Browse files

DOC: improve DataFrame.apply docstring, close #977

  • Loading branch information...
wesm committed Apr 2, 2012
1 parent 06dba79 commit 9388d96f1a53df2b50ae21e2b1aaee84c45a106f
Showing with 5 additions and 5 deletions.
  1. +5 −5 pandas/core/
@@ -2981,15 +2981,16 @@ def apply(self, func, axis=0, broadcast=False, raw=False,
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). Returns either a DataFrame (if the
- function produces another Series) or a Series indexed on either the
- index or columns if the function produces an aggregated value.
+ (axis=0) or the columns (axis=1). Return type depends on whether passed
+ function aggregates
func : function
Function to apply to each column
axis : {0, 1}
+ 0 : apply function to each column
+ 1 : apply function to each row
broadcast : bool, default False
For aggregation functions, return object of same size with values
@@ -3011,8 +3012,7 @@ def apply(self, func, axis=0, broadcast=False, raw=False,
- Function passed should not have side effects. If the result is a
- Series, it should have the same index
+ To apply a function elementwise, use applymap

0 comments on commit 9388d96

Please sign in to comment.