https://www..org/downloads/release/python-383/
https://www.jetbrains.com/pycharm/

在这里插入图片描述

分Professional和Community两个版本,deployment等功能仅前者开放。
· Community版本:免费。
· Professional版本:高校在校生可以注册账号并认证,即可免费使用。
在这里插入图片描述

3. 新建工程
打开pycharm后,点击 project -> new project 。
· 1 – 环境,可选默认Virtual
· 2 – 工程编译器位置
· 3 – 工程编译器base(一般是你安装的python位置)
在这里插入图片描述

4. 加载包
方法一:Setting加载
打开File – > settings , 打开下方位置python interpreter,点击右方加号。
位置1:搜索包
位置2:选择版本
位置3:点击安装

在这里插入图片描述
在这里插入图片描述

方法二:terminal 安装

在下方Terminal内使用pip install xxx或者 pip install 已经下载好的文件。
在这里插入图片描述

5 . 运行代码

需要加载包 matplotlib 和pandas 。

from matplotlib import pyplot as plt
import pandas as pd
# 读取文件
filename = "E:\\wq18.CSV"
data = pd.read_csv(filename)
# 读取数据
irq = []
irq = data.loc[:, 'irq']
NT = []
NT = data.loc[:, 'NT']
negativeeff = []
negativeeff = data.loc[:, 'negativeeff']
PT = []
PT = data.loc[:, 'PT']
PE = []
PE = data.loc[:, 'PE']
cesd = []
cesd = data.loc[:, 'cesd']
loneliness = []
loneliness = data.loc[:, 'loneliness']
traitanxiety = []
traitanxiety = data.loc[:, 'traitanxiety']
# 分类
x_array = [irq, NT, negativeeff, PT, PE]
y_array = [cesd, loneliness, traitanxiety]
x_label = ['interpersonal emotion regulation', 'IER negative tendency', 'IER negative efficacy', 'IER positive tendency', 'IER positive efficacy']
y_label = ['depressive symptoms', 'loneliness', 'trait anxiety']
# 画图
for i in range(1, 6):
for j in range(1, 4):
plt.figure(i+5*j-5)
plt.xlabel(x_label[i-1], fontsize=10)
plt.ylabel(y_label[j-1], fontsize=10)
plt.scatter(x_array[i-1], y_array[j-1], s=50)
plt.savefig('E:\\Result_' + x_label[i-1] + '_' + y_label[j-1] + '.jpg')
#绘制
plt.show()