Python note 17 - object oriented - inheritance
Python notes
Object oriented - inheritance
I Introduction to inheritance
Inheritance Encyclopedia
Python object-oriented inheritance refers to the ownership relationship between multiple classes, that is, the subclass inherits all the properties and methods of the parent class by default. In Python, all classes inherit the ...
Posted by webhamster on Thu, 24 Feb 2022 12:34:57 +0100
Python Basics - Introduction to file mode, basic file operation process and detailed explanation of file operation mode (T mode)
Daily test
1,Three characteristics of elements in a set
Must be of immutable type
disorder
No repetition
2,What is the purpose of the collection?
Relational operation
duplicate removal
3,An example is given to illustrate the relational operation
intersection
s1 & s2
Union
s1 | s2
Differen ...
Posted by chrisv on Thu, 24 Feb 2022 12:11:41 +0100
Implementation of Python data structure
preface
Data structure is the way that computer stores and organizes data. A data structure is a collection of data elements that have one or more specific relationships with each other. In general, carefully selected data structures can bring higher operation or storage efficiency. Data structure is often related to efficient retrieval al ...
Posted by richo89 on Thu, 24 Feb 2022 12:04:23 +0100
[introduction to Python tutorial] basic data types of Python
The essence of a computer is calculation. Internally, it is the change of bits of 0 and 1, and externally, it is the change of data. So what data can computers process? In essence, data is stored in bytes. In terms of performance, they are integers, floating-point numbers, strings and so on. Python's basic data types are no more than this.
I ...
Posted by evanesq on Thu, 24 Feb 2022 09:18:43 +0100
Detailed summary of numpy usage: This article is enough to learn how to use numpy
Import numpy and view version
import numpy as np
np.__version__
'1.13.1'
What is numpy?
That is, Numeric Python. After expansion, python can support array and matrix types, including a large number of matrix and array calculation functions
Numpy framework is the basis of machine learning and data mining. pandas, scipy and matplotli ...
Posted by luckybob on Thu, 24 Feb 2022 08:43:55 +0100
The latest function of Cartopy 0.20 - don't panic if Cartopy can't be installed. There is a solution inside
Latest features of Cartopy 0.20
Background introduction
Cartopy is a map mapping package developed by the Met Office, which realizes most of the functions of Basemap and makes use of the powerful proj 4. NumPy and Shapely libraries, and a programming interface is built on Matplotlib to create and publish quality maps, and conduct geospatial d ...
Posted by january_9th on Thu, 24 Feb 2022 08:42:08 +0100
An article to understand unittest unit testing framework
For Python 2.1 and later versions, unittest is put into the python development package as a standard module.
01 use unittest to write test cases [at the end of the paper, a learning resource for automated testing is prepared for free sharing]
Rules:
import unittestTo create a test class, you must inherit unittest Testcase classCreate a test ...
Posted by datoshway on Thu, 24 Feb 2022 08:20:05 +0100
Python multithreaded programming - queue class of 10 Queue module
Catalogue
1. Usage scenario of queue class
2. queue class
2.1. queue class constructor
2.2 queue class attributes and methods
3. queue.Queue usage scenario
3.1 creating queues
3.2 use the methods of empty(), full(), qsize() to check the queue status
3.3 use put(), put_ The nowait () method is inserted into the queue
3.4 using get(), ge ...
Posted by chinni_77 on Thu, 24 Feb 2022 06:25:10 +0100
Introduction to Python zero Basics - 14 - tuples in Python
What is a tuple
Tuple is a data type similar to list and. They have basically the same characteristics, but they also have many differences.
Tuples, like lists, are queues that can store multiple data structuresThe same tuple is also an ordered set with repeatable elements
Definition and creation of tuples
In Python, tuple represents th ...
Posted by dslax27 on Thu, 24 Feb 2022 01:38:49 +0100
Introduction to Python zero Basics - 13 - list in Python
What is a list
List is a very important data type in Python. Why is it so important? Because in our actual development process, list is a data structure that is often used. It is widely used because it takes up less space and wastes less memory space.
A list is a queueIt is not only a collection of various data, but also a data structureA ...
Posted by dickey on Thu, 24 Feb 2022 00:05:31 +0100