Alternatively, if you like the idea of ββ"making a vector of all your values" and then accept its standard deviation:
df.stack().std()
But notice here: remember that pandas std functions take a different denominator (degrees of freedom) than numpy std functions , so:
df = pd.DataFrame(np.arange(1, 10).reshape(3, 3), columns=list('abc')) print np.std(df.values) print df.stack().std() print df.stack().std() * np.sqrt(8. / 9.)
gives:
2.58198889747 2.73861278753 2.58198889747
The average is different! Not a typo!
source share