import pandas as pd
import datetime
import matplotlib.pyplot as plt
data1 = pd.read_excel('aa.xlsx', sheet_name='sheet2')
data1.drop(['A列', 'AA列'], axis=1, inplace=True) # 删除不需要的列
for i in data1.columns:
a = type(i)
a = str(a)
if a == "<class 'datetime.datetime'>":
ii = datetime.datetime.strftime(i, '%Y-%m-%d')
data1.rename(columns={i: ii}, inplace=True)
print('更换完毕')
网友评论