|
From: Pierre H. <pie...@cr...> - 2012-09-26 08:31:56
|
Hi, Just a detail : Le 26/09/2012 04:29, Paul Tremblay a écrit : > percent = (np.divide(the_cumsum, the_sum)) * 100 This lines doesn't work on my computer (numpy 1.6.2) Indeed, there is a casting issue : In [2]: percent Out[2]: array([ 0, 0, 0, 0, 100]) However, using the regular "/" operator instead of np.divide gives the proper result: In [8]: the_cumsum/the_sum*100 Out[8]: array([ 42.10526316, 71.05263158, 90.78947368, 97.36842105, 100. ]) Best, Pierre |