
GITHUB . COM {
}
Detected CMS Systems:
- Wordpress (2 occurrences)
Title:
BUG: DataFrame.replace fails to replace value when column contains pd.NA Β· Issue #47480 Β· pandas-dev/pandas
Description:
Pandas version checks I have checked that this issue has not already been reported. I have confirmed this bug exists on the latest version of pandas. I have confirmed this bug exists on the main branch of pandas. Reproducible Example imp...
Website Age:
17 years and 8 months (reg. 2007-10-09).
Matching Content Categories {π}
- Technology & Computing
- Video & Online Content
- Personal Finance
Content Management System {π}
What CMS is github.com built with?
Github.com employs WORDPRESS.
Traffic Estimate {π}
What is the average monthly size of github.com audience?
ππ Tremendous Traffic: 10M - 20M visitors per month
Based on our best estimate, this website will receive around 10,634,170 visitors per month in the current month.
check SE Ranking
check Ahrefs
check Similarweb
check Ubersuggest
check Semrush
How Does Github.com Make Money? {πΈ}
Subscription Packages {π³}
We've located a dedicated page on github.com that might include details about subscription plans or recurring payments. We identified it based on the word pricing in one of its internal links. Below, you'll find additional estimates for its monthly recurring revenues.How Much Does Github.com Make? {π°}
Subscription Packages {π³}
Prices on github.com are in US Dollars ($).
They range from $4.00/month to $21.00/month.
We estimate that the site has approximately 5,306,322 paying customers.
The estimated monthly recurring revenue (MRR) is $22,286,554.
The estimated annual recurring revenues (ARR) are $267,438,648.
Wordpress Themes and Plugins {π¨}
What WordPress theme does this site use?
It is strange but we were not able to detect any theme on the page.
What WordPress plugins does this website use?
It is strange but we were not able to detect any plugins on the page.
Keywords {π}
replace, issue, pandas, phofl, bug, pdna, file, line, column, member, tests, sign, version, commented, needed, projects, main, printdf, dfareplacetoreplace, inplacetrue, work, behavior, versions, added, good, navigation, pull, requests, actions, security, dataframereplace, fails, description, pschwientek, confirmed, exists, function, installed, triage, reviewed, team, works, info, clarification, assess, method, closing, candidate, closeable, eyeballs,
Topics {βοΈ}
10/site-packages/pandas/core/internals/managers 10/site-packages/pandas/core/internals/blocks 10/site-packages/pandas/core/series 10/site-packages/pandas/core/generic 10/site-packages/pandas/core/missing prevent regressions good tests unit test personal information bug comment metadata assignees nullable extension arrays /library/frameworks/python phofl added darwin os-release type projects import pandas utf-8 pandas na df['a'] triage issue projects milestone bug exists latest version prevent regressions replace fails e8093ba python 0 python-bits pandas main branch framework/versions/3 behavior needed issue inplace=true info clarification local machine 10/lib/python3 dtype=bool na_value=false 'bool' object 8~1/release_x86_64 machine x86_64 processor i386 byteorder utf-8 locale milestone relationships na values 'a'] = pd attribute 'to_numpy' works fine 0 version github eyeballs replace
Payment Methods {π}
- Braintree
Questions {β}
- 2 and main?
- Already have an account?
- What versions do you use in your own environment?
Schema {πΊοΈ}
DiscussionForumPosting:
context:https://schema.org
headline:BUG: DataFrame.replace fails to replace value when column contains pd.NA
articleBody:### Pandas version checks
- [X] I have checked that this issue has not already been reported.
- [X] I have confirmed this bug exists on the [latest version](https://pandas.pydata.org/docs/whatsnew/index.html) of pandas.
- [X] I have confirmed this bug exists on the main branch of pandas.
### Reproducible Example
```python
import pandas as pd
df = pd.DataFrame({'A': [0, 1, 2]})
print(df)
# A
# 0 0
# 1 1
# 2 2
df['A'].replace(to_replace=2, value=99, inplace=True)
print(df)
# A
# 0 0
# 1 1
# 2 99
df.at[0, 'A'] = pd.NA
df['A'].replace(to_replace=1, value=100, inplace=True)
print(df)
# A
# 0 <NA>
# 1 1 <-- should be 100
# 2 99
```
### Issue Description
Pandas replace function does not seem to work on a column if the column contains at least one pd.NA value
### Expected Behavior
replace function should work even if pd.NA values are in the column
### Installed Versions
<details>
INSTALLED VERSIONS
------------------
commit : 66e3805b8cabe977f40c05259cc3fcf7ead5687d
python : 3.10.0.final.0
python-bits : 64
OS : Linux
OS-release : 5.16.19-76051619-generic
Version : #202204081339~1649696161~20.04~091f44b~dev-Ubuntu SMP PREEMPT Tu
machine : x86_64
processor : x86_64
byteorder : little
LC_ALL : None
LANG : en_US.UTF-8
LOCALE : en_US.UTF-8
pandas : 1.3.5
numpy : 1.21.2
pytz : 2021.3
dateutil : 2.8.2
pip : 21.2.4
setuptools : 58.0.4
Cython : None
pytest : None
hypothesis : None
sphinx : None
blosc : None
feather : None
xlsxwriter : 3.0.3
lxml.etree : None
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : 3.0.2
IPython : 7.29.0
pandas_datareader: None
bs4 : None
bottleneck : None
fsspec : None
fastparquet : None
gcsfs : None
matplotlib : 3.5.1
numexpr : None
odfpy : None
openpyxl : 3.0.9
pandas_gbq : None
pyarrow : None
pyxlsb : None
s3fs : None
scipy : 1.8.0
sqlalchemy : None
tables : None
tabulate : None
xarray : None
xlrd : None
xlwt : None
numba : None
</details>
author:
url:https://github.com/pschwientek
type:Person
name:pschwientek
datePublished:2022-06-23T01:34:40.000Z
interactionStatistic:
type:InteractionCounter
interactionType:https://schema.org/CommentAction
userInteractionCount:19
url:https://github.com/47480/pandas/issues/47480
context:https://schema.org
headline:BUG: DataFrame.replace fails to replace value when column contains pd.NA
articleBody:### Pandas version checks
- [X] I have checked that this issue has not already been reported.
- [X] I have confirmed this bug exists on the [latest version](https://pandas.pydata.org/docs/whatsnew/index.html) of pandas.
- [X] I have confirmed this bug exists on the main branch of pandas.
### Reproducible Example
```python
import pandas as pd
df = pd.DataFrame({'A': [0, 1, 2]})
print(df)
# A
# 0 0
# 1 1
# 2 2
df['A'].replace(to_replace=2, value=99, inplace=True)
print(df)
# A
# 0 0
# 1 1
# 2 99
df.at[0, 'A'] = pd.NA
df['A'].replace(to_replace=1, value=100, inplace=True)
print(df)
# A
# 0 <NA>
# 1 1 <-- should be 100
# 2 99
```
### Issue Description
Pandas replace function does not seem to work on a column if the column contains at least one pd.NA value
### Expected Behavior
replace function should work even if pd.NA values are in the column
### Installed Versions
<details>
INSTALLED VERSIONS
------------------
commit : 66e3805b8cabe977f40c05259cc3fcf7ead5687d
python : 3.10.0.final.0
python-bits : 64
OS : Linux
OS-release : 5.16.19-76051619-generic
Version : #202204081339~1649696161~20.04~091f44b~dev-Ubuntu SMP PREEMPT Tu
machine : x86_64
processor : x86_64
byteorder : little
LC_ALL : None
LANG : en_US.UTF-8
LOCALE : en_US.UTF-8
pandas : 1.3.5
numpy : 1.21.2
pytz : 2021.3
dateutil : 2.8.2
pip : 21.2.4
setuptools : 58.0.4
Cython : None
pytest : None
hypothesis : None
sphinx : None
blosc : None
feather : None
xlsxwriter : 3.0.3
lxml.etree : None
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : 3.0.2
IPython : 7.29.0
pandas_datareader: None
bs4 : None
bottleneck : None
fsspec : None
fastparquet : None
gcsfs : None
matplotlib : 3.5.1
numexpr : None
odfpy : None
openpyxl : 3.0.9
pandas_gbq : None
pyarrow : None
pyxlsb : None
s3fs : None
scipy : 1.8.0
sqlalchemy : None
tables : None
tabulate : None
xarray : None
xlrd : None
xlwt : None
numba : None
</details>
author:
url:https://github.com/pschwientek
type:Person
name:pschwientek
datePublished:2022-06-23T01:34:40.000Z
interactionStatistic:
type:InteractionCounter
interactionType:https://schema.org/CommentAction
userInteractionCount:19
url:https://github.com/47480/pandas/issues/47480
Person:
url:https://github.com/pschwientek
name:pschwientek
url:https://github.com/pschwientek
name:pschwientek
InteractionCounter:
interactionType:https://schema.org/CommentAction
userInteractionCount:19
interactionType:https://schema.org/CommentAction
userInteractionCount:19
External Links {π}(3)
Analytics and Tracking {π}
- Site Verification - Google
Libraries {π}
- Clipboard.js
- D3.js
- Lodash
Emails and Hosting {βοΈ}
Mail Servers:
- aspmx.l.google.com
- alt1.aspmx.l.google.com
- alt2.aspmx.l.google.com
- alt3.aspmx.l.google.com
- alt4.aspmx.l.google.com
Name Servers:
- dns1.p08.nsone.net
- dns2.p08.nsone.net
- dns3.p08.nsone.net
- dns4.p08.nsone.net
- ns-1283.awsdns-32.org
- ns-1707.awsdns-21.co.uk
- ns-421.awsdns-52.com
- ns-520.awsdns-01.net