我是 plotly 新手并试图绘制树图但收到错误:ValueError: Value of 'path_0' is not the name of a column in 'data_frame'. Expected one of ['country_name', 'counts'] but received: c
示例数据
import pandas as pd
import plotly.express as px
d = {'country_name':['USA', 'UK', 'Germany'], 'counts':[100, 200, 300]}
dd = pd.DataFrame(data=d)
阴谋
fig = px.treemap(dd, path='country_name', values='counts')
fig.show()
不知道为什么我收到此错误。