import pandas as pd # create a sample dataframe df = pd.DataFrame({'A': [1,2,3,4,5,6,7,8,9,10], 'B': ['a','b','c','d','e','f','g','h','i','j']}) # select every 5th row using iloc df_filtered = df.iloc[::5] print(df_filtered)