上一页 1 2 3 4 5 6 7 8 9 ··· 23 下一页
摘要: 1. 使用QUiloader加载 from PySide6.QtUiTools import QUiLoader from PySide6.QtWidgets import QApplication,QWidget import sys class ui_call(QWidget): def __i 阅读全文
posted @ 2024-07-16 09:44 华小电 阅读(284) 评论(0) 推荐(0)
摘要: A string is happy if every three consecutive characters are distinct. def check_if_string_is_happy1(input_str): check = [] for a,b,c in zip(input_str, 阅读全文
posted @ 2024-07-14 10:11 华小电 阅读(18) 评论(0) 推荐(0)
摘要: isinstance() 函数来判断一个对象是否是一个已知的类型,类似 type()。 isinstance() 与 type() 区别: type() 不会认为子类是一种父类类型,不考虑继承关系。 isinstance() 会认为子类是一种父类类型,考虑继承关系。 如果要判断两个类型是否相同推荐使 阅读全文
posted @ 2024-07-14 09:13 华小电 阅读(72) 评论(0) 推荐(0)
摘要: Themes from qt_material import list_themes print(list_themes()) ['dark_amber.xml', 'dark_blue.xml', 'dark_cyan.xml', 'dark_lightgreen.xml', 'dark_medi 阅读全文
posted @ 2024-07-10 10:48 华小电 阅读(95) 评论(0) 推荐(0)
摘要: 在Matplotlib中,如果你有一个时间序列数据,并且x轴上的时间标签太多导致它们重叠或难以阅读,你可以通过几种方法来减少显示的标签数量或调整它们的格式。以下是一些常用的方法: 使用plt.xticks()手动设置x轴标签: 你可以通过plt.xticks()手动设置你想显示的x轴标签的位置和文本 阅读全文
posted @ 2024-04-27 15:16 华小电 阅读(860) 评论(0) 推荐(0)
摘要: groupby是Pandas用于根据给定列中的不同值对数据点(即行)进行分组,分组后的数据可以计算生成组的聚合值。 agg 聚合操作 聚合操作是groupby后非常常见的操作,聚合操作可以用来求和、均值、最大值、最小值等. 函数 用途 函数 用途 min 最小值 max 最大值 sum 求和 mea 阅读全文
posted @ 2024-04-05 17:25 华小电 阅读(193) 评论(0) 推荐(0)
摘要: 全量梯度下降 import numpy as np # 创建数据集X,y np.random.seed(1) X = np.random.rand(100, 1) y = 4 + 3*X + np.random.randn(100, 1) X_b = np.c_[np.ones((100, 1)), 阅读全文
posted @ 2024-04-05 16:57 华小电 阅读(82) 评论(0) 推荐(0)
摘要: import re content = [] srt = [] with open('input.vtt','r') as open_file: for lines in open_file: lines = lines.replace('WEBVTT','') #删除WEBVTT # vtt文件中 阅读全文
posted @ 2024-03-21 21:56 华小电 阅读(334) 评论(0) 推荐(0)
摘要: In Python, a decorator is a design pattern that allows you to modify the functionality of a function by wrapping it in another function. The outer fun 阅读全文
posted @ 2024-03-16 20:43 华小电 阅读(28) 评论(0) 推荐(0)
摘要: def counter(list): c_dict = {} for i in list: if i in c_dict: c_dict[i] += 1 else: c_dict[i] = 1 return c_dict def entropy(x): counts = counter(x) #每个 阅读全文
posted @ 2024-03-09 10:08 华小电 阅读(169) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 7 8 9 ··· 23 下一页