1.DataFrame.sub(other, axis='columns', level=None, fill_value=None)(dataframe相减)
Subtraction of dataframe and other, element-wise (binary operator sub).
Equivalent to dataframe - other, but with support to substitute a fill_value for missing data in one of the inputs.
2.DataFrame.
apply
(func, axis=0, broadcast=False, raw=False, reduce=None, args=(), **kwds)
Applies function along input axis of DataFrame.
Objects passed to functions are Series objects having index either the DataFrame’s index (axis=0) or the columns (axis=1).
Return type depends on whether passed function aggregates, or the reduce argument if the DataFrame is empty.
3.DataFrame.sort_index(axis=0, by=None, ascending=True, inplace=False, kind='quicksort')
Sort DataFrame either by labels (along either axis) or by the values in a column
4.DataFrame.
sort_values
(by, axis=0, ascending=True, inplace=False, kind='quicksort', na_position='last')
Sort by the values along either axis5.DataFrame.cumsum(axis=None, dtype=None, out=None, skipna=True, **kwargs)
Return cumulative sum over requested axis.6.DataFrame.
dropna
(axis=0, how='any', thresh=None, subset=None, inplace=False)
Return object with labels on given axis omitted where alternately any or all of the data are missing
7.DataFrame.map
Like values in a Series, axis labels can be similarly transformed by a function or mapping of some form to produce new, differently labeled objects. You can also modify the axes in-place without creating a new data structure. Here’s a simple example:
7.DataFrame.
sample
(n=None, frac=None, replace=False, weights=None, random_state=None, axis=None)
Returns a random sample of items from an axis of object.
这里用df[['data1']].join(dummies)相当于直接删除了key这一列,把想要的直接加在后面了。
9.多维DataFrame的拆解
10.DataFrame.
join
(
other,
on=None,
how='left',
lsuffix='',
rsuffix='',
sort=False
)
Join columns with other DataFrame either on index or on a key column. Efficiently Join multiple DataFrame objects by index at once by passing a list.
11.groupby中使用函数