【发布时间】:2021-11-11 06:37:27
【问题描述】:
我需要建议。在我的数据库中,我有 x 点和 y 点的形式:
df = pd.read_sql_table('table', cnx)
| id | curves |
|---|---|
| 1 | [(x,y),(x,y),(x,y) etc.] |
| 2 | [(x,y),(x,y),(x,y) etc.] |
type(df['curves']) #pandas.core.series.Series
我想尝试绘制折线图。
我尝试了几种解决方案。但对我没有任何帮助。
data = df['curves']
plt.plot(*zip(*data))
plt.show()
或
data_in_array = np.array(data)
transposed = data_in_array.T
x,y = transposed #but here i got error - not enough values to unpack (expected 2, got 1)
请指教
【问题讨论】:
标签: python pandas numpy jupyter-notebook ipython