E:\Anaconda\python.exe C:\Users\cheny\Desktop\PythonProject2\作业.py
开始处理文件: C:\Users\cheny\Desktop\PythonProject2\附件1.xlsx
原始数据维度: (2380, 7)
原始列名: ['年', '月', '日', '时间', '水位(m)', '流量(m3/s)', '含沙量(kg/m3) ']
检测到的时间相关列: ['年', '月', '日', '时间']
识别的数值列: ['水位(m)', '流量(m3/s)', '含沙量(kg/m3) ', '小时', '星期', '月份', '是否周末']
==================================================
成功处理文件: C:\Users\cheny\Desktop\PythonProject2\附件1.xlsx
==================================================
前5行数据预览:
水位(m) 流量(m3/s) 含沙量(kg/m3) 日期时间 小时 星期 月份 是否周末
0 0.604838 -0.427574 -0.313104 2016-01-01 0.0 0.0 0.0 0.0
1 0.642500 -0.400586 -0.313104 NaT 0.0 0.0 0.0 0.0
2 0.642500 -0.400586 -0.360354 NaT 0.0 0.0 0.0 0.0
3 0.680161 -0.378097 -0.360354 NaT 0.0 0.0 0.0 0.0
4 0.793147 -0.306131 -0.360354 NaT 0.0 0.0 0.0 0.0
处理后数据维度: (2380, 8)
数据摘要统计:
水位(m) 流量(m3/s) 含沙量(kg/m3) ... 星期 月份 是否周末
count 2.380000e+03 2.380000e+03 2.380000e+03 ... 2380.0 2380.0 2380.0
mean -1.741128e-14 1.194189e-16 2.627217e-16 ... 0.0 0.0 0.0
min -1.805525e+00 -1.210203e+00 -1.253218e+00 ... 0.0 0.0 0.0
25% -7.133292e-01 -7.379268e-01 -7.856051e-01 ... 0.0 0.0 0.0
50% -1.860625e-01 -4.410673e-01 -3.668715e-01 ... 0.0 0.0 0.0
75% 6.801614e-01 7.238813e-01 6.400444e-01 ... 0.0 0.0 0.0
max 2.770397e+00 2.916593e+00 2.778519e+00 ... 0.0 0.0 0.0
std 1.000210e+00 1.000210e+00 1.000210e+00 ... 0.0 0.0 0.0
[8 rows x 8 columns]
缺失值统计:
日期时间 2379
dtype: int64
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
处理失败: [Errno 13] Permission denied: 'processed_data.csv'
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Traceback (most recent call last):
File "C:\Users\cheny\Desktop\PythonProject2\作业.py", line 194, in <module>
processed_data.to_csv(output_file, index=False, encoding='utf-8-sig')
File "E:\Anaconda\Lib\site-packages\pandas\util\_decorators.py", line 333, in wrapper
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "E:\Anaconda\Lib\site-packages\pandas\core\generic.py", line 3967, in to_csv
return DataFrameRenderer(formatter).to_csv(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "E:\Anaconda\Lib\site-packages\pandas\io\formats\format.py", line 1014, in to_csv
csv_formatter.save()
File "E:\Anaconda\Lib\site-packages\pandas\io\formats\csvs.py", line 251, in save
with get_handle(
^^^^^^^^^^^
File "E:\Anaconda\Lib\site-packages\pandas\io\common.py", line 873, in get_handle
handle = open(
^^^^^
PermissionError: [Errno 13] Permission denied: 'processed_data.csv'
进程已结束,退出代码为 0
最新发布