我有一个具有以下列名的文件:
STOD_WMO TIMI AR MAN DAGUR KLST
MINUTA MINSL SEKSL H_M PS T RH
TD H_FT D F_KT LAT LONG FJARL
STIGHR
我想读取此数据,然后以Year:day:hour:minute的格式转换表示Year(AR),Month(称为MAN),Day(称为DAGUR),minute(MINUTA)的列: 我在做:
df = pd.read_csv('/nfs/potts.jasmin-north/scratch/earic
/radiosonde_Iceland_analysis
/data/keflavik_radiosonde_1991-2005',sep = "\s+|\t+|
\s+\t+|\t+\s+")
## transform the time colmns in 1 column
df['date'] =
pd.to_datetime(df[['AR','MAN','DAGUR','KLST','MINUTA']])
但出现以下错误:
Error: to assemble mappings requires at least that [year,
month, day] be specified: [day,month,year] is missing
我如何让python识别我使用的年,小时等名称,并做我想做的事情(更改数据格式)? 谢谢。