Jump to content

Data Analysis with Python: Calculating Mean and Median


WalidKhan

Recommended Posts

I'm working on a data analysis project in Python and need to calculate both the mean and median of a dataset. I understand the basic concepts, but I'm looking for a Python code example that demonstrates how to do this efficiently.

Let's say I have a list of numbers:

data = [12, 45, 67, 23, 41, 89, 34, 54, 21]

I want to calculate both the mean and median of these numbers. Could you provide a Python code snippet that accomplishes this? Additionally, it would be helpful if you could explain any libraries or functions used in the code.

Thank you for your assistance in calculating these basic statistics for my data analysis project!

Link to comment
Share on other sites

28 minutes ago, WalidKhan said:

I'm working on..

No, you do not work..

 

32 minutes ago, WalidKhan said:

but I'm looking for a Python code example that demonstrates how to do this efficiently.

...then show your not optimal code....

 

Link to comment
Share on other sites

  • 6 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.