Numpy - Accessing and Changing Elements, Rows, Columns
See original GitHub issueDescribe your problem and how to reproduce it: The output does not align with the question, nor does it align with the code. I suspect this is what the output was meant to be:
# Output:
# [[ 1 2 20 4 5 ]
# [ 6 7 20 9 10 ]]
Also, I would suggest the formatting of the code to change. Ie. spacing between numbers and []
, and spacing between numbers.
Add a Link to the page with the problem: https://www.freecodecamp.dev/learn/data-analysis-with-python/numpy/accessing-and-changing-elements-rows-columns
If possible, add a screenshot here (you can drag and drop, png, jpg, gif, etc. in this box):
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:6 (6 by maintainers)
Top Results From Across the Web
Transpose ndarray (swap rows and columns, rearrange axes)
To transpose NumPy array ndarray (swap rows and columns), use the T attribute (.T), the ndarray method transpose() and the numpy.transpose() ...
Read more >Modify a particular row/column of a NumPy array
If you want to change the values of a row or column of an array, you can assign it to a new list...
Read more >How to access a NumPy array by column - GeeksforGeeks
Accessing a NumPy-based array by a specific Column index can be achieved by indexing. NumPy follows standard 0-based indexing in Python.
Read more >How to Set Axis for Rows and Columns in NumPy
Specifically, operations like sum can be performed column-wise using axis=0 and row-wise using axis=1. In this tutorial, you will discover how ...
Read more >The Basics of NumPy Arrays | Python Data Science Handbook
Array Indexing: Accessing Single Elements¶ ... Keep in mind that, unlike Python lists, NumPy arrays have a fixed type. This means, for example,...
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
@scissorsneedfoodtoo , well. What was your intent? I assumed the output was there as an example for what the end result should become. Ie. after performing:
Or, was the output just another representation of the output of the
np.array
?I suggest it be the expected output of the code the user needs to select, as this helps the user clarify what needs to be done.
Okay. I will be working on it.