【发布时间】:2020-10-17 23:25:21
【问题描述】:
我尝试用星期几创建一个新列:
df2019['Weekday']=pd.to_datetime(df2019['Year'],df2019['Month'],df2019['Day']).weekday()
我收到以下错误:
ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().
谢谢!
【问题讨论】:
标签: python pandas dataframe date weekday