Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 1866a26

Browse files
authoredFeb 2, 2024
docs: Fix the DataFrame.apply code sample (#366)
Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly: - [ ] Make sure to open an issue as a [bug/issue](https://togithub.com/googleapis/python-bigquery-dataframes/issues/new/choose) before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea - [ ] Ensure the tests and linter pass - [ ] Code coverage does not decrease (if any source code was changed) - [ ] Appropriate docs were updated (if necessary) Fixes #<issue_number_goes_here> 🦕
1 parent 04ce3be commit 1866a26

File tree

1 file changed

+8
-8
lines changed
  • third_party/bigframes_vendored/pandas/core

1 file changed

+8
-8
lines changed
 

‎third_party/bigframes_vendored/pandas/core/frame.py

+8-8
Original file line numberDiff line numberDiff line change
@@ -3296,19 +3296,19 @@ def apply(self, func, *, args=(), **kwargs):
32963296
32973297
>>> df = bpd.DataFrame({'col1': [1, 2], 'col2': [3, 4]})
32983298
>>> df
3299-
col1 col2
3300-
0 1 3
3301-
1 2 4
3299+
col1 col2
3300+
0 1 3
3301+
1 2 4
33023302
<BLANKLINE>
33033303
[2 rows x 2 columns]
33043304
3305-
>>> def sqaure(x):
3305+
>>> def square(x):
33063306
... return x * x
3307-
>>> df1 = df.apply(sqaure)
3308-
>>> df
3307+
3308+
>>> df.apply(square)
33093309
col1 col2
3310-
0 1 3
3311-
1 2 4
3310+
0 1 9
3311+
1 4 16
33123312
<BLANKLINE>
33133313
[2 rows x 2 columns]
33143314

0 commit comments

Comments
 (0)
Failed to load comments.