0
A
回答
2
我认为这个问题与unit
有关。该函数预期在数据传递为DataFrame
的情况下指示数据属于哪个主题。这个函数行为对我来说并不明显,但看到这个例子。
# Test Data
df = pd.DataFrame({'month': [1, 2, 3, 4, 5, 6],
'value': [11.5, 9.7, 12, 8, 4, 12.3]})
# Added a custom unit with a value = 1
sns.tsplot(data=df, value='value', unit=[1]*len(df), time='month')
plt.show()
您还可以使用提取Series
和绘制。
sns.tsplot(data=df.set_index('month')['value'])
plt.show()
0
我有同样的问题。在我的情况下,这是由于数据不完整,因此每个时间点至少有一个缺失值,导致默认估计器每个时间点返回NaN。
既然你只显示你的数据的前5条记录,我们不能分辨你的数据是否有同样的问题。您可以看到以下修补程序是否正常工作:
from scipy import stats
sns.tsplot(data = df_month, time = 'month',
value = 'pm_local',
estimator = stats.nanmean);
相关问题
- 1. 在seaborn tsplot外移图例
- 2. 带seaborn tsplot的多线图
- 3. 熊猫的seaborn tsplot问题
- 4. Seaborn tsplot条件子集
- 5. seaborn heatmap y轴逆序
- 6. Seaborn tsplot显示什么
- 7. 如何翻转seaborn tsplot图上的坐标轴?
- 8. seaborn对熊猫的y轴缩放
- 9. seaborn tsplot:传奇色彩变淡
- 10. D3 Y轴比例不可见
- 11. 带有比例Y轴的Google Chart
- 12. Matplotlib y轴的比例不拟合值
- 13. 两个相同比例的y轴
- 14. 展开Y比例,但Y轴线的极限高度
- 15. 按比例缩放X轴上方的Y轴
- 16. 在Excel图表上使X轴和Y轴比例相等
- 17. VBA访问枢轴图设置Y轴最小/最大比例
- 18. 如何在MS Chart中设置X轴和Y轴的比例?
- 19. list_plot中x轴和y轴的缩放比例相同
- 20. y在散点图中比例缩放y轴与y值不同y D3.js
- 21. ggplot barplot - Y轴百分比
- 22. 添加Y轴CrossFilter例子
- 23. x/y轴的比例和自动缩放点和窗口的比例
- 24. 使用不同时间序列的Seaborn tsplot绘图
- 25. 错误的y轴范围使用matplotlib subplots和seaborn
- 26. Seaborn distplot y轴正常化错标签标签
- 27. 如何设置seaborn boxplot的y轴范围?
- 28. Seaborn BarPlot反转Y轴,并保持x轴的图表区域的底部
- 29. Android:使用achartengine更改y轴比例的条形图
- 30. R:在boxplot中更改y轴缩放比例
您可以编辑代码为[完整示例](https://stackoverflow.com/help/mcve)吗? –