-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Conversation
## 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. |
There was a problem hiding this comment.
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> |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
Co-authored-by: Radhika-okhade <[email protected]>
Thank you for contributing to Codecademy docs @mamtawardhani. The entry looks good to be merged. |
👋 @mamtawardhani 🎉 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. |
Description
[Edit] Python: NumPy - .mean()
Issue Solved
Closes #6443
Type of Change
Checklist
main
branch.Issues Solved
section.