Note: When I was a sophomore, I found that life is short, so I trusted God and began to learn Python. After learning for half a year, I successfully switched to the front end. Let’s write a tutorial to help you get started with Python.

Zero Basics for Python

Start with the basics: variables, syntax, data types, functions, scopes, modules, etc. (even if you have basic programming knowledge)

Just like in basketball, a three-step layup begins:

  1. Python basic knowledge introduction, from the program foundation to learn, can understand the code can be. There are three options: First, find an introductory Python tutorial book, such as Head First Python, The Stupid Way to Learn Python, and the Simple Python Tutorial. Head First series of books are very simple and easy to understand, suitable for liberal arts students to read. From the most basic things, students with programming background will feel naive. The other two are general introductory books. Take your pick. Some Python e-books to download, password: yjw3. The third kind: video tutorial, recommended moOCs network. There are also netease Cloud classroom and Xuetang online (there are many college courses in this one).
  2. Learn to write some basic Python programs, which can be done in the examples below in the Brief Python Tutorial. To further master the basics, do some LeetCode Easy exercises to practice your skills. (It depends on my personal situation, I don’t have the patience to do the questions, it is too boring, although writing questions is very beneficial)
  3. Do small projects of interest. Here are 100 Python problems, very basic. If you don’t think you are tall enough, you can play with the projects in the lab building. The lab building is a good website, and you can do some fun things.

These three steps will get you Python mastery in 21 days

You can view the state of the program, variable states, function calls, and memory allocation step by step. It is very helpful for understanding the variable life cycle, scope, and debugging understanding of the program. Development tools: Pycharm is recommended. Free community version is available, and professional version can be registered with edu email.

Python is advanced

Python includes AI (NLP, deep learning, image processing, whatever), Web development (back-end services, crawlers), data processing (data analysis, scientific computing), tools (like reading and writing Excel, writing automated scripts), Desktop development (GUI tools), etc. Python is so powerful, I want to write Python again.

Here’s a quick primer on what I know:

Web development

The Python Web framework is a great tool for building websites. For setting up less complex CMS systems, such as news sites and blog sites, Django is unfriendless and unbreakable. Flask is a great framework for sites that focus on flexibility, flexible and small, and very elegant.

  1. Get started with Django Look at the official documentation to understand the basic concepts. Then start working on actual projects, such as the Django Development blog system tutorial
  2. Flask start look at the official documentation, same as Django.

Crawler (Web data acquisition)

First, a web crawler can be understood as a spider that crawls on the network. The Internet is like a big web, and a crawler is a spider that crawls on this web. If it encounters resources, it will grab them down. Let’s say it’s crawling a web page, and in that web it finds a path, which is actually a hyperlink to a web page, and then it can crawl to another web page to get data. Simply put, use programs to get the data you want from a web page. Python’s crawler framework is extensive and very useful. Getting started:

  1. Understanding how a web page is made up of the basic knowledge of the web page includes: basic KNOWLEDGE of THE HTML language understand the concept of the website to send and receive (POST GET) a little js knowledge for understanding dynamic web pages
  2. Parsing web pages, here you need to learn regular expressions
  3. Pick a crawler framework, such as urllib, Request, BS4, etc
  4. Read the official documentation on how to use the framework, and then you can raise a crawler.

Tutorial point here

The data processing

The previous crawler talked about how to get the data. Here we will learn how to analyze and process the data. Scientific computation, data processing is used more is MATLAB, omnipotent Python can also replace it of course. Numpy Pandas are two of the most important modules in scientific computing. Matplotlib is a very powerful Python data visualization tool that draws various graphs.

  1. See the documentation on the official website to understand the basic usage of this library.
  2. Learn some simple projects, the laboratory building mentioned above can also be used

AI field

A few basic quotes from elsewhere

  1. Theano is a Python library for defining and evaluating mathematical expressions using sequences. It makes deep learning algorithms in Python much easier to write.
  2. Keras is a lean, highly modular neural network library similar to Torch. Theano at the bottom helps it optimize tensor operations in CPU and GPU running.
  3. Pylearn2 is a library that references numerous models and training algorithms such as Stochastic gradients. It is widely used in deep learning, and the library is also based on Theano.
  4. Lasagne is a lightweight library that builds and trains neural networks in Theano. It is simple, transparent, modular, practical, focused and restrained.
  5. Blocks is a framework that helps you build neural network models on top of Theano.
  6. Caffe is a deep learning framework built around clarity, speed and modularity. It was developed by the Berkeley Vision and Learning Center (BVLC) in conjunction with contributors to the online community. Google’s DeepDream ai image processing program is built on Caffe’s framework. The framework is a bsd-licensed C++ library with a Python interface.
  7. Nolearn includes a number of wrappers and Abstractions found in other neural network libraries, most notably Lasagne, which also contains some useful modules for machine learning.
  8. Genism is a deep learning toolkit deployed in the Python programming language for processing large sets of text with efficient algorithms.
  9. CXXNET is a fast, concise distributed deep learning framework based on MShadow. It is a lightweight extensible C++/CUDA neural network toolkit with a friendly Python/Matlab interface for machine learning training and prediction.

There are too many things involved here, the basic learning method as above.

Appendix:

Let’s see how powerful Python is, or we won’t be able to learn it. Face_recognition can be implemented in Python or on the command line. Constructed using dLIB deep learning face recognition technology, the accuracy of Labeled Faces in the Wild was 99.38%.

Known_obama_image = face_recognition. Load_image_file ("face1.jpg") known_obamA_image = face_recognition. Known_biden_image = face_recognition. Load_image_file ("face_kid.jpg") # Encode loaded picture obamA_face_encoding = face_recognition.face_encodings(known_obama_image)[0] biden_face_encoding = face_recognition.face_encodings(known_biden_image)[0] known_encodings = [ obama_face_encoding, Biden_face_encoding # Load the image to be recognized and encode image_to_test = face_recognition. Load_image_file ("face2.jpg") image_to_test_encoding Face_distance.face_encodings (image_to_test)[0] # Compute the difference between this image and existing image face_distance.face_distance.face_encodings (image_to_test)[0 Face_recognition. Face_distance (known_encodings, image_to_test_encoding) For I, face_distance in enumerate(face_accommodate): print("The test image has a distance of {:.2} from known image #{}".format(face_distance, Print ("- With a normal cutoff of 0.6, {}". Format (face_distance < 0.6)) print("- With a very strict cutoff of 0.5, {}". Format (face_distance < 0.5) print()Copy the code