-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
DOC: Removed Notes from DataFrame.applymap #31695
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 6 commits
190faac
8b53292
4227ba4
cd7a881
4a44260
f95e6c5
0ec76ed
eb4b4db
a6ea389
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# -*- mode: python ; coding: utf-8 -*- | ||
|
||
block_cipher = None | ||
|
||
|
||
a = Analysis(['make.py'], | ||
pathex=['/home/rakshit/Desktop/python_practice/pandas/doc'], | ||
binaries=[], | ||
datas=[], | ||
hiddenimports=[], | ||
hookspath=[], | ||
runtime_hooks=[], | ||
excludes=[], | ||
win_no_prefer_redirects=False, | ||
win_private_assemblies=False, | ||
cipher=block_cipher, | ||
noarchive=False) | ||
pyz = PYZ(a.pure, a.zipped_data, | ||
cipher=block_cipher) | ||
exe = EXE(pyz, | ||
a.scripts, | ||
a.binaries, | ||
a.zipfiles, | ||
a.datas, | ||
[], | ||
name='make', | ||
debug=False, | ||
bootloader_ignore_signals=False, | ||
strip=False, | ||
upx=True, | ||
upx_exclude=[], | ||
runtime_tmpdir=None, | ||
console=True ) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# -*- mode: python ; coding: utf-8 -*- | ||
|
||
block_cipher = None | ||
|
||
|
||
a = Analysis(['myScript.py'], | ||
pathex=['/home/rakshit/Desktop/python_practice/pandas/doc'], | ||
binaries=[], | ||
datas=[], | ||
hiddenimports=['pandas._libs.tslibs.timedeltas'], | ||
hookspath=[], | ||
runtime_hooks=[], | ||
excludes=[], | ||
win_no_prefer_redirects=False, | ||
win_private_assemblies=False, | ||
cipher=block_cipher, | ||
noarchive=False) | ||
pyz = PYZ(a.pure, a.zipped_data, | ||
cipher=block_cipher) | ||
exe = EXE(pyz, | ||
a.scripts, | ||
a.binaries, | ||
a.zipfiles, | ||
a.datas, | ||
[], | ||
name='myScript', | ||
debug=False, | ||
bootloader_ignore_signals=False, | ||
strip=False, | ||
upx=True, | ||
upx_exclude=[], | ||
runtime_tmpdir=None, | ||
console=True ) |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6969,14 +6969,6 @@ def applymap(self, func) -> "DataFrame": | |
-------- | ||
DataFrame.apply : Apply a function along input axis of DataFrame. | ||
|
||
Notes | ||
----- | ||
In the current implementation applymap calls `func` twice on the | ||
first column/row to decide whether it can take a fast or slow | ||
code path. This can lead to unexpected behavior if `func` has | ||
side-effects, as they will take effect twice for the first | ||
column/row. | ||
|
||
Examples | ||
-------- | ||
>>> df = pd.DataFrame([[1, 2.12], [3.356, 4.567]]) | ||
|
@@ -6990,8 +6982,7 @@ def applymap(self, func) -> "DataFrame": | |
0 3 4 | ||
1 5 5 | ||
|
||
Note that a vectorized version of `func` often exists, which will | ||
be much faster. You could square each number elementwise. | ||
You could square each number elementwise. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This part doesn't need changing, the vectorised version is still faster:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh okay. Thanks a lot. Included it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can you revert this There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry, for being late! I'm having a very busy semester. I'll do this asap and get back! |
||
|
||
>>> df.applymap(lambda x: x**2) | ||
0 1 | ||
|
@@ -7005,7 +6996,6 @@ def applymap(self, func) -> "DataFrame": | |
0 1.000000 4.494400 | ||
1 11.262736 20.857489 | ||
""" | ||
|
||
# if we have a dtype == 'M8[ns]', provide boxed values | ||
def infer(x): | ||
if x.empty: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9960,7 +9960,7 @@ def _add_numeric_operations(cls): | |
see_also="", | ||
examples="", | ||
) | ||
@Appender(_num_doc) | ||
@Appender(_num_doc_mad) | ||
def mad(self, axis=None, skipna=None, level=None): | ||
if skipna is None: | ||
skipna = True | ||
|
@@ -10329,6 +10329,26 @@ def _doc_parms(cls): | |
%(examples)s | ||
""" | ||
|
||
_num_doc_mad = """ | ||
%(desc)s | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is an unrelated change, can you revert |
||
|
||
Parameters | ||
---------- | ||
axis : %(axis_descr)s | ||
Axis for the function to be applied on. | ||
skipna : bool, default None | ||
Exclude NA/null values when computing the result. | ||
level : int or level name, default None | ||
If the axis is a MultiIndex (hierarchical), count along a | ||
particular level, collapsing into a %(name1)s. | ||
|
||
Returns | ||
------- | ||
%(name1)s or %(name2)s (if level specified)\ | ||
%(see_also)s\ | ||
%(examples)s | ||
""" | ||
|
||
_num_ddof_doc = """ | ||
%(desc)s | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this no longer accurate? we regularly get questions about the user-defined functions being called in groupby.apply/agg to determine fast vs slow path
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In #28854 this was removed from
DataFrame.apply
, and there are comments on the original issue (#28827) saying that the implementation has changed recently, andDataFrame.applymap
directly callsDataFrame.apply