Basic statistical analysis, also known as descriptive statistical analysis, generally calculates the minimum, first quartile, median, third quartile, and maximum value of a variable.

The descriptive statistical analysis function is describe, which returns values such as mean, standard deviation, maximum, minimum, and quantile. You can use arguments in parentheses such as percentitles=[0.2,0.4,0.6,0.8] to specify that only the 0.2, 0.6,0.8 quartile should be calculated, rather than the default 1/4, 1/2, and 3/4 quartile.

  • Describe () 1.mean 2.median 3.mode 4.count 5.std

Commonly used statistical functions are:

  • Size: count (this function does not require parentheses)
  • The sum () : the sum
  • Scheme () : the average
  • Var () : variance
  • STD () : the standard deviation
import pandas as pd

df = pd.read_excel(r'/pylearn/examples/i_nuc.xls', sheet_name='Sheet7')
print(df)

print(df. Several points. The describe ())# View the basic statistics for the number column

print(df.describe()) # Check the basic statistics of each column

print(df) a few solutions. The size)#
print("Maximum", df['solution a few'].max()) #
print(Minimum value,df['solution a few'].min()) #
print("Summation.",df['solution a few'].sum()) #
print("Take the mean.",df['solution a few'].mean()) #
print("Find the variance",df['solution a few'].var()) #
print(Standard deviation,df['solution a few'].std()) #


The Numpy array can also use the mean function to calculate the sample mean, or the average function to calculate the weighted sample mean.

Use the mean function to calculate the average function of "fractional"

import numpy as np

print(np.mean(df['a few points']))

You can also use the average function to calculate the average score of "scores"
print(np.average(df['a few points']))


You can also use the mean method for pandas' DataFrame object.
print(df['a few points'].mean())

# Calculate the median
print(df.median())

For qualitative data, where the mode is the most frequent value, use mode() to calculate the mode. "" "
print(df.mode())

Copy the code