- 博客(4)
- 收藏
- 关注
原创 pandas对具体列的内容通过正则表达式进行数据提取
使用前要确保该列的类型统一,str或者float格式,最好事先通过astype强制转换一下;df[‘new_col’] = df[‘selected_col’].str.extract(‘正则表达式’, expand = True)
2020-06-02 17:27:55
4404
1
原创 DB2 数据表单复制与备份
关于DB2数据库的表单的复制与备份前提:DB2 SQL与Mysql有些许差异步骤:复制制定表的格式: create table table_name as (select * from schema.selected_table_name) definition only把指定表的内容嵌入新创建的表中:insert into table_name (select * from schema.selected_table_name)...
2020-05-20 16:49:57
232
转载 python如何将变量名作为字符串输出
import inspectdef retrieve_name(var):“”"Gets the name of var. Does it from the out most frame inner-wards.:param var: variable to get name from.:return: string“”"for fi in reversed(inspect.stack()):names = [var_name for var_name, var_val in fi.fram
2020-05-13 17:51:59
2290
转载 Python实现并列排序
现在有一个有序的列表: [75,78,80,89,89,92,93]需要对他们按成绩进行排名。说到排名,一般大家会这样写:grade_list = [75, 78, 80, 89, 89, 92, 93]for index, grade in enumerate(grade_list, start=1):print(f’成绩:{grade},排名第:{index}’)运行效果如下图所示:...
2020-05-13 17:48:21
2182
1
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人