2021年10月的文章

第2页

多元线性回归

阅读(498)

import pandas as pd from sklearn import model_selection import statsmodels.api as sm Profit = pd.read_excel('Predict to ...

Python直接替换列表中元素的4种方法

阅读(690)

把列表中的元素直接更改、替换。 例子:表面列表aaa中的元素‘黑色’替换成‘黄色’。 aaa=[‘黑色’,’红色’,’白色’,’黑色’] 第一种...

Python判断数据或数据结构类型的方法

阅读(906)

代码中要实现变量是否为某一数据或数据结构类型的判断,可以使用以下几种方式: type(a).__name__ == 'str' type(b).__name__ == 'list' type(a) is str type(b) is lis...