figure - dataset with columns renamed for different algorithmsanalysis and even visualizationswe often require only subset of attributes to work with with pandaswe can vertically slice (select subset of columnsin variety of ways pandas provides different ways to suit different scenarios as we shall see in the following snippet print("using column index::print(df[[ ]values[: print("using column name::print(df quantity_purchased valuesprint(using column data type::print(df select_dtypes(include=['float ']values[:, in this snippetwe have performed attribute selection in three different ways the first method utilizes column index number to get the required information in this casewe wanted to work with only the field quantity_purchasedhence index number (pandas columns are indexedthe second method also extracts data for the same attribute by directly referring to the column name in dot notation while the first method is very handy when working in loopsthe second one is more readable and blends well when we are utilizing the object oriented nature on python yet there are times when we would need to get attributes based on their data types alone the third method makes use of select_dtypes(utility to get this job done it provides ways of both including and excluding columns based on data types alone in this example we selected the column(swith data type as float (price column in our datasetthe output from this snippet is as follows using column index:[ using column name:[ using column data type: