Based on my personal experience, I will talk about the process of learning python, and I recommend books about learning python at the same time

    Because I need to use it for work, I started to learn python in May 19th. After about a month of learning, I can work for the company. And this python project also contains elements such as machine learning, about 3 Months later, I also took on the task of developing machine learning data analysis in the project. So I feel that although python contains popular elements such as crawlers, machine learning, and data analysis, python is not difficult to learn, and if the method is appropriate, the degree of learning capable projects is also very fast. In this article, I will explain the process of learning Python and show you how to learn Python efficiently.

1 Set up a development environment

    Since I have a foundation in learning java, I know that I have to set up a development environment first. At that time, I used eclipse+Python interpreter+pydev plug-in to build an environment. At that time, I was still using 3.4 interpreter. Of course, now the interpreter seems to be 3.9 Yes, I also use Pycharm integrated development environment.

    If you want to learn python now, it is recommended to use the following steps to build an environment.

    1. Go to the official website to download the python interpreter and install it

    This is the official website, https://www.python.org/downloads/windows/, where you can choose the latest version, and according to your machine's operating system, download the windows or linux or mac version, I downloaded windows version. After downloading, follow the prompts to complete the installation.

    Python is an interpreted language, so after downloading and installing the interpreter, you can run python language locally.

     2. Install pycharm integrated development environment

    After installing the python interpreter, you can theoretically develop and run python programs through the command line. But this is very inconvenient, so it is recommended to go to https://www.jetbrains.com/pycharm/download/ to download and install the pycharm integrated development environment.

     3. Install third-party packages

     After the python interpreter is installed, the interpreter will come with some basic dependency packages, but if you want to develop programs such as machine learning or data analysis, you need to install third-party packages, such as numpy mentioned later.

     The way I install third-party packages is to use cd and other commands in the command window to enter the path where the Python interpreter is located, such as C:\Users\think\AppData\Local\Programs\Python\Python37. In this path, Then enter the Scripts path, find the pip3 command, and then install the third-party package by means of the pip3 install package name. For example, to install the numpy package, the corresponding command is pip3 install numpy.

    At this point, the development environment is set up.

2 Pitfalls encountered when building a development environment

    I encountered two pitfalls when setting up the development environment. The first was to change the source, and the second was to find the corresponding interpreter in pycharm.

    What is changing the source?

    When using commands such as pip3 install numpy to install third-party libraries, the default seems to be to download from foreign websites, so if you encounter a large package and the network is not good, the download will be more difficult, so you can use the following -i The parameter specifies the source of downloading third-party reports.

    pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple virtualen

    Here after the -i parameter, https://pypi.tuna.tsinghua.edu.cn/simple specifies the source of Tsinghua, while virtualen is the third-party package to be downloaded, so that the third-party can be downloaded and installed in a faster way package.

    Determine the interpreter in pycharm

    I have been in this area for a long time, and then when I brought my classmates to get started with python in the training class, I found that beginners often make mistakes here.

    We know that pycharm will come with a python interpreter.

    But this interpreter version may not be what we expected, so we will install other interpreters. The problem is here, the installed third-party package is followed by the interpreter .

    For example, we have installed a number of third-party packages in the 3.8 interpreter that comes with pycharm, but if you switch to the 3.9python interpreter installed by yourself, these third-party packages will all change.

    For example, when we switched the interpreter, we found that the third-party package had all changed.

    So when installing a third-party package, you must pay attention to the selected interpreter, such as the interpreter 3.9 directory, and run the pip3 command, so that you can install the package for a specific interpreter. 

3 Familiarize yourself with the syntax by typing the code

    Python introductory books are almost the same, I used this one at the time. You don’t need to have many introductory books, just run the grammar code in one book.

    The basic syntax of Python includes: branch loops, collections (list dictionary tuples, etc.), object-oriented (classes and inheritance, etc.), file reading and writing, and exception handling. These syntax points can be basically understood after running through them. During the learning phase, don’t go too deep.

    If you think the basics of programming are average, you can find another book, such as this one. But the basic grammar doesn't need to be read, it is enough to run the code of two books. Because Python's focus is on data analysis, crawlers, and machine learning.

4 Learning data analysis Three Musketeers component

    My project is to use Python for quantitative stock analysis, but I have observed that no matter what kind of application Python is used for, the three musketeers of data analysis, such as Numpy, Pandas and Matplotlib, generally have to be mastered.

    I was reading this book, which contains the syntax and applications of the Three Musketeers. I usually read one and then run it again according to the code inside. The data analysis should be able to reach the point of being able to work. .

    

5 Learn Scrapy crawler framework

    My project did not include the crawler function, but I took a private job to help a school record a python crawler video. So I bought this book in 2 weeks and ran it according to the case inside, and then I knew the details of the Scrapy crawler.

    The points to note when learning the Scrapy framework are as follows.

  •     Scrapy third-party is difficult to build, and other packages need to be installed in advance. It is recommended to build an environment based on python3.8 and 3.9 interpreters.
  •     It is recommended to download the package locally and install it locally.

    But if you really set up the Scrapy environment, follow the instructions in this book, and basically you won't encounter big problems.

6 Getting started with the machine learning sklearn library with cases

    In terms of machine learning, I was reading this book at the time, which included machine learning, and also used the sklearn library to do linear regression and SVM analysis cases.

    My experience is: Although the machine learning algorithms are more complicated, they are basically encapsulated in the sklearn library. That is to say, in python, you only need to call the method and pass in the correct parameters to use the machine in the project. Learning algorithm.

7 Comprehensively learn python data analysis with stock quantification cases

    In the previous book, there are more comprehensive cases of integrating machine learning and data analysis, in which numpy+pandas+matplotlib+sklearn library can also be integrated, but the project I am doing is related to financial quantification, so I bought After reading this book, I use quantitative cases to comprehensively study data analysis.

8 Summary: My experience of learning python

    I feel that my efficiency in learning python is fairly high, so here is a summary of my learning experience.

  •     Learning must have a purpose, such as using python to find a job, using python in the project, or using python to pick up private work, otherwise don't learn it for no purpose.
  •     At the beginning, it is not recommended to learn through video, but to buy a book to learn, because the knowledge points in the book are more systematic, and the code in the book can be guaranteed to run.
  •     Don't just read the book, you must master the skills while running the code. 

    Following the above method, you must be familiar with python within a month.

9 Summary: The cost and benefit of learning python

    Money cost

    I buy books for about 400 yuan before and after

    Time costs

    In the evenings and weekends of a month, if you run python without doing anything else, you will be familiar with python grammar + data analysis, plus a month, you will be familiar with machine learning related grammar.

    income:

    Be able to do projects at work and earn wages.

    Later, two books were published, and the remuneration was about 25,000.

    It's okay to make money if you can go to lectures.

    I did a python crawler private job and earned more than 10,000.

    But I feel that since python includes deep learning and other hotspots, programmers should really find a goal first, such as job-hopping, and then learn python. According to the process given in this article, I should be able to learn to be able to work quickly. 

    

    Please pay attention to my official account: make progress together and make money together. In this official account, there will be many wonderful articles.

Guess you like

Origin blog.csdn.net/sxeric/article/details/112982154
Recommended