Python Pandas General functions(静态方法)

数据框操作

方法描述
melt(frame[, id_vars, value_vars, var_name, …])Unpivot a DataFrame from wide format to long format, optionally leaving identifier variables set.
pivot(data[, index, columns, values])Return reshaped DataFrame organized by given index / column values.
pivot_table(data[, values, index, columns, …])Create a spreadsheet-style pivot table as a DataFrame.
crosstab(index, columns[, values, rownames, …])Compute a simple cross tabulation of two (or more) factors.
cut(x, bins[, right, labels, retbins, …])Bin values into discrete intervals.
qcut(x, q[, labels, retbins, precision, …])Quantile-based discretization function.
merge(left, right[, how, on, left_on, …])sql join操作
merge_ordered(left, right[, on, left_on, …])Perform merge with optional filling/interpolation designed for ordered data like time series data.
merge_asof(left, right[, on, left_on, …])Perform an asof merge.
concat(objs[, axis, join, join_axes, …])Concatenate pandas objects along a particular axis with optional set logic along the other axes.
get_dummies(data[, prefix, prefix_sep, …])Convert categorical variable into dummy/indicator variables.
factorize(values[, sort, order, …])Encode the object as an enumerated type or categorical variable.
unique(values)去重,一般都用value_counts替代
wide_to_long(df, stubnames, i, j[, sep, suffix])Wide panel to long format.

缺失值操作

方法描述
isna(obj)Detect missing values for an array-like object.
isnull(obj)Detect missing values for an array-like object.
notna(obj)Detect non-missing values for an array-like object.
notnull(obj)Detect non-missing values for an array-like object.

类型转换操作

方法描述
to_numeric(arg[, errors, downcast])Convert argument to a numeric type.
to_datetime(arg[, errors, dayfirst, …])Convert argument to datetime.
to_timedelta(arg[, unit, box, errors])Convert argument to timedelta.

时间类型

方法描述
date_range([start, end, periods, freq, tz, …])Return a fixed frequency DatetimeIndex.
bdate_range([start, end, periods, freq, tz, …])Return a fixed frequency DatetimeIndex, with business day as the default frequency
period_range([start, end, periods, freq, name])Return a fixed frequency PeriodIndex, with day (calendar) as the default frequency
timedelta_range([start, end, periods, freq, …])Return a fixed frequency TimedeltaIndex, with day as the default frequency
infer_freq(index[, warn])Infer the most likely frequency given the input index.

其他

不常用去官网看

参考文献:
https://pandas.pydata.org/pandas-docs/stable/reference/general_functions.html

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值