【发布时间】:2020-07-15 05:49:27
【问题描述】:
这是我编写的代码,用于在 df 中加载数据帧 iris 并绘制堆积面积图
import matplotlib.pyplot as plt
import seaborn as sns
def read_dataset():
df = sns.load_dataset('iris')
print(df)
return df
def line_plot():
df = read_dataset()
col1 = "sepal_length"
col2 = "sepal_width"
col3 = "species"
plt.stackplot(col1, col2)
plt.show()
line_plot()
错误如下:
TypeError: 无法使用灵活类型执行累加
【问题讨论】:
-
This question 提到了您报告的相同错误。可能对你有点帮助
标签: python dataframe stacked-area-chart