table of Contents
1. Python introduction and installation
1.2 Installation of Python [Key Points]
1.3 Check whether Python is installed successfully [Key]
1.4 Use of Python's own interpreter
Two, PyCharm introduction and installation
2.1 PyCharm installation and use 【Key points】
2.2 Open the PyCharm software and create a Python file
Three, install machine learning related packages
4. Introduction to related libraries during Python development [Key points]
1. Python introduction and installation
Python is a computer programming language. Is an object-oriented dynamic type language, originally designed for writing automated scripts (shell), with the continuous update of the version and the addition of new language features, more and more are used for the development of independent and large-scale projects .
1.1 Python application areas
Python is an interpreted scripting language that can be used in the following areas:
- Web and Internet development
- Scientific calculations and statistics
- education
- Desktop interface development
- Software development
- Back-end development
Don't blame me for not reminding that the two versions of Python 3 and Python 2 are incompatible, and Python 3 will be the main branch in the follow-up. The details are as follows:
- Python3 re-split and integrate the standard library, and also solved the problem of Python2's poor support for Chinese;
- The Python2 version is only supported until 2020.
1.2 Installation of Python [Key Points]
1. Python download link: https://www.python.org/downloads/
2. Double-click to open after downloading, as follows:
3. Here we must check Add Python 3.9 to PATH, and then remember to choose custom installation. As shown below:
Then, choose the next step:
Select the installation location and click Install, as shown in the figure below:
Wait for the installation to complete.
1.3 Check whether Python is installed successfully [Key]
1. Enter Python in cmd
2. Use of Phthon's own interpreter
1.4 Use of Python's own interpreter
1. Find the IDE in the start menu
Choose New File and add the following content:
Save the file as a .py file to the computer desktop; click to run, the shortcut key is F5
We can see that the Python code is running normally
Two, PyCharm introduction and installation
PyCharm is a Python IDE with a set of tools that can help users improve the efficiency of the Python language development, such as debugging, syntax highlighting, project management, code jump, smart prompts, automatic completion, unit testing, version control . In addition, the IDE provides some advanced features to support professional web development under the Django framework.
Pycharm Professional Edition requires a fee, needs to be cracked and activated, you can search on Baidu.
2.1 PyCharm installation and use 【Key points】
1. PyCharm download link: https://www.jetbrains.com/pycharm/download/#section=windows
Custom installation path:
Installation is basically clicking next. Need to check: 64-bit launchar、Add launchers dir to the PATH
Wait for the installation to complete.
2.2 Open the PyCharm software and create a Python file
Click the software icon to open the software, as shown in the figure below.
Choose your favorite theme
Plug-in installation
Next is the activation process, you can choose to try it free for 30 days. Subsequent activation of the latter
Create a name for the project, then you need to specify the Python installation path
Then select the file project right click to create a Python file
Next we can write Python files
print("hello world")
Right-click to run the project, because creating a new project requires configuration, so you need to wait for a while. So we run the first Python code
2.3 PyCharm general settings
Next, we set the font size
Find Font in File --> Setting. Edit --> Font Modify the font size, you can set the font size to 20, and finally save it. Then the font becomes larger.
We set the font size by setting shortcut keys.
Searching for Increase Font in the keymap is to increase the font, and Decrease Font is to decrease the font. After finding the corresponding option, right click [Add Keyboard Shortcut]. After setting, we can press Ctrl + mouse wheel to adjust the font size.
Three, install machine learning related packages
If you are using Python for data analysis, you need to install additional packages. Normally, because Python has a large number of feature-rich packages, it is very helpful for data analysis:
1. Python interpreter
According to the computer operating system (Linux/Windows/Mac) and the corresponding version (32bit, 64bit), select the corresponding Python interpreter.
Download address of Python interpreter: www.python.org
2. Python Package
uses the pip tool to install the following packages: numpy, scipy, pandas, matplotlib, scikit-learn, TensorFlow, Keras.
If you need to install other packages, you can install them when you use them.
The usage method is: pip install <Package Name>
3. Choose any IDE, such as Anaconda, PyCharm, etc.
The download links are:
- Anaconda official website: https://www.anaconda.com/
- PyCharm official website: http://www.jetbrains.com/pycharm/
The above content, if you only install Anaconda, you no longer need steps 1 and 2.
Mac computer installation is basically similar:
As we all know, Mac comes with Python, the version is 2.7, the following describes how to install Python 3. The installation steps are as above
After installation, you need to use: which python3, you can see the path of python, so you can set this path in PyCharm
4. Introduction to related libraries during Python development [Key points]
- NumPy scientific computing; NumPy is an extended library of Python language. Supports a large number of advanced dimensional arrays and matrix operations, and also provides a large number of mathematical function libraries for array operations. Numpy has released Python's PIL (Global Interpreter Lock) internally, and has excellent computational efficiency. It is the basic library for a large number of machine learning frameworks!
- Plotly is used to generate charts
- Scrapy screenshot and crawler operation
- pygame game module
- Matplotlib plotting package
- SciKit-Learn implements many machine learning algorithms
- Thrano
- Scipy Scipy advanced scientific computing library, Scipy generally manipulates Numpy arrays for scientific computing and statistical analysis
- Pandas Pandas is built on NumPy arrays, making data preprocessing, cleaning, and analysis faster and easier.
- NLTK easily completes many natural language processing (NLP) tasks, including word segmentation, part-of-speech tagging, named entity recognition (NER) and syntactic analysis.
- Gensim gensim is a program package for calculating text similarity in Python.
- Sealborn Seaborn is actually a more advanced API encapsulation based on matplotlib, which makes drawing easier. In most cases, using seaborn can make very attractive maps.
# _#_ coding utf-8 _#_
# 开发团队:大数据组
# 开发人员:${USER}
# 开发时间:${DATE} ${TIME}
# 文件名称:${NAME}.py
# 开发工具:${PRODUCT_NAME}