how to slice few rows in pandas 1

how to slice few rows in pandas

df[:10]

Here is what the above code is Doing:
1. We’re using the pandas library to read in the csv file.
2. We’re printing out the column names using df.columns
3. We’re using df.head(10), so we can only print out the first 10 rows.

Similar Posts