python find standard deviation code example
Example 1: standard deviation python
import numpy as np
values=[1,10,100]
print(np.std(values))
values=[1,10,100,np.nan]
print(np.nanstd(values))
Example 2: python running standard deviation
import panda as pd
df = pd.DataFrame(data)
window=5
running_vol=df['x'].rolling(window).std()