摘要:
pandas.DataFrame 进行新增列操作的五种方法:insert、reindex、loc、obj[‘col’]、concat。 data: a b c 0 1 2 3 1 4 5 6 2 7 8 9 一、insert 方法 使用 pandas 的 insert 方法,第一个参数指定插入列的位 阅读全文
摘要:
1.双y轴绘制 关键函数:twinx() # -*- coding: utf-8 -*- import numpy as np import matplotlib.pyplot as plt from matplotlib import rc rc('mathtext', default='regu 阅读全文
摘要:
####UI文件 # -*- coding: utf-8 -*- from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale, QMetaObject, QObject, QPoint, QRect, QSize, 阅读全文
摘要:
import matplotlib.pyplot as plt from scipy.optimize import curve_fit import numpy as np def func(x, a, b, c): # 拟合的方程 return a * np.exp(-b * x) + c de 阅读全文
摘要:
1.数据 x = np.random.uniform(-5, 5 ,size=100) X = x.reshape(-1, 1) y = x**2 + x +2 + np.random.normal(0, 1, size = 100) 2. 拟合 ploy = PolynomialFeatures( 阅读全文
摘要:
使用sklearn.preprocessing.PolynomialFeatures来进行特征的构造。 它是使用多项式的方法来进行的,如果有a,b两个特征, 那么它的2次多项式为($1,a,b,a^2,ab, b^2$)。 那么它的3次多项式为($1,a,b,a^2,ab, b^2, a^3, a^ 阅读全文
摘要:
QFileDialog有四项功能 1.打开文件夹 getExistingDirectory() def openfolder(self): self.folder = QFileDialog.getExistingDirectory(self) print(self.folder) 2.打开特定文件 阅读全文
摘要:
在Qt Designer中先建立UI,转成py文件,文件名为:plot_ui.py # -*- coding: utf-8 -*- ################################################################################ ## 阅读全文
摘要:
from PySide6.QtWidgets import QApplication, QMainWindow,QWidget import pyqtgraph as pg import sys from PySide6 import QtCore,QtWidgets import numpy as 阅读全文
摘要:
示例1 from PySide6.QtWidgets import QWidget,QApplication from PySide6 import QtWidgets ,QtCore import pyqtgraph as pg import sys import numpy as np clas 阅读全文