Python程序教程

您现在的位置是:首页 >  Django

当前栏目

pycharm运行环境配置_pycharm安装django

pycharm,运行,环境,配置,安装,django
2025-03-13 21:27:25 时间

大家好,又见面了,我是你们的朋友全栈君。

1.安装Python 前往 https://www.python.org/downloads/release/python-383/ , 根据环境下载对应的python安装包安装。

2. 安装pycharm Pycharm是一个可用作工程开发的工具。 前往 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()

发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/174354.html原文链接:https://javaforall.cn