How to slice a pandas DataFrame by position?

http://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.head.html?highlight=head#pandas.DataFrame.head

df2 = df.head(10)

should do the trick

Leave a Comment