- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Print the mean of a Pandas series
mean() function in the Pandas library can be used to find the mean of a series.
Algorithm
Step 1: Define a Pandas series. Step 2: Use the mean() function to calculate the mean. Step 3: Print the mean.
Example Code
import pandas as pd series = pd.Series([10,20,30,40,50]) print("Pandas Series: \n", series) series_mean = series.mean() print("Mean of the Pandas series:\n", series_mean)
Output
Pandas Series: 0 10 1 20 2 30 3 40 4 50 dtype: int64 Mean of the Pandas series: 30.0
Advertisements
To Continue Learning Please Login
Login with Google