python数据处理
python数据处理
lee_yr
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
categorical类型
pandas中的categorical类型对象属性生成方法将dataframe的一列转换为categorical对象其他序列直接生成利用分类编码数据生成使用Categorical对象进行计算对象属性categoriescodes生成方法将dataframe的一列转换为categorical对象df[name] = df[name].astype('category')其他序列直接生成pd.Categorical(list)利用分类编码数据生成categories = ['a',原创 2021-12-24 15:35:34 · 591 阅读 · 0 评论 -
pandas 数据处理用法
pandas 数据处理用法处理缺失值数据转换删除重复值数据转换数据替代离散化和分箱数据规整处理缺失值dropna()fillna()isnull()notnull()数据转换删除重复值df.duplicated()df.drop_duplicates()数据转换Series.map(arg, na_action=None)DataFrame.apply(func, axis=0, raw=False, result_type=None, args=(), **kwds)Data原创 2021-04-16 14:38:44 · 148 阅读 · 0 评论 -
pandas time
pandas timetime类型Timestamp类timedelta类根据时间来重采样time类型Timestamp类str to timestamppd.to_datetime(arg.format=’%Y%m%d%H%M%S’,errors)pd.DatetimeIndex:和上面一样不过把时间设为索引#Errors =raise 显示错误信息 coerce 遇到错误设为nan ignore转换能转换的值timestamp to strtimestamp.strftim原创 2021-04-16 10:59:37 · 564 阅读 · 0 评论 -
numpy的函数用法以及注意事项
numpy的函数用法以及注意事项函数用法生成函数强制类型转换where线性代数注意事项函数用法生成函数arraynarrayone 根据给定形状和数据类型生成全1的数组numpy.ones(shape, dtype=None, order='C')[source]ones_like 根据所给的数组生成形状一样的全1数组numpy.ones_like(a, dtype=None, order='K', subok=True)zeroszeros_likeemptyempt原创 2021-04-16 11:00:31 · 229 阅读 · 0 评论 -
pandas 常见用法
pandas 常见用法数据合并mergejoinconcatappend标签set_indexreset_index聚合groupby其他用法dropto_csv数据合并mergepandas.merge(left, right, how='inner', on=None, left_on=None, right_on=None, left_index=False, right_index=False, sort=False, suffixes=('_x', '_y'), copy=True, ind原创 2021-04-16 11:24:21 · 196 阅读 · 0 评论
分享