【发布时间】:2021-10-27 15:32:50
【问题描述】:
Plotly 抛出了一个看起来很奇怪的错误,IN 不太明白。
这是我的代码。
print(df_geo.dtypes)
import plotly.express as px
px.scatter(df_geo, x="Exp_Month", y="Rev_Month", animation_frame="Volume", animation_group="Site_Name",
size="Volume", color="Market", hover_name="Market",
log_x=True, size_max=55, range_x=[100,1000000], range_y=[2,100000])
这是错误信息。
Invalid value of type {typ} received for the '{name}' property of {pname}
ValueError:
Invalid value of type 'pandas._libs.tslibs.timestamps.Timestamp' received for the 'name' property of frame
Received value: Timestamp('2020-01-01 00:00:00')
The 'name' property is a string and must be specified as:
- A string
- A number that will be converted to a string
我想也许 Exp_Month 或 Rev_Month 有一些奇怪的字符,所以我升序和降序排序,但没有发现任何错误。此外,这两个字段都是 datetime64[ns]。 Volume 是 float64,Site_Name 和 Market 都是对象。关于我在这里做错了什么有什么想法吗?
【问题讨论】:
标签: python python-3.x plotly