python 拆分csv文件
1 import pandas as pd 2 3 data = pd.read_csv(r'文件路径', encoding='gbk') 4 print('running') 5 6 for i in range(0, 10): 7 save_data = data.iloc[i*200000:(i+1)*200000] 8 file_name = r'输出路径文件_' + str(i) + '.csv' 9 print(str(i)+'ok') 10 save_data.to_csv(file_name, index=False, encoding='gbk')