May-25-2020, 10:14 PM
import numpy as np x = np.zeros(10) np.add.at(x, i, 1) print(x)output
Output:[0. 1. 1. 0. 1. 0. 0. 0. 1. 0.]
I just don't get how this at()
method works. X becomes array that contains all zeroes. Then happens what?
add.at() method
|
|
Messages In This Thread |
add.at() method - by Truman - May-25-2020, 10:14 PM
RE: add.at() method - by KavyaL - May-26-2020, 04:53 AM
RE: add.at() method - by pyzyx3qwerty - May-26-2020, 09:54 AM
RE: add.at() method - by KavyaL - May-26-2020, 10:56 AM
RE: add.at() method - by Truman - May-26-2020, 09:18 PM
|