dmap = {0:'Mon',1:'Tue',2:'Wed',3:'Thur',4:'Fri',5:'Sat',6:'Sun'}
df['DayOfWeek']=df['DayOfWeek'].map(dmap)
df.head()
答案 0 :(得分:0)
我没有完全理解你的问题,但我想它必须是那样的
dmap = {0:'Mon',1:'Tue',2:'Wed',3:'Thur',4:'Fri',5:'Sat',6:'Sun'}
count = 0
df = pd.DataFrame({'DayNumber':[], 'DayOfWeek': []})
for key, value in dmap.items() :
df.loc[count] = [str(key) , value]
count = count + 1
print(df.head())