Differences between functions and methods in Python

Brief summary: Functions that have no binding relationship with classes and instances belong to function s; Functions bound to classes and instances belong to method s.   First of all, abandon the false cognition: not all calls in a class are called methods Function type Functions encapsulate some independent functions and can be called direc ...

Posted by PHPeter on Mon, 23 May 2022 22:12:54 +0300

Arrays and strings

target 1. Understand the difference between array and dynamic array. 2. Be familiar with the basic operations in array and dynamic array. 3. Be able to understand and use multidimensional arrays. 4. Understand the concept of string and the different characteristics of string. 5. Be able to use double pointer skills to solve practical probl ...

Posted by bigwatercar on Mon, 23 May 2022 21:35:07 +0300

numpy common summary

A chestnut >>> import numpy as np >>> a = np.arange(15).reshape(3, 5) >>> a array([[ 0, 1, 2, 3, 4], [ 5, 6, 7, 8, 9], [10, 11, 12, 13, 14]]) >>> a.shape (3, 5) >>> a.ndim # The number of axes of an array. In the python world, the number of axes is called rank 2 >>> a ...

Posted by evilmonkey on Mon, 23 May 2022 17:11:31 +0300

Big data acquisition case: Python web crawler instance

Web crawler: Web crawler (also known as web page) spider , network robot, in FOAF In the middle of the community, more often referred to as web page chaser), it is a kind of automatic crawling according to certain rules web A program or script that contains information. Other names that are not often used are Ants , automatic indexing, emulator ...

Posted by lobobr on Mon, 23 May 2022 13:35:16 +0300

pytorch on GPU - training neural network with CUDA (pytorch series-30)

Running PyTorch code on GPU - neural network programming guide In this episode, we will learn how to use GPU and PyTorch. We will see how to use the general methods of GPU, and we will see how to apply these general techniques to train our neural networks. Deep learning using GPU If you haven't seen the episode about why deep learning and neur ...

Posted by bmbc on Mon, 23 May 2022 12:42:05 +0300

Use of urllib Library of reptiles

urllib Library preface In the actual operation of the crawler, we only need two lines of code to get the web content. This function is the implementation of the third-party library In Python 2, our library has urllib 2 and urllib, but in Python 3, we directly merged this library into urllib, which is why we can't afford to install it when we in ...

Posted by ReDucTor on Mon, 23 May 2022 11:16:21 +0300

Detailed explanation of design pattern and Python implementation

Design pattern and Python implementation What is the design pattern? Christopher Alexander: "each pattern describes a recurring problem around us and the core of the solution to the problem * so that you can use the solution again and again without having to do repetitive work." Design patterns are summarized and optimized to provide ...

Posted by axo on Mon, 23 May 2022 10:49:13 +0300

Python draws snowflakes all over the sky and walks around the world

  the snowflakes all over the sky and walking on the horizon have always been what I think is a very romantic picture. After research, it is finally implemented in Python! In this article, let's take a look at the snow map with background pictures and music.             1, Effect drawing of snowflakes all over the sky    The snowflakes a ...

Posted by shameermp on Mon, 23 May 2022 10:27:19 +0300

Data processing of the use of Python's pandas module

1. Data import and export (1) Data import and export of csv file import pandas # Import 1.csv data into the data variable data = pandas.read_csv( # file path 'D:/1.csv', # Set the engine parameter so that the Chinese meaning in the path will not report an error engine='python', # set encoding format encoding='utf8' ) # Data output # de ...

Posted by EvilWalrus on Mon, 23 May 2022 07:22:19 +0300

A plug-in that connects the two lines between BurpSuite and Python—Burpy

Burpy is a plug-in that can open up the relationship between BurpSuite and Python. From now on, you can use your python to process Http packets arbitrarily! effect Execute the specified python script and return the processing result to BurpSuite. Function, UI introduction Here's a note: use python2. Specify your own python script in Burpy PY f ...

Posted by nielskg on Mon, 23 May 2022 05:57:28 +0300