摘要: 博客目录 python基础部分 数据类型 字符串 列表 元组 字典 集合 其他 文件操作 编码 文件编辑 函数 初识函数 函数进阶 装饰器函数 迭代器和生成器 内置函数和匿名函数 递归函数 常用模块 常用模块 模块和包 面向对象 初识面向对象 面向对象进阶 网络编程 网络编程 并发编程 操作系统介绍 阅读全文
posted @ 2019-08-29 11:35 supreme_me 阅读(200) 评论(0) 推荐(0)
摘要: a = '123456789'print(a.split('4')) #split()把字符串变成列表 ['123', '56789']b = a.split('4')print(''.join(b)) #把列表变成字符串 12356789a = ['A', 'C', 'T', 'G']kmers 阅读全文
posted @ 2022-04-28 15:38 supreme_me 阅读(46) 评论(0) 推荐(0)
摘要: import random a = random.sample(range(4), 2) #在range(4)区间随机生成4个不重复的数字 print(type(a),a) #<class 'list'> [2, 0] b = random.sample(range(4), 2)[0] print( 阅读全文
posted @ 2022-04-28 12:59 supreme_me 阅读(30) 评论(0) 推荐(0)
摘要: matplotlib.markers 处理标记的函数;使用的标记物的功能 plot,scatter和 errorbar。 所有可能的标记都在这里定义: import matplotlib.pyplot as pltimport numpy as np# x = np.floor(10*np.rand 阅读全文
posted @ 2021-07-24 14:15 supreme_me 阅读(148) 评论(0) 推荐(0)
摘要: import matplotlib.pyplot as plt import numpy as np fig, ax = plt.subplots() # Create a figure containing a single axes. plt.plot([1, 2, 3, 4], [1, 4, 阅读全文
posted @ 2021-07-23 15:36 supreme_me 阅读(61) 评论(0) 推荐(0)
摘要: from matplotlib.figure import SubplotParams SubplotParams(left=None, bottom=None, right=None, top=None, wspace=None, hspace=None) 五个参数:left:浮动子图左边缘的位置 阅读全文
posted @ 2021-07-23 15:06 supreme_me 阅读(120) 评论(0) 推荐(0)
摘要: from sklearn.linear_model import LinearRegression #导入LinearRegression模块(普通最小二乘线性回归) #LinearRegression 拟合线性模型,系数 w = (w1, …, wp) 最小化观察目标之间的残差平方和 数据集 #以 阅读全文
posted @ 2021-07-22 20:39 supreme_me 阅读(1285) 评论(0) 推荐(0)
摘要: from sklearn.preprocessing import PolynomialFeatures #导入PolynomialFeatures模块:生成多项式和交互特征。 #生成由所有多项式组合组成的新特征矩阵 度数小于或等于指定度数的要素。#例如,如果输入样本是二维的并且形式为 [a, b] 阅读全文
posted @ 2021-07-22 16:51 supreme_me 阅读(1251) 评论(0) 推荐(0)
摘要: ''' NumPy 是 Python 科学计算的基础包。 它是一个提供多维数组对象的 Python 库, 各种派生对象(例如掩码数组和矩阵),以及 用于对数组进行快速操作的各种例程,包括 数学、逻辑、形状操作、排序、选择、I/O、 离散傅立叶变换,基本线性代数,基本统计 操作、随机模拟等等。 Num 阅读全文
posted @ 2021-07-12 23:48 supreme_me 阅读(438) 评论(0) 推荐(0)
摘要: with open('earpa001.txt',mode='r',encoding='utf-8') as f,\ open('earpa001_count.txt',mode='w',encoding='utf-8') as f1: d = {} content = f.readlines() 阅读全文
posted @ 2020-01-21 10:49 supreme_me 阅读(150) 评论(0) 推荐(0)
摘要: 将八进制数字 423.5176 转换成十进制: 423.5176 = 4×82 + 2×81 + 3×80 + 5×8-1 + 1×8-2 + 7×8-3 + 6×8-4 = 275.65576171875(十进制) 小数部分和整数部分相反,要从左往右看,第1位的位权为 8-1=1/8,第2位的位权 阅读全文
posted @ 2019-09-23 21:35 supreme_me 阅读(795) 评论(1) 推荐(1)