xxxxxxxxxx
df2 = df.head(N)
# this should select N rows from top and copy to new df
df3 = df.tail(N)
# this should select N rows from bottom and copy to new df
xxxxxxxxxx
import pandas as pd
# Assuming your DataFrame is named 'df'
first_row = df.iloc[0]
# Print the first row
print(first_row)