python时间序列画图_绘图:使用绘图和日期时间索引绘制时间序列

---------------------------------------------------------------------------ValueErrorTraceback(most recent call last)in56fig=px.line(data['yieldsp'],x=data.index,y='Yield Spread',color="continent",line_shape="spline",---->7render_mode="svg")8fig.show()~/opt/anaconda3/envs/tsa_course/lib/python3.7/site-packages/plotly/express/_chart_types.pyinline(data_frame,x,y,line_group,color,line_dash,hover_name,hover_data,custom_data,text,facet_row,facet_col,facet_col_wrap,error_x,error_x_minus,error_y,error_y_minus,animation_frame,animation_group,category_orders,labels,orientation,color_discrete_sequence,color_discrete_map,line_dash_sequence,line_dash_map,log_x,log_y,range_x,range_y,line_shape,render_mode,title,template,width,height)242a polyline markin2Dspace.243"""

--> 244 return make_figure(args=locals(), constructor=go.Scatter)

245

246

~/opt/anaconda3/envs/tsa_course/lib/python3.7/site-packages/plotly/express/_core.py in make_figure(args, constructor, trace_patch, layout_patch)

1753 apply_default_cascade(args)

1754

-> 1755 args = build_dataframe(args, constructor)

1756 if constructor in [go.Treemap, go.Sunburst] and args["path"] is not None:

1757 args = process_dataframe_hierarchy(args)

~/opt/anaconda3/envs/tsa_course/lib/python3.7/site-packages/plotly/express/_core.py in build_dataframe(args, constructor)

1311

1312 df_output, wide_id_vars = process_args_into_dataframe(

-> 1313 args, wide_mode, var_name, value_name

1314 )

1315

~/opt/anaconda3/envs/tsa_course/lib/python3.7/site-packages/plotly/express/_core.py in process_args_into_dataframe(args, wide_mode, var_name, value_name)

1117 if argument == "index":

1118 err_msg += "\n To use the index, pass it in directly as `df.index`."

-> 1119 raise ValueError(err_msg)

1120 elif length and len(df_input[argument]) != length:

1121 raise ValueError(

ValueError: Value of 'y' is not the name of a column in 'data_frame'. Expected one of ['yieldsp'] but received: Yield Spread

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值