
GITHUB . COM {
}
Detected CMS Systems:
- Wordpress (2 occurrences)
Title:
BUG: `pd.NA` when it replaces a value in a column, changes its type to "object" Β· Issue #44199 Β· pandas-dev/pandas
Description:
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 master branch of pandas. Reproducible Example import pandas as pd moc...
Website Age:
17 years and 8 months (reg. 2007-10-09).
Matching Content Categories {π}
- Technology & Computing
- Video & Online Content
- Education
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,653,586 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,316,011 paying customers.
The estimated monthly recurring revenue (MRR) is $22,327,244.
The estimated annual recurring revenues (ARR) are $267,926,929.
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 {π}
pdna, phofl, pandas, bug, issue, float, column, type, demetrio, member, commented, behavior, assert, pdapitypesisnumericdtypemockdatavalue, expected, indexing, sign, columns, dtype, conversions, nullable, issues, projects, object, mockdata, pddataframe, date, passes, change, default, mockdataloc, related, int, types, incompatible, dtypes, navigation, solutions, open, pull, requests, actions, security, replaces, closed, description, confirmed, exists, breaks, pdfloatdtype,
Topics {βοΈ}
open issues discussing personal information bug sql-compatible database major architectural move comment metadata assignees introduces null logic missing-data np na assert pd pandas breaks setting incompatible values solutions projects milestone type projects bug exists import pandas na/null null-values triage issue dtype na ist assert pd data type nullable type latest version master branch overarching principle make sense reading cvs mailing list conclusion reached buggier/unstable stay opt tough nut milestone relationships default assignment series/frames nullable types passes mock_data github expected behavior bug numeric column numpy types pandas dataframe[int64] numpy dtypes column type default mock_data mock_data = pd change column'
Payment Methods {π}
- Braintree
Questions {β}
- Already have an account?
- Nonetheless, can you reference the issue?
- Why not?
Schema {πΊοΈ}
DiscussionForumPosting:
context:https://schema.org
headline:BUG: `pd.NA` when it replaces a value in a column, changes its type to "object"
articleBody:###
- [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.
- [ ] I have confirmed this bug exists on the master branch of pandas.
### Reproducible Example
```python
import pandas as pd
mock_data = pd.DataFrame({
'date': ['0', '1', '2', '3'],
'value': [1, 2, 1, 1.5]
})
assert pd.api.types.is_numeric_dtype(mock_data.value) # passes
mock_data_pd_na.loc[2, 'value'] = pd.NA
assert pd.api.types.is_numeric_dtype(mock_data.value) # breaks
```
### Issue Description
Changing one value in a column with an `NA`/`NULL` should not change column's data type. That seems reasonable. Also, it seems the functionality is already there. I am not entirely sure if this is a bug or a feature.
Essentially it is due to the default assignment of a column type, which is `float64` not `pd.Float64Dtype()`. I am not sure if the migration is on the roadmap, but this bug could be an argument in its favor.
### Expected Behavior
```python
mock_data = pd.DataFrame({
'date': ['0', '1', '2', '3'],
'value': [1, 2, 1, 1.5]
})
mock_data.value = mock_data.value.astype(pd.Float64Dtype()) # this should happen by default
mock_data.value.dtype # Float64Dtype()
mock_data.loc[2, 'value'] = pd.NA
assert pd.api.types.is_numeric_dtype(mock_data.value) # still passes
mock_data.value.dtype # Float64Dtype()
```
### Installed Versions
<details>
```
pandas : 1.3.4
```
```
INSTALLED VERSIONS
------------------
commit : 945c9ed766a61c7d2c0a7cbb251b6edebf9cb7d5
python : 3.9.7.final.0
python-bits : 64
OS : Linux
OS-release : 5.11.0-34-generic
Version : #36~20.04.1-Ubuntu SMP Fri Aug 27 08:06:32 UTC 2021
machine : x86_64
processor : x86_64
byteorder : little
LC_ALL : None
LANG : en_US.UTF-8
LOCALE : en_US.UTF-8
pandas : 1.3.4
numpy : 1.21.2
pytz : 2021.3
dateutil : 2.8.2
pip : 21.3.1
setuptools : 58.2.0
Cython : None
pytest : None
hypothesis : None
sphinx : None
blosc : None
feather : None
xlsxwriter : None
lxml.etree : None
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : 3.0.2
IPython : 7.28.0
pandas_datareader: None
bs4 : None
bottleneck : None
fsspec : None
fastparquet : None
gcsfs : None
matplotlib : 3.4.3
numexpr : None
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : 5.0.0
pyxlsb : None
s3fs : None
scipy : 1.7.1
sqlalchemy : 1.4.25
tables : None
tabulate : 0.8.9
xarray : None
xlrd : None
xlwt : None
numba : None
```
</details>
author:
url:https://github.com/Demetrio92
type:Person
name:Demetrio92
datePublished:2021-10-27T00:24:43.000Z
interactionStatistic:
type:InteractionCounter
interactionType:https://schema.org/CommentAction
userInteractionCount:7
url:https://github.com/44199/pandas/issues/44199
context:https://schema.org
headline:BUG: `pd.NA` when it replaces a value in a column, changes its type to "object"
articleBody:###
- [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.
- [ ] I have confirmed this bug exists on the master branch of pandas.
### Reproducible Example
```python
import pandas as pd
mock_data = pd.DataFrame({
'date': ['0', '1', '2', '3'],
'value': [1, 2, 1, 1.5]
})
assert pd.api.types.is_numeric_dtype(mock_data.value) # passes
mock_data_pd_na.loc[2, 'value'] = pd.NA
assert pd.api.types.is_numeric_dtype(mock_data.value) # breaks
```
### Issue Description
Changing one value in a column with an `NA`/`NULL` should not change column's data type. That seems reasonable. Also, it seems the functionality is already there. I am not entirely sure if this is a bug or a feature.
Essentially it is due to the default assignment of a column type, which is `float64` not `pd.Float64Dtype()`. I am not sure if the migration is on the roadmap, but this bug could be an argument in its favor.
### Expected Behavior
```python
mock_data = pd.DataFrame({
'date': ['0', '1', '2', '3'],
'value': [1, 2, 1, 1.5]
})
mock_data.value = mock_data.value.astype(pd.Float64Dtype()) # this should happen by default
mock_data.value.dtype # Float64Dtype()
mock_data.loc[2, 'value'] = pd.NA
assert pd.api.types.is_numeric_dtype(mock_data.value) # still passes
mock_data.value.dtype # Float64Dtype()
```
### Installed Versions
<details>
```
pandas : 1.3.4
```
```
INSTALLED VERSIONS
------------------
commit : 945c9ed766a61c7d2c0a7cbb251b6edebf9cb7d5
python : 3.9.7.final.0
python-bits : 64
OS : Linux
OS-release : 5.11.0-34-generic
Version : #36~20.04.1-Ubuntu SMP Fri Aug 27 08:06:32 UTC 2021
machine : x86_64
processor : x86_64
byteorder : little
LC_ALL : None
LANG : en_US.UTF-8
LOCALE : en_US.UTF-8
pandas : 1.3.4
numpy : 1.21.2
pytz : 2021.3
dateutil : 2.8.2
pip : 21.3.1
setuptools : 58.2.0
Cython : None
pytest : None
hypothesis : None
sphinx : None
blosc : None
feather : None
xlsxwriter : None
lxml.etree : None
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : 3.0.2
IPython : 7.28.0
pandas_datareader: None
bs4 : None
bottleneck : None
fsspec : None
fastparquet : None
gcsfs : None
matplotlib : 3.4.3
numexpr : None
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : 5.0.0
pyxlsb : None
s3fs : None
scipy : 1.7.1
sqlalchemy : 1.4.25
tables : None
tabulate : 0.8.9
xarray : None
xlrd : None
xlwt : None
numba : None
```
</details>
author:
url:https://github.com/Demetrio92
type:Person
name:Demetrio92
datePublished:2021-10-27T00:24:43.000Z
interactionStatistic:
type:InteractionCounter
interactionType:https://schema.org/CommentAction
userInteractionCount:7
url:https://github.com/44199/pandas/issues/44199
Person:
url:https://github.com/Demetrio92
name:Demetrio92
url:https://github.com/Demetrio92
name:Demetrio92
InteractionCounter:
interactionType:https://schema.org/CommentAction
userInteractionCount:7
interactionType:https://schema.org/CommentAction
userInteractionCount:7
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