Skip to content
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

Confusing typo in the heredoc of the Series.replace method #15008

Closed
2 tasks done
scur-iolus opened this issue Mar 12, 2024 · 1 comment · Fixed by #15019
Closed
2 tasks done

Confusing typo in the heredoc of the Series.replace method #15008

scur-iolus opened this issue Mar 12, 2024 · 1 comment · Fixed by #15019
Labels
bug Something isn't working needs triage Awaiting prioritization by a maintainer python Related to Python Polars

Comments

@scur-iolus
Copy link

scur-iolus commented Mar 12, 2024

Checks

  • I have checked that this issue has not already been reported.
  • I have confirmed this bug exists on the latest version of Polars.

Issue description

There is a typo in the Python documentation on this page regarding the old argument:

Also accepts a mapping of values to their replacement as syntactic sugar for replace(new=Series(mapping.keys()), old=Series(mapping.values())).

In this short code sample, new and old have been mistakenly switched (see also the example provided).

This should be easy to fix!

Expected behavior

Instead, it should be:

Also accepts a mapping of values to their replacement as syntactic sugar for replace(old=Series(mapping.keys()), new=Series(mapping.values())).

Installed versions

--------Version info---------
Polars:               0.20.15
Index type:           UInt32
Platform:             Linux-5.15.0-100-generic-x86_64-with-glibc2.31
Python:               3.11.8 (main, Feb 25 2024, 16:41:26) [GCC 9.4.0]

----Optional dependencies----
adbc_driver_manager:  <not installed>
cloudpickle:          <not installed>
connectorx:           <not installed>
deltalake:            <not installed>
fastexcel:            <not installed>
fsspec:               <not installed>
gevent:               <not installed>
hvplot:               <not installed>
matplotlib:           3.8.3
numpy:                1.26.4
openpyxl:             3.1.2
pandas:               2.2.0
pyarrow:              15.0.0
pydantic:             <not installed>
pyiceberg:            <not installed>
pyxlsb:               <not installed>
sqlalchemy:           <not installed>
xlsx2csv:             <not installed>
xlsxwriter:           <not installed>
@scur-iolus scur-iolus added bug Something isn't working needs triage Awaiting prioritization by a maintainer python Related to Python Polars labels Mar 12, 2024
@mcrumiller
Copy link
Contributor

mcrumiller commented Mar 12, 2024

Good catch, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs triage Awaiting prioritization by a maintainer python Related to Python Polars
Projects
None yet
2 participants