VisibleDeprecationWarning when creating random array of size 2e5
I defined var1, var2 as the following arrays: N = 2e5 var1 = np.array(50 * np.random.normal(size=N) + 0.1) var2 = np.array(0.01 * np.random.normal(size=N) - 300) Upon running these 3 statements in python I get the following two warnings: __main__:7: VisibleDeprecationWarning: using a non-integer number instead of an integer will result in an error in the future __main__:8: VisibleDeprecationWarning: using a non-integer number instead of an integer will result in an error in the future How do I correct this?
The size must be an integer. You used N=2e5 but that's a float, you can instead just use 2 * 10**5: >>> type(2e5) float >>> type(2*10**5) int Or otherwise convert the value to an integer.
You can't use floats or double as indexes, convert the result into an Int: import numpy as np N = int(2e5) var1 = np.array(50*np.random.normal(size=N) + 0.1) var2 = np.array(0.01*np.random.normal(size=N) - 300)
Organise .rst files for sphinx?
Scatter Plot of a Specific Column in Python using matplotlib
How to make difference between email html body and html attachment in python?
Cobb-Douglas maximization in python
Django won't serve some static files
Flask return SUM into Jinja2 list
i tried this sql request on python but is not working
Passing command line arguments in python by pytest
Not using grid anywhere in class still gives error 'cannot use geometry manager pack inside . which already has slaves managed by grid' in tkinter
Minimax Alogrithm for TicTacToe [python]
Zero Crossings Rate
Recursive function with one argument that does something to each element
Storing and Graphing results of API queried via Python. [on hold]
While handling Exceptions, how to print any error statement that occurs? See below for more details
Having trouble getting my calculator app to print the result I want
Why am I getting this ValueError?