Python Dataframes: Describing a single column

Python Dataframes: Describing a single column

Just add column name in square braquets:

df[column_name].describe()

Example:

enter

To get a single column:

df[1]

To get several columns:

df[[1,2]]

To get a single row by name:

df.loc[B]

or by index:

df.iloc[o]

To get a specific field:

df[1][C]
import pandas as pd
data=pd.read_csv(data.csv)
data[[column1, column2, column3]].describe()

Python Dataframes: Describing a single column

import pandas as pd
data = pd.read_csv(ad.data, header=None)
data[111].describe()

or for example

lastindice = data[data .columns[-1]]
lastindice.describe()

Leave a Reply

Your email address will not be published.