随笔分类 -  pandas

摘要:制定编码: utf_8 --》utf_8_sig 修改后代码code: df.to_csv('data3.csv',index=False,encoding='utf_8_sig') 阅读全文
posted @ 2023-01-26 21:24 半个程序猿Cohen_Lee 阅读(29) 评论(0) 推荐(0) 编辑
摘要:import pandas as pd import numpy as np import os # pip install html5lib -i https://pypi.tuna.tsinghua.edu.cn/simple/ #创建DataFrame np.random.seed(10) # 阅读全文
posted @ 2022-07-25 09:50 半个程序猿Cohen_Lee 阅读(343) 评论(0) 推荐(0) 编辑
摘要:https://blog.csdn.net/m0_46412065/article/details/107324827 Series对象和DataFrame的列数据提供了cat、dt、str三种属性接口(accessors),分别对应分类数据、日期时间数据和字符串数据,通过这几个接口可以快速实现特定 阅读全文
posted @ 2022-07-18 22:35 半个程序猿Cohen_Lee 阅读(161) 评论(0) 推荐(0) 编辑
摘要:引用链接 :https://pandas.pydata.org/pandas-docs/version/0.23.4/generated/pandas.cut.html 用途 pandas.cut用来把一组数据分割成离散的区间。比如有一组年龄数据,可以使用pandas.cut将年龄数据分割成不同的年 阅读全文
posted @ 2022-07-04 15:20 半个程序猿Cohen_Lee 阅读(397) 评论(0) 推荐(0) 编辑
摘要:describe() print('profile连续属性:','\n',df.describe()) print('profile离散属性:','\n',df.describe(include='object')) 函数自动计算的字段有count(非空值数)、unique(唯一值数)、top(频数 阅读全文
posted @ 2022-07-04 15:15 半个程序猿Cohen_Lee 阅读(30) 评论(0) 推荐(0) 编辑
摘要:pandas所有方法学习 https://cankaoshouce.com/pandas-dataframes/pandas-ref-dataframe.html 阅读全文
posted @ 2022-06-30 11:46 半个程序猿Cohen_Lee 阅读(122) 评论(0) 推荐(0) 编辑
摘要:import numpy as np import os np.set_printoptions(threshold=np.inf) #显示所有列 pd.set_option('display.max_columns', None) #显示所有行 pd.set_option('display.max 阅读全文
posted @ 2022-03-10 17:49 半个程序猿Cohen_Lee 阅读(170) 评论(0) 推荐(0) 编辑
摘要:Python datetime.replace()方法 (Python datetime.replace() Method) datetime.replace() method is used to manipulate objects of datetime class of module dat 阅读全文
posted @ 2021-04-07 14:31 半个程序猿Cohen_Lee 阅读(1510) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示