• python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Facebook Twitter Instagram
Devs Fixed
  • python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Devs Fixed
Home ยป Resolved: Using Numpy to update one column by the square root of those column values

Resolved: Using Numpy to update one column by the square root of those column values

0
By Isaac Tonny on 16/06/2022 Issue
Share
Facebook Twitter LinkedIn

Question:

Given an array update the second column by the square root of those values.

Answer:

As rafaelc suggested, you can use np.sqrt on a specific column.
a = np.array([[1.,2.,3.],[1.,2.,3.]])
a[:,1] = np.sqrt(a[:,1])
a has two rows and three columns. a[:,1] is the second column.

If you have better answer, please add a comment about this, thank you!

python
Share. Facebook Twitter LinkedIn

Related Posts

Resolved: Table data is coming as empty in React

02/04/2023

Resolved: In a Pinescript v5 Strategy why is my bool not working?

02/04/2023

Resolved: net::ERR_HTTP2_PROTOCOL_ERROR by http get request angular 15.2

02/04/2023

Leave A Reply

© 2023 DEVSFIX.COM

Type above and press Enter to search. Press Esc to cancel.