Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The installation process of Python algorithm library

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains the "Python algorithm library installation process", the article explains the content is simple and clear, easy to learn and understand, the following please follow the editor's ideas slowly in depth, together to study and learn "Python algorithm library installation process"!

The Python algorithm library contains the following packages, the official download address:

Https://pypi.python.org/pypi

The downloaded algorithm library should be the same as the installed Python version, for example, the Python3.7-64-bit version is installed, and the downloaded algorithm library should be cp37...win_amd64, otherwise an error will be reported during installation. The installation order of the Python algorithm library is: NumPy- > SciPy- > Matplotlib- > Scikit-Learn.

NumPy:

Array processing for numbers, strings, records, and objects.

NumPy is an open source Python scientific computing library. With NumPy, you can naturally use arrays and matrices. NumPy contains many practical mathematical functions, including linear algebraic operation, Fourier transform and random number generation. NumPy is commonly used with SciPy and Matplotlib, and this combination is widely used as an alternative to MatLab, a popular technology computing platform, and Python, as an alternative to MatLab, is now seen as a more modern and complete programming language.

Installation:

C:\ Program Files\ Python37\ Scripts > pip install d:\ numpy-1.15.2-cp37-none-win_amd64.whl

Processing d:\ numpy-1.15.2-cp37-none-win_amd64.whl

Installing collected packages: numpy

Successfully installed numpy-1.15.2

SciPy:

Scientific Library for Python.

SciPy is an open source Python scientific computing library based on Numpy. Its added functions include numerical integration, optimization, statistics and some special functions. SciPy function library adds many library functions commonly used in mathematics, science and engineering calculation on the basis of NumPy library. For example, interpolation, linear algebra, numerical solution of ordinary differential equations, signal processing, image processing, sparse matrix and so on.

Installation:

C:\ Program Files\ Python37\ Scripts > pip install d:\ scipy-1.1.0-cp37-none-win_amd64.whl

Processing d:\ scipy-1.1.0-cp37-none-win_amd64.whl

Requirement already satisfied: numpy > = 1.8.2 in c:\ program files\ python37\ lib\ site-packages (from scipy==1.1.0) (1.15.2)

Installing collected packages: scipy

Successfully installed scipy-1.1.0

Matplotlib:

Python plotting package.

Matplotlib is a Python 2D drawing library that can generate publishing quality graphics in a variety of hard copy formats and interactive environments on various platforms. Matplotlib only needs a few lines of code to generate graphs, histograms, cookie charts, scatter charts, and so on.

Installation:

C:\ Program Files\ Python37\ Scripts > pip install d:\ matplotlib-3.0.0-cp37-cp37m-win_amd64.whl

Processing d:\ matplotlib-3.0.0-cp37-cp37m-win_amd64.whl

Collecting kiwisolver > = 1.0.1 (from matplotlib==3.0.0)

Downloading https://files.pythonhosted.org/packages/7c/be/7ae355b45699460e369ebf88d86058fca26827933974cc3f6b6b7800a324/kiwisolver-1.0.1-cp37-none-win_amd64.whl (57kB)

100% | ██ | 61kB 55kB/s

Collecting python-dateutil > = 2.1 (from matplotlib==3.0.0)

Downloading https://files.pythonhosted.org/packages/cf/f5/af2b09c957ace60dcfac112b669c45c8c97e32f94aa8b56da4c6d1682825/python_dateutil-2.7.3-py2.py3-none-any.whl (211kB)

100% | ██ | 215kB 74kB/s

Collecting cycler > = 0.10 (from matplotlib==3.0.0)

Downloading https://files.pythonhosted.org/packages/f7/d2/e07d3ebb2bd7af696440ce7e754c59dd546ffe1bbe732c8ab68b9c834e61/cycler-0.10.0-py2.py3-none-any.whl

Collecting pyparsingsong, 2.0.4, from matplotlib==3.0.0, 2.1.2, 2.1.6, > = 2.0.1

Downloading https://files.pythonhosted.org/packages/2b/4a/f06b45ab9690d4c37641ec776f7ad691974f4cf6943a73267475b05cbfca/pyparsing-2.2.2-py2.py3-none-any.whl (57kB)

100% | ██ | 61kB 131kB/s

Requirement already satisfied: numpy > = 1.10.0 in c:\ program files\ python37\ lib\ site-packages (from matplotlib==3.0.0) (1.15.2)

Requirement already satisfied: setuptools in c:\ program files\ python37\ lib\ site-packages (from kiwisolver > = 1.0.1-> matplotlib==3.0.0) (39.0.1)

Collecting six > = 1.5 (from python-dateutil > = 2.1-> matplotlib==3.0.0)

Downloading https://files.pythonhosted.org/packages/67/4b/141a581104b1f6397bfa78ac9d43d8ad29a7ca43ea90a2d863fe3056e86a/six-1.11.0-py2.py3-none-any.whl

Installing collected packages: kiwisolver, six, python-dateutil, cycler, pyparsing, matplotlib

Successfully installed cycler-0.10.0 kiwisolver-1.0.1 matplotlib-3.0.0 pyparsing-2.2.2 python-dateutil-2.7.3 six-1.11.0

Scikit-Learn:

A set of python modules for machine learning and data mining.

Scikit-learn (abbreviated sklearn) is a machine learning algorithm library implemented in python. Sklearn can realize common machine learning algorithms such as data preprocessing, classification, regression, dimensionality reduction, model selection and so on. Sklearn is based on NumPy, SciPy, matplotlib.

Installation:

C:\ Program Files\ Python37\ Scripts > pip install d:\ scikit_learn-0.20.0-cp37-cp37m-win_amd64.whl

Processing d:\ scikit_learn-0.20.0-cp37-cp37m-win_amd64.whl

Requirement already satisfied: scipy > = 0.13.3 in c:\ program files\ python37\ lib\ site-packages (from scikit-learn==0.20.0) (1.1.0)

Requirement already satisfied: numpy > = 1.8.2 in c:\ program files\ python37\ lib\ site-packages (from scikit-learn==0.20.0) (1.15.2)

Installing collected packages: scikit-learn

Successfully installed scikit-learn-0.20.0

You can simply test the effect of the installed algorithm library. The code is as follows:

# Import NumPy Library import numpy as np# Import Matplotlib Library import matplotlib.pyplot as pltimport math# definition sequence Endpoint and sample number x = np.linspace (- math.pi, math.pi, 100) # define function y0 = x / x-1y1 = np.sin (x) y2 = np.cos (x) y3 = x drawing curve plt.plot (x, y0, color = 'black', linewidth = 0.5) plt.plot (x, y1, label =' $y=sin (x) $' Color = 'red', linewidth = 0.5) plt.plot (x, y2, label =' $y=cos (x) $', color = 'green', linewidth = 0.5) plt.plot (x, y3, label =' $y = x ^ 2-2x+1 $', color = 'blue', linewidth = 0.5) # definition coordinates plt.xlabel (' Time (s)') plt.ylabel ('Volt') plt.xlim (- 4,4) plt.ylim (- 2) 2) # title and icon plt.title ('PyPlot') plt.legend () # display drawing plt.show ()

Thank you for your reading, the above is the content of "the installation process of Python algorithm library". After the study of this article, I believe you have a deeper understanding of the installation process of Python algorithm library, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Network Security

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report