Python pandas Group by

Ex
Group BY

step   1:df=pd.read_csv('ferrovial.csv')

df
step 2:data=df.groupby('city')
data
#aatlu lkheya pche output nai aave next line add karve
for city,city_df in data:
    print(city)
    print(city_df)
step 3:particular city joiti hoy to aa step add karvu
data.get_group("kerala")
Step 4:data.max() #max value aavse
step 5:data.mean()#mean value aavse
step 6:data.describe() # descibe lkheshu to mean,median,max,min bdhu j aavse
DateCloseHighLowOpenVolumecity
002-01-200712.85012.94012.71012.9003080000.0vado
103-01-200712.66012.86012.60012.8502740000.0vado
204-01-200712.45012.72012.38012.5902330000.0vado
305-01-200712.20012.36012.07012.1701930000.0vado
408-01-200712.19012.28012.15012.2201970000.0vado
509-01-200712.45012.50012.22012.3902560000.0ahem
610-01-200712.28012.48012.26012.4002490000.0ahem
711-01-200712.35012.49012.20012.3101760000.0ahem
812-01-200712.50012.53012.31012.5901600000.0kerala
915-01-200712.65012.76012.59012.6401310000.0kerala
1016-01-200712.43012.74012.36012.5601250000.0surat

Comments

Popular posts from this blog

Seaborn

profile fragment firebase ie image and information vadu page update tay firebase ma

Payment ideal