Numpy - Copying Arrays Warning – unnecessary commas
See original GitHub issueDescribe your problem and how to reproduce it:
The challenge in the numpy module Numpy - Copying Arrays Warning provides the different options separating the items with ,
comma characters
[1, 2, 3, 4, 5]
[1, 2, 20, 4, 5]
[1, 20, 3, 4, 5]
Since the challenge describes numpy arrays however, the correct syntax would be
[1 2 3 4 5]
[1 2 20 4 5]
[1 20 3 4 5]
I’d be more than glad to fix this with a pull request if you agree 👍
Add a Link to the page with the problem:
https://www.freecodecamp.dev/learn/data-analysis-with-python/numpy/copying-arrays-warning
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
why an extra comma in the shape of a single index numpy array
With lists, the trailing comma is not needed although some style guides recommend ... A numpy array's shape property always returns a tuple....
Read more >4.5. Understanding the internals of NumPy to avoid ...
In this recipe, we will see how to avoid unnecessary array copies in order to save memory. In that respect, we will need...
Read more >Structured arrays — NumPy v1.24 Manual
A string of comma-separated dtype specifications ... Warning. In Numpy 1.15, indexing an array with a multi-field index returned a copy of the...
Read more >Chapter 4. NumPy Basics: Arrays and Vectorized Computation
Calling astype always creates a new array (a copy of the data), even if the new dtype is the same as the old...
Read more >PEP 8: The Style Guide for Python Code
This document gives coding conventions for the Python code comprising the ... When trailing commas are redundant, they are often helpful when a...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Don’t worry, it happens. So, the first thing to do is make sure you make a backup of your work, because you’ll need to reset your master branch. Once you’ve backed it up these are the steps
at this point your master will only have the commits that this remote has.
Now, create a new branch off master:
That branch is where you can put the commits to fix this issue.
The other PR looked fine, so I merged it. No need to worry about that one!
That makes sense to me. @borntofrappe a PR would be very welcome!