pandas keep dataframe single row a df not series code example Example: dataframe look at every second column df[df.columns[::n]]