【发布时间】:2021-09-19 06:30:30
【问题描述】:
我正在尝试使用datetime.time 对象在多个神经的振幅和它们在试验中使用的时间之间生成回归/散点图。
>>> df.head()
Amp strain 8 min [mA] Time in use [hh:mm]
0 0.1 00:22:00
1 0.0 00:46:00
2 0.8 00:18:00
3 0.3 00:23:00
4 0.6 00:14:00
但是sns.regplot(y=df.iloc[:, 1], x=df.iloc[:, 0]) 会导致
TypeError: float() argument must be a string or a number, not 'datetime.time'
【问题讨论】:
-
试试
sns.regplot(y=df.iloc[:, 0], x=df.iloc[:, 1]) -
虽然这会创建一个空图,但错误仍然存在
标签: python pandas datetime matplotlib seaborn