pandas 将一列数据划分成并横向拼接

import pandas as pd

data = pd.read_excel("1.xlsx")

dftotal = pd.DataFrame()
d = 0
for i in range(480):
    df = pd.DataFrame(data.loc[d:d+60]).reset_index(drop=True)
    d +=61
    x = dftotal
    dftotal = pd.concat([x,df ], axis=1).reset_index(drop=True)
dftotal.to_csv("xx.csv", encoding='utf-8', index=False,mode='w+')

你可能感兴趣的:(ᕦ,机器学习,ᕤ,python,pandas,数据处理)