1, download Python
: https://www.python.org/downloads/windows/
2. Configure Python environment variables
Add the Python installation path in the system variable path of the system properties of the computer, as in path; F:\Python34; F:\Python34\Scripts;
3. Install the NumPy package using PIP instructions
3.1 Open DOS command input pip install NumPy will be installed automatically
A long time, successful installation will have the following tips
3.2 You can also use the PIP command to search for packages in the Python repository, which you need to install.
If we can search for packages related to CRF (conditional random field)
This makes it possible to use the NumPy package for scientific calculations.
4, test of NumPy package
Code: Use the NumPy package to implement a matrix transpose, multiply.
__author__='Xianweizheng' fromNumPyImport*randarrays= Random.rand (bis)Print("Rand arrays:\n", randarrays) Randmat= Mat (Random.rand (bis))#Use the mat () function to convert an array to matrixPrint("Rand matrix:\n", Randmat) Invrandmat= Randmat.i#use. I implement the transpose of the MatrixPrint("Inverse Rand matrix:\n", Invrandmat)
Operation Result:
Python NumPy Package Installation