how to extract row and column form pandas dataframe code example
Example: extract row and column from python dataframe
# Extract the third row
df.iloc[2]
### or ###
df.iloc[2,]
### or ###
df.iloc[2,:]
## Extract the first three rows
df.iloc[:3]
### or ###
df.iloc[0:3]
### or ###
df.iloc[0:3,:]