Pandas in Python 16sept2022
Pandas in Python 16sept2022
com 16-Sept-2022 Pg 1 of 8
https://www.analyticsvidhya.com/blog/2021/11/a-simple-guide-to-pandas-dataframe-opera
tions/
#
https://www.analyticsvidhya.com/blog/2021/11/a-simple-guide-to-pandas-data
frame-operations/
import pandas as pd
points_table = {'Team_':['MI', 'CSK', 'Devils', 'MI', 'CSK',
'RCB', 'CSK', 'CSK', 'KKR', 'KKR', 'KKR', 'RCB'],
'Rank_' :[1, 2, 2, 3, 3,4 ,1 ,1,2 , 4,1,2],
'Year_' :[2014,2015,2014,2015,2014,2015,2016,2017,2016,2014,2015,2017],
'Point_':[876,789,863,673,741,812,756,788,694,701,804,690]}
df = pd.DataFrame(points_table)
print(df)
#https://www.analyticsvidhya.com/blog/2021/11/a-simple-guide-to-pandas-dat
aframe-operations/
df =
pd.read_csv(r'https://raw.githubusercontent.com/a-coders-guide-to-ai/a-cod
ers-guide-to-neural-networks/master/data/diabetes.csv')
#this will give first 5 rows of the data frame we can also get the first
10 the rows n=10
df.head(n=5)