Saturday 11 December 2021

Python-Pandas Dataframe.describe() method

 Pandas describe() is used to view some basic statistical details like percentile, mean, std etc. of a data frame or a series of numeric values. When this method is applied to a series of string, it returns a different output which is shown in the examples below.

Syntax: DataFrame.describe(percentiles=None, include=None, exclude=None)

Parameters:

  1. percentile: list like data type of numbers between 0-1 to return the respective percentile
  2. include: List of data types to be included while describing dataframe. Default is None
  3. exclude: List of data types to be Excluded while describing dataframe. Default is None
  4. Return type: Statistical summary of data frame.

 The describe() function computes a summary of statistics pertaining to the DataFrame columns.

Example:- The following is a simple exams that illustrates The describe() function computes a summary of statistics pertaining to the DataFrame columns.

import pandas as pd

data = [[10, 18, 11], 
        [13, 15, 8], 
        [9, 20, 3]]

df = pd.DataFrame(data)

print(df.describe())

The following is the out put of the above program

  0          1          2
count   3.000000   3.000000   3.000000
mean   10.666667  17.666667   7.333333
std     2.081666   2.516611   4.041452
min     9.000000  15.000000   3.000000
25%     9.500000  16.500000   5.500000
50%    10.000000  18.000000   8.000000
75%    11.500000  19.000000   9.500000
max    13.000000  20.000000  11.000000

0 comments :

Post a Comment

Note: only a member of this blog may post a comment.

Machine Learning

More

Advertisement

Java Tutorial

More

UGC NET CS TUTORIAL

MFCS
COA
PL-CG
DBMS
OPERATING SYSTEM
SOFTWARE ENG
DSA
TOC-CD
ARTIFICIAL INT

C Programming

More

Python Tutorial

More

Data Structures

More

computer Organization

More
Top