自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(8)
  • 收藏
  • 关注

原创 前端开发必备网站,快速上手项目

前端新手如何快速上手前端项目,高效率完成期末/导师大项目

2022-01-29 13:27:47 1378

原创 时间序列使用KNNImputer插值,估计值一样

问题描述时间序列问题中经常遇到数据缺失的情况,线性插值、均值插值效果一般,因此考虑使用KNN插值,但是使用过程中发现每一列缺失的地方补齐的数都是一样的,应该就是将一列的平均数填充进去了。查阅资料后发现应该是插值时的neighbor不是指时间顺序(索引顺序)。修改前:from numpy import isnanfrom pandas import read_csvfrom sklearn.impute import KNNImputer# split into input and outp

2021-10-20 11:51:10 1355 1

原创 DataFrame插入一列数据

在最左侧插入一列数据将dataframe的时间列插入到imputation的第一列中# 第一个参数指插入的位置,0表示第一列# 第二个参数指这一列的名字# 第三个参数为插入的数据imputation.insert(0, '时间', dataframe["时间"])参考链接https://blog.csdn.net/qq_35318838/article/details/102720553...

2021-10-20 10:24:24 2748

原创 报错信息: TypeError: ufunc ‘isnan‘ not supported for the input types, and the inputs could not be safe

解决方法:将np.isnan改为pd.isna例子:import numpy as npimport pandas as pdprint('Missing: %d' % sum(np.isnan(X).flatten()))改为:print('Missing: %d' % sum(pd.isna(X).flatten()))参考:https://github.com/slundberg/shap/issues/677...

2021-10-19 20:09:38 1601

原创 Excel将所有空格填充内容

step1打开查找替换中的定位条件step2step3输入要填充的内容,比如0、?最最最后,按住Ctrl+Enter所有空格填充完成????

2021-10-19 16:44:23 1029

原创 Python 批量读取csv文件报错 UnicodeDecodeError: ‘utf-8‘ codec can‘t decode byte 0xb7 in position 2: invalid

Python 批量读取csv文件报错 UnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0xb7 in position 2: invalid start byte方法一:在read_csv函数中,加上encoding=‘gbk’。 df = pd.read_csv(file_path + '/' + filename[i], encoding='gbk')遇上某些文件会继续报错``UnicodeDecodeError: 'gbk

2021-10-14 19:30:40 1382 1

原创 使用matplotlib时出现segment fault错误

问题描述:使用matplotlib的plt.show()函数时,图像显示一秒就自动关闭,且报错:segment fault xxxxx。解决方案:加入以下两行代码import matplotlib as mplmpl.use('TkAgg')

2020-12-18 17:09:43 652 1

原创 Keras设置随机种子后无法得到相同结果的解决方法

操作系统:macOS。tensorflow版本:2.1.0keras版本:2.3.1问题描述在代码的最开始加上随机种子后(代码如下),每次模型运行结果还是有有些许不同。import numpy as npmy_seed = 666np.random.seed(my_seed)import random random.seed(my_seed)import tensorflow as tftf.random.set_seed(my_seed)解决方法模型compile的时.

2020-12-05 17:32:54 5675 15

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除