pandas
文章平均质量分 51
一口气吃五碗饭的阿霖
这个作者很懒,什么都没留下…
展开
-
python Geatpy包的实现进化算法多线程多进程的单目标優化 优化模型參數
深度模型的超参数,由于模型计算量大,计算时间长,往往会采用运气调参,或者随机搜索调参来进行。今天打算记录一下使用Geatpy包对超参数进行进化算法的参数优化实现。讓我們先看看文檔http://geatpy.com/wp-content/plugins/pdfjs-viewer-shortcode/pdfjs/web/viewer.php?file=http%3A%2F%2Fgeatpy.com%2Fwp-content%2Fuploads%2F2020%2F10%2F4.%E8%BF%9B%E5%8C%原创 2021-05-31 12:02:41 · 1991 阅读 · 1 评论 -
pandas 对数据进行逻辑上的分割操作后 将分割出来的数据集行序列重新整理成0-1
当对Dataframe 进行过切割操作之后生成的子Dataframe 中的航序列会因此改变这个时候就需要重新将正序的行序列写入 DataframedataList = []for i in range(5): li = data.loc[ [line for line in range(i,data.shape[0],5)],]#对数据进行交替式分割 # 分割完之后的li 不再是 【0,1,2,3,4,5】 而是 【0,4,9,14】 renameDict = {} # 定原创 2021-05-24 17:58:16 · 235 阅读 · 0 评论 -
pandas 对标签使用unique()函数进行 label编码报错 ValueError:nan is not in list
错误信息截图后面发现 可能是因为unique() 取唯一值的时候,由于该列的数据类型是 int64的类型 所以直接当做这个元素的唯一值了 吼吼吼解决办法是使用 .apply(str) 转成字符串v['A'] = v['A'].apply(str)...原创 2021-04-26 17:43:57 · 1218 阅读 · 0 评论 -
pandas 將數據字符裝換成時間搓
chillerData['Date_Time'] = chillerData['Date_Time'].apply(lambda x:time.mktime(time.strptime(x,'%Y-%m-%d %H:%M:%S')))time.strptime(x,’%Y-%m-%d %H:%M:%S’)函數原型 time.strptime(string[, format])返回:struct_timetime.mktime(time.struct_time)返回:時間搓pandas.appl原创 2021-04-01 11:09:35 · 38 阅读 · 0 评论 -
python pandas包 读取和修改数据文件 常用接口记录
因为经常用到pandas处理一些数据,所以在这里记录一下pandas 读取文件原创 2021-03-21 22:30:57 · 350 阅读 · 0 评论