GeeKee's Odyssey

GeeKee's Odyssey

Data Frame Analysis

gayatri kumar's photo
gayatri kumar
·Jul 31, 2022·

1 min read

Table of contents

  • Data set
  • df.min()
  • df.max()
  • df.sum()
  • df.count()
  • df.mean()
  • df.median()
  • df.mode(numeric_only=True)
  • df.describe()

To analyze the data in the dataframes, and derive conclusions from it, pandas has inbuilt methods.

image.png

Data set

Importing our dataset. Our dataset contains bestseller books.

image.png

df.min()

Returns min values of every column of the dataset

image.png

df.max()

Returns max value of every col of the dataset.

image.png

In both cases(max and min) the type of the data is

type(houses.max())

pandas.core.series.Series

df.sum()

Sum of every value on every column.

image.png

To specify that only numeric type data values are summed:

df.sum(numeric_only=True)

image.png

df.count()

Count the no. of values present in every column.

image.png

df.mean()

Mean of all the values in every column.

image.png

If you want only the mean of the first 50 elements.

image.png

df.median()

Median or middle value of every column.

image.png

df.mode(numeric_only=True)

Mode or maximum occuring value of every column.

image.png

For only numerical value columns.

image.png

df.describe()

If you quickly want all the statistical value.

image.png

If you want data for all non numeric type cols

df.describe(include=[“object”])

or

df.describe(include=[“O”])

image.png

 
Share this