我有一个示例数据框 here (它是 df
的 pickle)。当我执行以下操作时:
df = pd.read_pickle('test.pickle')
sns.tsplot(data=df.sort('time', ascending=True), time='time', unit='entity', condition='prior_type', value='perf')
我得到以下输出(无):
当我将其更改为使用 unit_traces
时,我实际上可以看到数据
sns.tsplot(data=df.sort('time', ascending=True), time='time', unit='entity', condition='prior_type', value='perf', err_style='unit_traces')
我的问题是为什么我看不到 CI?数据在某些地方有点脱节,但我仍然认为它应该能够得出某种置信区间。我在这里遗漏了什么吗?
最佳答案
默认估算器 (numpy.mean
) 在缺少数据时生成 NaN,而 matplotlib 只是避免绘图(通常有用,但在这里可能会造成混淆)。使用 nan-safe 估计器,例如 scipy.stats.nanmean
应该可以。抱歉,这在文档中并不明显。
关于python - Seaborn tsplot 不显示 CI strip ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29156464/