data sciense[AND,OR BETWEEN,specefic columns,iloc,ascending,total] ,Change name karvu hooy to excel mathi

1)df=pd.read_csv('nba-players-stats/player_data.csv')[aama je excel file nu je name hoy te lkhvanu ('')brecket ma
print(df)
2)df['year_start']=='1991'
3)mask=df['year_start']==1991
df[mask]
4)mask=df['year_start']!=1991        [! ie not]
df[mask]
5)mask=df['height']=='7-2'  //aama height 7-2 vasdi hse ae j aavse
df[mask]
6)df.info()
7)AND OPERATOR
->df[(df['year_start']==1992) & (df['year_end']==2001)]
->df[(df['Type 1']=='Grass') & (df['Type 2']=='Poison')& (df['HP']>70)]
8)df[(df['year_start']==1992) & (df['height']=='7-2')]
9) OR OPERATOR
df[(df['year_start']==1992) | (df['height']=='7-2')]
10)df['birth_date'].unique()
11)df['birth_date'].duplicated()
12)BETWEEN
df = df[df['year_start'].between(1991, 1992, inclusive=True)]
df
13)OR AND[NBA che tya df lkhvu]
NBA[(NBA['year_start']==1992) | (NBA['year_end']==2001)& (NBA['height']=='7-2')]
14)#specific colums
data[['HP','Attack']]
or
df.columns
print(df['Name'])
print(df['Name'][0:5])
*vdhare hoy to
print(df[['Name','Type 1','HP']])
15)Change name ie data set ma aalap na badle tirth name nakhvu che data set ma aena mate
df.loc[df['Type 1']=='Grass','Type 1']='GGG'
df
16)iloc
print(df.iloc[2])
#ie[2] ie 2 row read karse
#iloc function use read each row
print(df.iloc[1:4])
17)ascending{pokemon data set]
->df.sort_values('Name',ascending=False)
#ie aama Name title hsse ne aema False kreyu che ie z thi chalu tse and true lkheye ie A thi chalu tse name
->df.sort_values(['Type 1','HP'],ascending=[1,0])
#[1,0] ie 1 ie type 1 acending and 0 ie hp decending
18)TOTAL
df['Total']=df['HP']+df['Attack']+df['Defense']+df['Sp. Atk']+df['Sp. Def']+df['Speed']

df.head(5) #HEAD ie 1st 5 row and tail ie last 5 row

Comments

Popular posts from this blog

Seaborn

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

Payment ideal