Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Edit] Python: NumPy - .mean() #6477

Merged
merged 7 commits into from
Apr 7, 2025

Conversation

mamtawardhani
Copy link
Collaborator

@mamtawardhani mamtawardhani commented Apr 4, 2025

Description

[Edit] Python: NumPy - .mean()

Issue Solved

Closes #6443

Type of Change

  • Editing an existing entry

Checklist

  • All writings are my own.
  • My entry follows the Codecademy Docs style guide.
  • My changes generate no new warnings.
  • I have performed a self-review of my own writing and code.
  • I have checked my entry and corrected any misspellings.
  • I have made corresponding changes to the documentation if needed.
  • I have confirmed my changes are not being pushed from my forked main branch.
  • I have confirmed that I'm pushing from a new branch named after the changes I'm making.
  • I have linked any issues that are relevant to this PR in the Issues Solved section.

@mamtawardhani mamtawardhani added enhancement New feature or request numpy NumPy entries status: under review Issue or PR is currently being reviewed labels Apr 4, 2025
Comment on lines 219 to 225
## Best Practices

1. **Choose the appropriate axis**: When working with multi-dimensional arrays, carefully select the axis parameter to ensure calculations are performed along the intended dimension.

2. **Consider data type precision**: For scientific calculations requiring high precision, use the default `float64` or explicitly specify it. For less critical applications where memory efficiency is important, consider using `float32`.

3. **Use keepdims for dimensional consistency**: Set `keepdims=True` when maintaining the same number of dimensions in the output as in the input is necessary, which can be useful for broadcasting operations.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This section can be removed. It's making the entry big.

## FAQs

<details>
<summary>1. What's the difference between `np.mean()` and `np.average()`?</summary>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add backlinks to np.mean and np.average?


## Example
## Example 3: Data Analysis with Real-world Data
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove example 3 as well. We already have two examples and a codebyte.

@Radhika-okhade
Copy link
Collaborator

Thank you for contributing to Codecademy docs @mamtawardhani. The entry looks good to be merged.

@Radhika-okhade Radhika-okhade merged commit 18ee5ad into Codecademy:main Apr 7, 2025
7 checks passed
Copy link

github-actions bot commented Apr 7, 2025

👋 @mamtawardhani
You have contributed to Codecademy Docs, and we would like to know more about you and your experience.
Please take a minute to fill out this four question survey to help us better understand Docs contributions and how we can improve the experience for you and our learners.
Thank you for your help!

🎉 Your contribution(s) can be seen here:

https://www.codecademy.com/resources/docs/numpy/built-in-functions/mean

Please note it may take a little while for changes to become visible.
If you're appearing as anonymous and want to be credited, visit the linked accounts page and ensure that your GitHub account is linked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Edit] Python: NumPy - .mean()
2 participants