# Create the Mean and Standard Deviation of the Data of a Pandas Series

## Create the Mean and Standard Deviation of the Data of a Pandas Series

Standard Deviation is the square root of the Variance. The Standard Deviation denoted by sigma is a measure of the spread of numbers. In pandas, the `std() `function is used to find the standard Deviation of the series.
The mean can be simply defined as the average of numbers. In pandas, the` mean()` function is used to find the mean of the series.

Example 1 : Finding the mean and Standard Deviation of a Pandas Series.

 `# importing the module` `import` `pandas as pd` ` ` `# creating a series` `s ``=` `pd.Series(data ``=` `[``5``, ``9``, ``8``, ``5``, ``7``, ``8``, ``1``, ``2``, ``3``,` `                      ``4``, ``5``, ``6``, ``7``, ``8``, ``9``, ``5``, ``3``])` ` ` `# displaying the series` `print``(s)`

Output :

Finding the mean of the series using the `mean()` function.

 `# finding the mean` `print``(s.mean())`

Output :

Finding the standard deviation of the series using the `std()` function.

 `# finding the Standard deviation` `print``(s.std())`

Output :

Example 2 : Finding the mean and Standard Deviation of a Pandas DataFrame.

 `# importing the module` `import` `pandas as pd` ` ` `# creating a dataframe ` `df ``=` `pd.DataFrame({``'ID'``:[``114``, ``345``, ``157788``, ``5626``],` `                   ``'Product'``:[``'shirt'``, ``'trousers'``, ``'tie'``, ``'belt'``],` `                   ``'Color'``:[``'White'``, ``'Black'``, ``'Red'``, ``'Brown'``],` `                   ``'Discount'``:[``10``, ``10``, ``10``, ``10``]})` ` ` `# displaying the DataFrame` `print``(df)`

Output :

Finding the mean of the DataFrame using the `mean()` function.

 `# finding the mean` `print``(df.mean())`

Output :

Finding the standard deviation of the DataFrame using the `std()` function.

 `# finding the Standard deviation` `print``(df.std())`

Output :

Last Updated on October 19, 2021 by admin

## Python | Pandas Series.varPython | Pandas Series.var

Python | Pandas Series.var Python is a great language for doing data analysis, primarily because

## Split a column in Pandas dataframe and get part of itSplit a column in Pandas dataframe and get part of it

Split a column in Pandas dataframe and get part of it When a part of

## Pandas Series.str.get_dummies()Pandas Series.str.get_dummies()

Python | Pandas Series.str.get_dummies() Python is a great language for doing data analysis, primarily because

## Conditional operation on Pandas DataFrame columnsConditional operation on Pandas DataFrame columns

Conditional operation on Pandas DataFrame columns Suppose you have an online store. The price of

## How to create pandas dataframe (All possible ways)How to create pandas dataframe (All possible ways)

Pandas DataFrame is a 2-dimensional labelled data structure with columns of potentially different types. It

## Methods to Round Values in Pandas DataFrameMethods to Round Values in Pandas DataFrame

Methods to Round Values in Pandas DataFrame There are various ways to Round Values in

## Pandas Series.iteritems()Pandas Series.iteritems()

Python | Pandas Series.iteritems() Pandas series is a One-dimensional ndarray with axis labels. The labels

## Extract week number from date in Pandas-PythonExtract week number from date in Pandas-Python

Extract week number from date in Pandas-Python Many times, when working with some data containing