Created
June 12, 2021 07:59
-
-
Save nithyadurai87/9617f06d4e340ed83d4af189b0f13d45 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
import numpy as np | |
l2 = [[90,83,67,83,45],[68,89,75,56,73],[58,88,60,90,100]] | |
df = pd.DataFrame(l2,columns=['Tamil','English','Maths','Science','Social'],index=['Ramesh','Suresh','Kamesh'],dtype='int32') | |
print (df) | |
print (df.pct_change()) | |
print (df['Tamil'].cov(df['English'])) | |
print (df.cov()) | |
print (df.corr()) | |
print (df.rank()) | |
print (df.rolling(window=3).mean()) | |
print (df.rolling(window=3,min_periods=2).mean()) | |
print (df.rolling(window=3,min_periods=2).aggregate([np.sum,np.mean])) | |
print (df.rolling(window=2).sum()) | |
print (df.expanding(min_periods=2).sum()) | |
print (df.ewm(com=0.5).mean()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment