用法介绍

transform用法

pandas.Series.transform 

Call func on self producing a Series with transformed values.

Produced Series will have same axis length as self.

Parameters
funcfunction, str, list or dict
Function to use for transforming the data. If a function, must either work when passed a Series or when passed to Series.apply.

Accepted combinations are:

function

string function name

list of functions and/or function names, e.g. [np.exp. 'sqrt']

dict of axis labels -> functions, function names or list of such.

axis{0 or ‘index’}
Parameter needed for compatibility with DataFrame.

*args
Positional arguments to pass to func.

**kwargs
Keyword arguments to pass to func.

Returns
Series
A Series that must have the same length as self.

Raises
ValueErrorIf the returned Series has a different length than self.
Series.transform(self, func, axis=0, *args, **kwargs)

相关文章:

  • 2022-12-23
  • 2021-09-03
  • 2022-12-23
  • 2021-11-03
  • 2021-04-25
  • 2021-07-04
  • 2021-09-06
  • 2021-07-05
猜你喜欢
  • 2021-05-16
  • 2022-12-23
  • 2022-12-23
  • 2021-06-08
  • 2022-12-23
  • 2021-06-10
  • 2022-12-23
相关资源
相似解决方案