python pandas创建空白文件

创建一个空白文件

import datetime
import time
import pandas as pd
import numpy as np
import re
#from datetime import datetime
from pytz import timezone
import pytz
import os
def creat_Firfile():

    shibiao,zhiling=[],[]
    for i in range(20*3600):
        shibiao.append(i+1)
        zhiling.append(0)
    cd=[shibiao,zhiling,zhiling,zhiling,zhiling,zhiling,zhiling,zhiling]
    listb = [[r[ionk] for r in cd] for ionk in range(len(zhiling))]
    test = pd.DataFrame(data=listb)




    test.to_csv(r'c:\Users\Administrator\Desktop\ms.csv',index=False,mode='a+',encoding='utf-8')



if __name__ == '__main__':

    creat_Firfile()
    print('all_done')

你可能感兴趣的:(数据处理)