Python object-oriented (class, inheritance of class)

Python Object Oriented Remember one sentence: Classes are templates, while instances are objects created from classes. Class is literally understood in the beginning of school. It can be unilaterally thought to be a kind. It is a sampling of similar characteristics, that is, something similar, which can abstract similar characteristics of tran ...

Posted on Thu, 26 Mar 2020 11:21:52 -0700 by redhair

Python data analysis - Chapter 3 Introduction to Pandas

Pandas is an open source BSD licensed Python library, which provides python programming language with high performance and easy to use data structure and data analysis tools. Pandas is used in a wide range of fields, including finance, economy, statistics, analysis and other academic and business fields. Here we learn to use pandas for some sim ...

Posted on Tue, 24 Mar 2020 08:44:48 -0700 by j007ha

Python - MySQL of Python operation database

Python - MySQL of Python operation database (1) 1, About MySQL: MySQL is a relational database management system, developed by MySQLAB company in Sweden, which is a product of Oracle. MySQL is one of the most popular relational database management systems. In WEB applications, MySQL is the best RDBMS(Relational Database Management System, One o ...

Posted on Tue, 24 Mar 2020 06:00:01 -0700 by imurkid

2020Python exercise 14 - decorator

@2020.3.23 After class exercise - decorator 1: Write the function, (the time of function execution is simulated by time.sleep(n)) import time def index(x,y): time.sleep(3) print('index %s %s' %(x,y)) index(111,222)   2: Write decorator to add statistical time to function import time def index(x,y): start=time ...

Posted on Mon, 23 Mar 2020 07:56:58 -0700 by johnoc

Batch character input of Python_adb in selfie 49

Android terminal product system or App test, involving input box boundary value test, For example, set the name of wifi hotspot, or search the input box, You need to verify that the text input box can enter up to 256 characters, How to input 256 characters quickly? Preparation stage Manually click the wifi hotspot name text input box to make ...

Posted on Mon, 23 Mar 2020 05:31:06 -0700 by surfnjunkie

[2020Python cultivation 19] Python syntax introduction function decorator

[directory] 1, Introduction to decorators 1. What is a decorator 2. Why use ornaments 2, The realization of decorator 1. Realization of parameterless decorator 2. Realization of parametric decorator *Reserve knowledge: (please click the title below to read ~) 1,Namespace and scope 2,Function object + function nesting + closure func ...

Posted on Mon, 23 Mar 2020 02:51:31 -0700 by serious1234

python sequence list derivation real column

1. List derivation list derivation can form a new list very succinctly: only a simple expression can transform the elements. Format: [expression for variable in list] or [expression for variable in list if condition] Filter conditions are optional, depending on the actual application, leaving only expressions >>> list =[x*x for x in ...

Posted on Sun, 22 Mar 2020 07:53:38 -0700 by peachsnapple

Correct use of parser for Python crawler BS4 Library

The reason bs4 libraries can quickly locate the elements we want is because they can parse html files in one way, and different parsers have different effects.This is described below. bs4 Parser Selection The ultimate purpose of a web crawler is to filter the selected network information, the most important part can be said to be a parser.Th ...

Posted on Sat, 21 Mar 2020 20:09:49 -0700 by 696020

Numpy slice and index

Array axis a= np.arange(24).reshape((2, 3, 4)) print(a) print(a.ndim) #Dimension of array, i.e. axis print(a.shape) #Shape of array //Output: [[[ 0 1 2 3] [ 4 5 6 7] [ 8 9 10 11]] [[12 13 14 15] [16 17 18 19] [20 21 22 23]]] 3 (2, 3, 4) Get the elements of the array according to the index Subscript is an integer Subscript is ...

Posted on Sat, 21 Mar 2020 08:49:29 -0700 by pitn

Building basic synthesis of neural network

Building basic synthesis of neural network The following is based on the torch website and don't worry about python learning Basic steps Load data, training set, prediction set, dimension set Build a network, i.e. class Net Instantiation net Create optimizer Determine loss function Start training ...

Posted on Sat, 21 Mar 2020 07:59:11 -0700 by patriklko