python-scipyHow do I check the version of Python Numpy I am using?
To check the version of Python Numpy you are using, you can use the np.__version__
command. This command will return the version of Numpy as a string.
For example,
import numpy as np
np.__version__
Output example
'1.18.1'
The code above imports the Numpy library as np
, and then calls the np.__version__
command to print out the version of Numpy.
In addition, you can also check the version of Numpy from the command line. To do this, just type python -c "import numpy; print(numpy.__version__)"
and it will return the version of Numpy.
Code explanation
import numpy as np
: imports the Numpy library asnp
np.__version__
: calls thenp.__version__
command to print out the version of Numpypython -c "import numpy; print(numpy.__version__)"
: checks the version of Numpy from the command line
Helpful links
More of Python Scipy
- How can I check if a certain version of Python is compatible with SciPy?
- How do I use Python XlsxWriter to write a NumPy array to an Excel file?
- How do I create a 2D array of zeros using Python and NumPy?
- How can I use Python and SciPy to find the zeros of a function?
- How do I use Python Numpy to read and write Excel (.xlsx) files?
- How can I use Python and SciPy to implement a quantum Monte Carlo simulation?
- How can I use scipy linalg in Python?
- How do I use Python Scipy to perform a Z test?
- How to use Python, XML-RPC, and NumPy together?
- How can I use Python and SciPy together online?
See more codes...