python - organizing numbers in numpy -


I have some numbers in the list that I want to organize with numpy. My Code Higher

  lst = ['99 .56 ', '99 .76', '99 .84 ',' 100.00 ',' 100.00 ',' 100.00 ',' 100.00 ',' 100.00 ',' 100.00 ', .99 .80', '99.43 '] for lst2 = [] I am in N.P. Ranges (95.0.100.0.0.1): for x = 0 in lst in Jammu: Float (i) + 0.1> = float (j) ) & gt; Float (I): X = X + 1 lst2.append (x) lst2 = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 , 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 0, 0, 0, 1, 0, 0, 0, 1, 0]   

I did not understand why the last object is 0. There are 6 '100.00'. How <6>

thanks

ndarray generated By numpy.arange typically not end value is included:

 in  [15]: np.arange (99.0, 100., 0.1] Out [15]: Array ([99., 99.1, 99.2, 99.3, 99.4, 99.5, 99.6, 99.7, 99.8, 99.9])   

Note that an underlying Method numpy.histogram for you to do this; [13]: np.histogram (lst, list (np.arange (95.0, 100.2.0.1))) [13]: (array ([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 2, 0, 6, 0]) , Array ([95., 95.1, 95.2, 95.3, 95.4, 95.5, 95.6, 95.7, 95.8, 95.9, 96., 96.1, 96.2, 96.3, 96.4, 96.5, 96.6, 96.7, 96.8, 96.9, 97 ., 97.1, 97.2, 97.3, 97.4, 97.5, 97.6, 97.7, 97.8, 97.9, 98., 98.1, 98.2, 98.3, 98.4, 98.5, 98.6, 98.7, 98.8, 98.9, 99. 99.1, 99.2, 99.3, 99.4 , 99.5, 99.6, 99.7, 99.8, 99.9, 100., 100.1, 100.2]))

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -