我有一个数据框df,它的第一列是timedelta64
df.info():
<class 'pandas.core.frame.DataFrame'>
RangeIndex: 686 entries, 0 to 685
Data columns (total 6 columns):
0 686 non-null timedelta64[ns]
1 686 non-null object
2 686 non-null object
3 686 non-null object
4 686 non-null object
5 686 non-null object
Run Code Online (Sandbox Code Playgroud)
print(df[0][2])例如,如果 I ,它会给我0 days 05:01:11。但是,我不想要0 days归档。我只想05:01:11被打印。有人可以教我如何做到这一点吗?非常感谢!
我有一个函数声明:
func:{[id;time] select last synp from synp_t where instr_id = id, tp_time < time}
Run Code Online (Sandbox Code Playgroud)
哪里instr_id有类型i和tp_time类型v.
例如,func[8;05:00:11]工作正常,给我价值17.55.
但是,如果我尝试func[8 1;05:00:11 07:10:59],我得到:
'length ERROR: incompatible lengths (different lengths of operands for synchronized operation or table columns lengths are not the same
Run Code Online (Sandbox Code Playgroud)
我想得到的是,例如,17.55 9.66.
如果我这样做select res:func_demo[id;time]from tab,也会弹出相同的错误,其中tab有两列instr_id和的表tp_time.
我想enlist可以解决问题,但我不确切知道如何使用它.我该如何解决这个问题?