statsmodels learning -- fitting data using multiple regression

1. Multiple regression fitting code First, construct an arbitrary dataframe: import pandas as pd import numpy as np import statsmodels.api as sm df = pd.DataFrame(data=np.random.randint(0, 20, size=(100, 4)), columns=['x1', 'x2', 'x3', 'y']) # Start splitting x and y X = df.loc[:, 'x1':'x3'] Y = df['y'] The dataframe ...

Posted by AliasXNeo on Sun, 30 Jan 2022 19:07:09 +0100

Dare to skip class. The teacher made a random roll call system with Python. Do you still escape?

I will give you two opportunities to skip class. You must know what is more important than class. For example, the Jianjia outside the building, or the moon tonight. -- Mr. Zhou Heng Introduction: In college, many teachers will call the roll before or after class. Sometimes they will draw some students to answer questions in class. Today, we ...

Posted by algarve4me on Sun, 30 Jan 2022 17:12:31 +0100

PyQt5 basic learning

pyqt5- Foundation PyQt5 is a set of adhesives from Digia's Qt5 application framework and python. Support Python 2 X and python 3 X version. PyQt5 implements functions in the form of a set of Python modules. It contains more than 620 classes, 600 methods and functions. It is a multi platform tool suite that can run on all major operating syste ...

Posted by darknessmdk on Sun, 30 Jan 2022 14:56:22 +0100

[event scheduler & thread] learning notes

event scheduler Event scheduler: as the name suggests, it is mainly used to schedule events. In fact, for me, this is more like a timer. Too many explanations are not given here (the content itself is not complex, and no official explanation has been found for the time being. I'm afraid it will harm people's children). Directly on the code. S ...

Posted by rigbyae on Sun, 30 Jan 2022 14:11:40 +0100

Run yolov5 on CPU (detailed steps + suitable for getting started)

catalogue 1, Create a new environment 2, Import Python Library 3, New project 4, Testing 5, Prepare dataset 6, Modify profile 7, Training 8, Example test 9, Concluding remarks By default, Anaconda and pycham are installed and everyone knows the basic operation. 1, Create a new environment Open the cmd window, enter conda create -n ...

Posted by jcbones on Sun, 30 Jan 2022 13:33:19 +0100

Pandas advanced tutorial: merging of Dataframe

brief introduction Pandas provides many powerful functions of merging Series and Dataframe, which can facilitate data analysis. This article will explain in detail how to use pandas to merge Series and Dataframe. Using concat The most commonly used method is DF concat. Let's look at the following: pd.concat(objs, axis=0, join='outer', i ...

Posted by Tsukasa on Sun, 30 Jan 2022 12:54:23 +0100

[Yugong series] January 2022 MinIO file storage server - object operation (Python version)

What is an object? Object is the basic unit for MinIO to store Data, also known as MinIO file. The object is composed of Object Meta, user Data and file name (Key). The object is identified by a unique Key inside the storage space. Object Meta information is a set of Key value pairs, which represents some attributes of the object, such a ...

Posted by wolfrock on Sun, 30 Jan 2022 12:10:02 +0100

[interview] python modifier for interview questions

1) What is a python decorator? Python decorator is a very powerful function, an excellent design pattern, which abstracts the repeated content and gives a function other functions without changing the function itself. Simply put, modifiers are functions that modify the functions of other functions.It makes the code extremely concise and ...

Posted by flash_78 on Sun, 30 Jan 2022 07:21:58 +0100

knn(k-nearest neighbor algorithm) -- python

catalogue 1. Basic definitions 2. Algorithm principle 2.1 advantages and disadvantages of the algorithm 2.2 algorithm parameters 2.3 variants 3. Distance formula in the algorithm 4. Case realization 4.1 import related libraries 4.2 reading data 4.3 read variable name 4.4 define X,Y data 4.5 separate training set and test set 4.6 ca ...

Posted by marcusb on Sun, 30 Jan 2022 07:06:35 +0100

Opencv Python Fourier transform and inverse transform

Opencv Python Fourier transform 1, Image Fourier transform Principle of two-dimensional Fourier transform Gray image is composed of two-dimensional discrete points. Two dimensional discrete Fourier transform (2ddft) is often used in image processing. The spectrum of an image is obtained after Fourier transform. The frequency level in the spe ...

Posted by DonnieDarko on Sun, 30 Jan 2022 06:12:57 +0100