Reputation: 557
So I have a dataframe that is (2624229, 574) and I would like to select only the first 864000 rows, but I can't figure out how to do it.
Thank you.
Upvotes: 2
Views: 12244
Reputation: 30991
One of possible solutions is to use iloc:
n = 864000
df.iloc[:n]
The above code retrieves initial n rows (for now df holds all rows). But if you want to drop all rows beyond this limit, run:
df = df.iloc[:n]
Upvotes: 5