In [19]:
import pandas as pd
In [20]:
df = pd.read_csv('weather_by_cities.csv')
Out[20]:
In [55]:
g = df.groupby('city')
g
Out[55]:
Group BY¶
In [56]:
for city, city_df in g:
print(city)
print(city_df)
In [48]:
g = df.groupby('city').sum()
Out[48]:
In [23]:
# SELECT * from city_data GROUP BY city
g.get_group('mumbai')
Out[23]:
In [33]:
g.max()
Out[33]:
In [35]:
g.mean()
Out[35]:
In [38]:
g.describe()
Out[38]:
沒有留言:
張貼留言