【发布时间】:2017-08-16 13:38:48
【问题描述】:
【问题讨论】:
-
查看这个问题的第一个答案stackoverflow.com/questions/30385975/… 它应该可以解决问题。
标签: python matplotlib bar-chart
【问题讨论】:
标签: python matplotlib bar-chart
试试这个:
import pandas as pd
import matplotlib.pyplot as plt
from scipy import stats
mean = df.mean(axis = 1)
std = df.std(axis = 1)
n= df.shape[1]
yerr = std / np.sqrt(n) * stats.t.ppf(1-0.05/2, n - 1)
plt.figure()
plt.bar(range(df.shape[0]), mean, yerr = yerr)
plt.show()
祝你好运!
【讨论】: