selecting specific attributes/columns is one of the ways of subsetting dataframe there may be requirements to horizontally splitting dataframe as well to work with subset of rowspandas provides ways as outlined in the following snippet print("select specific row indices::"print(df iloc[[ , , ]print(excluding specific row indices::print(df drop([ , , ]axis= head()print("subsetting based on logical condition( )::print(df[df quantity_purchased> head()print("subsetting based on offset from top (bottom)::print(df[ :head(#df tail(- the first method utilizes the iloc (or integer index/locationbased selectionwe need to specify list of indices we need from the dataframe the second method allows in removing/filtering out specific row indices from the dataframe itself this comes in handy in scenarios where rows not satisfying certain criteria need to be filtered out the third method showcases conditional logic based filtering of rows the final method filters based on offset from the top of the dataframe similar methodcalled tail()can be used to offset from bottom as well the output generated is depicted in figure - figure - different ways of subsetting rows