Python Forum
Scaling elements of marix.
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Scaling elements of marix.
#1
I have a matrix 682x10 and I have problem with one task. I want to do for each j-column Xj=(Xj-min(Xj))/(max(Xj)-min(Xj)). Of course, I know how to do this with for. But I have to use numpy library.I tried it this way:
X[0:] = (X[0:] - np.min(X[0:])) / (np.max(X[0:]) - np.min(X[0:]))
But:
Error:
NotImplementedError: subtracting a nonzero scalar from a sparse matrix is not supported
Reply


Messages In This Thread
Scaling elements of marix. - by pawlo392 - May-16-2019, 10:15 PM
RE: Scaling elements of marix. - by michalmonday - May-16-2019, 11:37 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  quiver plot scaling help StillAnotherDave 1 1,751 Oct-26-2020, 09:17 AM
Last Post: StillAnotherDave
  Scaling random numbers within specific range schniefen 4 3,192 Oct-28-2019, 11:22 AM
Last Post: jefsummers
  WaveCopy and Amplitude Scaling kgbprod 3 3,439 Apr-24-2019, 05:49 PM
Last Post: kgbprod

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020