
pandas
彩云的笔记
一起编程去!!
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
pandas 分组 取最大值
import numpy as np import pandas as pd import random import sys data = [[ random.randint(0,100), random.randint(0,1) ] for i in range(6)] data = pd.DataFrame(data,columns=['age','sex'],dtype=int) print('line=',str(sys._getframe().f_lineno), '\n',data) .原创 2022-03-02 11:06:28 · 2354 阅读 · 0 评论 -
sklearn FKold K折交叉验证 k-fold cross validation
C:\Users\pcl>conda activate torch38 (torch38) C:\Users\pcl>python Python 3.8.11 (default, Aug 6 2021, 09:57:55) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32 Type "help", "copyright", "credits" or "license" for more information. >>&g.原创 2021-12-01 09:59:33 · 420 阅读 · 0 评论 -
pandas 操作 加减行 对列数据进行修改 行遍历 从身份号码列提取出年月日
代码托管在github https://github.com/sofiathefirst/AIcode/tree/master/06pandasAPI csv 文件内容 name,se,id 李铭,1,44030119610508 林路陶,2,44020319620319 李琳,2,44030119880703 刘国平,1,44030119690319 import pandas as ...原创 2019-04-12 15:25:01 · 3424 阅读 · 0 评论 -
pandas 利用 正则表达式 从文本中提取数字
需要从text特征中提取形如 13.5/10 这样的字符串,再分别提取分子分母。 1)可以利用str.extract()方法。 2)利用正则表达式\d+\.?\d*\/\d+进行匹配 3)再利用.split()方法提取分子分母 id lable train/395017260.png 0 train/392533560.png 0 train/359114469.png 1 t...原创 2019-10-29 11:04:02 · 3610 阅读 · 0 评论 -
利用pandas做数据分析统计应用---统计二胎年龄差距
https://github.com/sofiathefirst/AIcode/tree/master/06pandasAPI 源码和数据文件见上述链接。 本文数据提取自深圳市2019年某次公租房申请公示名单,移除了非身份证的数据。 import pandas as pd import matplotlib.pyplot as plt ''' 粗略统计二胎年龄差距 se 为1 主申请人,...原创 2019-04-12 16:48:29 · 687 阅读 · 0 评论