import pandas as pd # Select file infile = r'path/file' # Use skiprows to choose starting point and nrows to choose number of rows data = pd.read_csv(infile, skiprows = 50, nrows=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 telling pandas to skip the first 50 rows of the file.
3. We’re telling pandas to only read in 10 rows of the file.