会员
周边
新闻
博问
闪存
众包
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
笑而不语心自闲
博客园
首页
新随笔
联系
订阅
管理
上一页
1
2
3
4
5
6
7
···
10
下一页
2024年5月26日
python pandas DataFrame-A 更新 DataFrame-B中指定列相同的数据
摘要: 假设现在有两个dataframe,分别是A和B,它们有相同的列text和label。现在想使用B的label来更新A的label,基于它们共同的text。 import pandas as pd # Sample DataFrames A and B data_A = {'text': ['text
阅读全文
posted @ 2024-05-26 10:51 笑而不语心自闲
阅读(187)
评论(0)
推荐(0)
2024年5月24日
pandas 设置二级索引
摘要: 如果df数据已经设置了索引,现在想增加二级索引,可以用下面的方法 df.reset_index(inplace=True) df.set_index(['index1', 'index2'], inplace=True) # 可以转换内外标签 df.swaplevel()
阅读全文
posted @ 2024-05-24 22:11 笑而不语心自闲
阅读(60)
评论(0)
推荐(0)
pandas读取excel乱码报错
摘要: 如题,pandas读取excel时出现"No codepage record..."错误 解决方法: # 用xlrd打开excel文件,指定encoding_override为gbk或者其它编码格式 wb = xlrd.open_workbook_xls(file_name, encoding_ov
阅读全文
posted @ 2024-05-24 22:06 笑而不语心自闲
阅读(223)
评论(0)
推荐(0)
2024年5月3日
DataFrame删除复合索引
摘要: index2 和 reasons_id 数据显示重复,可以删除列'reasons_id',如果强迫症必须删除索引,可以用下面的方法 # reasons_id total_price ... total_price_统计 people_num_统计 # index1 index2 ... # A 变座
阅读全文
posted @ 2024-05-03 18:55 笑而不语心自闲
阅读(31)
评论(0)
推荐(0)
pd.merge函数合并DataFrame 保留原index
摘要: C=pd.merge(A,B),merge之后C的行数并不会变。但是A的index丢失了,因为merge之后index是重排的。 解决办法: 方法1: #可以先把A的index保存一下,A、B中含有"col"列 A_index =A.index C=pd.merge(A,B,on="col",how
阅读全文
posted @ 2024-05-03 18:24 笑而不语心自闲
阅读(427)
评论(0)
推荐(0)
2024年4月5日
PyCharm关闭 强制换行视觉参考线
摘要:
阅读全文
posted @ 2024-04-05 22:09 笑而不语心自闲
阅读(90)
评论(0)
推荐(0)
2024年3月6日
dbeaver 如何去除 项目通用密码(project general master password)
摘要: 打开dbeaver后,提示(project general master password) 清除方法: 文件-->Project security
阅读全文
posted @ 2024-03-06 21:12 笑而不语心自闲
阅读(1172)
评论(0)
推荐(2)
2024年2月8日
element-plus 2.4.1版本 el-tree踩坑
摘要: element-plus 2.4.1版本 el-tree 设置属性props中的label时,无法指定,例如 <el-tree :data="datas.tree_data" show-checkbox node-key="menu_id" :props="{ // label: function(
阅读全文
posted @ 2024-02-08 17:15 笑而不语心自闲
阅读(344)
评论(0)
推荐(0)
2024年2月3日
<template #default="{ node,data }">
摘要: <template> <el-dialog v-model="dialogVisible" :title="title" :width="width" :close-on-click-modal="false" :close-on-press-escape="false" @close="dialo
阅读全文
posted @ 2024-02-03 17:38 笑而不语心自闲
阅读(613)
评论(0)
推荐(0)
2024年1月28日
动态绑定组件时 v-model:value 的使用
摘要: // require import components const files = require.context("@/components/control", true, /\index.vue$/); // console.log('files:', files.keys()) //file
阅读全文
posted @ 2024-01-28 23:29 笑而不语心自闲
阅读(634)
评论(0)
推荐(0)
上一页
1
2
3
4
5
6
7
···
10
下一页
公告