2021年5月25日
摘要: plt.hist(x, bins=None, range=None, density=None, weights=None, cumulative=False, bottom=None, histtype='bar', align='mid', orientation='vertical', rwi 阅读全文
posted @ 2021-05-25 19:40 风景金 阅读(5879) 评论(0) 推荐(0) 编辑
2021年1月31日
摘要: 读取txt或csv数据,按行读取,对每行数据根据','进行分隔,将每行数据以","为间隔分成一个列表 line = re.split(',', line) 对数组内元素出现的次数进行统计 from collections import Counter list_len_array = np.arra 阅读全文
posted @ 2021-01-31 12:30 风景金 阅读(73) 评论(0) 推荐(0) 编辑
2020年11月10日
摘要: df_org = pd.read_csv(path) print(df_org.head(5)) df_org.columns = ["UserID", "Gender", "Age", "Attribution", "Type", "StartTime", "EndTime", "Log", "L 阅读全文
posted @ 2020-11-10 22:29 风景金 阅读(23097) 评论(0) 推荐(0) 编辑
2020年9月9日
摘要: 在conda的虚拟环境中运行命令 pip install websocket 在进行安装即可 阅读全文
posted @ 2020-09-09 14:51 风景金 阅读(626) 评论(0) 推荐(0) 编辑
2020年7月9日
摘要: 一个简单的函数 def greet_user(): """显示简单的问候语""" print("Hello!") greet_user() 第二行的文本被称为文档字符串(docstring)的注释,描述了函数是做什么的。文档字符串用三引号括起,Python使用它们来生成有关程序中函数的文档。第五行直 阅读全文
posted @ 2020-07-09 10:31 风景金 阅读(83) 评论(0) 推荐(0) 编辑
2020年7月8日
摘要: python中接受用户输入需要使用函数 input() input函数工作原理 函数input()让程序暂停运行,等待用户输入一些文本。input返回用户输入内容,再将其存入变量即可获得用户输入。例如: message = input("Tell me something, and I will r 阅读全文
posted @ 2020-07-08 21:35 风景金 阅读(120) 评论(0) 推荐(0) 编辑