- 博客(6)
- 收藏
- 关注
原创 python 数据处理 - 文件接口相关模块
python 数据处理 - 文件接口相关模块 1.OS 1.1.读取文件夹中的文件相应路径 path = r'D:\' folders = os.listdir(path) # 调整文件夹中读文件的顺序 sort_num_list = [] for folder in folders: sort_num_list.append(int(folder.split('(')[1].split(')')[0])) #去掉前面的字符串和下划线以及后缀,只留下数字并转换为整数方便后面排序 sort_num_lis
2020-10-16 18:27:59
307
原创 python 数据处理 - matplotlib模块
python 数据处理 - matplotlib模块 1.一些常用函数 plt.figure(figsize=(12,6)) plt.grid(alpha=0.5,linestyle='-.') plt.xticks(rotation=30) plt.plot(df['电量差'],'c',label='curve') plt.legend() 2.解决中文显示问题 # 解决中文显示问题 plt.rcParams['font.sans-serif'] = ['SimHei'] plt.rcParams[
2020-10-16 17:53:55
223
原创 python 数据处理 - datetime模块
python 数据处理 - datetime模块 1.datetime模块介绍 类名 功能说明 date 日期对象,常用的属性有year, month, day time 时间对象 datetime 日期时间对象,常用的属性有hour, minute, second, microsecond datetime_CAPI 日期时间对象C语言接口 timedelta 时间间隔,即两个时间点之间的长度 tzinfo 时区信息对象 2.datetime各模块分别介绍 http
2020-10-16 17:11:16
261
原创 python 数据处理 - numpy模块
python 数据处理 - numpy 模块 1.np.array() Parameters object: array_like dtype: data-type, optional copy: bool, optional order{‘K’, ‘A’, ‘C’, ‘F’}, optional # 示例1 data = np.array(data,dtype=np.float) 2.np.where() numpy.``where(condition[****, x**,** y**]****)**
2020-10-16 11:33:35
338
1
原创 python 数据处理 - JSON模块
python 数据处理 - JSON库 1.将字典保存为JSON格式数据 final_dict = {"version": 1, "battery": 2} json_result = json.dumps(final_dict) filename = 'result_temp.json' with open(filename,'w') as file_obj: json.dump(json.loads(json_result), file_obj, indent=4,
2020-10-16 10:44:26
525
原创 python 数据处理 - Pandas模块
python 数据处理 - Pandas模块 1.一些函数 1.1 pd.DataFrame class pandas.``DataFrame(data=None, index=None**,** columns=None**,** dtype=None**,** copy=False**)** Parameters data: ndarray (structured or homogeneous), Iterable, dict, or DataFrame index: Index or arra
2020-10-15 18:02:10
1060
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅