Bottom Page

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
Quote
#2
Could you show example of input and output that you'd like to achieve using some random 4x2 array?
Quote

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  Sum of elements on the list recursive sev 3 220 Jun-20-2019, 02:14 PM
Last Post: sev
  WaveCopy and Amplitude Scaling kgbprod 3 295 Apr-24-2019, 05:49 PM
Last Post: kgbprod
  Recursive Function - Compare 2 lists, return the elements that don't exist in both KellyBaptist 1 410 Dec-23-2018, 10:10 AM
Last Post: Gribouillis
  Printing elements in a tuple with formatting oncebuddy 1 919 Jan-24-2018, 06:25 AM
Last Post: Gribouillis
  Repeating elements when appending in iteration in Python 3.6 miguelsantana 2 905 Dec-17-2017, 01:22 AM
Last Post: Terafy
  reach the elements in the list ptah 7 1,189 Oct-04-2017, 08:12 PM
Last Post: ptah
  join elements from two splits dwiga 2 1,095 Sep-29-2017, 09:27 PM
Last Post: nilamo

Forum Jump:


Users browsing this thread: 1 Guest(s)