hi, streamlit team and community.
I saw beautiful chart made of echart.
I tried to find a way in the community.
But I face error when I was tried plot my dataframe using echart.
- error: ‘Could not convert component args to JSON’, TypeError(‘Object of type ndarray is not JSON serializable’
Tried to solve it in a known way but still couldn’t solve it
- I tried : “data” : df[‘column’].values
If anyone knows how to draw an echart with my dataframe, please let me know.
thanks!
raw_data = {
"Last Name": ["Miller", "Jacobson", "Ali", "Milner", "Smith"],
"Age": [42, 52, 36, 24, 73],
}
df = pd.DataFrame(raw_data)
options = {
"series": [
{
"type": "pie",
"radius": "50%",
# "data": df['Age'].values
#-> error ('Could not convert component args to JSON', TypeError('Object of type ndarray is not JSON serializable'))
"data": df['Age'].to_list()
}
]
}
st_echarts(options=options)