
GITHUB . COM {
}
Detected CMS Systems:
- Wordpress (2 occurrences)
Title:
BUG: df.A raises AttributeError if column index is of dtype string Β· Issue #46185 Β· 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
- Cryptocurrency
Content Management System {π}
What CMS is github.com built with?
Github.com uses 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,000,019 visitors per month in the current month.
However, some sources were not loaded, we suggest to reload the page to get complete results.
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 4,989,889 paying customers.
The estimated monthly recurring revenue (MRR) is $20,957,532.
The estimated annual recurring revenues (ARR) are $251,490,385.
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 {π}
pandas, bug, dfa, dtype, issue, works, column, index, sign, raises, attributeerror, string, projects, object, navigation, pull, requests, actions, security, closed, description, ragblufthim, version, confirmed, exists, dtypestring, expected, triage, reviewed, team, member, github, type, milestone, footer, skip, content, menu, product, solutions, resources, open, source, enterprise, pricing, search, jump, pandasdev, public, notifications,
Topics {βοΈ}
assigned labels bug personal information bug comment metadata assignees latest version type projects triage issue import pandas df2['a'] works projects milestone raises attributeerror bug exists dtype string attribute 'a' issue pandas pandas 1 dtype object main branch getattribute raising milestone relationships df2 = df1 column index github bug 'dataframe' object string dtype= dtype df2 expected column index 'object' df1 dataframe works sign skip jump df checked reported confirmed reproducible list abc xyz set_axis iloc[0] axis=
Payment Methods {π}
- Braintree
Questions {β}
- Already have an account?
Schema {πΊοΈ}
DiscussionForumPosting:
context:https://schema.org
headline:BUG: df.A raises AttributeError if column index is of dtype string
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.
- [ ] I have confirmed this bug exists on the main branch of pandas.
### Reproducible Example
```python
import pandas as pd
df1 = pd.DataFrame({0:list("Abc"), 1:list("Xyz")}, dtype="string")
df2 = df1.set_axis(df1.iloc[0], axis="columns")
df2.A # raises AttributeError
```
### Issue Description
`df2.A` raises `AttributeError: 'DataFrame' object has no attribute 'A'` even though df2 has a column A.
`df2['A']` works as expected.
When I leave out the `dtype="string"` of the creation of df1, it works.
When I change the first argument of the `.set_axis` above to `df1.iloc[0].astype('object')` it works.
So `df2.A` works if the column index is of dtype object, but not if it is of dtype string.
### Expected Behavior
`df2.A` works regardless of the dtype of the column index.
The Reproducable Example works with Pandas 1.2.4, probably because there every index is of dtype object.
(I noticed the bug after upgrading from 1.2.4 to 1.4.1, when production scripts stopped working.)
### Installed Versions
<details>
INSTALLED VERSIONS
------------------
commit : 06d230151e6f18fdb8139d09abf539867a8cd481
python : 3.10.2.final.0
python-bits : 64
OS : Windows
OS-release : 10
Version : 10.0.19042
machine : AMD64
...
pandas : 1.4.1
numpy : 1.22.2
pytz : 2021.3
dateutil : 2.8.2
pip : 21.2.4
setuptools : 58.1.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 : None
IPython : None
pandas_datareader: None
bs4 : None
bottleneck : None
fastparquet : None
fsspec : None
gcsfs : None
matplotlib : None
numba : None
numexpr : None
odfpy : None
openpyxl : 3.0.9
pandas_gbq : None
pyarrow : None
pyreadstat : None
pyxlsb : None
s3fs : None
scipy : None
sqlalchemy : None
tables : None
tabulate : None
xarray : None
xlrd : None
xlwt : None
zstandard : None
</details>
author:
url:https://github.com/RagBlufThim
type:Person
name:RagBlufThim
datePublished:2022-02-28T20:32:41.000Z
interactionStatistic:
type:InteractionCounter
interactionType:https://schema.org/CommentAction
userInteractionCount:0
url:https://github.com/46185/pandas/issues/46185
context:https://schema.org
headline:BUG: df.A raises AttributeError if column index is of dtype string
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.
- [ ] I have confirmed this bug exists on the main branch of pandas.
### Reproducible Example
```python
import pandas as pd
df1 = pd.DataFrame({0:list("Abc"), 1:list("Xyz")}, dtype="string")
df2 = df1.set_axis(df1.iloc[0], axis="columns")
df2.A # raises AttributeError
```
### Issue Description
`df2.A` raises `AttributeError: 'DataFrame' object has no attribute 'A'` even though df2 has a column A.
`df2['A']` works as expected.
When I leave out the `dtype="string"` of the creation of df1, it works.
When I change the first argument of the `.set_axis` above to `df1.iloc[0].astype('object')` it works.
So `df2.A` works if the column index is of dtype object, but not if it is of dtype string.
### Expected Behavior
`df2.A` works regardless of the dtype of the column index.
The Reproducable Example works with Pandas 1.2.4, probably because there every index is of dtype object.
(I noticed the bug after upgrading from 1.2.4 to 1.4.1, when production scripts stopped working.)
### Installed Versions
<details>
INSTALLED VERSIONS
------------------
commit : 06d230151e6f18fdb8139d09abf539867a8cd481
python : 3.10.2.final.0
python-bits : 64
OS : Windows
OS-release : 10
Version : 10.0.19042
machine : AMD64
...
pandas : 1.4.1
numpy : 1.22.2
pytz : 2021.3
dateutil : 2.8.2
pip : 21.2.4
setuptools : 58.1.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 : None
IPython : None
pandas_datareader: None
bs4 : None
bottleneck : None
fastparquet : None
fsspec : None
gcsfs : None
matplotlib : None
numba : None
numexpr : None
odfpy : None
openpyxl : 3.0.9
pandas_gbq : None
pyarrow : None
pyreadstat : None
pyxlsb : None
s3fs : None
scipy : None
sqlalchemy : None
tables : None
tabulate : None
xarray : None
xlrd : None
xlwt : None
zstandard : None
</details>
author:
url:https://github.com/RagBlufThim
type:Person
name:RagBlufThim
datePublished:2022-02-28T20:32:41.000Z
interactionStatistic:
type:InteractionCounter
interactionType:https://schema.org/CommentAction
userInteractionCount:0
url:https://github.com/46185/pandas/issues/46185
Person:
url:https://github.com/RagBlufThim
name:RagBlufThim
url:https://github.com/RagBlufThim
name:RagBlufThim
InteractionCounter:
interactionType:https://schema.org/CommentAction
userInteractionCount:0
interactionType:https://schema.org/CommentAction
userInteractionCount:0
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