Change language

# Python Numpy Data Analysis – Mean – Median – Mode – Deviation

in this lesson we will make examples of machine learning which is often used in the python programming language machine learning allows the computer to learn by examining data and statistics machine learning is a program that analyzes data and learns to predict the outcome you can download and develop the source codes of the project in this video from the turtle code github account before starting the project you can support us by following the turtle code youtube channel and other social media accounts so lets start we need to create a project file using the visual studio code program click the open folder button to create the project file create an empty file create a python code file inside the file check that the python script file is running using the print command the project ran without errors lets start by examining computer data and statistics lets first make examples using the mean mean -median-mode-in-python-without-libraries/">median and mode methods for example lets create a list stating the speed of 13 cars lets find the average of this list using the numpy library this could be a simple example but it makes our job easier when analyzing lists that contain a lot of data lets start making the example transfer the numpy library to the project code file create a list of the speeds of the 13 cars synchronize the mean of the list to a variable with the mean function using the numpy library print the variable to the console screen using the print command run the project we printed the average of the list on the console screen using the mean function lets find the mean -median-mode-in-python-without-libraries/">median value of the data using the mean -median-mode-in-python-without-libraries/">median function when we rank a mean -median-mode-in-python-without-libraries/">median population or sample data series from smallest to largest it is the value that divides the series in half run the project and see the result on the console screen we can find the mean -median-mode-in-python-without-libraries/">median value of the list using the mean -median-mode-in-python-without-libraries/">median function if there are two numbers in the middle we can find the mean -median-mode-in-python-without-libraries/">median value of the list by dividing the sum of these numbers by two lets show this example in the python script file add the data found in the previous example to the list run the project and test the value in the example on the console screen when there are two numbers in the middle we calculate the mean -median-mode-in-python-without-libraries/">median value of the list by dividing the sum of these numbers by two lets do an example to find the mode value of the list the mod value is the most visible value in the list since 86 is the most visible value in the list the mode value of the list is 86 to learn the mode value of the list we need to transfer the sipi library to the code file instead of the numpy library we can transfer the sipi library to our project file by typing this code in the terminal section press the enter key the download will be completed shortly the download is complete lets change the values in the list to find the mode value of the list transfer the stats file from the sipi library use the stats library instead of the numpy library sync the speed list with the mode function run the project we found the mode value in the list using the sipi library lets start making an example of standard deviation standard deviation is a measure used in probability theory and statistics to summarize the spread of data values from a population a sample a probability distribution or a random variable to begin with the standard deviation example lets change the velocity list we use the std function to get the standard deviation value of the list transfer the numpy library to use the std function use numpy library in variable run the project we can learn the standard deviation of the velocity variable list we created with this method now lets find out the variance value of the list the variance is another number that shows how spread out the values are in fact if you take the square root of the variance you get the standard deviation or vice versa if you multiply the standard deviation by itself you get the variance we use the var function to find the variance value of the list run the project and lets find out the variance value of the list we found the variance value of the list using the var function so how can we calculate the variance value mathematically to calculate the variance of a list calculate the mean of the numbers in the list subtract the average value you calculated from each element of the list square all of the new values calculate the mean of the new values the value you calculated is the variance value of your list use the std function to find the standard deviation of the same list as i said earlier the square root of variance is the standard deviation the square of the standard deviation is equal to the variance value lets start with an example of the concept of percentile make a list of ages submit the list you created and a rate to the percentile function this ratio is a percentage and represents the age ratio of people run the project using the percentile function we printed the number 43 on the console screen this mean s that 75 percent of the people on the list are under the age of 43.

lets change the example using a different ratio run the project using the percentile function we printed the number 61 on the console screen this mean s that 90 percent of the people on the list are under the age of 61.

lets start by making an example about the concept of data distribution create a variable x using the numpy library we can get numbers using the random function in the numpy library for this send three parameters to the uniform function the first two parameters represent the range of numbers to be generated the last parameter represents the number of numbers to be generated run the project 250 random numbers between 0 and 5 were printed on the console screen we need a library to make a different example we can transfer this library to the project file using this code the installation process is complete submit the library transferred to the project to the script file we will use the library with the abbreviation name plt generate random numbers using the numpy library as in the previous example use the hist function and pass two parameters to the hist function the first parameter is the variable we just created the second parameter represents the axis length of the graph to be created use the show function and display the graph on the screen a randomly generated graphic was displayed on the screen to better understand the example change the number of randomly generated digits and the axis length of the graph and rerun in this example we created a chart with random numbers if you have any questions let me know in the comments you can also support us by subscribing to the turtle code youtube channel and other social media accounts [Music] you

## Shop

Learn programming in R: courses

\$

Best Python online courses for 2022

\$

Best laptop for Fortnite

\$

Best laptop for Excel

\$

Best laptop for Solidworks

\$

Best laptop for Roblox

\$

Best computer for crypto mining

\$

Best laptop for Sims 4

\$

Latest questions

NUMPYNUMPY

Common xlabel/ylabel for matplotlib subplots

12 answers

NUMPYNUMPY

How to specify multiple return types using type-hints

12 answers

NUMPYNUMPY

Why do I get "Pickle - EOFError: Ran out of input" reading an empty file?

12 answers

NUMPYNUMPY

Flake8: Ignore specific warning for entire file

12 answers

NUMPYNUMPY

glob exclude pattern

12 answers

NUMPYNUMPY

How to avoid HTTP error 429 (Too Many Requests) python

12 answers

NUMPYNUMPY

Python CSV error: line contains NULL byte

12 answers

NUMPYNUMPY

csv.Error: iterator should return strings, not bytes

12 answers

## Wiki

Python | How to copy data from one Excel sheet to another

Common xlabel/ylabel for matplotlib subplots

Check if one list is a subset of another in Python

How to specify multiple return types using type-hints

Printing words vertically in Python

Python Extract words from a given string

Cyclic redundancy check in Python

Finding mean, median, mode in Python without libraries

Python add suffix / add prefix to strings in a list

Why do I get "Pickle - EOFError: Ran out of input" reading an empty file?

Python - Move item to the end of the list

Python - Print list vertically