我的pandas数据框中有year和month列,我想将它们串接成一个字符串,以便将它们转换为datetime。
df.info()给出
Data columns (total 3 columns):
years 372 non-null object
months 372 non-null object
windSpeedM 371 non-null float64
数据看起来像
years month windSpeedM
1985 1 0.4
我在试这个
ff2['date'] = ff2['years']+'-'+ff2['months']+'-'+'01'
我有个错误
TypeError: ufunc 'add' did not contain a loop with signature matching types dtype('S21') dtype('S21') dtype('S21')
相关问题 更多 >
编程相关推荐