url
stringlengths 55
59
| repository_url
stringclasses 1
value | labels_url
stringlengths 69
73
| comments_url
stringlengths 64
68
| events_url
stringlengths 62
66
| html_url
stringlengths 44
49
| id
int64 338k
1.06B
| node_id
stringlengths 18
32
| number
int64 1
44.6k
| title
stringlengths 1
590
| user
dict | labels
listlengths 0
9
| state
stringclasses 2
values | locked
bool 2
classes | assignee
dict | assignees
listlengths 0
5
| milestone
dict | comments
int64 0
477
| created_at
timestamp[us, tz=UTC] | updated_at
timestamp[us, tz=UTC] | closed_at
timestamp[us, tz=UTC] | author_association
stringclasses 3
values | active_lock_reason
stringclasses 4
values | body
stringlengths 0
251k
⌀ | reactions
dict | timeline_url
stringlengths 64
68
| performed_via_github_app
float64 | draft
float64 0
1
⌀ | pull_request
dict |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
https://api.github.com/repos/pandas-dev/pandas/issues/35517
|
https://api.github.com/repos/pandas-dev/pandas
|
https://api.github.com/repos/pandas-dev/pandas/issues/35517/labels{/name}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35517/comments
|
https://api.github.com/repos/pandas-dev/pandas/issues/35517/events
|
https://github.com/pandas-dev/pandas/issues/35517
| 671,594,743
|
MDU6SXNzdWU2NzE1OTQ3NDM=
| 35,517
|
BUG: Pandas 1.0.5 → 1.1.0 behavior change on DataFrame.apply() where fn returns np.ndarray
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/866859?v=4",
"events_url": "https://api.github.com/users/dechamps/events{/privacy}",
"followers_url": "https://api.github.com/users/dechamps/followers",
"following_url": "https://api.github.com/users/dechamps/following{/other_user}",
"gists_url": "https://api.github.com/users/dechamps/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/dechamps",
"id": 866859,
"login": "dechamps",
"node_id": "MDQ6VXNlcjg2Njg1OQ==",
"organizations_url": "https://api.github.com/users/dechamps/orgs",
"received_events_url": "https://api.github.com/users/dechamps/received_events",
"repos_url": "https://api.github.com/users/dechamps/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/dechamps/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/dechamps/subscriptions",
"type": "User",
"url": "https://api.github.com/users/dechamps"
}
|
[
{
"color": "e11d21",
"default": false,
"description": "Functionality that used to work in a prior pandas version",
"id": 32815646,
"name": "Regression",
"node_id": "MDU6TGFiZWwzMjgxNTY0Ng==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Regression"
},
{
"color": "0052cc",
"default": false,
"description": "pandas objects compatability with Numpy or Python functions",
"id": 76865106,
"name": "Compat",
"node_id": "MDU6TGFiZWw3Njg2NTEwNg==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Compat"
},
{
"color": "fbca04",
"default": false,
"description": "Apply, Aggregate, Transform",
"id": 697792067,
"name": "Apply",
"node_id": "MDU6TGFiZWw2OTc3OTIwNjc=",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Apply"
},
{
"color": "0e8a16",
"default": true,
"description": null,
"id": 717120670,
"name": "good first issue",
"node_id": "MDU6TGFiZWw3MTcxMjA2NzA=",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/good%20first%20issue"
},
{
"color": "cdea3c",
"default": false,
"description": "Unit test(s) needed to prevent regressions",
"id": 986278782,
"name": "Needs Tests",
"node_id": "MDU6TGFiZWw5ODYyNzg3ODI=",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Needs%20Tests"
}
] |
open
| false
| null |
[] |
{
"closed_at": null,
"closed_issues": 786,
"created_at": "2015-01-13T10:53:19Z",
"creator": {
"avatar_url": "https://avatars.githubusercontent.com/u/953992?v=4",
"events_url": "https://api.github.com/users/jreback/events{/privacy}",
"followers_url": "https://api.github.com/users/jreback/followers",
"following_url": "https://api.github.com/users/jreback/following{/other_user}",
"gists_url": "https://api.github.com/users/jreback/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jreback",
"id": 953992,
"login": "jreback",
"node_id": "MDQ6VXNlcjk1Mzk5Mg==",
"organizations_url": "https://api.github.com/users/jreback/orgs",
"received_events_url": "https://api.github.com/users/jreback/received_events",
"repos_url": "https://api.github.com/users/jreback/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jreback/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jreback/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jreback"
},
"description": "Changes that would be nice to have in the next release. These issues are not blocking. They will be pushed to the next release if no one has time to fix them.",
"due_on": null,
"html_url": "https://github.com/pandas-dev/pandas/milestone/32",
"id": 933188,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/32/labels",
"node_id": "MDk6TWlsZXN0b25lOTMzMTg4",
"number": 32,
"open_issues": 1053,
"state": "open",
"title": "Contributions Welcome",
"updated_at": "2021-11-21T00:50:06Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/32"
}
| 11
| 2020-08-02T10:51:12Z
| 2021-08-08T19:43:54Z
| null |
NONE
| null |
- [X] I have checked that this issue has not already been reported.
- [X] I have confirmed this bug exists on the latest version of pandas.
- [ ] (optional) I have confirmed this bug exists on the master branch of pandas.
---
#### Code Sample, a copy-pastable example
```python
print(type(
pd.DataFrame([['foo']])
.apply(lambda col: np.array('bar'))
.iloc[0]))
```
#### Output of Pandas 1.0.5
```
<class 'str'>
```
#### Output of Pandas 1.1.0
```
<class 'numpy.ndarray'>
```
It is not clear to me if this behaviour change is intended or not. I couldn't find anything obvious in the [release notes](https://pandas.pydata.org/pandas-docs/stable/whatsnew/v1.1.0.html).
I discovered it because it broke my code, which returns the output of `DataFrame.unique().squeeze()` (with the intent of extracting a scalar) in an `apply()` func. Arguably my code is wrong, because `DataFrame.unique()` returns an `np.ndarray`, and calling `squeeze()` on that always returns an ndarray, never a scalar - the correct call would have been `item()`. Up until now, Pandas would "hide" the bug because it would take the one-element ndarray and treat it as a scalar. Not anymore, it seems. My code ultimately fails downstream of the call as it tries to hash the resulting string, which doesn't work if the string is actually a 1-element ndarray.
#### Output of ``pd.show_versions()``
<details>
INSTALLED VERSIONS
------------------
commit : d9fff2792bf16178d4e450fe7384244e50635733
python : 3.6.9.final.0
python-bits : 64
OS : Linux
OS-release : 4.19.104+
Version : #1 SMP Wed Feb 19 05:26:34 PST 2020
machine : x86_64
processor : x86_64
byteorder : little
LC_ALL : None
LANG : en_US.UTF-8
LOCALE : en_US.UTF-8
pandas : 1.1.0
numpy : 1.19.1
pytz : 2018.9
dateutil : 2.8.1
pip : 19.3.1
setuptools : 49.2.0
Cython : 0.29.21
pytest : 3.6.4
hypothesis : None
sphinx : 1.8.5
blosc : None
feather : 0.4.1
xlsxwriter : None
lxml.etree : 4.2.6
html5lib : 1.0.1
pymysql : None
psycopg2 : 2.7.6.1 (dt dec pq3 ext lo64)
jinja2 : 2.11.2
IPython : 5.5.0
pandas_datareader: None
bs4 : 4.6.3
bottleneck : 1.3.2
fsspec : 0.7.4
fastparquet : None
gcsfs : None
matplotlib : 3.2.2
numexpr : 2.7.1
odfpy : None
openpyxl : 2.5.9
pandas_gbq : 0.11.0
pyarrow : 0.14.1
pytables : None
pyxlsb : None
s3fs : 0.4.2
scipy : 1.4.1
sqlalchemy : 1.3.18
tables : 3.4.4
tabulate : 0.8.7
xarray : 0.15.1
xlrd : 1.1.0
xlwt : 1.3.0
numba : 0.48.0
</details>
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/35517/reactions"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35517/timeline
| null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/35518
|
https://api.github.com/repos/pandas-dev/pandas
|
https://api.github.com/repos/pandas-dev/pandas/issues/35518/labels{/name}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35518/comments
|
https://api.github.com/repos/pandas-dev/pandas/issues/35518/events
|
https://github.com/pandas-dev/pandas/issues/35518
| 671,613,238
|
MDU6SXNzdWU2NzE2MTMyMzg=
| 35,518
|
BUG: Pandas 1.0.5 → 1.1.0 behavior change on DataFrame.apply() where func returns tuple
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/866859?v=4",
"events_url": "https://api.github.com/users/dechamps/events{/privacy}",
"followers_url": "https://api.github.com/users/dechamps/followers",
"following_url": "https://api.github.com/users/dechamps/following{/other_user}",
"gists_url": "https://api.github.com/users/dechamps/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/dechamps",
"id": 866859,
"login": "dechamps",
"node_id": "MDQ6VXNlcjg2Njg1OQ==",
"organizations_url": "https://api.github.com/users/dechamps/orgs",
"received_events_url": "https://api.github.com/users/dechamps/received_events",
"repos_url": "https://api.github.com/users/dechamps/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/dechamps/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/dechamps/subscriptions",
"type": "User",
"url": "https://api.github.com/users/dechamps"
}
|
[
{
"color": "e10c02",
"default": false,
"description": null,
"id": 76811,
"name": "Bug",
"node_id": "MDU6TGFiZWw3NjgxMQ==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Bug"
},
{
"color": "e11d21",
"default": false,
"description": "Functionality that used to work in a prior pandas version",
"id": 32815646,
"name": "Regression",
"node_id": "MDU6TGFiZWwzMjgxNTY0Ng==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Regression"
},
{
"color": "fbca04",
"default": false,
"description": "Apply, Aggregate, Transform",
"id": 697792067,
"name": "Apply",
"node_id": "MDU6TGFiZWw2OTc3OTIwNjc=",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Apply"
},
{
"color": "f2f989",
"default": false,
"description": "Data where the values are collections (lists, sets, dicts, objects, etc.).",
"id": 2189479765,
"name": "Nested Data",
"node_id": "MDU6TGFiZWwyMTg5NDc5NzY1",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Nested%20Data"
}
] |
open
| false
| null |
[] |
{
"closed_at": null,
"closed_issues": 786,
"created_at": "2015-01-13T10:53:19Z",
"creator": {
"avatar_url": "https://avatars.githubusercontent.com/u/953992?v=4",
"events_url": "https://api.github.com/users/jreback/events{/privacy}",
"followers_url": "https://api.github.com/users/jreback/followers",
"following_url": "https://api.github.com/users/jreback/following{/other_user}",
"gists_url": "https://api.github.com/users/jreback/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jreback",
"id": 953992,
"login": "jreback",
"node_id": "MDQ6VXNlcjk1Mzk5Mg==",
"organizations_url": "https://api.github.com/users/jreback/orgs",
"received_events_url": "https://api.github.com/users/jreback/received_events",
"repos_url": "https://api.github.com/users/jreback/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jreback/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jreback/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jreback"
},
"description": "Changes that would be nice to have in the next release. These issues are not blocking. They will be pushed to the next release if no one has time to fix them.",
"due_on": null,
"html_url": "https://github.com/pandas-dev/pandas/milestone/32",
"id": 933188,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/32/labels",
"node_id": "MDk6TWlsZXN0b25lOTMzMTg4",
"number": 32,
"open_issues": 1053,
"state": "open",
"title": "Contributions Welcome",
"updated_at": "2021-11-21T00:50:06Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/32"
}
| 10
| 2020-08-02T13:04:16Z
| 2021-06-11T13:00:46Z
| null |
NONE
| null |
- [X] I have checked that this issue has not already been reported.
- [X] I have confirmed this bug exists on the latest version of pandas.
- [ ] (optional) I have confirmed this bug exists on the master branch of pandas.
---
#### Code Sample, a copy-pastable example
```python
print(
pd.DataFrame([['orig1', 'orig2']])
.apply(func=lambda col: ('new1', 'new2')))
```
#### Output of Pandas 1.0.5
```
0 (new1, new2)
1 (new1, new2)
dtype: object
```
#### Output of Pandas 1.1.0
```
0 1
0 new1 new1
1 new2 new2
```
It is not clear to me if this behaviour change is intended or not. I couldn't find anything obvious in the [release notes](https://pandas.pydata.org/pandas-docs/stable/whatsnew/v1.1.0.html).
Possibly related: #35517, #34909 @simonjayhawkins @jbrockmendel
This broke my code, which is actively relying on tuples being treated as scalars and stored as single objects (instead of being laid across the dataframe).
#### Output of ``pd.show_versions()``
<details>
INSTALLED VERSIONS
------------------
commit : d9fff2792bf16178d4e450fe7384244e50635733
python : 3.6.9.final.0
python-bits : 64
OS : Linux
OS-release : 4.19.104+
Version : #1 SMP Wed Feb 19 05:26:34 PST 2020
machine : x86_64
processor : x86_64
byteorder : little
LC_ALL : None
LANG : en_US.UTF-8
LOCALE : en_US.UTF-8
pandas : 1.1.0
numpy : 1.19.1
pytz : 2018.9
dateutil : 2.8.1
pip : 19.3.1
setuptools : 49.2.0
Cython : 0.29.21
pytest : 3.6.4
hypothesis : None
sphinx : 1.8.5
blosc : None
feather : 0.4.1
xlsxwriter : None
lxml.etree : 4.2.6
html5lib : 1.0.1
pymysql : None
psycopg2 : 2.7.6.1 (dt dec pq3 ext lo64)
jinja2 : 2.11.2
IPython : 5.5.0
pandas_datareader: None
bs4 : 4.6.3
bottleneck : 1.3.2
fsspec : 0.7.4
fastparquet : None
gcsfs : None
matplotlib : 3.2.2
numexpr : 2.7.1
odfpy : None
openpyxl : 2.5.9
pandas_gbq : 0.11.0
pyarrow : 0.14.1
pytables : None
pyxlsb : None
s3fs : 0.4.2
scipy : 1.4.1
sqlalchemy : 1.3.18
tables : 3.4.4
tabulate : 0.8.7
xarray : 0.15.1
xlrd : 1.1.0
xlwt : 1.3.0
numba : 0.48.0
</details>
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/35518/reactions"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35518/timeline
| null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/35519
|
https://api.github.com/repos/pandas-dev/pandas
|
https://api.github.com/repos/pandas-dev/pandas/issues/35519/labels{/name}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35519/comments
|
https://api.github.com/repos/pandas-dev/pandas/issues/35519/events
|
https://github.com/pandas-dev/pandas/pull/35519
| 671,672,973
|
MDExOlB1bGxSZXF1ZXN0NDYxODQ3OTA4
| 35,519
|
REF: StringArray._from_sequence, use less memory
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/26364415?v=4",
"events_url": "https://api.github.com/users/topper-123/events{/privacy}",
"followers_url": "https://api.github.com/users/topper-123/followers",
"following_url": "https://api.github.com/users/topper-123/following{/other_user}",
"gists_url": "https://api.github.com/users/topper-123/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/topper-123",
"id": 26364415,
"login": "topper-123",
"node_id": "MDQ6VXNlcjI2MzY0NDE1",
"organizations_url": "https://api.github.com/users/topper-123/orgs",
"received_events_url": "https://api.github.com/users/topper-123/received_events",
"repos_url": "https://api.github.com/users/topper-123/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/topper-123/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/topper-123/subscriptions",
"type": "User",
"url": "https://api.github.com/users/topper-123"
}
|
[
{
"color": "a10c02",
"default": false,
"description": "Memory or execution speed performance",
"id": 8935311,
"name": "Performance",
"node_id": "MDU6TGFiZWw4OTM1MzEx",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Performance"
},
{
"color": "5319e7",
"default": false,
"description": "String extension data type and string data",
"id": 57522093,
"name": "Strings",
"node_id": "MDU6TGFiZWw1NzUyMjA5Mw==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Strings"
}
] |
closed
| false
| null |
[] |
{
"closed_at": "2020-08-21T08:34:54Z",
"closed_issues": 110,
"created_at": "2020-07-10T13:54:44Z",
"creator": {
"avatar_url": "https://avatars.githubusercontent.com/u/953992?v=4",
"events_url": "https://api.github.com/users/jreback/events{/privacy}",
"followers_url": "https://api.github.com/users/jreback/followers",
"following_url": "https://api.github.com/users/jreback/following{/other_user}",
"gists_url": "https://api.github.com/users/jreback/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jreback",
"id": 953992,
"login": "jreback",
"node_id": "MDQ6VXNlcjk1Mzk5Mg==",
"organizations_url": "https://api.github.com/users/jreback/orgs",
"received_events_url": "https://api.github.com/users/jreback/received_events",
"repos_url": "https://api.github.com/users/jreback/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jreback/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jreback/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jreback"
},
"description": "on-merge: backport to 1.1.x",
"due_on": "2020-08-22T07:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/75",
"id": 5640672,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/75/labels",
"node_id": "MDk6TWlsZXN0b25lNTY0MDY3Mg==",
"number": 75,
"open_issues": 0,
"state": "closed",
"title": "1.1.1",
"updated_at": "2020-08-25T06:31:23Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/75"
}
| 11
| 2020-08-02T19:15:46Z
| 2020-09-19T08:19:56Z
| 2020-08-17T14:35:00Z
|
CONTRIBUTOR
| null |
- [x] closes #35499
- [x] tests added / passed
- [x] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [x] whatsnew entry
@ldacey, can you try if this fixes your problem?
CC @simonjayhawkins
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/35519/reactions"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35519/timeline
| null | 0
|
{
"diff_url": "https://github.com/pandas-dev/pandas/pull/35519.diff",
"html_url": "https://github.com/pandas-dev/pandas/pull/35519",
"merged_at": "2020-08-17T14:35:00Z",
"patch_url": "https://github.com/pandas-dev/pandas/pull/35519.patch",
"url": "https://api.github.com/repos/pandas-dev/pandas/pulls/35519"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35520
|
https://api.github.com/repos/pandas-dev/pandas
|
https://api.github.com/repos/pandas-dev/pandas/issues/35520/labels{/name}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35520/comments
|
https://api.github.com/repos/pandas-dev/pandas/issues/35520/events
|
https://github.com/pandas-dev/pandas/issues/35520
| 671,726,669
|
MDU6SXNzdWU2NzE3MjY2Njk=
| 35,520
|
ENH: parse_dates in read_csv should not fail silently
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/39023576?v=4",
"events_url": "https://api.github.com/users/metazoic/events{/privacy}",
"followers_url": "https://api.github.com/users/metazoic/followers",
"following_url": "https://api.github.com/users/metazoic/following{/other_user}",
"gists_url": "https://api.github.com/users/metazoic/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/metazoic",
"id": 39023576,
"login": "metazoic",
"node_id": "MDQ6VXNlcjM5MDIzNTc2",
"organizations_url": "https://api.github.com/users/metazoic/orgs",
"received_events_url": "https://api.github.com/users/metazoic/received_events",
"repos_url": "https://api.github.com/users/metazoic/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/metazoic/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/metazoic/subscriptions",
"type": "User",
"url": "https://api.github.com/users/metazoic"
}
|
[
{
"color": "4E9A06",
"default": false,
"description": null,
"id": 76812,
"name": "Enhancement",
"node_id": "MDU6TGFiZWw3NjgxMg==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Enhancement"
},
{
"color": "AFEEEE",
"default": false,
"description": null,
"id": 211840,
"name": "Timeseries",
"node_id": "MDU6TGFiZWwyMTE4NDA=",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Timeseries"
},
{
"color": "5319e7",
"default": false,
"description": "read_csv, to_csv",
"id": 47229171,
"name": "IO CSV",
"node_id": "MDU6TGFiZWw0NzIyOTE3MQ==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/IO%20CSV"
},
{
"color": "b60205",
"default": false,
"description": "Internal Consistency of API/Behavior",
"id": 1741841389,
"name": "API - Consistency",
"node_id": "MDU6TGFiZWwxNzQxODQxMzg5",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/API%20-%20Consistency"
}
] |
closed
| false
| null |
[] | null | 5
| 2020-08-03T00:53:18Z
| 2021-08-12T19:06:48Z
| 2021-08-08T19:48:28Z
|
NONE
| null |
#### Is your feature request related to a problem?
If `timestamp.csv` contains a malformed timestamp in the column `timestamp`, then
```python
df = pandas.read_csv('timestamp.csv', parse_dates=['timestamp'])
df.timestamp.dtype
```
results in
```
dtype('O')
```
(corroborated in the documentation). Because of the silent fail, every `read_csv()` with `parse_dates` must be followed by a `dtype` check.
#### Describe the solution you'd like
By contrast,
```python
pandas.to_datetime(df.timestamp)
```
results in an explicit error with an informative message:
```python
ParserError: Unknown string format: 11:22:33:44
```
#### API breaking implications
If one performs a `datetime` operation on any `parse_dates` column, then it will error if the column is of `object` type. I'm asking for a more informative error to occur in `read_csv()` instead (just like `to_datetime()`).
#### Describe alternatives you've considered
`to_datetime()` behaves as expected.
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/35520/reactions"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35520/timeline
| null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/35521
|
https://api.github.com/repos/pandas-dev/pandas
|
https://api.github.com/repos/pandas-dev/pandas/issues/35521/labels{/name}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35521/comments
|
https://api.github.com/repos/pandas-dev/pandas/issues/35521/events
|
https://github.com/pandas-dev/pandas/issues/35521
| 671,760,921
|
MDU6SXNzdWU2NzE3NjA5MjE=
| 35,521
|
REGR: invalid cache after take operation with non-consolidated dataframe
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/45395475?v=4",
"events_url": "https://api.github.com/users/on55/events{/privacy}",
"followers_url": "https://api.github.com/users/on55/followers",
"following_url": "https://api.github.com/users/on55/following{/other_user}",
"gists_url": "https://api.github.com/users/on55/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/on55",
"id": 45395475,
"login": "on55",
"node_id": "MDQ6VXNlcjQ1Mzk1NDc1",
"organizations_url": "https://api.github.com/users/on55/orgs",
"received_events_url": "https://api.github.com/users/on55/received_events",
"repos_url": "https://api.github.com/users/on55/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/on55/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/on55/subscriptions",
"type": "User",
"url": "https://api.github.com/users/on55"
}
|
[
{
"color": "e10c02",
"default": false,
"description": null,
"id": 76811,
"name": "Bug",
"node_id": "MDU6TGFiZWw3NjgxMQ==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Bug"
},
{
"color": "e11d21",
"default": false,
"description": "Functionality that used to work in a prior pandas version",
"id": 32815646,
"name": "Regression",
"node_id": "MDU6TGFiZWwzMjgxNTY0Ng==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Regression"
},
{
"color": "fbca04",
"default": false,
"description": "Related to non-user accessible pandas implementation",
"id": 49094459,
"name": "Internals",
"node_id": "MDU6TGFiZWw0OTA5NDQ1OQ==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Internals"
}
] |
closed
| false
| null |
[] |
{
"closed_at": "2020-09-09T09:07:44Z",
"closed_issues": 94,
"created_at": "2020-08-17T19:11:56Z",
"creator": {
"avatar_url": "https://avatars.githubusercontent.com/u/13159005?v=4",
"events_url": "https://api.github.com/users/simonjayhawkins/events{/privacy}",
"followers_url": "https://api.github.com/users/simonjayhawkins/followers",
"following_url": "https://api.github.com/users/simonjayhawkins/following{/other_user}",
"gists_url": "https://api.github.com/users/simonjayhawkins/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/simonjayhawkins",
"id": 13159005,
"login": "simonjayhawkins",
"node_id": "MDQ6VXNlcjEzMTU5MDA1",
"organizations_url": "https://api.github.com/users/simonjayhawkins/orgs",
"received_events_url": "https://api.github.com/users/simonjayhawkins/received_events",
"repos_url": "https://api.github.com/users/simonjayhawkins/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/simonjayhawkins/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/simonjayhawkins/subscriptions",
"type": "User",
"url": "https://api.github.com/users/simonjayhawkins"
},
"description": "on-merge: backport to 1.1.x",
"due_on": "2020-09-08T07:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/76",
"id": 5781056,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/76/labels",
"node_id": "MDk6TWlsZXN0b25lNTc4MTA1Ng==",
"number": 76,
"open_issues": 0,
"state": "closed",
"title": "1.1.2",
"updated_at": "2020-10-02T11:57:23Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/76"
}
| 22
| 2020-08-03T03:05:29Z
| 2020-09-04T20:48:43Z
| 2020-09-04T20:48:43Z
|
NONE
| null |
a program run ok with pandas 1.0.5, but after upgrade to 1.1.0. it fail.
i found sometimes when I change one cell of dataframe value, print(df) and it doesn't change.
but i use ==, it says changed.
for example: original cell value is A, then i change cell value to B. A=B
print df, it show still A
df.at(x, x) == B, it says TRUE.
-----
MarcoGorelli's edit: here's a reproducible example:
```
import pandas as pd
position = pd.DataFrame(columns=["code", "startdate"])
position = position.append([{"code": "a", "startdate": 0}])
# These two lines should not change anything.
# BUT, commenting either of them out makes this code run as intendeed
position["code"] == "A"
position[position["startdate"] == 0]
position.at[0, "code"] = "A"
print(position.at[0, "code"])
print(position)
```
output:
```
A
code startdate
0 a 0
```
expected output:
```
A
code startdate
0 A 0
```
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/35521/reactions"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35521/timeline
| null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/35522
|
https://api.github.com/repos/pandas-dev/pandas
|
https://api.github.com/repos/pandas-dev/pandas/issues/35522/labels{/name}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35522/comments
|
https://api.github.com/repos/pandas-dev/pandas/issues/35522/events
|
https://github.com/pandas-dev/pandas/pull/35522
| 671,859,430
|
MDExOlB1bGxSZXF1ZXN0NDYxOTk3NDYw
| 35,522
|
BUG: Fix assert_equal when check_exact=True for non-numeric dtypes #3…
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/8238804?v=4",
"events_url": "https://api.github.com/users/ivirshup/events{/privacy}",
"followers_url": "https://api.github.com/users/ivirshup/followers",
"following_url": "https://api.github.com/users/ivirshup/following{/other_user}",
"gists_url": "https://api.github.com/users/ivirshup/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/ivirshup",
"id": 8238804,
"login": "ivirshup",
"node_id": "MDQ6VXNlcjgyMzg4MDQ=",
"organizations_url": "https://api.github.com/users/ivirshup/orgs",
"received_events_url": "https://api.github.com/users/ivirshup/received_events",
"repos_url": "https://api.github.com/users/ivirshup/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/ivirshup/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/ivirshup/subscriptions",
"type": "User",
"url": "https://api.github.com/users/ivirshup"
}
|
[
{
"color": "e10c02",
"default": false,
"description": null,
"id": 76811,
"name": "Bug",
"node_id": "MDU6TGFiZWw3NjgxMQ==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Bug"
},
{
"color": "C4A000",
"default": false,
"description": "pandas testing functions or related to the test suite",
"id": 127685,
"name": "Testing",
"node_id": "MDU6TGFiZWwxMjc2ODU=",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Testing"
}
] |
closed
| false
| null |
[] |
{
"closed_at": "2020-08-21T08:34:54Z",
"closed_issues": 110,
"created_at": "2020-07-10T13:54:44Z",
"creator": {
"avatar_url": "https://avatars.githubusercontent.com/u/953992?v=4",
"events_url": "https://api.github.com/users/jreback/events{/privacy}",
"followers_url": "https://api.github.com/users/jreback/followers",
"following_url": "https://api.github.com/users/jreback/following{/other_user}",
"gists_url": "https://api.github.com/users/jreback/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jreback",
"id": 953992,
"login": "jreback",
"node_id": "MDQ6VXNlcjk1Mzk5Mg==",
"organizations_url": "https://api.github.com/users/jreback/orgs",
"received_events_url": "https://api.github.com/users/jreback/received_events",
"repos_url": "https://api.github.com/users/jreback/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jreback/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jreback/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jreback"
},
"description": "on-merge: backport to 1.1.x",
"due_on": "2020-08-22T07:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/75",
"id": 5640672,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/75/labels",
"node_id": "MDk6TWlsZXN0b25lNTY0MDY3Mg==",
"number": 75,
"open_issues": 0,
"state": "closed",
"title": "1.1.1",
"updated_at": "2020-08-25T06:31:23Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/75"
}
| 6
| 2020-08-03T07:20:45Z
| 2020-08-10T13:31:13Z
| 2020-08-10T13:30:14Z
|
CONTRIBUTOR
| null |
`assert_series_equal(..., check_exact=True)` no longer raises an error when series has a non-numeric dtype. This fixes a bug/ regression introduced in `1.1.0`.
- [x] closes #35446
- [x] tests added / passed
- [x] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [x] whatsnew entry
I've added a very simple test, but could add more. For instance, there could be a check on `assert_frame_equal`, but I'm not sure what the desired strategy is for that.
I've left off the `whatsnew` entry for now since I figure that's the most likely to generate conflicts while this gets reviewed.
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/35522/reactions"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35522/timeline
| null | 0
|
{
"diff_url": "https://github.com/pandas-dev/pandas/pull/35522.diff",
"html_url": "https://github.com/pandas-dev/pandas/pull/35522",
"merged_at": "2020-08-10T13:30:13Z",
"patch_url": "https://github.com/pandas-dev/pandas/pull/35522.patch",
"url": "https://api.github.com/repos/pandas-dev/pandas/pulls/35522"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35523
|
https://api.github.com/repos/pandas-dev/pandas
|
https://api.github.com/repos/pandas-dev/pandas/issues/35523/labels{/name}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35523/comments
|
https://api.github.com/repos/pandas-dev/pandas/issues/35523/events
|
https://github.com/pandas-dev/pandas/issues/35523
| 671,867,372
|
MDU6SXNzdWU2NzE4NjczNzI=
| 35,523
|
ENH: Allow pd.Series to fill NA with a callable
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/7464471?v=4",
"events_url": "https://api.github.com/users/ligz08/events{/privacy}",
"followers_url": "https://api.github.com/users/ligz08/followers",
"following_url": "https://api.github.com/users/ligz08/following{/other_user}",
"gists_url": "https://api.github.com/users/ligz08/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/ligz08",
"id": 7464471,
"login": "ligz08",
"node_id": "MDQ6VXNlcjc0NjQ0NzE=",
"organizations_url": "https://api.github.com/users/ligz08/orgs",
"received_events_url": "https://api.github.com/users/ligz08/received_events",
"repos_url": "https://api.github.com/users/ligz08/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/ligz08/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/ligz08/subscriptions",
"type": "User",
"url": "https://api.github.com/users/ligz08"
}
|
[
{
"color": "4E9A06",
"default": false,
"description": null,
"id": 76812,
"name": "Enhancement",
"node_id": "MDU6TGFiZWw3NjgxMg==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Enhancement"
}
] |
closed
| false
| null |
[] | null | 4
| 2020-08-03T07:33:01Z
| 2020-08-21T17:04:43Z
| 2020-08-07T07:04:28Z
|
NONE
| null |
#### Is your feature request related to a problem?
I wanted to do Series additions/subtractions where two Series objects' index may not align. I was using the [`pd.Series.add()`](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Series.add.html) function, which first aligns two Series' by their indices, and then do the adding at each index -- this is great. However, when dealing with NaNs generated at misaligned indices, I want to use a callable (e.g. a function or a class constructor) with a Series item's index and/or value as arguments to fill the NaNs. Right now Pandas.Series doesn't support such functionality, the `fill_value` argument for the `pd.Series.add()` function can be a float number at best.
Example:
```python
idx1 = [1,2,3]
idx2 = [2,3,4]
s1 = pd.Series((_**2 for _ in idx1), index=idx1, name='square')
s2 = pd.Series((_**2 for _ in idx2), index=idx2, name='square')
```
Hopefully with
```python
result = s1.add(s2, fill_value=lambda idx, val: idx**2)
```
the holes introduced when aligning `s1` and `s2` can be filled by calling the `lambda` function on the NA items in the Series, so eventually the `result` is effectively `pd.Series([1,4,9,16]) + pd.Series([1,4,9,16])`, and looks like
```python
result
>>>
1 2
2 8
3 18
4 32
```
#### Describe the solution you'd like
Whenever a Series needs to fill NAs, e.g. `pd.Series.fillna()`, `pd.Series.align()`, `pd.Series.add()` etc, the `fill_value` argument should be able to accept a callable that takes two arguments `idx` and `val`, and call it with the Series' (index, value) pair as arguments to fill NAs.
#### API breaking implications
This may break the API behavior in (imo a rare) case a user intentionally wants to put callable objects in a Series to fill NAs. For example:
```python
s = pd.Series([min, max, sum, np.nan])
result = s.fillna(max)
```
Current behavior
```python
result
>>>
0 <built-in function min>
1 <built-in function max>
2 <built-in function sum>
3 <built-in function max>
```
New behavior after the proposed change:
```python
result
>>>
0 <built-in function min>
1 <built-in function max>
2 <built-in function sum>
3 3
```
because at item 3, calling `max(3, np.nan)` results in `3`.
#### Describe alternatives you've considered
A workaround for `pd.Series.fillna()` but can use a callable to generate fill values is to create a `backup` Series separately with that callable, and use `pd.Series.mask()` instead. Suppose `func = lambda idx, val: idx**2`
```python
backup = pd.Series((func(idx, val) for idx, val in s.items()), index=s.index)
result = s.mask(pd.isna, other=backup)
result
>>>
0 <built-in function min>
1 <built-in function max>
2 <built-in function sum>
3 9
```
Above is just for the `pd.Series.fillna()` function, and `.add()` and `.align()` functions can use similar approaches, but obviously it gets quite tedious.
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/35523/reactions"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35523/timeline
| null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/35524
|
https://api.github.com/repos/pandas-dev/pandas
|
https://api.github.com/repos/pandas-dev/pandas/issues/35524/labels{/name}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35524/comments
|
https://api.github.com/repos/pandas-dev/pandas/issues/35524/events
|
https://github.com/pandas-dev/pandas/issues/35524
| 671,872,431
|
MDU6SXNzdWU2NzE4NzI0MzE=
| 35,524
|
BUG:
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/53900164?v=4",
"events_url": "https://api.github.com/users/kmadhavan2000/events{/privacy}",
"followers_url": "https://api.github.com/users/kmadhavan2000/followers",
"following_url": "https://api.github.com/users/kmadhavan2000/following{/other_user}",
"gists_url": "https://api.github.com/users/kmadhavan2000/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/kmadhavan2000",
"id": 53900164,
"login": "kmadhavan2000",
"node_id": "MDQ6VXNlcjUzOTAwMTY0",
"organizations_url": "https://api.github.com/users/kmadhavan2000/orgs",
"received_events_url": "https://api.github.com/users/kmadhavan2000/received_events",
"repos_url": "https://api.github.com/users/kmadhavan2000/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/kmadhavan2000/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/kmadhavan2000/subscriptions",
"type": "User",
"url": "https://api.github.com/users/kmadhavan2000"
}
|
[] |
closed
| false
| null |
[] |
{
"closed_at": null,
"closed_issues": 2361,
"created_at": "2015-02-26T19:29:05Z",
"creator": {
"avatar_url": "https://avatars.githubusercontent.com/u/1020496?v=4",
"events_url": "https://api.github.com/users/jorisvandenbossche/events{/privacy}",
"followers_url": "https://api.github.com/users/jorisvandenbossche/followers",
"following_url": "https://api.github.com/users/jorisvandenbossche/following{/other_user}",
"gists_url": "https://api.github.com/users/jorisvandenbossche/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jorisvandenbossche",
"id": 1020496,
"login": "jorisvandenbossche",
"node_id": "MDQ6VXNlcjEwMjA0OTY=",
"organizations_url": "https://api.github.com/users/jorisvandenbossche/orgs",
"received_events_url": "https://api.github.com/users/jorisvandenbossche/received_events",
"repos_url": "https://api.github.com/users/jorisvandenbossche/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jorisvandenbossche/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jorisvandenbossche/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jorisvandenbossche"
},
"description": "A milestone for closed or open issues for which there is no action needed (eg not a bug, just a question / discussion, nothing to resolve, wontfix, etc).\r\n\r\n",
"due_on": null,
"html_url": "https://github.com/pandas-dev/pandas/milestone/33",
"id": 997544,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/33/labels",
"node_id": "MDk6TWlsZXN0b25lOTk3NTQ0",
"number": 33,
"open_issues": 11,
"state": "open",
"title": "No action",
"updated_at": "2021-11-19T17:33:16Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/33"
}
| 1
| 2020-08-03T07:41:09Z
| 2020-08-03T09:41:12Z
| 2020-08-03T09:40:27Z
|
NONE
| null |
- [ ] I have checked that this issue has not already been reported.
- [ ] I have confirmed this bug exists on the latest version of pandas.
- [ ] (optional) I have confirmed this bug exists on the master branch of pandas.
---
**Note**: Please read [this guide](https://matthewrocklin.com/blog/work/2018/02/28/minimal-bug-reports) detailing how to provide the necessary information for us to reproduce your bug.
#### Code Sample, a copy-pastable example
```python
# Your code here
```
#### Problem description
[this should explain **why** the current behaviour is a problem and why the expected output is a better solution]
#### Expected Output
#### Output of ``pd.show_versions()``
<details>
[paste the output of ``pd.show_versions()`` here leaving a blank line after the details tag]
</details>
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/35524/reactions"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35524/timeline
| null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/35525
|
https://api.github.com/repos/pandas-dev/pandas
|
https://api.github.com/repos/pandas-dev/pandas/issues/35525/labels{/name}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35525/comments
|
https://api.github.com/repos/pandas-dev/pandas/issues/35525/events
|
https://github.com/pandas-dev/pandas/issues/35525
| 672,010,436
|
MDU6SXNzdWU2NzIwMTA0MzY=
| 35,525
|
ENH: Add keep_index as an optional argument to json_serialize
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/24782867?v=4",
"events_url": "https://api.github.com/users/amrsoll/events{/privacy}",
"followers_url": "https://api.github.com/users/amrsoll/followers",
"following_url": "https://api.github.com/users/amrsoll/following{/other_user}",
"gists_url": "https://api.github.com/users/amrsoll/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/amrsoll",
"id": 24782867,
"login": "amrsoll",
"node_id": "MDQ6VXNlcjI0NzgyODY3",
"organizations_url": "https://api.github.com/users/amrsoll/orgs",
"received_events_url": "https://api.github.com/users/amrsoll/received_events",
"repos_url": "https://api.github.com/users/amrsoll/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/amrsoll/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/amrsoll/subscriptions",
"type": "User",
"url": "https://api.github.com/users/amrsoll"
}
|
[
{
"color": "4E9A06",
"default": false,
"description": null,
"id": 76812,
"name": "Enhancement",
"node_id": "MDU6TGFiZWw3NjgxMg==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Enhancement"
},
{
"color": "207de5",
"default": false,
"description": "read_json, to_json, json_normalize",
"id": 49379259,
"name": "IO JSON",
"node_id": "MDU6TGFiZWw0OTM3OTI1OQ==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/IO%20JSON"
}
] |
closed
| false
| null |
[] | null | 4
| 2020-08-03T11:32:56Z
| 2021-08-08T19:52:05Z
| 2021-08-08T19:52:05Z
|
NONE
| null |
#### Is your feature request related to a problem?
I have a DataFrame with a column filled with json data. I would like concatenate a subset of that json data to the DataFrame itself while preserving the index of the DataFrame for easy concatenation.
#### Describe the solution you'd like
1. I would add `pd.Series` as a possible data input in [the definition of json_normalize]
2. Add optional keyword `keep_index`
3. If the type of the data is a Series and `keep_index` is `True`, then add set the index of the result to the index of the Series.
#### API breaking implications
As an optional feature, this does not break the API, but the preservation of the index can not take effect if the data is not a pandas Series and might have unintended effects when switching the type of data.
However, given that i doesn't affect other types of data than `pd.Series`, the default value of `keep_index` could be set to `True` without affecting the example use cases.
#### Describe alternatives you've considered
I have been using this alternative so far, simply adding the index after json_serialize.
```python
s = df['col']
result = pd.json_serialize(s)
result.index = s.index
pd.concat(df, s, axis='columns')
```
#### Additional context
This feature request is similar to #17440 but doesn't result in the same kind of output, because this doesn't add an extra column.
#### Current behaviour
```python
data = [{'id': 1, 'name': {'first': 'Coleen', 'last': 'Volk'}},
{'name': {'given': 'Mose', 'family': 'Regner'}},
{'id': 2, 'name': 'Faye Raker'}]
df = pd.DataFrame({"Letters":['A','B','C']})
df['data'] = data
df.index = ['a', 'b','c']
df
```
| | Letters | data |
|---| --- | --- |
| a | A | {'id': 1, 'name': {'first': 'Coleen', 'last': ... |
| b | B | {'name': {'given': 'Mose', 'family': 'Regner'}} |
| c | C | {'id': 2, 'name': 'Faye Raker'} |
```
>>> pd.json_normalize(df['data'])
id name.first name.last name.given name.family name
0 1.0 Coleen Volk NaN NaN NaN
1 NaN NaN NaN Mose Regner NaN
2 2.0 NaN NaN NaN NaN Faye Raker
>>> pd.concat([df, pd.json_normalize(df['data'])], axis='columns')
Letters data id ... name.given name.family name
a A {'id': 1, 'name': {'first': 'Coleen', 'last': ... NaN ... NaN NaN NaN
b B {'name': {'given': 'Mose', 'family': 'Regner'}} NaN ... NaN NaN NaN
c C {'id': 2, 'name': 'Faye Raker'} NaN ... NaN NaN NaN
0 NaN NaN 1.0 ... NaN NaN NaN
1 NaN NaN NaN ... Mose Regner NaN
2 NaN NaN 2.0 ... NaN NaN Faye Raker
```
#### Expected behaviour
```
>>> pd.json_normalize(df['data'], keep_index=True)
id name.first name.last name.given name.family name
a 1.0 Coleen Volk NaN NaN NaN
b NaN NaN NaN Mose Regner NaN
c 2.0 NaN NaN NaN NaN Faye Raker
>>> pd.concat([df, pd.json_normalize(df['data'], keep_index=True)], axis='columns')
Letters data id ... name.given name.family name
a A {'id': 1, 'name': {'first': 'Coleen', 'last': ... 1.0 ... NaN NaN NaN
b B {'name': {'given': 'Mose', 'family': 'Regner'}} NaN ... Mose Regner NaN
c C {'id': 2, 'name': 'Faye Raker'} 2.0 ... NaN NaN Faye Raker
```
[the definition of json_normalize]: https://github.com/pandas-dev/pandas/blob/6388370eb313244ba0e4cd8215dcdbfdabb7004b/pandas/io/json/_normalize.py#L113
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/35525/reactions"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35525/timeline
| null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/35526
|
https://api.github.com/repos/pandas-dev/pandas
|
https://api.github.com/repos/pandas-dev/pandas/issues/35526/labels{/name}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35526/comments
|
https://api.github.com/repos/pandas-dev/pandas/issues/35526/events
|
https://github.com/pandas-dev/pandas/issues/35526
| 672,040,911
|
MDU6SXNzdWU2NzIwNDA5MTE=
| 35,526
|
BUG:
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/18665030?v=4",
"events_url": "https://api.github.com/users/shadowbourne/events{/privacy}",
"followers_url": "https://api.github.com/users/shadowbourne/followers",
"following_url": "https://api.github.com/users/shadowbourne/following{/other_user}",
"gists_url": "https://api.github.com/users/shadowbourne/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/shadowbourne",
"id": 18665030,
"login": "shadowbourne",
"node_id": "MDQ6VXNlcjE4NjY1MDMw",
"organizations_url": "https://api.github.com/users/shadowbourne/orgs",
"received_events_url": "https://api.github.com/users/shadowbourne/received_events",
"repos_url": "https://api.github.com/users/shadowbourne/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/shadowbourne/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/shadowbourne/subscriptions",
"type": "User",
"url": "https://api.github.com/users/shadowbourne"
}
|
[
{
"color": "e10c02",
"default": false,
"description": null,
"id": 76811,
"name": "Bug",
"node_id": "MDU6TGFiZWw3NjgxMQ==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Bug"
},
{
"color": "009800",
"default": false,
"description": "Duplicate issue or pull request",
"id": 40153326,
"name": "Duplicate Report",
"node_id": "MDU6TGFiZWw0MDE1MzMyNg==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Duplicate%20Report"
}
] |
closed
| false
| null |
[] |
{
"closed_at": null,
"closed_issues": 2361,
"created_at": "2015-02-26T19:29:05Z",
"creator": {
"avatar_url": "https://avatars.githubusercontent.com/u/1020496?v=4",
"events_url": "https://api.github.com/users/jorisvandenbossche/events{/privacy}",
"followers_url": "https://api.github.com/users/jorisvandenbossche/followers",
"following_url": "https://api.github.com/users/jorisvandenbossche/following{/other_user}",
"gists_url": "https://api.github.com/users/jorisvandenbossche/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jorisvandenbossche",
"id": 1020496,
"login": "jorisvandenbossche",
"node_id": "MDQ6VXNlcjEwMjA0OTY=",
"organizations_url": "https://api.github.com/users/jorisvandenbossche/orgs",
"received_events_url": "https://api.github.com/users/jorisvandenbossche/received_events",
"repos_url": "https://api.github.com/users/jorisvandenbossche/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jorisvandenbossche/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jorisvandenbossche/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jorisvandenbossche"
},
"description": "A milestone for closed or open issues for which there is no action needed (eg not a bug, just a question / discussion, nothing to resolve, wontfix, etc).\r\n\r\n",
"due_on": null,
"html_url": "https://github.com/pandas-dev/pandas/milestone/33",
"id": 997544,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/33/labels",
"node_id": "MDk6TWlsZXN0b25lOTk3NTQ0",
"number": 33,
"open_issues": 11,
"state": "open",
"title": "No action",
"updated_at": "2021-11-19T17:33:16Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/33"
}
| 1
| 2020-08-03T12:27:36Z
| 2020-08-03T12:45:13Z
| 2020-08-03T12:44:43Z
|
NONE
| null |
---
**Note**: Please read [this guide](https://matthewrocklin.com/blog/work/2018/02/28/minimal-bug-reports) detailing how to provide the necessary information for us to reproduce your bug.
#### Code Sample, a copy-pastable example
```python
# Your code here
import pandas as pd
def edit(row):
row["poo"] = 9
return row
df = pd.DataFrame({"foo":[1,2,3,4],"Hi":[0,1,0,2]})
print(df.head())
print(df.apply(edit, axis=1))
```
#### Problem description
Returns completely wrong output on my system, but anyone else's it seems fine. (pandas 1.1.0, python 3.8.4 and 3.7.8)
[this should explain **why** the current behaviour is a problem and why the expected output is a better solution]
#### Bugged Output:
foo Hi poo
0 1 0 9
1 1 0 9
2 1 0 9
3 1 0 9
#### Expected Output
foo Hi poo
0 1 0 9
1 2 1 9
2 3 0 9
3 4 2 9
#### Output of ``pd.show_versions()``
<details>
INSTALLED VERSIONS
------------------
commit : d9fff2792bf16178d4e450fe7384244e50635733
python : 3.7.8.final.0
python-bits : 64
OS : Windows
OS-release : 10
Version : 10.0.18362
machine : AMD64
processor : AMD64 Family 21 Model 2 Stepping 0, AuthenticAMD
byteorder : little
LC_ALL : None
LANG : en_GB.UTF-8
LOCALE : None.None
pandas : 1.1.0
numpy : 1.19.1
pytz : 2020.1
dateutil : 2.8.1
pip : 20.1.1
setuptools : 47.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
fsspec : None
fastparquet : None
gcsfs : None
matplotlib : None
numexpr : None
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : None
pytables : None
pyxlsb : None
s3fs : None
scipy : None
sqlalchemy : None
tables : None
tabulate : None
xarray : None
xlrd : None
xlwt : None
numba : None
None
[paste the output of ``pd.show_versions()`` here leaving a blank line after the details tag]
</details>
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/35526/reactions"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35526/timeline
| null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/35527
|
https://api.github.com/repos/pandas-dev/pandas
|
https://api.github.com/repos/pandas-dev/pandas/issues/35527/labels{/name}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35527/comments
|
https://api.github.com/repos/pandas-dev/pandas/issues/35527/events
|
https://github.com/pandas-dev/pandas/issues/35527
| 672,174,809
|
MDU6SXNzdWU2NzIxNzQ4MDk=
| 35,527
|
AssertionError in multidimensional indexing of a Series
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1312546?v=4",
"events_url": "https://api.github.com/users/TomAugspurger/events{/privacy}",
"followers_url": "https://api.github.com/users/TomAugspurger/followers",
"following_url": "https://api.github.com/users/TomAugspurger/following{/other_user}",
"gists_url": "https://api.github.com/users/TomAugspurger/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/TomAugspurger",
"id": 1312546,
"login": "TomAugspurger",
"node_id": "MDQ6VXNlcjEzMTI1NDY=",
"organizations_url": "https://api.github.com/users/TomAugspurger/orgs",
"received_events_url": "https://api.github.com/users/TomAugspurger/received_events",
"repos_url": "https://api.github.com/users/TomAugspurger/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/TomAugspurger/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/TomAugspurger/subscriptions",
"type": "User",
"url": "https://api.github.com/users/TomAugspurger"
}
|
[
{
"color": "e10c02",
"default": false,
"description": null,
"id": 76811,
"name": "Bug",
"node_id": "MDU6TGFiZWw3NjgxMQ==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Bug"
},
{
"color": "0b02e1",
"default": false,
"description": "Related to indexing on series/frames, not to indexes themselves",
"id": 2822098,
"name": "Indexing",
"node_id": "MDU6TGFiZWwyODIyMDk4",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Indexing"
},
{
"color": "e11d21",
"default": false,
"description": "Functionality that used to work in a prior pandas version",
"id": 32815646,
"name": "Regression",
"node_id": "MDU6TGFiZWwzMjgxNTY0Ng==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Regression"
}
] |
closed
| false
| null |
[] |
{
"closed_at": "2020-12-08T12:11:38Z",
"closed_issues": 81,
"created_at": "2020-10-29T13:43:23Z",
"creator": {
"avatar_url": "https://avatars.githubusercontent.com/u/13159005?v=4",
"events_url": "https://api.github.com/users/simonjayhawkins/events{/privacy}",
"followers_url": "https://api.github.com/users/simonjayhawkins/followers",
"following_url": "https://api.github.com/users/simonjayhawkins/following{/other_user}",
"gists_url": "https://api.github.com/users/simonjayhawkins/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/simonjayhawkins",
"id": 13159005,
"login": "simonjayhawkins",
"node_id": "MDQ6VXNlcjEzMTU5MDA1",
"organizations_url": "https://api.github.com/users/simonjayhawkins/orgs",
"received_events_url": "https://api.github.com/users/simonjayhawkins/received_events",
"repos_url": "https://api.github.com/users/simonjayhawkins/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/simonjayhawkins/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/simonjayhawkins/subscriptions",
"type": "User",
"url": "https://api.github.com/users/simonjayhawkins"
},
"description": "on-merge: backport to 1.1.x",
"due_on": "2020-12-07T08:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/79",
"id": 6047124,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/79/labels",
"node_id": "MDk6TWlsZXN0b25lNjA0NzEyNA==",
"number": 79,
"open_issues": 0,
"state": "closed",
"title": "1.1.5",
"updated_at": "2020-12-08T12:11:38Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/79"
}
| 6
| 2020-08-03T15:53:45Z
| 2020-12-01T00:14:52Z
| 2020-12-01T00:14:52Z
|
CONTRIBUTOR
| null |
In pandas 1.0.5, indexing a Series with a multidimensional key raised an IndexError. In 1.1.0 it raises a TypeError:
```python
In [1]: import pandas as pd
In [2]: s = pd.Series(pd.date_range("2000", periods=4, tz="CET"))
In [3]: s[:, None]
```
```pytb
# 1.0.5
In [3]: s[:, None]
---------------------------------------------------------------------------
IndexError Traceback (most recent call last)
<ipython-input-3-89522aec9762> in <module>
----> 1 s[:, None]
IndexError: only integers, slices (`:`), ellipsis (`...`), numpy.newaxis (`None`) and integer or boolean arrays are valid indices
```
```pytb
# 1.1.0
In [3]: s[:, None]
/Users/taugspurger/sandbox/pandas/pandas/core/indexes/range.py:716: FutureWarning: Support for multi-dimensional indexing (e.g. `obj[:, None]`) is deprecated and will be removed in a future version. Convert to a numpy array before indexing instead.
return super().__getitem__(key)
---------------------------------------------------------------------------
AssertionError Traceback (most recent call last)
<ipython-input-3-89522aec9762> in <module>
----> 1 s[:, None]
~/sandbox/pandas/pandas/core/series.py in __getitem__(self, key)
906 return self._get_values(key)
907
--> 908 return self._get_with(key)
909
910 def _get_with(self, key):
~/sandbox/pandas/pandas/core/series.py in _get_with(self, key)
921 )
922 elif isinstance(key, tuple):
--> 923 return self._get_values_tuple(key)
924
925 elif not is_list_like(key):
~/sandbox/pandas/pandas/core/series.py in _get_values_tuple(self, key)
951 # mpl hackaround
952 if com.any_none(*key):
--> 953 result = self._get_values(key)
954 deprecate_ndim_indexing(result, stacklevel=5)
955 return result
~/sandbox/pandas/pandas/core/series.py in _get_values(self, indexer)
966 def _get_values(self, indexer):
967 try:
--> 968 return self._constructor(self._mgr.get_slice(indexer)).__finalize__(self,)
969 except ValueError:
970 # mpl compat if we look up e.g. ser[:, np.newaxis];
~/sandbox/pandas/pandas/core/internals/managers.py in get_slice(self, slobj, axis)
1561 array = blk._slice(slobj)
1562 block = blk.make_block_same_class(array, placement=slice(0, len(array)))
-> 1563 return type(self)(block, self.index[slobj])
1564
1565 @property
~/sandbox/pandas/pandas/core/internals/managers.py in __init__(self, block, axis, do_integrity_check, fastpath)
1505 ):
1506 assert isinstance(block, Block), type(block)
-> 1507 assert isinstance(axis, Index), type(axis)
1508
1509 if fastpath is not lib.no_default:
AssertionError: <class 'numpy.ndarray'>
```
We should continue to raise an IndexError here.
Reported in https://github.com/matplotlib/matplotlib/issues/18158.
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/35527/reactions"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35527/timeline
| null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/35528
|
https://api.github.com/repos/pandas-dev/pandas
|
https://api.github.com/repos/pandas-dev/pandas/issues/35528/labels{/name}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35528/comments
|
https://api.github.com/repos/pandas-dev/pandas/issues/35528/events
|
https://github.com/pandas-dev/pandas/issues/35528
| 672,218,354
|
MDU6SXNzdWU2NzIyMTgzNTQ=
| 35,528
|
BUG: columns disappear when selecting rows with an explicit boolean expression which returns no rows
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/7925833?v=4",
"events_url": "https://api.github.com/users/yanvirin/events{/privacy}",
"followers_url": "https://api.github.com/users/yanvirin/followers",
"following_url": "https://api.github.com/users/yanvirin/following{/other_user}",
"gists_url": "https://api.github.com/users/yanvirin/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/yanvirin",
"id": 7925833,
"login": "yanvirin",
"node_id": "MDQ6VXNlcjc5MjU4MzM=",
"organizations_url": "https://api.github.com/users/yanvirin/orgs",
"received_events_url": "https://api.github.com/users/yanvirin/received_events",
"repos_url": "https://api.github.com/users/yanvirin/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/yanvirin/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/yanvirin/subscriptions",
"type": "User",
"url": "https://api.github.com/users/yanvirin"
}
|
[
{
"color": "e10c02",
"default": false,
"description": null,
"id": 76811,
"name": "Bug",
"node_id": "MDU6TGFiZWw3NjgxMQ==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Bug"
},
{
"color": "0b02e1",
"default": false,
"description": "Related to indexing on series/frames, not to indexes themselves",
"id": 2822098,
"name": "Indexing",
"node_id": "MDU6TGFiZWwyODIyMDk4",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Indexing"
},
{
"color": "be21f2",
"default": false,
"description": "May be closeable, needs more eyeballs",
"id": 2365504893,
"name": "Closing Candidate",
"node_id": "MDU6TGFiZWwyMzY1NTA0ODkz",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Closing%20Candidate"
}
] |
closed
| false
| null |
[] |
{
"closed_at": null,
"closed_issues": 2361,
"created_at": "2015-02-26T19:29:05Z",
"creator": {
"avatar_url": "https://avatars.githubusercontent.com/u/1020496?v=4",
"events_url": "https://api.github.com/users/jorisvandenbossche/events{/privacy}",
"followers_url": "https://api.github.com/users/jorisvandenbossche/followers",
"following_url": "https://api.github.com/users/jorisvandenbossche/following{/other_user}",
"gists_url": "https://api.github.com/users/jorisvandenbossche/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jorisvandenbossche",
"id": 1020496,
"login": "jorisvandenbossche",
"node_id": "MDQ6VXNlcjEwMjA0OTY=",
"organizations_url": "https://api.github.com/users/jorisvandenbossche/orgs",
"received_events_url": "https://api.github.com/users/jorisvandenbossche/received_events",
"repos_url": "https://api.github.com/users/jorisvandenbossche/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jorisvandenbossche/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jorisvandenbossche/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jorisvandenbossche"
},
"description": "A milestone for closed or open issues for which there is no action needed (eg not a bug, just a question / discussion, nothing to resolve, wontfix, etc).\r\n\r\n",
"due_on": null,
"html_url": "https://github.com/pandas-dev/pandas/milestone/33",
"id": 997544,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/33/labels",
"node_id": "MDk6TWlsZXN0b25lOTk3NTQ0",
"number": 33,
"open_issues": 11,
"state": "open",
"title": "No action",
"updated_at": "2021-11-19T17:33:16Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/33"
}
| 7
| 2020-08-03T17:09:17Z
| 2021-04-22T21:25:06Z
| 2021-04-22T21:24:58Z
|
NONE
| null |
- [ ] I have checked that this issue has not already been reported.
- [ ] I have confirmed this bug exists on the latest version of pandas.
- [ ] (optional) I have confirmed this bug exists on the master branch of pandas.
---
**Note**: Please read [this guide](https://matthewrocklin.com/blog/work/2018/02/28/minimal-bug-reports) detailing how to provide the necessary information for us to reproduce your bug.
#### Code Sample, a copy-pastable example
```python
df = DataFrame(columns=["x","y"])
df = df[df["x"]]
print(df.columns)
# columns disappeared
df = DataFrame(columns=["x","y"])
df = df[df["x"] == True]
print(df.columns)
# columns still there
```
#### Problem description
Columns disappear in the first example, when using a boolean expression to select rows with no matching rows.
#### Expected Output
Columns should remain intact as in the second example, which should be equivalent to the first one.
#### Output of ``pd.show_versions()``
<details>
INSTALLED VERSIONS
------------------
commit : None
python : 3.7.3.final.0
python-bits : 64
OS : Darwin
OS-release : 18.7.0
machine : x86_64
processor : i386
byteorder : little
LC_ALL : None
LANG : en_US.UTF-8
LOCALE : en_US.UTF-8
pandas : 0.25.3
numpy : 1.18.1
pytz : 2019.3
dateutil : 2.8.1
pip : 19.0.3
setuptools : 40.8.0
Cython : None
pytest : 5.3.5
hypothesis : None
sphinx : None
blosc : None
feather : None
xlsxwriter : None
lxml.etree : None
html5lib : None
pymysql : None
psycopg2 : 2.8.5 (dt dec pq3 ext lo64)
jinja2 : 2.11.0
IPython : 7.6.1
pandas_datareader: None
bs4 : 4.8.2
bottleneck : None
fastparquet : None
gcsfs : None
lxml.etree : None
matplotlib : 3.2.1
numexpr : 2.7.1
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : None
pytables : None
s3fs : None
scipy : 1.4.1
sqlalchemy : 1.3.13
tables : 3.6.1
xarray : None
xlrd : None
xlwt : None
xlsxwriter : None
</details>
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/35528/reactions"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35528/timeline
| null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/35529
|
https://api.github.com/repos/pandas-dev/pandas
|
https://api.github.com/repos/pandas-dev/pandas/issues/35529/labels{/name}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35529/comments
|
https://api.github.com/repos/pandas-dev/pandas/issues/35529/events
|
https://github.com/pandas-dev/pandas/issues/35529
| 672,228,184
|
MDU6SXNzdWU2NzIyMjgxODQ=
| 35,529
|
BUG: ValueError during floordiv of a series with timedelta type
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/11664259?v=4",
"events_url": "https://api.github.com/users/galipremsagar/events{/privacy}",
"followers_url": "https://api.github.com/users/galipremsagar/followers",
"following_url": "https://api.github.com/users/galipremsagar/following{/other_user}",
"gists_url": "https://api.github.com/users/galipremsagar/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/galipremsagar",
"id": 11664259,
"login": "galipremsagar",
"node_id": "MDQ6VXNlcjExNjY0MjU5",
"organizations_url": "https://api.github.com/users/galipremsagar/orgs",
"received_events_url": "https://api.github.com/users/galipremsagar/received_events",
"repos_url": "https://api.github.com/users/galipremsagar/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/galipremsagar/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/galipremsagar/subscriptions",
"type": "User",
"url": "https://api.github.com/users/galipremsagar"
}
|
[
{
"color": "e10c02",
"default": false,
"description": null,
"id": 76811,
"name": "Bug",
"node_id": "MDU6TGFiZWw3NjgxMQ==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Bug"
},
{
"color": "006b75",
"default": false,
"description": "Arithmetic, Comparison, and Logical operations",
"id": 47223669,
"name": "Numeric Operations",
"node_id": "MDU6TGFiZWw0NzIyMzY2OQ==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Numeric%20Operations"
},
{
"color": "5319e7",
"default": false,
"description": "Timedelta data type",
"id": 49597148,
"name": "Timedelta",
"node_id": "MDU6TGFiZWw0OTU5NzE0OA==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Timedelta"
}
] |
closed
| false
| null |
[] |
{
"closed_at": "2020-12-26T13:57:50Z",
"closed_issues": 1768,
"created_at": "2020-05-29T23:47:32Z",
"creator": {
"avatar_url": "https://avatars.githubusercontent.com/u/953992?v=4",
"events_url": "https://api.github.com/users/jreback/events{/privacy}",
"followers_url": "https://api.github.com/users/jreback/followers",
"following_url": "https://api.github.com/users/jreback/following{/other_user}",
"gists_url": "https://api.github.com/users/jreback/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jreback",
"id": 953992,
"login": "jreback",
"node_id": "MDQ6VXNlcjk1Mzk5Mg==",
"organizations_url": "https://api.github.com/users/jreback/orgs",
"received_events_url": "https://api.github.com/users/jreback/received_events",
"repos_url": "https://api.github.com/users/jreback/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jreback/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jreback/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jreback"
},
"description": "on-merge: backport to 1.2.x",
"due_on": "2020-12-15T08:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/73",
"id": 5479819,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/73/labels",
"node_id": "MDk6TWlsZXN0b25lNTQ3OTgxOQ==",
"number": 73,
"open_issues": 0,
"state": "closed",
"title": "1.2",
"updated_at": "2021-04-13T15:46:43Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/73"
}
| 0
| 2020-08-03T17:26:52Z
| 2020-08-06T16:20:29Z
| 2020-08-06T16:20:29Z
|
NONE
| null |
- [x] I have checked that this issue has not already been reported.
- [x] I have confirmed this bug exists on the latest version of pandas.
- [ ] (optional) I have confirmed this bug exists on the master branch of pandas.
---
#### Code Sample, a copy-pastable example
```python
>>> import pandas as pd
>>> sr = pd.Series([10, 20, 30], dtype='timedelta64[ns]')
>>> sr
0 00:00:00.000000
1 00:00:00.000000
2 00:00:00.000000
dtype: timedelta64[ns]
>>> sr = pd.Series([1000, 20, 30], dtype='timedelta64[ns]')
>>> sr
0 00:00:00.000001
1 00:00:00.000000
2 00:00:00.000000
dtype: timedelta64[ns]
>>> sr = pd.Series([1000, 222330, 30], dtype='timedelta64[ns]')
>>> sr
0 00:00:00.000001
1 00:00:00.000222
2 00:00:00.000000
dtype: timedelta64[ns]
>>> sr1 = pd.Series([1000, 222330, None], dtype='timedelta64[ns]')
>>> sr1
0 00:00:00.000001
1 00:00:00.000222
2 NaT
dtype: timedelta64[ns]
>>> sr / sr1
0 1.0
1 1.0
2 NaN
dtype: float64
>>> sr // sr1
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/nvme/0/pgali/envs/cudfdev1/lib/python3.7/site-packages/pandas/core/ops/common.py", line 64, in new_method
return method(self, other)
File "/nvme/0/pgali/envs/cudfdev1/lib/python3.7/site-packages/pandas/core/ops/__init__.py", line 503, in wrapper
result = arithmetic_op(lvalues, rvalues, op, str_rep)
File "/nvme/0/pgali/envs/cudfdev1/lib/python3.7/site-packages/pandas/core/ops/array_ops.py", line 193, in arithmetic_op
res_values = dispatch_to_extension_op(op, lvalues, rvalues)
File "/nvme/0/pgali/envs/cudfdev1/lib/python3.7/site-packages/pandas/core/ops/dispatch.py", line 125, in dispatch_to_extension_op
res_values = op(left, right)
File "/nvme/0/pgali/envs/cudfdev1/lib/python3.7/site-packages/pandas/core/arrays/timedeltas.py", line 637, in __floordiv__
result[mask] = np.nan
ValueError: cannot convert float NaN to integer
```
#### Problem description
When there is a `NaT` in either of the series, the result should ideally be of type `nullable` integer (`Int64`) to avoid this kind of `ValueError`
#### Expected Output
#### Output of ``pd.show_versions()``
<details>
INSTALLED VERSIONS
------------------
commit : None
python : 3.7.6.final.0
python-bits : 64
OS : Linux
OS-release : 4.15.0-76-generic
machine : x86_64
processor : x86_64
byteorder : little
LC_ALL : None
LANG : en_US.UTF-8
LOCALE : en_US.UTF-8
pandas : 1.0.5
numpy : 1.18.5
pytz : 2020.1
dateutil : 2.8.1
pip : 20.1.1
setuptools : 49.1.0.post20200704
Cython : 0.29.21
pytest : 5.4.3
hypothesis : 5.19.0
sphinx : 3.1.2
blosc : None
feather : None
xlsxwriter : None
lxml.etree : None
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : 2.11.2
IPython : 7.16.1
pandas_datareader: None
bs4 : None
bottleneck : None
fastparquet : None
gcsfs : None
lxml.etree : None
matplotlib : None
numexpr : None
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : 0.17.1
pytables : None
pytest : 5.4.3
pyxlsb : None
s3fs : None
scipy : None
sqlalchemy : None
tables : None
tabulate : None
xarray : None
xlrd : None
xlwt : None
xlsxwriter : None
numba : 0.50.1
</details>
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/35529/reactions"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35529/timeline
| null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/35530
|
https://api.github.com/repos/pandas-dev/pandas
|
https://api.github.com/repos/pandas-dev/pandas/issues/35530/labels{/name}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35530/comments
|
https://api.github.com/repos/pandas-dev/pandas/issues/35530/events
|
https://github.com/pandas-dev/pandas/issues/35530
| 672,290,983
|
MDU6SXNzdWU2NzIyOTA5ODM=
| 35,530
|
BUG: "buffer source array is read-only" with tz_convert_from_utc/DatetimeArray.date
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/327919?v=4",
"events_url": "https://api.github.com/users/lidavidm/events{/privacy}",
"followers_url": "https://api.github.com/users/lidavidm/followers",
"following_url": "https://api.github.com/users/lidavidm/following{/other_user}",
"gists_url": "https://api.github.com/users/lidavidm/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/lidavidm",
"id": 327919,
"login": "lidavidm",
"node_id": "MDQ6VXNlcjMyNzkxOQ==",
"organizations_url": "https://api.github.com/users/lidavidm/orgs",
"received_events_url": "https://api.github.com/users/lidavidm/received_events",
"repos_url": "https://api.github.com/users/lidavidm/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/lidavidm/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/lidavidm/subscriptions",
"type": "User",
"url": "https://api.github.com/users/lidavidm"
}
|
[
{
"color": "e10c02",
"default": false,
"description": null,
"id": 76811,
"name": "Bug",
"node_id": "MDU6TGFiZWw3NjgxMQ==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Bug"
},
{
"color": "AFEEEE",
"default": false,
"description": null,
"id": 211840,
"name": "Timeseries",
"node_id": "MDU6TGFiZWwyMTE4NDA=",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Timeseries"
},
{
"color": "5319e7",
"default": false,
"description": "Timezone data dtype",
"id": 60458168,
"name": "Timezones",
"node_id": "MDU6TGFiZWw2MDQ1ODE2OA==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Timezones"
}
] |
closed
| false
| null |
[] |
{
"closed_at": "2020-12-26T13:57:50Z",
"closed_issues": 1768,
"created_at": "2020-05-29T23:47:32Z",
"creator": {
"avatar_url": "https://avatars.githubusercontent.com/u/953992?v=4",
"events_url": "https://api.github.com/users/jreback/events{/privacy}",
"followers_url": "https://api.github.com/users/jreback/followers",
"following_url": "https://api.github.com/users/jreback/following{/other_user}",
"gists_url": "https://api.github.com/users/jreback/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jreback",
"id": 953992,
"login": "jreback",
"node_id": "MDQ6VXNlcjk1Mzk5Mg==",
"organizations_url": "https://api.github.com/users/jreback/orgs",
"received_events_url": "https://api.github.com/users/jreback/received_events",
"repos_url": "https://api.github.com/users/jreback/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jreback/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jreback/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jreback"
},
"description": "on-merge: backport to 1.2.x",
"due_on": "2020-12-15T08:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/73",
"id": 5479819,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/73/labels",
"node_id": "MDk6TWlsZXN0b25lNTQ3OTgxOQ==",
"number": 73,
"open_issues": 0,
"state": "closed",
"title": "1.2",
"updated_at": "2021-04-13T15:46:43Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/73"
}
| 1
| 2020-08-03T19:25:16Z
| 2020-08-06T15:11:22Z
| 2020-08-06T15:11:22Z
|
CONTRIBUTOR
| null |
- [X] I have checked that this issue has not already been reported.
There are similar issues with the same symptom
- [X] I have confirmed this bug exists on the latest version of pandas.
Tested with Pandas 1.1.0
- [X] (optional) I have confirmed this bug exists on the master branch of pandas.
Tested with bdcc5bffaadb7488474b65554c4e8e96a00aa4af
---
**Note**: Please read [this guide](https://matthewrocklin.com/blog/work/2018/02/28/minimal-bug-reports) detailing how to provide the necessary information for us to reproduce your bug.
#### Code Sample, a copy-pastable example
```python
import pyarrow as pa
import pandas as pd
import pytz
print("PyArrow:", pa.__version__)
print("Pandas:", pd.__version__)
table = pa.table([
pa.array([
pd.Timestamp('2014-01-01'),
], type=pa.timestamp("ns"))
], names=["time"])
df = table.to_pandas(self_destruct=True, split_blocks=True)
df.set_index("time", inplace=True)
df.index = df.index.tz_localize(pytz.utc)
# These are OK
print(df.index.date)
print(df.index.tz_convert("America/New_York"))
# But not this
print(df.index.tz_convert("America/New_York").date)
```
#### Problem description
The reproduction results in this exception:
```python
Traceback (most recent call last):
File "repro.py", line 18, in <module>
print(df.index.tz_convert("America/New_York").date)
File "/home/lidavidm/Code/twosigma/pandas/temp/venv/lib/python3.8/site-packages/pandas/core/indexes/extension.py", line 54, in fget
result = getattr(self._data, name)
File "/home/lidavidm/Code/twosigma/pandas/temp/venv/lib/python3.8/site-packages/pandas/core/arrays/datetimes.py", line 1246, in date
timestamps = self._local_timestamps()
File "/home/lidavidm/Code/twosigma/pandas/temp/venv/lib/python3.8/site-packages/pandas/core/arrays/datetimes.py", line 731, in _local_timestamps
return tzconversion.tz_convert_from_utc(self.asi8, self.tz)
File "pandas/_libs/tslibs/tzconversion.pyx", line 407, in pandas._libs.tslibs.tzconversion.tz_convert_from_utc
File "stringsource", line 658, in View.MemoryView.memoryview_cwrapper
File "stringsource", line 349, in View.MemoryView.memoryview.__cinit__
ValueError: buffer source array is read-only
```
The data is not being modified in place, so it should work with an immutable source array.
This is because `tz_convert_from_utc` and `_tz_convert_from_utc` are missing some `const` specifiers in Cython.
#### Expected Output
The `.date` accessor should work as expected:
```python
[datetime.date(2013, 12, 31)]
```
#### Output of ``pd.show_versions()``
<details>
INSTALLED VERSIONS
------------------
commit : d9fff2792bf16178d4e450fe7384244e50635733
python : 3.8.3.final.0
python-bits : 64
OS : Linux
OS-release : 5.7.9-arch1-1
Version : #1 SMP PREEMPT Thu, 16 Jul 2020 19:34:49 +0000
machine : x86_64
processor :
byteorder : little
LC_ALL : None
LANG : en_US.UTF-8
LOCALE : en_US.UTF-8
pandas : 1.1.0
numpy : 1.19.1
pytz : 2020.1
dateutil : 2.8.1
pip : 20.1.1
setuptools : 47.1.1
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
fsspec : None
fastparquet : None
gcsfs : None
matplotlib : None
numexpr : None
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : 1.0.0
pytables : None
pyxlsb : None
s3fs : None
scipy : None
sqlalchemy : None
tables : None
tabulate : None
xarray : None
xlrd : None
xlwt : None
numba : None
</details>
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/35530/reactions"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35530/timeline
| null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/35531
|
https://api.github.com/repos/pandas-dev/pandas
|
https://api.github.com/repos/pandas-dev/pandas/issues/35531/labels{/name}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35531/comments
|
https://api.github.com/repos/pandas-dev/pandas/issues/35531/events
|
https://github.com/pandas-dev/pandas/issues/35531
| 672,306,607
|
MDU6SXNzdWU2NzIzMDY2MDc=
| 35,531
|
QST:Adding NOT NULL Columns using to_sql to MSSQL database using Pandas SqlAlchemy
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/69168747?v=4",
"events_url": "https://api.github.com/users/Menaz12/events{/privacy}",
"followers_url": "https://api.github.com/users/Menaz12/followers",
"following_url": "https://api.github.com/users/Menaz12/following{/other_user}",
"gists_url": "https://api.github.com/users/Menaz12/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Menaz12",
"id": 69168747,
"login": "Menaz12",
"node_id": "MDQ6VXNlcjY5MTY4NzQ3",
"organizations_url": "https://api.github.com/users/Menaz12/orgs",
"received_events_url": "https://api.github.com/users/Menaz12/received_events",
"repos_url": "https://api.github.com/users/Menaz12/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Menaz12/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Menaz12/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Menaz12"
}
|
[
{
"color": "0052cc",
"default": false,
"description": null,
"id": 34444536,
"name": "Usage Question",
"node_id": "MDU6TGFiZWwzNDQ0NDUzNg==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Usage%20Question"
}
] |
closed
| false
| null |
[] | null | 2
| 2020-08-03T19:55:03Z
| 2020-08-21T17:04:43Z
| 2020-08-04T14:33:00Z
|
NONE
| null |
I am trying to read table from SQL and writing to ORACLE using pandas.
Everything works except the columns are created as NULL in Oracle.
Any help is greatly appreciated.
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/35531/reactions"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35531/timeline
| null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/35532
|
https://api.github.com/repos/pandas-dev/pandas
|
https://api.github.com/repos/pandas-dev/pandas/issues/35532/labels{/name}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35532/comments
|
https://api.github.com/repos/pandas-dev/pandas/issues/35532/events
|
https://github.com/pandas-dev/pandas/pull/35532
| 672,387,439
|
MDExOlB1bGxSZXF1ZXN0NDYyNDMzNzUx
| 35,532
|
BUG: handle immutable arrays in tz_convert_from_utc (#35530)
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/327919?v=4",
"events_url": "https://api.github.com/users/lidavidm/events{/privacy}",
"followers_url": "https://api.github.com/users/lidavidm/followers",
"following_url": "https://api.github.com/users/lidavidm/following{/other_user}",
"gists_url": "https://api.github.com/users/lidavidm/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/lidavidm",
"id": 327919,
"login": "lidavidm",
"node_id": "MDQ6VXNlcjMyNzkxOQ==",
"organizations_url": "https://api.github.com/users/lidavidm/orgs",
"received_events_url": "https://api.github.com/users/lidavidm/received_events",
"repos_url": "https://api.github.com/users/lidavidm/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/lidavidm/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/lidavidm/subscriptions",
"type": "User",
"url": "https://api.github.com/users/lidavidm"
}
|
[
{
"color": "AFEEEE",
"default": false,
"description": null,
"id": 211840,
"name": "Timeseries",
"node_id": "MDU6TGFiZWwyMTE4NDA=",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Timeseries"
}
] |
closed
| false
| null |
[] |
{
"closed_at": "2020-12-26T13:57:50Z",
"closed_issues": 1768,
"created_at": "2020-05-29T23:47:32Z",
"creator": {
"avatar_url": "https://avatars.githubusercontent.com/u/953992?v=4",
"events_url": "https://api.github.com/users/jreback/events{/privacy}",
"followers_url": "https://api.github.com/users/jreback/followers",
"following_url": "https://api.github.com/users/jreback/following{/other_user}",
"gists_url": "https://api.github.com/users/jreback/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jreback",
"id": 953992,
"login": "jreback",
"node_id": "MDQ6VXNlcjk1Mzk5Mg==",
"organizations_url": "https://api.github.com/users/jreback/orgs",
"received_events_url": "https://api.github.com/users/jreback/received_events",
"repos_url": "https://api.github.com/users/jreback/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jreback/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jreback/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jreback"
},
"description": "on-merge: backport to 1.2.x",
"due_on": "2020-12-15T08:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/73",
"id": 5479819,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/73/labels",
"node_id": "MDk6TWlsZXN0b25lNTQ3OTgxOQ==",
"number": 73,
"open_issues": 0,
"state": "closed",
"title": "1.2",
"updated_at": "2021-04-13T15:46:43Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/73"
}
| 6
| 2020-08-03T22:49:18Z
| 2020-08-06T18:17:25Z
| 2020-08-06T15:11:23Z
|
CONTRIBUTOR
| null |
- [x] closes #35530
- [x] tests added / passed
- [x] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [x] whatsnew entry
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/35532/reactions"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35532/timeline
| null | 0
|
{
"diff_url": "https://github.com/pandas-dev/pandas/pull/35532.diff",
"html_url": "https://github.com/pandas-dev/pandas/pull/35532",
"merged_at": "2020-08-06T15:11:22Z",
"patch_url": "https://github.com/pandas-dev/pandas/pull/35532.patch",
"url": "https://api.github.com/repos/pandas-dev/pandas/pulls/35532"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35533
|
https://api.github.com/repos/pandas-dev/pandas
|
https://api.github.com/repos/pandas-dev/pandas/issues/35533/labels{/name}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35533/comments
|
https://api.github.com/repos/pandas-dev/pandas/issues/35533/events
|
https://github.com/pandas-dev/pandas/pull/35533
| 672,431,117
|
MDExOlB1bGxSZXF1ZXN0NDYyNDY5MzI5
| 35,533
|
Check if NPY_NAT is NA for int64 in rank() (#32859)
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/5392964?v=4",
"events_url": "https://api.github.com/users/gabrielNT/events{/privacy}",
"followers_url": "https://api.github.com/users/gabrielNT/followers",
"following_url": "https://api.github.com/users/gabrielNT/following{/other_user}",
"gists_url": "https://api.github.com/users/gabrielNT/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/gabrielNT",
"id": 5392964,
"login": "gabrielNT",
"node_id": "MDQ6VXNlcjUzOTI5NjQ=",
"organizations_url": "https://api.github.com/users/gabrielNT/orgs",
"received_events_url": "https://api.github.com/users/gabrielNT/received_events",
"repos_url": "https://api.github.com/users/gabrielNT/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/gabrielNT/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/gabrielNT/subscriptions",
"type": "User",
"url": "https://api.github.com/users/gabrielNT"
}
|
[
{
"color": "8cc645",
"default": false,
"description": "Related to pd.NA and nullable extension arrays",
"id": 1817503692,
"name": "NA - MaskedArrays",
"node_id": "MDU6TGFiZWwxODE3NTAzNjky",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/NA%20-%20MaskedArrays"
}
] |
closed
| false
| null |
[] | null | 2
| 2020-08-04T01:04:37Z
| 2020-08-18T01:03:40Z
| 2020-08-18T01:03:30Z
|
CONTRIBUTOR
| null |
- [x] closes #32859
- [x] tests added / passed
- [x] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [x] whatsnew entry
Used `missing.isnaobj()` to try to handle the suggestion from @jbrockmendel. Lmk if this might cause other issues.
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/35533/reactions"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35533/timeline
| null | 0
|
{
"diff_url": "https://github.com/pandas-dev/pandas/pull/35533.diff",
"html_url": "https://github.com/pandas-dev/pandas/pull/35533",
"merged_at": null,
"patch_url": "https://github.com/pandas-dev/pandas/pull/35533.patch",
"url": "https://api.github.com/repos/pandas-dev/pandas/pulls/35533"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35534
|
https://api.github.com/repos/pandas-dev/pandas
|
https://api.github.com/repos/pandas-dev/pandas/issues/35534/labels{/name}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35534/comments
|
https://api.github.com/repos/pandas-dev/pandas/issues/35534/events
|
https://github.com/pandas-dev/pandas/issues/35534
| 672,540,575
|
MDU6SXNzdWU2NzI1NDA1NzU=
| 35,534
|
BUG: Cannot select values in series using tuples when indexing with tuples in pandas 1.1.0
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/7500158?v=4",
"events_url": "https://api.github.com/users/lfiedler/events{/privacy}",
"followers_url": "https://api.github.com/users/lfiedler/followers",
"following_url": "https://api.github.com/users/lfiedler/following{/other_user}",
"gists_url": "https://api.github.com/users/lfiedler/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/lfiedler",
"id": 7500158,
"login": "lfiedler",
"node_id": "MDQ6VXNlcjc1MDAxNTg=",
"organizations_url": "https://api.github.com/users/lfiedler/orgs",
"received_events_url": "https://api.github.com/users/lfiedler/received_events",
"repos_url": "https://api.github.com/users/lfiedler/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/lfiedler/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/lfiedler/subscriptions",
"type": "User",
"url": "https://api.github.com/users/lfiedler"
}
|
[
{
"color": "0b02e1",
"default": false,
"description": "Related to indexing on series/frames, not to indexes themselves",
"id": 2822098,
"name": "Indexing",
"node_id": "MDU6TGFiZWwyODIyMDk4",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Indexing"
},
{
"color": "e11d21",
"default": false,
"description": "Functionality that used to work in a prior pandas version",
"id": 32815646,
"name": "Regression",
"node_id": "MDU6TGFiZWwzMjgxNTY0Ng==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Regression"
}
] |
closed
| false
| null |
[] |
{
"closed_at": "2020-10-05T18:41:57Z",
"closed_issues": 106,
"created_at": "2020-09-07T09:13:14Z",
"creator": {
"avatar_url": "https://avatars.githubusercontent.com/u/13159005?v=4",
"events_url": "https://api.github.com/users/simonjayhawkins/events{/privacy}",
"followers_url": "https://api.github.com/users/simonjayhawkins/followers",
"following_url": "https://api.github.com/users/simonjayhawkins/following{/other_user}",
"gists_url": "https://api.github.com/users/simonjayhawkins/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/simonjayhawkins",
"id": 13159005,
"login": "simonjayhawkins",
"node_id": "MDQ6VXNlcjEzMTU5MDA1",
"organizations_url": "https://api.github.com/users/simonjayhawkins/orgs",
"received_events_url": "https://api.github.com/users/simonjayhawkins/received_events",
"repos_url": "https://api.github.com/users/simonjayhawkins/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/simonjayhawkins/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/simonjayhawkins/subscriptions",
"type": "User",
"url": "https://api.github.com/users/simonjayhawkins"
},
"description": "on-merge: backport to 1.1.x",
"due_on": "2020-09-29T07:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/77",
"id": 5850626,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/77/labels",
"node_id": "MDk6TWlsZXN0b25lNTg1MDYyNg==",
"number": 77,
"open_issues": 0,
"state": "closed",
"title": "1.1.3",
"updated_at": "2020-10-29T13:15:36Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/77"
}
| 5
| 2020-08-04T06:30:02Z
| 2020-09-12T21:39:40Z
| 2020-09-12T21:39:40Z
|
NONE
| null |
- [x] I have checked that this issue has not already been reported.
- [x] I have confirmed this bug exists on the latest version of pandas.
- [ ] (optional) I have confirmed this bug exists on the master branch of pandas.
---
**Note**: Please read [this guide](https://matthewrocklin.com/blog/work/2018/02/28/minimal-bug-reports) detailing how to provide the necessary information for us to reproduce your bug.
#### Code Sample, a copy-pastable example
```python
import pandas as pd
if __name__ == "__main__":
series = pd.Series([1, 2, 3, 4], index=[("a", ), ("b", ), ("c", ), ("d", )])
print(series[("a", )])
```
#### Problem description
On pandas 1.0.5 selecting values of a series which is indexed by tuples was possible via `__getitem__` using the desired tuple (see above code). In pandas 1.1.0 this suddenly raises a ValueError:
```
ValueError: Can only tuple-index with a MultiIndex
```
As this used to work in 1.0.5 and earlier versions (0.25 as far as I can recall) I expect this to be an unwanted side effect rather than a wanted change in behavior (in which case it would certainly be breaking).
Apart from this, I expected Series objects to behave to some degree like python dictionaries. In particular using tuples of strings as keys and selecting values by such tuples I think should be possible.
#### Expected Output
`1`
#### Output of ``pd.show_versions()``
<details>
```
INSTALLED VERSIONS
------------------
commit : d9fff2792bf16178d4e450fe7384244e50635733
python : 3.8.3.final.0
python-bits : 64
OS : Linux
OS-release : 5.4.0-42-generic
Version : #46-Ubuntu SMP Fri Jul 10 00:24:02 UTC 2020
machine : x86_64
processor : x86_64
byteorder : little
LC_ALL : None
LANG : en_US.UTF-8
LOCALE : en_US.UTF-8
pandas : 1.1.0
numpy : 1.19.1
pytz : 2020.1
dateutil : 2.8.1
pip : 20.1.1
setuptools : 47.3.1.post20200622
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
fsspec : None
fastparquet : None
gcsfs : None
matplotlib : None
numexpr : None
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : None
pytables : None
pyxlsb : None
s3fs : None
scipy : None
sqlalchemy : None
tables : None
tabulate : None
xarray : None
xlrd : None
xlwt : None
numba : None
None
```
</details>
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/35534/reactions"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35534/timeline
| null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/35535
|
https://api.github.com/repos/pandas-dev/pandas
|
https://api.github.com/repos/pandas-dev/pandas/issues/35535/labels{/name}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35535/comments
|
https://api.github.com/repos/pandas-dev/pandas/issues/35535/events
|
https://github.com/pandas-dev/pandas/pull/35535
| 672,604,354
|
MDExOlB1bGxSZXF1ZXN0NDYyNjEwMDAy
| 35,535
|
Backport PR #35467 on branch 1.1.x (CI: activate github actions on 1.1.x (PR only))
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/39504233?v=4",
"events_url": "https://api.github.com/users/meeseeksmachine/events{/privacy}",
"followers_url": "https://api.github.com/users/meeseeksmachine/followers",
"following_url": "https://api.github.com/users/meeseeksmachine/following{/other_user}",
"gists_url": "https://api.github.com/users/meeseeksmachine/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/meeseeksmachine",
"id": 39504233,
"login": "meeseeksmachine",
"node_id": "MDQ6VXNlcjM5NTA0MjMz",
"organizations_url": "https://api.github.com/users/meeseeksmachine/orgs",
"received_events_url": "https://api.github.com/users/meeseeksmachine/received_events",
"repos_url": "https://api.github.com/users/meeseeksmachine/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/meeseeksmachine/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/meeseeksmachine/subscriptions",
"type": "User",
"url": "https://api.github.com/users/meeseeksmachine"
}
|
[] |
closed
| false
| null |
[] |
{
"closed_at": "2020-08-21T08:34:54Z",
"closed_issues": 110,
"created_at": "2020-07-10T13:54:44Z",
"creator": {
"avatar_url": "https://avatars.githubusercontent.com/u/953992?v=4",
"events_url": "https://api.github.com/users/jreback/events{/privacy}",
"followers_url": "https://api.github.com/users/jreback/followers",
"following_url": "https://api.github.com/users/jreback/following{/other_user}",
"gists_url": "https://api.github.com/users/jreback/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jreback",
"id": 953992,
"login": "jreback",
"node_id": "MDQ6VXNlcjk1Mzk5Mg==",
"organizations_url": "https://api.github.com/users/jreback/orgs",
"received_events_url": "https://api.github.com/users/jreback/received_events",
"repos_url": "https://api.github.com/users/jreback/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jreback/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jreback/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jreback"
},
"description": "on-merge: backport to 1.1.x",
"due_on": "2020-08-22T07:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/75",
"id": 5640672,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/75/labels",
"node_id": "MDk6TWlsZXN0b25lNTY0MDY3Mg==",
"number": 75,
"open_issues": 0,
"state": "closed",
"title": "1.1.1",
"updated_at": "2020-08-25T06:31:23Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/75"
}
| 0
| 2020-08-04T08:22:31Z
| 2020-08-04T09:00:50Z
| 2020-08-04T09:00:50Z
|
NONE
| null |
Backport PR #35467: CI: activate github actions on 1.1.x (PR only)
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/35535/reactions"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35535/timeline
| null | 0
|
{
"diff_url": "https://github.com/pandas-dev/pandas/pull/35535.diff",
"html_url": "https://github.com/pandas-dev/pandas/pull/35535",
"merged_at": "2020-08-04T09:00:50Z",
"patch_url": "https://github.com/pandas-dev/pandas/pull/35535.patch",
"url": "https://api.github.com/repos/pandas-dev/pandas/pulls/35535"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35536
|
https://api.github.com/repos/pandas-dev/pandas
|
https://api.github.com/repos/pandas-dev/pandas/issues/35536/labels{/name}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35536/comments
|
https://api.github.com/repos/pandas-dev/pandas/issues/35536/events
|
https://github.com/pandas-dev/pandas/pull/35536
| 672,604,711
|
MDExOlB1bGxSZXF1ZXN0NDYyNjEwMjk3
| 35,536
|
Backport PR #35468 on branch 1.1.x (CI: activate azure pipelines on 1.1.x)
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/39504233?v=4",
"events_url": "https://api.github.com/users/meeseeksmachine/events{/privacy}",
"followers_url": "https://api.github.com/users/meeseeksmachine/followers",
"following_url": "https://api.github.com/users/meeseeksmachine/following{/other_user}",
"gists_url": "https://api.github.com/users/meeseeksmachine/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/meeseeksmachine",
"id": 39504233,
"login": "meeseeksmachine",
"node_id": "MDQ6VXNlcjM5NTA0MjMz",
"organizations_url": "https://api.github.com/users/meeseeksmachine/orgs",
"received_events_url": "https://api.github.com/users/meeseeksmachine/received_events",
"repos_url": "https://api.github.com/users/meeseeksmachine/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/meeseeksmachine/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/meeseeksmachine/subscriptions",
"type": "User",
"url": "https://api.github.com/users/meeseeksmachine"
}
|
[] |
closed
| false
| null |
[] |
{
"closed_at": "2020-08-21T08:34:54Z",
"closed_issues": 110,
"created_at": "2020-07-10T13:54:44Z",
"creator": {
"avatar_url": "https://avatars.githubusercontent.com/u/953992?v=4",
"events_url": "https://api.github.com/users/jreback/events{/privacy}",
"followers_url": "https://api.github.com/users/jreback/followers",
"following_url": "https://api.github.com/users/jreback/following{/other_user}",
"gists_url": "https://api.github.com/users/jreback/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jreback",
"id": 953992,
"login": "jreback",
"node_id": "MDQ6VXNlcjk1Mzk5Mg==",
"organizations_url": "https://api.github.com/users/jreback/orgs",
"received_events_url": "https://api.github.com/users/jreback/received_events",
"repos_url": "https://api.github.com/users/jreback/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jreback/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jreback/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jreback"
},
"description": "on-merge: backport to 1.1.x",
"due_on": "2020-08-22T07:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/75",
"id": 5640672,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/75/labels",
"node_id": "MDk6TWlsZXN0b25lNTY0MDY3Mg==",
"number": 75,
"open_issues": 0,
"state": "closed",
"title": "1.1.1",
"updated_at": "2020-08-25T06:31:23Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/75"
}
| 0
| 2020-08-04T08:23:08Z
| 2020-08-04T09:01:47Z
| 2020-08-04T09:01:47Z
|
NONE
| null |
Backport PR #35468: CI: activate azure pipelines on 1.1.x
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/35536/reactions"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35536/timeline
| null | 0
|
{
"diff_url": "https://github.com/pandas-dev/pandas/pull/35536.diff",
"html_url": "https://github.com/pandas-dev/pandas/pull/35536",
"merged_at": "2020-08-04T09:01:47Z",
"patch_url": "https://github.com/pandas-dev/pandas/pull/35536.patch",
"url": "https://api.github.com/repos/pandas-dev/pandas/pulls/35536"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35537
|
https://api.github.com/repos/pandas-dev/pandas
|
https://api.github.com/repos/pandas-dev/pandas/issues/35537/labels{/name}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35537/comments
|
https://api.github.com/repos/pandas-dev/pandas/issues/35537/events
|
https://github.com/pandas-dev/pandas/pull/35537
| 672,631,168
|
MDExOlB1bGxSZXF1ZXN0NDYyNjMxODY5
| 35,537
|
Backport PR #35502 on branch 1.1.x (CI: xfail numpy-dev)
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/39504233?v=4",
"events_url": "https://api.github.com/users/meeseeksmachine/events{/privacy}",
"followers_url": "https://api.github.com/users/meeseeksmachine/followers",
"following_url": "https://api.github.com/users/meeseeksmachine/following{/other_user}",
"gists_url": "https://api.github.com/users/meeseeksmachine/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/meeseeksmachine",
"id": 39504233,
"login": "meeseeksmachine",
"node_id": "MDQ6VXNlcjM5NTA0MjMz",
"organizations_url": "https://api.github.com/users/meeseeksmachine/orgs",
"received_events_url": "https://api.github.com/users/meeseeksmachine/received_events",
"repos_url": "https://api.github.com/users/meeseeksmachine/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/meeseeksmachine/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/meeseeksmachine/subscriptions",
"type": "User",
"url": "https://api.github.com/users/meeseeksmachine"
}
|
[] |
closed
| false
| null |
[] |
{
"closed_at": "2020-08-21T08:34:54Z",
"closed_issues": 110,
"created_at": "2020-07-10T13:54:44Z",
"creator": {
"avatar_url": "https://avatars.githubusercontent.com/u/953992?v=4",
"events_url": "https://api.github.com/users/jreback/events{/privacy}",
"followers_url": "https://api.github.com/users/jreback/followers",
"following_url": "https://api.github.com/users/jreback/following{/other_user}",
"gists_url": "https://api.github.com/users/jreback/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jreback",
"id": 953992,
"login": "jreback",
"node_id": "MDQ6VXNlcjk1Mzk5Mg==",
"organizations_url": "https://api.github.com/users/jreback/orgs",
"received_events_url": "https://api.github.com/users/jreback/received_events",
"repos_url": "https://api.github.com/users/jreback/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jreback/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jreback/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jreback"
},
"description": "on-merge: backport to 1.1.x",
"due_on": "2020-08-22T07:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/75",
"id": 5640672,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/75/labels",
"node_id": "MDk6TWlsZXN0b25lNTY0MDY3Mg==",
"number": 75,
"open_issues": 0,
"state": "closed",
"title": "1.1.1",
"updated_at": "2020-08-25T06:31:23Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/75"
}
| 0
| 2020-08-04T09:03:21Z
| 2020-08-04T09:53:42Z
| 2020-08-04T09:53:42Z
|
NONE
| null |
Backport PR #35502: CI: xfail numpy-dev
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/35537/reactions"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35537/timeline
| null | 0
|
{
"diff_url": "https://github.com/pandas-dev/pandas/pull/35537.diff",
"html_url": "https://github.com/pandas-dev/pandas/pull/35537",
"merged_at": "2020-08-04T09:53:42Z",
"patch_url": "https://github.com/pandas-dev/pandas/pull/35537.patch",
"url": "https://api.github.com/repos/pandas-dev/pandas/pulls/35537"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35538
|
https://api.github.com/repos/pandas-dev/pandas
|
https://api.github.com/repos/pandas-dev/pandas/issues/35538/labels{/name}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35538/comments
|
https://api.github.com/repos/pandas-dev/pandas/issues/35538/events
|
https://github.com/pandas-dev/pandas/issues/35538
| 672,664,228
|
MDU6SXNzdWU2NzI2NjQyMjg=
| 35,538
|
Can't access multi-index names when iterating over rows
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/2629945?v=4",
"events_url": "https://api.github.com/users/konstantinmiller/events{/privacy}",
"followers_url": "https://api.github.com/users/konstantinmiller/followers",
"following_url": "https://api.github.com/users/konstantinmiller/following{/other_user}",
"gists_url": "https://api.github.com/users/konstantinmiller/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/konstantinmiller",
"id": 2629945,
"login": "konstantinmiller",
"node_id": "MDQ6VXNlcjI2Mjk5NDU=",
"organizations_url": "https://api.github.com/users/konstantinmiller/orgs",
"received_events_url": "https://api.github.com/users/konstantinmiller/received_events",
"repos_url": "https://api.github.com/users/konstantinmiller/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/konstantinmiller/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/konstantinmiller/subscriptions",
"type": "User",
"url": "https://api.github.com/users/konstantinmiller"
}
|
[
{
"color": "e10c02",
"default": false,
"description": null,
"id": 76811,
"name": "Bug",
"node_id": "MDU6TGFiZWw3NjgxMQ==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Bug"
},
{
"color": "009800",
"default": false,
"description": "Duplicate issue or pull request",
"id": 40153326,
"name": "Duplicate Report",
"node_id": "MDU6TGFiZWw0MDE1MzMyNg==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Duplicate%20Report"
}
] |
closed
| false
| null |
[] | null | 1
| 2020-08-04T09:54:26Z
| 2020-08-04T12:32:57Z
| 2020-08-04T12:32:35Z
|
NONE
| null |
When iterating over rows with either `iterrows()` or `itertuples()`, it is not possible to access index names if you have a multi-index.
So, I would expect something like that to work
```
import pandas as pd
df = pd.DataFrame(
index=pd.MultiIndex(
names=['ind1'],
levels=[['a']],
codes=[[0]]
),
data={'C': [42]})
ind, row = next(df.iterrows())
row.C
ind.ind1
```
However, since `ind` is not a named tuple, it throws an `AttributeError: 'tuple' object has no attribute 'ind1'`
Same with `itertuples()`:
```
import pandas as pd
df = pd.DataFrame(
index=pd.MultiIndex(
names=['ind1'],
levels=[['a']],
codes=[[0]]
),
data={'C': [42]})
row = next(df.itertuples())
ind = row.Index
row.C
ind.ind1
```
throws `AttributeError: 'tuple' object has no attribute 'ind1'`
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/35538/reactions"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35538/timeline
| null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/35539
|
https://api.github.com/repos/pandas-dev/pandas
|
https://api.github.com/repos/pandas-dev/pandas/issues/35539/labels{/name}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35539/comments
|
https://api.github.com/repos/pandas-dev/pandas/issues/35539/events
|
https://github.com/pandas-dev/pandas/pull/35539
| 672,664,455
|
MDExOlB1bGxSZXF1ZXN0NDYyNjU5NDQ3
| 35,539
|
Backport PR #35440 on branch 1.1.x (BUG: CategoricalIndex.format)
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/39504233?v=4",
"events_url": "https://api.github.com/users/meeseeksmachine/events{/privacy}",
"followers_url": "https://api.github.com/users/meeseeksmachine/followers",
"following_url": "https://api.github.com/users/meeseeksmachine/following{/other_user}",
"gists_url": "https://api.github.com/users/meeseeksmachine/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/meeseeksmachine",
"id": 39504233,
"login": "meeseeksmachine",
"node_id": "MDQ6VXNlcjM5NTA0MjMz",
"organizations_url": "https://api.github.com/users/meeseeksmachine/orgs",
"received_events_url": "https://api.github.com/users/meeseeksmachine/received_events",
"repos_url": "https://api.github.com/users/meeseeksmachine/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/meeseeksmachine/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/meeseeksmachine/subscriptions",
"type": "User",
"url": "https://api.github.com/users/meeseeksmachine"
}
|
[] |
closed
| false
| null |
[] |
{
"closed_at": "2020-08-21T08:34:54Z",
"closed_issues": 110,
"created_at": "2020-07-10T13:54:44Z",
"creator": {
"avatar_url": "https://avatars.githubusercontent.com/u/953992?v=4",
"events_url": "https://api.github.com/users/jreback/events{/privacy}",
"followers_url": "https://api.github.com/users/jreback/followers",
"following_url": "https://api.github.com/users/jreback/following{/other_user}",
"gists_url": "https://api.github.com/users/jreback/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jreback",
"id": 953992,
"login": "jreback",
"node_id": "MDQ6VXNlcjk1Mzk5Mg==",
"organizations_url": "https://api.github.com/users/jreback/orgs",
"received_events_url": "https://api.github.com/users/jreback/received_events",
"repos_url": "https://api.github.com/users/jreback/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jreback/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jreback/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jreback"
},
"description": "on-merge: backport to 1.1.x",
"due_on": "2020-08-22T07:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/75",
"id": 5640672,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/75/labels",
"node_id": "MDk6TWlsZXN0b25lNTY0MDY3Mg==",
"number": 75,
"open_issues": 0,
"state": "closed",
"title": "1.1.1",
"updated_at": "2020-08-25T06:31:23Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/75"
}
| 1
| 2020-08-04T09:54:49Z
| 2020-08-04T10:38:00Z
| 2020-08-04T10:38:00Z
|
NONE
| null |
Backport PR #35440: BUG: CategoricalIndex.format
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/35539/reactions"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35539/timeline
| null | 0
|
{
"diff_url": "https://github.com/pandas-dev/pandas/pull/35539.diff",
"html_url": "https://github.com/pandas-dev/pandas/pull/35539",
"merged_at": "2020-08-04T10:38:00Z",
"patch_url": "https://github.com/pandas-dev/pandas/pull/35539.patch",
"url": "https://api.github.com/repos/pandas-dev/pandas/pulls/35539"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35540
|
https://api.github.com/repos/pandas-dev/pandas
|
https://api.github.com/repos/pandas-dev/pandas/issues/35540/labels{/name}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35540/comments
|
https://api.github.com/repos/pandas-dev/pandas/issues/35540/events
|
https://github.com/pandas-dev/pandas/pull/35540
| 672,664,977
|
MDExOlB1bGxSZXF1ZXN0NDYyNjU5OTAw
| 35,540
|
Backport PR #35510 on branch 1.1.x (REGR: Check for float in isnaobj_old)
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/39504233?v=4",
"events_url": "https://api.github.com/users/meeseeksmachine/events{/privacy}",
"followers_url": "https://api.github.com/users/meeseeksmachine/followers",
"following_url": "https://api.github.com/users/meeseeksmachine/following{/other_user}",
"gists_url": "https://api.github.com/users/meeseeksmachine/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/meeseeksmachine",
"id": 39504233,
"login": "meeseeksmachine",
"node_id": "MDQ6VXNlcjM5NTA0MjMz",
"organizations_url": "https://api.github.com/users/meeseeksmachine/orgs",
"received_events_url": "https://api.github.com/users/meeseeksmachine/received_events",
"repos_url": "https://api.github.com/users/meeseeksmachine/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/meeseeksmachine/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/meeseeksmachine/subscriptions",
"type": "User",
"url": "https://api.github.com/users/meeseeksmachine"
}
|
[] |
closed
| false
| null |
[] |
{
"closed_at": "2020-08-21T08:34:54Z",
"closed_issues": 110,
"created_at": "2020-07-10T13:54:44Z",
"creator": {
"avatar_url": "https://avatars.githubusercontent.com/u/953992?v=4",
"events_url": "https://api.github.com/users/jreback/events{/privacy}",
"followers_url": "https://api.github.com/users/jreback/followers",
"following_url": "https://api.github.com/users/jreback/following{/other_user}",
"gists_url": "https://api.github.com/users/jreback/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jreback",
"id": 953992,
"login": "jreback",
"node_id": "MDQ6VXNlcjk1Mzk5Mg==",
"organizations_url": "https://api.github.com/users/jreback/orgs",
"received_events_url": "https://api.github.com/users/jreback/received_events",
"repos_url": "https://api.github.com/users/jreback/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jreback/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jreback/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jreback"
},
"description": "on-merge: backport to 1.1.x",
"due_on": "2020-08-22T07:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/75",
"id": 5640672,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/75/labels",
"node_id": "MDk6TWlsZXN0b25lNTY0MDY3Mg==",
"number": 75,
"open_issues": 0,
"state": "closed",
"title": "1.1.1",
"updated_at": "2020-08-25T06:31:23Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/75"
}
| 0
| 2020-08-04T09:55:42Z
| 2020-08-04T10:56:33Z
| 2020-08-04T10:56:33Z
|
NONE
| null |
Backport PR #35510: REGR: Check for float in isnaobj_old
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/35540/reactions"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35540/timeline
| null | 0
|
{
"diff_url": "https://github.com/pandas-dev/pandas/pull/35540.diff",
"html_url": "https://github.com/pandas-dev/pandas/pull/35540",
"merged_at": "2020-08-04T10:56:33Z",
"patch_url": "https://github.com/pandas-dev/pandas/pull/35540.patch",
"url": "https://api.github.com/repos/pandas-dev/pandas/pulls/35540"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35541
|
https://api.github.com/repos/pandas-dev/pandas
|
https://api.github.com/repos/pandas-dev/pandas/issues/35541/labels{/name}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35541/comments
|
https://api.github.com/repos/pandas-dev/pandas/issues/35541/events
|
https://github.com/pandas-dev/pandas/issues/35541
| 672,675,539
|
MDU6SXNzdWU2NzI2NzU1Mzk=
| 35,541
|
QST: ExtensionDtype with complex arguments
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/2364173?v=4",
"events_url": "https://api.github.com/users/vnmabus/events{/privacy}",
"followers_url": "https://api.github.com/users/vnmabus/followers",
"following_url": "https://api.github.com/users/vnmabus/following{/other_user}",
"gists_url": "https://api.github.com/users/vnmabus/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/vnmabus",
"id": 2364173,
"login": "vnmabus",
"node_id": "MDQ6VXNlcjIzNjQxNzM=",
"organizations_url": "https://api.github.com/users/vnmabus/orgs",
"received_events_url": "https://api.github.com/users/vnmabus/received_events",
"repos_url": "https://api.github.com/users/vnmabus/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/vnmabus/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/vnmabus/subscriptions",
"type": "User",
"url": "https://api.github.com/users/vnmabus"
}
|
[
{
"color": "0052cc",
"default": false,
"description": null,
"id": 34444536,
"name": "Usage Question",
"node_id": "MDU6TGFiZWwzNDQ0NDUzNg==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Usage%20Question"
},
{
"color": "6138b5",
"default": false,
"description": "Extending pandas with custom dtypes or arrays.",
"id": 849023693,
"name": "ExtensionArray",
"node_id": "MDU6TGFiZWw4NDkwMjM2OTM=",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/ExtensionArray"
}
] |
closed
| false
| null |
[] | null | 5
| 2020-08-04T10:12:41Z
| 2020-08-07T21:15:32Z
| 2020-08-07T21:15:32Z
|
NONE
| null |
#### Question about pandas
I am trying to add support to store columns of functional data in Pandas. This kind of data requires that the associated dtype store some information, such as the discretization points for discretized functions, which is not as simple as the arguments in other ExtensionDtypes (for example, in this case would be a numpy array). This presents several challenges:
- The `ExtensionDtype` will not be hashable unless I take extra steps to make it so, hashing numpy arrays like in the Categorical dtype.
- If the name of the dtype has to include the value of the arguments it would be unreadable.
- `construct_from_string` should have to parse a lot of structured information (maybe possible using `eval`, but what is the point?). I would prefer that my `ExtensionDtype` could not be constructed from a string. However, at least one test require the dtype to be constructable from its name.
What suggestions do you have to solve these kind of problems?
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/35541/reactions"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35541/timeline
| null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/35542
|
https://api.github.com/repos/pandas-dev/pandas
|
https://api.github.com/repos/pandas-dev/pandas/issues/35542/labels{/name}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35542/comments
|
https://api.github.com/repos/pandas-dev/pandas/issues/35542/events
|
https://github.com/pandas-dev/pandas/issues/35542
| 672,765,849
|
MDU6SXNzdWU2NzI3NjU4NDk=
| 35,542
|
BUG: Groupby dropna=False argument unexpected behaviour with rolling window
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/26452178?v=4",
"events_url": "https://api.github.com/users/nrcjea001/events{/privacy}",
"followers_url": "https://api.github.com/users/nrcjea001/followers",
"following_url": "https://api.github.com/users/nrcjea001/following{/other_user}",
"gists_url": "https://api.github.com/users/nrcjea001/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/nrcjea001",
"id": 26452178,
"login": "nrcjea001",
"node_id": "MDQ6VXNlcjI2NDUyMTc4",
"organizations_url": "https://api.github.com/users/nrcjea001/orgs",
"received_events_url": "https://api.github.com/users/nrcjea001/received_events",
"repos_url": "https://api.github.com/users/nrcjea001/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/nrcjea001/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/nrcjea001/subscriptions",
"type": "User",
"url": "https://api.github.com/users/nrcjea001"
}
|
[
{
"color": "e10c02",
"default": false,
"description": null,
"id": 76811,
"name": "Bug",
"node_id": "MDU6TGFiZWw3NjgxMQ==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Bug"
},
{
"color": "729FCF",
"default": false,
"description": null,
"id": 233160,
"name": "Groupby",
"node_id": "MDU6TGFiZWwyMzMxNjA=",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Groupby"
},
{
"color": "d7e102",
"default": false,
"description": "np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate",
"id": 2822342,
"name": "Missing-data",
"node_id": "MDU6TGFiZWwyODIyMzQy",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Missing-data"
}
] |
closed
| false
| null |
[] |
{
"closed_at": "2020-12-26T13:57:50Z",
"closed_issues": 1768,
"created_at": "2020-05-29T23:47:32Z",
"creator": {
"avatar_url": "https://avatars.githubusercontent.com/u/953992?v=4",
"events_url": "https://api.github.com/users/jreback/events{/privacy}",
"followers_url": "https://api.github.com/users/jreback/followers",
"following_url": "https://api.github.com/users/jreback/following{/other_user}",
"gists_url": "https://api.github.com/users/jreback/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jreback",
"id": 953992,
"login": "jreback",
"node_id": "MDQ6VXNlcjk1Mzk5Mg==",
"organizations_url": "https://api.github.com/users/jreback/orgs",
"received_events_url": "https://api.github.com/users/jreback/received_events",
"repos_url": "https://api.github.com/users/jreback/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jreback/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jreback/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jreback"
},
"description": "on-merge: backport to 1.2.x",
"due_on": "2020-12-15T08:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/73",
"id": 5479819,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/73/labels",
"node_id": "MDk6TWlsZXN0b25lNTQ3OTgxOQ==",
"number": 73,
"open_issues": 0,
"state": "closed",
"title": "1.2",
"updated_at": "2021-04-13T15:46:43Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/73"
}
| 2
| 2020-08-04T12:47:16Z
| 2020-11-04T02:59:03Z
| 2020-11-04T02:59:03Z
|
NONE
| null |
- [x] I have checked that this issue has not already been reported.
- [x] I have confirmed this bug exists on the latest version of pandas.
- [ ] (optional) I have confirmed this bug exists on the master branch of pandas.
---
**Note**: Please read [this guide](https://matthewrocklin.com/blog/work/2018/02/28/minimal-bug-reports) detailing how to provide the necessary information for us to reproduce your bug.
#### Code Sample, a copy-pastable example
```python
# Your code here
data = {'group':['g1', 'g1', 'g1', np.nan, 'g1', 'g1', 'g2', 'g2', 'g2', 'g2', np.nan],
'A':[3, 1, 8, 2, 6, -1, 0, 13, -4, 0, 1],
'B':[5, 2, 3, 7, 11, -1, 4,-1, 1, 0, 2]}
df = pd.DataFrame(data)
df.groupby('group',dropna=False)['A'].rolling(1,min_periods=1).mean()
#### Output
group
g1 0 3.0
1 1.0
2 8.0
4 6.0
5 -1.0
g2 6 0.0
7 13.0
8 -4.0
9 0.0
Name: A, dtype: float64
```
#### Problem description
In Pandas 1.1.0, dropna=False is introduced as argument in groupby to allow for NA in group keys. However, we do not see this behaviour with rolling groupby. NA is not added to group key.
#### Expected Output
Nan group key
#### Output of ``pd.show_versions()``
<details>
INSTALLED VERSIONS
------------------
commit : d9fff2792bf16178d4e450fe7384244e50635733
python : 3.8.5.final.0
python-bits : 64
OS : Windows
OS-release : 10
Version : 10.0.18362
machine : AMD64
processor : Intel64 Family 6 Model 142 Stepping 11, GenuineIntel
byteorder : little
LC_ALL : None
LANG : None
LOCALE : English_United States.1252
pandas : 1.1.0
numpy : 1.18.5
pytz : 2020.1
dateutil : 2.8.1
pip : 20.2.1
setuptools : 49.2.1.post20200802
Cython : None
pytest : None
hypothesis : None
sphinx : None
blosc : None
feather : None
xlsxwriter : None
lxml.etree : None
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : 2.11.2
IPython : 7.17.0
pandas_datareader: None
bs4 : 4.9.1
bottleneck : None
fsspec : None
fastparquet : None
gcsfs : None
matplotlib : 3.3.0
numexpr : None
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : 1.0.0
pytables : None
pyxlsb : None
s3fs : None
scipy : 1.5.0
sqlalchemy : None
tables : None
tabulate : None
xarray : None
xlrd : None
xlwt : None
numba : 0.48.0
</details>
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/35542/reactions"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35542/timeline
| null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/35543
|
https://api.github.com/repos/pandas-dev/pandas
|
https://api.github.com/repos/pandas-dev/pandas/issues/35543/labels{/name}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35543/comments
|
https://api.github.com/repos/pandas-dev/pandas/issues/35543/events
|
https://github.com/pandas-dev/pandas/pull/35543
| 672,768,529
|
MDExOlB1bGxSZXF1ZXN0NDYyNzQ2ODM4
| 35,543
|
REGR: Fix interpolation on empty dataframe
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/48946947?v=4",
"events_url": "https://api.github.com/users/sanderland/events{/privacy}",
"followers_url": "https://api.github.com/users/sanderland/followers",
"following_url": "https://api.github.com/users/sanderland/following{/other_user}",
"gists_url": "https://api.github.com/users/sanderland/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/sanderland",
"id": 48946947,
"login": "sanderland",
"node_id": "MDQ6VXNlcjQ4OTQ2OTQ3",
"organizations_url": "https://api.github.com/users/sanderland/orgs",
"received_events_url": "https://api.github.com/users/sanderland/received_events",
"repos_url": "https://api.github.com/users/sanderland/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/sanderland/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sanderland/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sanderland"
}
|
[
{
"color": "d7e102",
"default": false,
"description": "np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate",
"id": 2822342,
"name": "Missing-data",
"node_id": "MDU6TGFiZWwyODIyMzQy",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Missing-data"
},
{
"color": "e11d21",
"default": false,
"description": "Functionality that used to work in a prior pandas version",
"id": 32815646,
"name": "Regression",
"node_id": "MDU6TGFiZWwzMjgxNTY0Ng==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Regression"
},
{
"color": "eb6420",
"default": false,
"description": "Non-arithmetic algos: value_counts, factorize, sorting, isin, clip, shift, diff",
"id": 57296398,
"name": "Algos",
"node_id": "MDU6TGFiZWw1NzI5NjM5OA==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Algos"
}
] |
closed
| false
| null |
[] |
{
"closed_at": "2020-08-21T08:34:54Z",
"closed_issues": 110,
"created_at": "2020-07-10T13:54:44Z",
"creator": {
"avatar_url": "https://avatars.githubusercontent.com/u/953992?v=4",
"events_url": "https://api.github.com/users/jreback/events{/privacy}",
"followers_url": "https://api.github.com/users/jreback/followers",
"following_url": "https://api.github.com/users/jreback/following{/other_user}",
"gists_url": "https://api.github.com/users/jreback/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jreback",
"id": 953992,
"login": "jreback",
"node_id": "MDQ6VXNlcjk1Mzk5Mg==",
"organizations_url": "https://api.github.com/users/jreback/orgs",
"received_events_url": "https://api.github.com/users/jreback/received_events",
"repos_url": "https://api.github.com/users/jreback/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jreback/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jreback/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jreback"
},
"description": "on-merge: backport to 1.1.x",
"due_on": "2020-08-22T07:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/75",
"id": 5640672,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/75/labels",
"node_id": "MDk6TWlsZXN0b25lNTY0MDY3Mg==",
"number": 75,
"open_issues": 0,
"state": "closed",
"title": "1.1.1",
"updated_at": "2020-08-25T06:31:23Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/75"
}
| 8
| 2020-08-04T12:51:33Z
| 2020-08-24T14:08:52Z
| 2020-08-17T10:22:35Z
|
CONTRIBUTOR
| null |
Interpolation on an empty dataframe broke in 1.1 due to a change in how 'all columns are objects' is checked (specifically all(empty set) is True, while before dtype count object = None was checked against size = 0).
This is a complex function and I'm not sure what the proper fix is, suggesting to keep the empty check out of the rest of the logic.
Example code that broke:
```python
import pandas as pd
df = pd.DataFrame([1,2])
df[[]].interpolate(limit_area='inside')
```
- [x] closes #35598
- [x] tests added / passed
- [x] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [x] whatsnew entry
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/35543/reactions"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35543/timeline
| null | 0
|
{
"diff_url": "https://github.com/pandas-dev/pandas/pull/35543.diff",
"html_url": "https://github.com/pandas-dev/pandas/pull/35543",
"merged_at": "2020-08-17T10:22:34Z",
"patch_url": "https://github.com/pandas-dev/pandas/pull/35543.patch",
"url": "https://api.github.com/repos/pandas-dev/pandas/pulls/35543"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35544
|
https://api.github.com/repos/pandas-dev/pandas
|
https://api.github.com/repos/pandas-dev/pandas/issues/35544/labels{/name}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35544/comments
|
https://api.github.com/repos/pandas-dev/pandas/issues/35544/events
|
https://github.com/pandas-dev/pandas/issues/35544
| 672,780,990
|
MDU6SXNzdWU2NzI3ODA5OTA=
| 35,544
|
BUG: series.truncate doesn't return the correct value in pandas 1.1.0
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/33315687?v=4",
"events_url": "https://api.github.com/users/gabicca/events{/privacy}",
"followers_url": "https://api.github.com/users/gabicca/followers",
"following_url": "https://api.github.com/users/gabicca/following{/other_user}",
"gists_url": "https://api.github.com/users/gabicca/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/gabicca",
"id": 33315687,
"login": "gabicca",
"node_id": "MDQ6VXNlcjMzMzE1Njg3",
"organizations_url": "https://api.github.com/users/gabicca/orgs",
"received_events_url": "https://api.github.com/users/gabicca/received_events",
"repos_url": "https://api.github.com/users/gabicca/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/gabicca/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/gabicca/subscriptions",
"type": "User",
"url": "https://api.github.com/users/gabicca"
}
|
[
{
"color": "e10c02",
"default": false,
"description": null,
"id": 76811,
"name": "Bug",
"node_id": "MDU6TGFiZWw3NjgxMQ==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Bug"
},
{
"color": "0b02e1",
"default": false,
"description": "Related to indexing on series/frames, not to indexes themselves",
"id": 2822098,
"name": "Indexing",
"node_id": "MDU6TGFiZWwyODIyMDk4",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Indexing"
},
{
"color": "e11d21",
"default": false,
"description": "Functionality that used to work in a prior pandas version",
"id": 32815646,
"name": "Regression",
"node_id": "MDU6TGFiZWwzMjgxNTY0Ng==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Regression"
}
] |
closed
| false
| null |
[] |
{
"closed_at": "2020-08-21T08:34:54Z",
"closed_issues": 110,
"created_at": "2020-07-10T13:54:44Z",
"creator": {
"avatar_url": "https://avatars.githubusercontent.com/u/953992?v=4",
"events_url": "https://api.github.com/users/jreback/events{/privacy}",
"followers_url": "https://api.github.com/users/jreback/followers",
"following_url": "https://api.github.com/users/jreback/following{/other_user}",
"gists_url": "https://api.github.com/users/jreback/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jreback",
"id": 953992,
"login": "jreback",
"node_id": "MDQ6VXNlcjk1Mzk5Mg==",
"organizations_url": "https://api.github.com/users/jreback/orgs",
"received_events_url": "https://api.github.com/users/jreback/received_events",
"repos_url": "https://api.github.com/users/jreback/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jreback/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jreback/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jreback"
},
"description": "on-merge: backport to 1.1.x",
"due_on": "2020-08-22T07:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/75",
"id": 5640672,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/75/labels",
"node_id": "MDk6TWlsZXN0b25lNTY0MDY3Mg==",
"number": 75,
"open_issues": 0,
"state": "closed",
"title": "1.1.1",
"updated_at": "2020-08-25T06:31:23Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/75"
}
| 2
| 2020-08-04T13:10:48Z
| 2020-08-07T11:39:32Z
| 2020-08-07T11:39:32Z
|
CONTRIBUTOR
| null |
- [Y] I have checked that this issue has not already been reported.
- [Y] I have confirmed this bug exists on the latest version of pandas.
- [ ] (optional) I have confirmed this bug exists on the master branch of pandas.
---
**Note**: Please read [this guide](https://matthewrocklin.com/blog/work/2018/02/28/minimal-bug-reports) detailing how to provide the necessary information for us to reproduce your bug.
#### Code Sample, a copy-pastable example
```python
def test_truncate():
series = pd.Series([0.1], index=pd.DatetimeIndex(['2020-08-04']))
before = pd.Timestamp('2020-08-02')
after = pd.Timestamp('2020-08-04')
assert series.truncate(before=before, after=after).equals(series)
```
#### Problem description
The above test passes in pandas 1.0.5 while fails in pandas 1.1.0.
After diving into the code I found that *truncate* in pandas/core/generic.py changed as follows:
```
if ax.is_monotonic_decreasing:
before, after = after, before
```
the above check was added to the method. ```ax.is_monotonic_decreasing``` returns true for 1-element series, (```ax.is_monotonic_increasing``` also returns true). When *before*, and *after* are given in the correct, increasing order (like in the test), the following check reverses them and the result of truncate will be an empty series, instead of returning the input series which is the expected behaviour.
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/35544/reactions"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35544/timeline
| null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/35545
|
https://api.github.com/repos/pandas-dev/pandas
|
https://api.github.com/repos/pandas-dev/pandas/issues/35545/labels{/name}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35545/comments
|
https://api.github.com/repos/pandas-dev/pandas/issues/35545/events
|
https://github.com/pandas-dev/pandas/issues/35545
| 672,822,670
|
MDU6SXNzdWU2NzI4MjI2NzA=
| 35,545
|
BUG: Problem importing compressed dataset (with repro datasets)
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/8394766?v=4",
"events_url": "https://api.github.com/users/rxxg/events{/privacy}",
"followers_url": "https://api.github.com/users/rxxg/followers",
"following_url": "https://api.github.com/users/rxxg/following{/other_user}",
"gists_url": "https://api.github.com/users/rxxg/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/rxxg",
"id": 8394766,
"login": "rxxg",
"node_id": "MDQ6VXNlcjgzOTQ3NjY=",
"organizations_url": "https://api.github.com/users/rxxg/orgs",
"received_events_url": "https://api.github.com/users/rxxg/received_events",
"repos_url": "https://api.github.com/users/rxxg/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/rxxg/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/rxxg/subscriptions",
"type": "User",
"url": "https://api.github.com/users/rxxg"
}
|
[
{
"color": "e10c02",
"default": false,
"description": null,
"id": 76811,
"name": "Bug",
"node_id": "MDU6TGFiZWw3NjgxMQ==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Bug"
},
{
"color": "5319e7",
"default": false,
"description": "SAS: read_sas",
"id": 258745163,
"name": "IO SAS",
"node_id": "MDU6TGFiZWwyNTg3NDUxNjM=",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/IO%20SAS"
}
] |
open
| false
| null |
[] | null | 8
| 2020-08-04T14:09:08Z
| 2020-12-09T11:03:53Z
| null |
CONTRIBUTOR
| null |
- [ ] I have checked that this issue has not already been reported.
- [X] I have confirmed this bug exists on the latest version of pandas.
- [ ] (optional) I have confirmed this bug exists on the master branch of pandas.
---
**Note**: Please read [this guide](https://matthewrocklin.com/blog/work/2018/02/28/minimal-bug-reports) detailing how to provide the necessary information for us to reproduce your bug.
#### Code Sample, a copy-pastable example
```python
import pandas as pd
# Read 900-line compressed dataset correctly
pd.read_sas('date_working.sas7bdat')
# Read 1000-line uncompressed dataset correctly
pd.read_sas('date_uncomp.sas7bdat')
# Read 1000-line compressed dataset - crashes (and leaves file open ...)
pd.read_sas('date_broken.sas7bdat')
```
#### Problem description
I have a 1000-row SAS dataset (written by SAS 9.4 TS Level 1M6 on X64_SRV16 platform) which pandas chokes on reading. I attach the problematic dataset, as well as the same dataset uncompressed and a smaller subset of the compressed dataset that can be correctly read.
[datasets.zip](https://github.com/pandas-dev/pandas/files/5022528/datasets.zip)
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "C:\Users\bug\venv\lib\site-packages\pandas\io\sas\sasreader.py", line 131, in read_sas
data = reader.read()
File "C:\Users\bug\venv\lib\site-packages\pandas\io\sas\sas7bdat.py", line 695, in read
rslt = self._chunk_to_dataframe()
File "C:\Users\bug\venv\lib\site-packages\pandas\io\sas\sas7bdat.py", line 739, in _chunk_to_dataframe
rslt[name] = self._byte_chunk[jb, :].view(dtype=self.byte_order + "d")
File "C:\Users\bug\venv\lib\site-packages\pandas\core\frame.py", line 3037, in __setitem__
self._set_item(key, value)
File "C:\Users\bug\venv\lib\site-packages\pandas\core\frame.py", line 3113, in _set_item
value = self._sanitize_column(key, value)
File "C:\Users\bug\venv\lib\site-packages\pandas\core\frame.py", line 3758, in _sanitize_column
value = sanitize_index(value, self.index)
File "C:\Users\bug\venv\lib\site-packages\pandas\core\internals\construction.py", line 748, in sanitize_index
"Length of values "
ValueError: Length of values (1000) does not match length of index (527)
#### Expected Output
No crash
#### Output of ``pd.show_versions()``
<details>
INSTALLED VERSIONS
------------------
commit : d9fff2792bf16178d4e450fe7384244e50635733
python : 3.7.1.final.0
python-bits : 64
OS : Windows
OS-release : 10
Version : 10.0.17763
machine : AMD64
processor : Intel64 Family 6 Model 142 Stepping 9, GenuineIntel
byteorder : little
LC_ALL : None
LANG : None
LOCALE : None.None
pandas : 1.1.0
numpy : 1.18.1
pytz : 2019.3
dateutil : 2.8.1
pip : 10.0.1
setuptools : 39.0.1
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
fsspec : None
fastparquet : None
gcsfs : None
matplotlib : None
numexpr : None
odfpy : None
openpyxl : 3.0.3
pandas_gbq : None
pyarrow : None
pytables : None
pyxlsb : None
s3fs : None
scipy : 1.4.1
sqlalchemy : None
tables : None
tabulate : None
xarray : None
xlrd : 1.2.0
xlwt : 1.3.0
numba : None
</details>
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/35545/reactions"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35545/timeline
| null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/35546
|
https://api.github.com/repos/pandas-dev/pandas
|
https://api.github.com/repos/pandas-dev/pandas/issues/35546/labels{/name}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35546/comments
|
https://api.github.com/repos/pandas-dev/pandas/issues/35546/events
|
https://github.com/pandas-dev/pandas/issues/35546
| 672,862,606
|
MDU6SXNzdWU2NzI4NjI2MDY=
| 35,546
|
BUG: Speed degradation with categoricals
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/8505928?v=4",
"events_url": "https://api.github.com/users/RedTailedHawk/events{/privacy}",
"followers_url": "https://api.github.com/users/RedTailedHawk/followers",
"following_url": "https://api.github.com/users/RedTailedHawk/following{/other_user}",
"gists_url": "https://api.github.com/users/RedTailedHawk/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/RedTailedHawk",
"id": 8505928,
"login": "RedTailedHawk",
"node_id": "MDQ6VXNlcjg1MDU5Mjg=",
"organizations_url": "https://api.github.com/users/RedTailedHawk/orgs",
"received_events_url": "https://api.github.com/users/RedTailedHawk/received_events",
"repos_url": "https://api.github.com/users/RedTailedHawk/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/RedTailedHawk/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/RedTailedHawk/subscriptions",
"type": "User",
"url": "https://api.github.com/users/RedTailedHawk"
}
|
[
{
"color": "729FCF",
"default": false,
"description": null,
"id": 233160,
"name": "Groupby",
"node_id": "MDU6TGFiZWwyMzMxNjA=",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Groupby"
},
{
"color": "a10c02",
"default": false,
"description": "Memory or execution speed performance",
"id": 8935311,
"name": "Performance",
"node_id": "MDU6TGFiZWw4OTM1MzEx",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Performance"
},
{
"color": "e11d21",
"default": false,
"description": "Categorical Data Type",
"id": 78527356,
"name": "Categorical",
"node_id": "MDU6TGFiZWw3ODUyNzM1Ng==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Categorical"
}
] |
open
| false
| null |
[] |
{
"closed_at": null,
"closed_issues": 786,
"created_at": "2015-01-13T10:53:19Z",
"creator": {
"avatar_url": "https://avatars.githubusercontent.com/u/953992?v=4",
"events_url": "https://api.github.com/users/jreback/events{/privacy}",
"followers_url": "https://api.github.com/users/jreback/followers",
"following_url": "https://api.github.com/users/jreback/following{/other_user}",
"gists_url": "https://api.github.com/users/jreback/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jreback",
"id": 953992,
"login": "jreback",
"node_id": "MDQ6VXNlcjk1Mzk5Mg==",
"organizations_url": "https://api.github.com/users/jreback/orgs",
"received_events_url": "https://api.github.com/users/jreback/received_events",
"repos_url": "https://api.github.com/users/jreback/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jreback/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jreback/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jreback"
},
"description": "Changes that would be nice to have in the next release. These issues are not blocking. They will be pushed to the next release if no one has time to fix them.",
"due_on": null,
"html_url": "https://github.com/pandas-dev/pandas/milestone/32",
"id": 933188,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/32/labels",
"node_id": "MDk6TWlsZXN0b25lOTMzMTg4",
"number": 32,
"open_issues": 1053,
"state": "open",
"title": "Contributions Welcome",
"updated_at": "2021-11-21T00:50:06Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/32"
}
| 14
| 2020-08-04T15:02:39Z
| 2021-10-14T00:20:51Z
| null |
NONE
| null |
I have noticed some major speed degradation when using categorical data types. For example, a data frame with 1 million rows that sums 10 float columns and groups by two columns (one a date column and one a category column). The cardinality of the category seems to have a major effect. When grouping on category column of cardinality 10, performance is decent (query runs in 150 ms). But with cardinality of 100, the query runs in 10 seconds. If I re-generate the data frame without categorical columns, the same query that took 10 seconds with categoricals now runs in 350 ms.
|
{
"+1": 1,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 1,
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/35546/reactions"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35546/timeline
| null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/35547
|
https://api.github.com/repos/pandas-dev/pandas
|
https://api.github.com/repos/pandas-dev/pandas/issues/35547/labels{/name}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35547/comments
|
https://api.github.com/repos/pandas-dev/pandas/issues/35547/events
|
https://github.com/pandas-dev/pandas/pull/35547
| 672,866,235
|
MDExOlB1bGxSZXF1ZXN0NDYyODI3OTk3
| 35,547
|
Bug fix one element series truncate
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/33315687?v=4",
"events_url": "https://api.github.com/users/gabicca/events{/privacy}",
"followers_url": "https://api.github.com/users/gabicca/followers",
"following_url": "https://api.github.com/users/gabicca/following{/other_user}",
"gists_url": "https://api.github.com/users/gabicca/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/gabicca",
"id": 33315687,
"login": "gabicca",
"node_id": "MDQ6VXNlcjMzMzE1Njg3",
"organizations_url": "https://api.github.com/users/gabicca/orgs",
"received_events_url": "https://api.github.com/users/gabicca/received_events",
"repos_url": "https://api.github.com/users/gabicca/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/gabicca/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/gabicca/subscriptions",
"type": "User",
"url": "https://api.github.com/users/gabicca"
}
|
[
{
"color": "AFEEEE",
"default": false,
"description": null,
"id": 211840,
"name": "Timeseries",
"node_id": "MDU6TGFiZWwyMTE4NDA=",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Timeseries"
},
{
"color": "0b02e1",
"default": false,
"description": "Related to indexing on series/frames, not to indexes themselves",
"id": 2822098,
"name": "Indexing",
"node_id": "MDU6TGFiZWwyODIyMDk4",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Indexing"
},
{
"color": "e11d21",
"default": false,
"description": "Functionality that used to work in a prior pandas version",
"id": 32815646,
"name": "Regression",
"node_id": "MDU6TGFiZWwzMjgxNTY0Ng==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Regression"
},
{
"color": "8dd5fc",
"default": false,
"description": "Series data structure",
"id": 1357732944,
"name": "Series",
"node_id": "MDU6TGFiZWwxMzU3NzMyOTQ0",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Series"
}
] |
closed
| false
| null |
[] |
{
"closed_at": "2020-08-21T08:34:54Z",
"closed_issues": 110,
"created_at": "2020-07-10T13:54:44Z",
"creator": {
"avatar_url": "https://avatars.githubusercontent.com/u/953992?v=4",
"events_url": "https://api.github.com/users/jreback/events{/privacy}",
"followers_url": "https://api.github.com/users/jreback/followers",
"following_url": "https://api.github.com/users/jreback/following{/other_user}",
"gists_url": "https://api.github.com/users/jreback/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jreback",
"id": 953992,
"login": "jreback",
"node_id": "MDQ6VXNlcjk1Mzk5Mg==",
"organizations_url": "https://api.github.com/users/jreback/orgs",
"received_events_url": "https://api.github.com/users/jreback/received_events",
"repos_url": "https://api.github.com/users/jreback/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jreback/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jreback/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jreback"
},
"description": "on-merge: backport to 1.1.x",
"due_on": "2020-08-22T07:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/75",
"id": 5640672,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/75/labels",
"node_id": "MDk6TWlsZXN0b25lNTY0MDY3Mg==",
"number": 75,
"open_issues": 0,
"state": "closed",
"title": "1.1.1",
"updated_at": "2020-08-25T06:31:23Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/75"
}
| 4
| 2020-08-04T15:07:30Z
| 2020-08-07T12:48:06Z
| 2020-08-07T11:39:32Z
|
CONTRIBUTOR
| null |
- [Y] closes #35544
- [Y] tests added / passed
- [Y] passes `black pandas`
- [Y] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [Y] whatsnew entry
Fix when trying to truncate a one-element series within a correct date range returned an empty series instead of the originally passed-in series.
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/35547/reactions"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35547/timeline
| null | 0
|
{
"diff_url": "https://github.com/pandas-dev/pandas/pull/35547.diff",
"html_url": "https://github.com/pandas-dev/pandas/pull/35547",
"merged_at": "2020-08-07T11:39:32Z",
"patch_url": "https://github.com/pandas-dev/pandas/pull/35547.patch",
"url": "https://api.github.com/repos/pandas-dev/pandas/pulls/35547"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35548
|
https://api.github.com/repos/pandas-dev/pandas
|
https://api.github.com/repos/pandas-dev/pandas/issues/35548/labels{/name}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35548/comments
|
https://api.github.com/repos/pandas-dev/pandas/issues/35548/events
|
https://github.com/pandas-dev/pandas/issues/35548
| 672,921,596
|
MDU6SXNzdWU2NzI5MjE1OTY=
| 35,548
|
REGR: Comparing timestamp to empty Series raises TypeError starting in 0.25.0
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1377457?v=4",
"events_url": "https://api.github.com/users/pganssle/events{/privacy}",
"followers_url": "https://api.github.com/users/pganssle/followers",
"following_url": "https://api.github.com/users/pganssle/following{/other_user}",
"gists_url": "https://api.github.com/users/pganssle/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/pganssle",
"id": 1377457,
"login": "pganssle",
"node_id": "MDQ6VXNlcjEzNzc0NTc=",
"organizations_url": "https://api.github.com/users/pganssle/orgs",
"received_events_url": "https://api.github.com/users/pganssle/received_events",
"repos_url": "https://api.github.com/users/pganssle/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/pganssle/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/pganssle/subscriptions",
"type": "User",
"url": "https://api.github.com/users/pganssle"
}
|
[
{
"color": "e10c02",
"default": false,
"description": null,
"id": 76811,
"name": "Bug",
"node_id": "MDU6TGFiZWw3NjgxMQ==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Bug"
},
{
"color": "AFEEEE",
"default": false,
"description": null,
"id": 211840,
"name": "Timeseries",
"node_id": "MDU6TGFiZWwyMTE4NDA=",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Timeseries"
},
{
"color": "006b75",
"default": false,
"description": "Arithmetic, Comparison, and Logical operations",
"id": 47223669,
"name": "Numeric Operations",
"node_id": "MDU6TGFiZWw0NzIyMzY2OQ==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Numeric%20Operations"
}
] |
open
| false
| null |
[] | null | 1
| 2020-08-04T16:28:10Z
| 2020-09-21T01:59:09Z
| null |
CONTRIBUTOR
| null |
- [x] I have checked that this issue has not already been reported.
- [x] I have confirmed this bug exists on the latest version of pandas.
- [x] (optional) I have confirmed this bug exists on the master branch of pandas.
---
#### Minimal reproducing code sample
```python
import pandas as pd
pd.Series() < pd.Timestamp.now() # Raises TypeError
```
(Note: This raises a warning because the default `dtype` is changing to `object` — which will actually fix the issue — but no warning is raised when you slice a column from an empty DataFrame).
### Problem description
Prior to 0.25.0, it was possible to compare a `pd.Timestamp` to an empty `Series` (even if that series did not have a dtype of `datetime64[ns]`), but starting in the 0.25.0 release, this operation now raises `TypeError` because of mismatched dtypes. Running `git bisect`, I gather that this change was introduced in GH-26916, but neither the PR or the issue seem to suggest that this change was an explicit goal.
It might be arguable what the correct behavior *should be*, since it's probably valid that you shouldn't be able to compare a `Timestamp` to a `float64`, but it's also obvious what the return value should be: an empty `Series` of dtype `bool`.
The reason it would be valuable to allow this behavior is that a lot of people rely on `pandas` to infer their data types from the input, but no such inference can take place if the data set is empty, in the pre-0.25.0 world, it was possible to design an API like this:
```python
def get_names_in_past(names: List[str], dates: List[datetime]) -> pd.DataFrame:
df = pd.DataFrame({'names': names, 'dates': dates})
return df[df['dates'] < pd.Timestamp.now()]
```
But starting in 0.25.0, when passed an empty list, you'd get a `TypeError` instead of an empty DataFrame, and you need to special-case the situation where `df` is empty. There are similar APIs you can imagine where the data are read from a CSV or some other source where the `dtype` is inferred from the contents that would start failing on empty data.
I think it would be reasonable to short-circuit comparisons with empty `Series` *before* the dtypes are compared, to always return an empty boolean `Series`.
Another reasonable option that I think would be more narrowly-scoped to solve the particular problem of `dtype` inference without data would be adding a flag to `Series` to indicate if the `dtype` is ambiguous. For `pd.Series()` it would be `True` and for `pd.Series(dtype=float)` it would be `False`. This would be more complicated to implement because you'd need to make sure that it's set correctly when the `Series` is part of a `DataFrame` and make sure it's set correctly in `.astype`, but that would allow you to preserve the error in comparing the wrong types when a type has been explicitly specified while avoiding the need for clunky code that has to explicitly handle empty DataFrames.
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/35548/reactions"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35548/timeline
| null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/35549
|
https://api.github.com/repos/pandas-dev/pandas
|
https://api.github.com/repos/pandas-dev/pandas/issues/35549/labels{/name}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35549/comments
|
https://api.github.com/repos/pandas-dev/pandas/issues/35549/events
|
https://github.com/pandas-dev/pandas/issues/35549
| 672,952,531
|
MDU6SXNzdWU2NzI5NTI1MzE=
| 35,549
|
BUG: Closed parameter in rolling function producing ValueError
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/26452178?v=4",
"events_url": "https://api.github.com/users/nrcjea001/events{/privacy}",
"followers_url": "https://api.github.com/users/nrcjea001/followers",
"following_url": "https://api.github.com/users/nrcjea001/following{/other_user}",
"gists_url": "https://api.github.com/users/nrcjea001/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/nrcjea001",
"id": 26452178,
"login": "nrcjea001",
"node_id": "MDQ6VXNlcjI2NDUyMTc4",
"organizations_url": "https://api.github.com/users/nrcjea001/orgs",
"received_events_url": "https://api.github.com/users/nrcjea001/received_events",
"repos_url": "https://api.github.com/users/nrcjea001/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/nrcjea001/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/nrcjea001/subscriptions",
"type": "User",
"url": "https://api.github.com/users/nrcjea001"
}
|
[
{
"color": "e10c02",
"default": false,
"description": null,
"id": 76811,
"name": "Bug",
"node_id": "MDU6TGFiZWw3NjgxMQ==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Bug"
},
{
"color": "d4c5f9",
"default": false,
"description": "rolling, ewma, expanding",
"id": 1045950827,
"name": "Window",
"node_id": "MDU6TGFiZWwxMDQ1OTUwODI3",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Window"
}
] |
closed
| false
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/10647082?v=4",
"events_url": "https://api.github.com/users/mroeschke/events{/privacy}",
"followers_url": "https://api.github.com/users/mroeschke/followers",
"following_url": "https://api.github.com/users/mroeschke/following{/other_user}",
"gists_url": "https://api.github.com/users/mroeschke/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/mroeschke",
"id": 10647082,
"login": "mroeschke",
"node_id": "MDQ6VXNlcjEwNjQ3MDgy",
"organizations_url": "https://api.github.com/users/mroeschke/orgs",
"received_events_url": "https://api.github.com/users/mroeschke/received_events",
"repos_url": "https://api.github.com/users/mroeschke/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/mroeschke/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/mroeschke/subscriptions",
"type": "User",
"url": "https://api.github.com/users/mroeschke"
}
|
[
{
"avatar_url": "https://avatars.githubusercontent.com/u/10647082?v=4",
"events_url": "https://api.github.com/users/mroeschke/events{/privacy}",
"followers_url": "https://api.github.com/users/mroeschke/followers",
"following_url": "https://api.github.com/users/mroeschke/following{/other_user}",
"gists_url": "https://api.github.com/users/mroeschke/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/mroeschke",
"id": 10647082,
"login": "mroeschke",
"node_id": "MDQ6VXNlcjEwNjQ3MDgy",
"organizations_url": "https://api.github.com/users/mroeschke/orgs",
"received_events_url": "https://api.github.com/users/mroeschke/received_events",
"repos_url": "https://api.github.com/users/mroeschke/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/mroeschke/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/mroeschke/subscriptions",
"type": "User",
"url": "https://api.github.com/users/mroeschke"
}
] |
{
"closed_at": "2020-08-21T08:34:54Z",
"closed_issues": 110,
"created_at": "2020-07-10T13:54:44Z",
"creator": {
"avatar_url": "https://avatars.githubusercontent.com/u/953992?v=4",
"events_url": "https://api.github.com/users/jreback/events{/privacy}",
"followers_url": "https://api.github.com/users/jreback/followers",
"following_url": "https://api.github.com/users/jreback/following{/other_user}",
"gists_url": "https://api.github.com/users/jreback/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jreback",
"id": 953992,
"login": "jreback",
"node_id": "MDQ6VXNlcjk1Mzk5Mg==",
"organizations_url": "https://api.github.com/users/jreback/orgs",
"received_events_url": "https://api.github.com/users/jreback/received_events",
"repos_url": "https://api.github.com/users/jreback/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jreback/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jreback/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jreback"
},
"description": "on-merge: backport to 1.1.x",
"due_on": "2020-08-22T07:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/75",
"id": 5640672,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/75/labels",
"node_id": "MDk6TWlsZXN0b25lNTY0MDY3Mg==",
"number": 75,
"open_issues": 0,
"state": "closed",
"title": "1.1.1",
"updated_at": "2020-08-25T06:31:23Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/75"
}
| 0
| 2020-08-04T17:20:50Z
| 2020-08-10T13:13:31Z
| 2020-08-10T13:13:31Z
|
NONE
| null |
- [x] I have checked that this issue has not already been reported.
- [x] I have confirmed this bug exists on the latest version of pandas.
- [ ] (optional) I have confirmed this bug exists on the master branch of pandas.
---
**Note**: Please read [this guide](https://matthewrocklin.com/blog/work/2018/02/28/minimal-bug-reports) detailing how to provide the necessary information for us to reproduce your bug.
#### Code Sample, a copy-pastable example
```python
# Your code here
df = pd.DataFrame({"column1": range(6),
"column2": range(6),
'group': 3*['A','B'],
'date':pd.date_range("20190101", periods=6)})
df.loc[:,'date']=df.loc[0,'date']
df
### Output
column1 column2 group date
0 0 0 A 2019-01-01
1 1 1 B 2019-01-01
2 2 2 A 2019-01-01
3 3 3 B 2019-01-01
4 4 4 A 2019-01-01
5 5 5 B 2019-01-01
df.groupby('group').rolling('1D',on='date',closed='left')['column1'].sum()
### Output
ValueError: closed only implemented for datetimelike and offset based windows
```
#### Problem description
Closed parameter not producing the result as it should. Only closed='both' is working.
Current workaround as follows (but considerably slower):
```
df.groupby('group').apply(lambda x: x.rolling('1D',on='date',closed='left')['column1'].sum())
```
#### Expected Output
```
group date
A 2019-01-01 NaN
2019-01-01 0.0
2019-01-01 2.0
B 2019-01-01 NaN
2019-01-01 1.0
2019-01-01 4.0
Name: column1, dtype: float64
```
Name: column1, dtype: float64
#### Output of ``pd.show_versions()``
<details>
INSTALLED VERSIONS
------------------
commit : d9fff2792bf16178d4e450fe7384244e50635733
python : 3.8.5.final.0
python-bits : 64
OS : Windows
OS-release : 10
Version : 10.0.18362
machine : AMD64
processor : Intel64 Family 6 Model 142 Stepping 11, GenuineIntel
byteorder : little
LC_ALL : None
LANG : None
LOCALE : English_United States.1252
pandas : 1.1.0
numpy : 1.18.5
pytz : 2020.1
dateutil : 2.8.1
pip : 20.2.1
setuptools : 49.2.1.post20200802
Cython : None
pytest : None
hypothesis : None
sphinx : None
blosc : None
feather : None
xlsxwriter : None
lxml.etree : None
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : 2.11.2
IPython : 7.17.0
pandas_datareader: None
bs4 : 4.9.1
bottleneck : None
fsspec : None
fastparquet : None
gcsfs : None
matplotlib : 3.3.0
numexpr : None
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : 1.0.0
pytables : None
pyxlsb : None
s3fs : None
scipy : 1.5.0
sqlalchemy : None
tables : None
tabulate : None
xarray : None
xlrd : None
xlwt : None
numba : 0.48.0
</details>
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/35549/reactions"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35549/timeline
| null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/35550
|
https://api.github.com/repos/pandas-dev/pandas
|
https://api.github.com/repos/pandas-dev/pandas/issues/35550/labels{/name}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35550/comments
|
https://api.github.com/repos/pandas-dev/pandas/issues/35550/events
|
https://github.com/pandas-dev/pandas/issues/35550
| 672,961,466
|
MDU6SXNzdWU2NzI5NjE0NjY=
| 35,550
|
DOC: add additional numba example
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/17162724?v=4",
"events_url": "https://api.github.com/users/raybellwaves/events{/privacy}",
"followers_url": "https://api.github.com/users/raybellwaves/followers",
"following_url": "https://api.github.com/users/raybellwaves/following{/other_user}",
"gists_url": "https://api.github.com/users/raybellwaves/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/raybellwaves",
"id": 17162724,
"login": "raybellwaves",
"node_id": "MDQ6VXNlcjE3MTYyNzI0",
"organizations_url": "https://api.github.com/users/raybellwaves/orgs",
"received_events_url": "https://api.github.com/users/raybellwaves/received_events",
"repos_url": "https://api.github.com/users/raybellwaves/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/raybellwaves/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/raybellwaves/subscriptions",
"type": "User",
"url": "https://api.github.com/users/raybellwaves"
}
|
[
{
"color": "3465A4",
"default": false,
"description": null,
"id": 134699,
"name": "Docs",
"node_id": "MDU6TGFiZWwxMzQ2OTk=",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Docs"
},
{
"color": "0e8a16",
"default": true,
"description": null,
"id": 717120670,
"name": "good first issue",
"node_id": "MDU6TGFiZWw3MTcxMjA2NzA=",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/good%20first%20issue"
},
{
"color": "d4c5f9",
"default": false,
"description": "rolling, ewma, expanding",
"id": 1045950827,
"name": "Window",
"node_id": "MDU6TGFiZWwxMDQ1OTUwODI3",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Window"
}
] |
closed
| false
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/34067903?v=4",
"events_url": "https://api.github.com/users/erfannariman/events{/privacy}",
"followers_url": "https://api.github.com/users/erfannariman/followers",
"following_url": "https://api.github.com/users/erfannariman/following{/other_user}",
"gists_url": "https://api.github.com/users/erfannariman/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/erfannariman",
"id": 34067903,
"login": "erfannariman",
"node_id": "MDQ6VXNlcjM0MDY3OTAz",
"organizations_url": "https://api.github.com/users/erfannariman/orgs",
"received_events_url": "https://api.github.com/users/erfannariman/received_events",
"repos_url": "https://api.github.com/users/erfannariman/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/erfannariman/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/erfannariman/subscriptions",
"type": "User",
"url": "https://api.github.com/users/erfannariman"
}
|
[
{
"avatar_url": "https://avatars.githubusercontent.com/u/34067903?v=4",
"events_url": "https://api.github.com/users/erfannariman/events{/privacy}",
"followers_url": "https://api.github.com/users/erfannariman/followers",
"following_url": "https://api.github.com/users/erfannariman/following{/other_user}",
"gists_url": "https://api.github.com/users/erfannariman/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/erfannariman",
"id": 34067903,
"login": "erfannariman",
"node_id": "MDQ6VXNlcjM0MDY3OTAz",
"organizations_url": "https://api.github.com/users/erfannariman/orgs",
"received_events_url": "https://api.github.com/users/erfannariman/received_events",
"repos_url": "https://api.github.com/users/erfannariman/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/erfannariman/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/erfannariman/subscriptions",
"type": "User",
"url": "https://api.github.com/users/erfannariman"
}
] |
{
"closed_at": "2020-12-26T13:57:50Z",
"closed_issues": 1768,
"created_at": "2020-05-29T23:47:32Z",
"creator": {
"avatar_url": "https://avatars.githubusercontent.com/u/953992?v=4",
"events_url": "https://api.github.com/users/jreback/events{/privacy}",
"followers_url": "https://api.github.com/users/jreback/followers",
"following_url": "https://api.github.com/users/jreback/following{/other_user}",
"gists_url": "https://api.github.com/users/jreback/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jreback",
"id": 953992,
"login": "jreback",
"node_id": "MDQ6VXNlcjk1Mzk5Mg==",
"organizations_url": "https://api.github.com/users/jreback/orgs",
"received_events_url": "https://api.github.com/users/jreback/received_events",
"repos_url": "https://api.github.com/users/jreback/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jreback/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jreback/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jreback"
},
"description": "on-merge: backport to 1.2.x",
"due_on": "2020-12-15T08:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/73",
"id": 5479819,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/73/labels",
"node_id": "MDk6TWlsZXN0b25lNTQ3OTgxOQ==",
"number": 73,
"open_issues": 0,
"state": "closed",
"title": "1.2",
"updated_at": "2021-04-13T15:46:43Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/73"
}
| 10
| 2020-08-04T17:37:02Z
| 2020-09-01T23:52:09Z
| 2020-09-01T23:52:08Z
|
CONTRIBUTOR
| null |
#### Location of the documentation
https://pandas.pydata.org/pandas-docs/stable/user_guide/enhancingperf.html#using-numba
#### Documentation problem
Provide a simpler copy-paste example.
#### Suggested fix for documentation
@TomAugspurger has a nice example of using numba to speed up a `rolling.apply()` operation here https://github.com/TomAugspurger/acon-2020-pandas/blob/master/Numba%20Acceleration.ipynb
Could this or a variant of this be added to the docs? Perhaps to show that you don't need to do `import numba` but can do `engine='numba'`
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/35550/reactions"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35550/timeline
| null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/35551
|
https://api.github.com/repos/pandas-dev/pandas
|
https://api.github.com/repos/pandas-dev/pandas/issues/35551/labels{/name}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35551/comments
|
https://api.github.com/repos/pandas-dev/pandas/issues/35551/events
|
https://github.com/pandas-dev/pandas/issues/35551
| 672,961,647
|
MDU6SXNzdWU2NzI5NjE2NDc=
| 35,551
|
ENH: Preserve Index in Pandas Groupby Rolling on Datetime
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/26452178?v=4",
"events_url": "https://api.github.com/users/nrcjea001/events{/privacy}",
"followers_url": "https://api.github.com/users/nrcjea001/followers",
"following_url": "https://api.github.com/users/nrcjea001/following{/other_user}",
"gists_url": "https://api.github.com/users/nrcjea001/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/nrcjea001",
"id": 26452178,
"login": "nrcjea001",
"node_id": "MDQ6VXNlcjI2NDUyMTc4",
"organizations_url": "https://api.github.com/users/nrcjea001/orgs",
"received_events_url": "https://api.github.com/users/nrcjea001/received_events",
"repos_url": "https://api.github.com/users/nrcjea001/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/nrcjea001/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/nrcjea001/subscriptions",
"type": "User",
"url": "https://api.github.com/users/nrcjea001"
}
|
[
{
"color": "4E9A06",
"default": false,
"description": null,
"id": 76812,
"name": "Enhancement",
"node_id": "MDU6TGFiZWw3NjgxMg==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Enhancement"
},
{
"color": "d4c5f9",
"default": false,
"description": "rolling, ewma, expanding",
"id": 1045950827,
"name": "Window",
"node_id": "MDU6TGFiZWwxMDQ1OTUwODI3",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Window"
}
] |
open
| false
| null |
[] | null | 2
| 2020-08-04T17:37:24Z
| 2021-03-26T06:17:08Z
| null |
NONE
| null |
#### Is your feature request related to a problem?
A problem arises when rolling on datetime column where dates are the same. The Groupby Rolling function does not preserve the original index and so when dates are the same within the Group, it is impossible to know which index value it pertains to from the original dataframe.
#### Describe the solution you'd like
Ideally we wish to preserve the original index so that it can be merged back onto the original dataframe.
#### Current Code
```python
# Your code here, if applicable
df = pd.DataFrame({"column1": range(6),
"column2": range(6),
'group': 3*['A','B'],
'date':pd.date_range("20190101", periods=6)})
df.loc[:,'date']=df.loc[0,'date']
df.groupby('group').rolling('1D',on='date')['column1'].sum()
## Output
group date
A 2019-01-01 0.0
2019-01-01 2.0
2019-01-01 6.0
B 2019-01-01 1.0
2019-01-01 4.0
2019-01-01 9.0
Name: column1, dtype: float64
```
#### Describe alternatives you've considered
Current workaround as follows, but considerably slower
```
df.groupby('group').apply(lambda x: x.rolling('1D',on='date',closed='left')['column1'].sum())
## Output
group
A 0 NaN
2 0.0
4 2.0
B 1 NaN
3 1.0
5 4.0
Name: column1, dtype: float64
```
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/35551/reactions"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35551/timeline
| null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/35552
|
https://api.github.com/repos/pandas-dev/pandas
|
https://api.github.com/repos/pandas-dev/pandas/issues/35552/labels{/name}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35552/comments
|
https://api.github.com/repos/pandas-dev/pandas/issues/35552/events
|
https://github.com/pandas-dev/pandas/issues/35552
| 673,013,343
|
MDU6SXNzdWU2NzMwMTMzNDM=
| 35,552
|
BUG: Segmentation fault in RollingGroupby.mean() with center=True and input with odd length
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/2073227?v=4",
"events_url": "https://api.github.com/users/wfvining/events{/privacy}",
"followers_url": "https://api.github.com/users/wfvining/followers",
"following_url": "https://api.github.com/users/wfvining/following{/other_user}",
"gists_url": "https://api.github.com/users/wfvining/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/wfvining",
"id": 2073227,
"login": "wfvining",
"node_id": "MDQ6VXNlcjIwNzMyMjc=",
"organizations_url": "https://api.github.com/users/wfvining/orgs",
"received_events_url": "https://api.github.com/users/wfvining/received_events",
"repos_url": "https://api.github.com/users/wfvining/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/wfvining/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/wfvining/subscriptions",
"type": "User",
"url": "https://api.github.com/users/wfvining"
}
|
[
{
"color": "e11d21",
"default": false,
"description": "Functionality that used to work in a prior pandas version",
"id": 32815646,
"name": "Regression",
"node_id": "MDU6TGFiZWwzMjgxNTY0Ng==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Regression"
},
{
"color": "d4c5f9",
"default": false,
"description": "rolling, ewma, expanding",
"id": 1045950827,
"name": "Window",
"node_id": "MDU6TGFiZWwxMDQ1OTUwODI3",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Window"
},
{
"color": "36ede0",
"default": false,
"description": "Non-Recoverable Error",
"id": 1121248195,
"name": "Segfault",
"node_id": "MDU6TGFiZWwxMTIxMjQ4MTk1",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Segfault"
}
] |
closed
| false
| null |
[] |
{
"closed_at": "2020-08-21T08:34:54Z",
"closed_issues": 110,
"created_at": "2020-07-10T13:54:44Z",
"creator": {
"avatar_url": "https://avatars.githubusercontent.com/u/953992?v=4",
"events_url": "https://api.github.com/users/jreback/events{/privacy}",
"followers_url": "https://api.github.com/users/jreback/followers",
"following_url": "https://api.github.com/users/jreback/following{/other_user}",
"gists_url": "https://api.github.com/users/jreback/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jreback",
"id": 953992,
"login": "jreback",
"node_id": "MDQ6VXNlcjk1Mzk5Mg==",
"organizations_url": "https://api.github.com/users/jreback/orgs",
"received_events_url": "https://api.github.com/users/jreback/received_events",
"repos_url": "https://api.github.com/users/jreback/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jreback/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jreback/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jreback"
},
"description": "on-merge: backport to 1.1.x",
"due_on": "2020-08-22T07:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/75",
"id": 5640672,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/75/labels",
"node_id": "MDk6TWlsZXN0b25lNTY0MDY3Mg==",
"number": 75,
"open_issues": 0,
"state": "closed",
"title": "1.1.1",
"updated_at": "2020-08-25T06:31:23Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/75"
}
| 1
| 2020-08-04T19:07:10Z
| 2020-08-07T18:09:30Z
| 2020-08-07T18:09:30Z
|
NONE
| null |
- [x] I have checked that this issue has not already been reported.
- [x] I have confirmed this bug exists on the latest version of pandas.
- [ ] (optional) I have confirmed this bug exists on the master branch of pandas.
---
#### Code Sample, a copy-pastable example
```python
import pandas as pd
series = pd.Series(range(1, 5))
series.groupby(series).rolling(center=True, window=3).mean()
```
#### Problem description
With an odd-length series and `center=True`, `RollingGroupby.mean()` causes a segfault. If `center=True` is not provided, or the input series has an even length, then there is no no segfault (example below).
```python
series = pd.Series(range(1, 6))
series.groupby(series).rolling(center=True, window=3).mean()
```
Outputs:
```
1 0 NaN
2 1 NaN
3 2 NaN
4 3 NaN
5 4 1.474760e+250
dtype: float64
```
The series can be grouped in any way, but the example above seemed simplest.
#### Expected Output
Should output a Series.
#### Output of ``pd.show_versions()``
<details>
INSTALLED VERSIONS
------------------
commit : d9fff2792bf16178d4e450fe7384244e50635733
python : 3.7.7.final.0
python-bits : 64
OS : Linux
OS-release : 4.18.0-25-generic
Version : #26-Ubuntu SMP Mon Jun 24 09:32:08 UTC 2019
machine : x86_64
processor : x86_64
byteorder : little
LC_ALL : None
LANG : en_US.UTF-8
LOCALE : en_US.UTF-8
pandas : 1.1.0
numpy : 1.19.1
pytz : 2020.1
dateutil : 2.8.1
pip : 20.1.1
setuptools : 49.2.0.post20200714
Cython : None
pytest : 6.0.1
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
fsspec : None
fastparquet : None
gcsfs : None
matplotlib : None
numexpr : None
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : None
pytables : None
pyxlsb : None
s3fs : None
scipy : 1.5.2
sqlalchemy : None
tables : None
tabulate : None
xarray : None
xlrd : None
xlwt : None
numba : None
</details>
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/35552/reactions"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35552/timeline
| null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/35553
|
https://api.github.com/repos/pandas-dev/pandas
|
https://api.github.com/repos/pandas-dev/pandas/issues/35553/labels{/name}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35553/comments
|
https://api.github.com/repos/pandas-dev/pandas/issues/35553/events
|
https://github.com/pandas-dev/pandas/pull/35553
| 673,032,510
|
MDExOlB1bGxSZXF1ZXN0NDYyOTY2NjQz
| 35,553
|
[MINOR] Fix unnecessary pluralization
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/14007150?v=4",
"events_url": "https://api.github.com/users/deepyaman/events{/privacy}",
"followers_url": "https://api.github.com/users/deepyaman/followers",
"following_url": "https://api.github.com/users/deepyaman/following{/other_user}",
"gists_url": "https://api.github.com/users/deepyaman/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/deepyaman",
"id": 14007150,
"login": "deepyaman",
"node_id": "MDQ6VXNlcjE0MDA3MTUw",
"organizations_url": "https://api.github.com/users/deepyaman/orgs",
"received_events_url": "https://api.github.com/users/deepyaman/received_events",
"repos_url": "https://api.github.com/users/deepyaman/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/deepyaman/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/deepyaman/subscriptions",
"type": "User",
"url": "https://api.github.com/users/deepyaman"
}
|
[
{
"color": "3465A4",
"default": false,
"description": null,
"id": 134699,
"name": "Docs",
"node_id": "MDU6TGFiZWwxMzQ2OTk=",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Docs"
}
] |
closed
| false
| null |
[] |
{
"closed_at": "2020-12-26T13:57:50Z",
"closed_issues": 1768,
"created_at": "2020-05-29T23:47:32Z",
"creator": {
"avatar_url": "https://avatars.githubusercontent.com/u/953992?v=4",
"events_url": "https://api.github.com/users/jreback/events{/privacy}",
"followers_url": "https://api.github.com/users/jreback/followers",
"following_url": "https://api.github.com/users/jreback/following{/other_user}",
"gists_url": "https://api.github.com/users/jreback/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jreback",
"id": 953992,
"login": "jreback",
"node_id": "MDQ6VXNlcjk1Mzk5Mg==",
"organizations_url": "https://api.github.com/users/jreback/orgs",
"received_events_url": "https://api.github.com/users/jreback/received_events",
"repos_url": "https://api.github.com/users/jreback/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jreback/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jreback/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jreback"
},
"description": "on-merge: backport to 1.2.x",
"due_on": "2020-12-15T08:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/73",
"id": 5479819,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/73/labels",
"node_id": "MDk6TWlsZXN0b25lNTQ3OTgxOQ==",
"number": 73,
"open_issues": 0,
"state": "closed",
"title": "1.2",
"updated_at": "2021-04-13T15:46:43Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/73"
}
| 1
| 2020-08-04T19:33:30Z
| 2020-09-15T10:55:35Z
| 2020-08-04T23:00:15Z
|
CONTRIBUTOR
| null |
- [ ] closes #xxxx
- [ ] tests added / passed
- [ ] passes `black pandas`
- [ ] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] whatsnew entry
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/35553/reactions"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35553/timeline
| null | 0
|
{
"diff_url": "https://github.com/pandas-dev/pandas/pull/35553.diff",
"html_url": "https://github.com/pandas-dev/pandas/pull/35553",
"merged_at": "2020-08-04T23:00:15Z",
"patch_url": "https://github.com/pandas-dev/pandas/pull/35553.patch",
"url": "https://api.github.com/repos/pandas-dev/pandas/pulls/35553"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35554
|
https://api.github.com/repos/pandas-dev/pandas
|
https://api.github.com/repos/pandas-dev/pandas/issues/35554/labels{/name}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35554/comments
|
https://api.github.com/repos/pandas-dev/pandas/issues/35554/events
|
https://github.com/pandas-dev/pandas/pull/35554
| 673,054,979
|
MDExOlB1bGxSZXF1ZXN0NDYyOTg1NDE4
| 35,554
|
DOC: Document that read_hdf can use pickle
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1312546?v=4",
"events_url": "https://api.github.com/users/TomAugspurger/events{/privacy}",
"followers_url": "https://api.github.com/users/TomAugspurger/followers",
"following_url": "https://api.github.com/users/TomAugspurger/following{/other_user}",
"gists_url": "https://api.github.com/users/TomAugspurger/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/TomAugspurger",
"id": 1312546,
"login": "TomAugspurger",
"node_id": "MDQ6VXNlcjEzMTI1NDY=",
"organizations_url": "https://api.github.com/users/TomAugspurger/orgs",
"received_events_url": "https://api.github.com/users/TomAugspurger/received_events",
"repos_url": "https://api.github.com/users/TomAugspurger/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/TomAugspurger/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/TomAugspurger/subscriptions",
"type": "User",
"url": "https://api.github.com/users/TomAugspurger"
}
|
[
{
"color": "3465A4",
"default": false,
"description": null,
"id": 134699,
"name": "Docs",
"node_id": "MDU6TGFiZWwxMzQ2OTk=",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Docs"
}
] |
closed
| false
| null |
[] |
{
"closed_at": "2020-08-21T08:34:54Z",
"closed_issues": 110,
"created_at": "2020-07-10T13:54:44Z",
"creator": {
"avatar_url": "https://avatars.githubusercontent.com/u/953992?v=4",
"events_url": "https://api.github.com/users/jreback/events{/privacy}",
"followers_url": "https://api.github.com/users/jreback/followers",
"following_url": "https://api.github.com/users/jreback/following{/other_user}",
"gists_url": "https://api.github.com/users/jreback/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jreback",
"id": 953992,
"login": "jreback",
"node_id": "MDQ6VXNlcjk1Mzk5Mg==",
"organizations_url": "https://api.github.com/users/jreback/orgs",
"received_events_url": "https://api.github.com/users/jreback/received_events",
"repos_url": "https://api.github.com/users/jreback/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jreback/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jreback/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jreback"
},
"description": "on-merge: backport to 1.1.x",
"due_on": "2020-08-22T07:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/75",
"id": 5640672,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/75/labels",
"node_id": "MDk6TWlsZXN0b25lNTY0MDY3Mg==",
"number": 75,
"open_issues": 0,
"state": "closed",
"title": "1.1.1",
"updated_at": "2020-08-25T06:31:23Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/75"
}
| 3
| 2020-08-04T20:16:58Z
| 2020-08-06T22:00:31Z
| 2020-08-06T22:00:27Z
|
CONTRIBUTOR
| null |
This documents that `read_hdf`, which uses PyTables, might invoke pickle to deserialize arrays that were serialize with pickle.
PyTables clearly documents this at http://www.pytables.org/usersguide/libref/declarative_classes.html#tables.ObjectAtom, but pandas users may not realize that if they aren't aware that pandas uses pytables under the hood.
I've tried to include the warning in all the methods that eventually read data, but it's a bit hard to say if I've gotten them all.
Ideally we would also like to provide an `allow_pickle=False` keyword, but that would be best implemented in PyTables, and used by us. I opened https://github.com/PyTables/PyTables/issues/813 for discussion.
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/35554/reactions"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35554/timeline
| null | 0
|
{
"diff_url": "https://github.com/pandas-dev/pandas/pull/35554.diff",
"html_url": "https://github.com/pandas-dev/pandas/pull/35554",
"merged_at": "2020-08-06T22:00:26Z",
"patch_url": "https://github.com/pandas-dev/pandas/pull/35554.patch",
"url": "https://api.github.com/repos/pandas-dev/pandas/pulls/35554"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35555
|
https://api.github.com/repos/pandas-dev/pandas
|
https://api.github.com/repos/pandas-dev/pandas/issues/35555/labels{/name}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35555/comments
|
https://api.github.com/repos/pandas-dev/pandas/issues/35555/events
|
https://github.com/pandas-dev/pandas/pull/35555
| 673,083,180
|
MDExOlB1bGxSZXF1ZXN0NDYzMDA5MjA4
| 35,555
|
Merge pull request #1 from pandas-dev/master - #34498 improve the .equals() docstring
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/59916821?v=4",
"events_url": "https://api.github.com/users/data-RanDan/events{/privacy}",
"followers_url": "https://api.github.com/users/data-RanDan/followers",
"following_url": "https://api.github.com/users/data-RanDan/following{/other_user}",
"gists_url": "https://api.github.com/users/data-RanDan/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/data-RanDan",
"id": 59916821,
"login": "data-RanDan",
"node_id": "MDQ6VXNlcjU5OTE2ODIx",
"organizations_url": "https://api.github.com/users/data-RanDan/orgs",
"received_events_url": "https://api.github.com/users/data-RanDan/received_events",
"repos_url": "https://api.github.com/users/data-RanDan/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/data-RanDan/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/data-RanDan/subscriptions",
"type": "User",
"url": "https://api.github.com/users/data-RanDan"
}
|
[
{
"color": "3465A4",
"default": false,
"description": null,
"id": 134699,
"name": "Docs",
"node_id": "MDU6TGFiZWwxMzQ2OTk=",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Docs"
}
] |
closed
| false
| null |
[] |
{
"closed_at": "2020-12-26T13:57:50Z",
"closed_issues": 1768,
"created_at": "2020-05-29T23:47:32Z",
"creator": {
"avatar_url": "https://avatars.githubusercontent.com/u/953992?v=4",
"events_url": "https://api.github.com/users/jreback/events{/privacy}",
"followers_url": "https://api.github.com/users/jreback/followers",
"following_url": "https://api.github.com/users/jreback/following{/other_user}",
"gists_url": "https://api.github.com/users/jreback/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jreback",
"id": 953992,
"login": "jreback",
"node_id": "MDQ6VXNlcjk1Mzk5Mg==",
"organizations_url": "https://api.github.com/users/jreback/orgs",
"received_events_url": "https://api.github.com/users/jreback/received_events",
"repos_url": "https://api.github.com/users/jreback/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jreback/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jreback/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jreback"
},
"description": "on-merge: backport to 1.2.x",
"due_on": "2020-12-15T08:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/73",
"id": 5479819,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/73/labels",
"node_id": "MDk6TWlsZXN0b25lNTQ3OTgxOQ==",
"number": 73,
"open_issues": 0,
"state": "closed",
"title": "1.2",
"updated_at": "2021-04-13T15:46:43Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/73"
}
| 7
| 2020-08-04T21:06:02Z
| 2020-08-07T19:19:12Z
| 2020-08-07T19:19:12Z
|
NONE
| null |
#34498 improve the .equals() docstring
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/35555/reactions"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35555/timeline
| null | 0
|
{
"diff_url": "https://github.com/pandas-dev/pandas/pull/35555.diff",
"html_url": "https://github.com/pandas-dev/pandas/pull/35555",
"merged_at": null,
"patch_url": "https://github.com/pandas-dev/pandas/pull/35555.patch",
"url": "https://api.github.com/repos/pandas-dev/pandas/pulls/35555"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35556
|
https://api.github.com/repos/pandas-dev/pandas
|
https://api.github.com/repos/pandas-dev/pandas/issues/35556/labels{/name}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35556/comments
|
https://api.github.com/repos/pandas-dev/pandas/issues/35556/events
|
https://github.com/pandas-dev/pandas/issues/35556
| 673,096,874
|
MDU6SXNzdWU2NzMwOTY4NzQ=
| 35,556
|
DOC: `.str.cat` output in case of `Index` object
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/11664259?v=4",
"events_url": "https://api.github.com/users/galipremsagar/events{/privacy}",
"followers_url": "https://api.github.com/users/galipremsagar/followers",
"following_url": "https://api.github.com/users/galipremsagar/following{/other_user}",
"gists_url": "https://api.github.com/users/galipremsagar/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/galipremsagar",
"id": 11664259,
"login": "galipremsagar",
"node_id": "MDQ6VXNlcjExNjY0MjU5",
"organizations_url": "https://api.github.com/users/galipremsagar/orgs",
"received_events_url": "https://api.github.com/users/galipremsagar/received_events",
"repos_url": "https://api.github.com/users/galipremsagar/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/galipremsagar/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/galipremsagar/subscriptions",
"type": "User",
"url": "https://api.github.com/users/galipremsagar"
}
|
[
{
"color": "3465A4",
"default": false,
"description": null,
"id": 134699,
"name": "Docs",
"node_id": "MDU6TGFiZWwxMzQ2OTk=",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Docs"
},
{
"color": "0e8a16",
"default": true,
"description": null,
"id": 717120670,
"name": "good first issue",
"node_id": "MDU6TGFiZWw3MTcxMjA2NzA=",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/good%20first%20issue"
}
] |
open
| false
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/5001953?v=4",
"events_url": "https://api.github.com/users/souris-dev/events{/privacy}",
"followers_url": "https://api.github.com/users/souris-dev/followers",
"following_url": "https://api.github.com/users/souris-dev/following{/other_user}",
"gists_url": "https://api.github.com/users/souris-dev/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/souris-dev",
"id": 5001953,
"login": "souris-dev",
"node_id": "MDQ6VXNlcjUwMDE5NTM=",
"organizations_url": "https://api.github.com/users/souris-dev/orgs",
"received_events_url": "https://api.github.com/users/souris-dev/received_events",
"repos_url": "https://api.github.com/users/souris-dev/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/souris-dev/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/souris-dev/subscriptions",
"type": "User",
"url": "https://api.github.com/users/souris-dev"
}
|
[
{
"avatar_url": "https://avatars.githubusercontent.com/u/5001953?v=4",
"events_url": "https://api.github.com/users/souris-dev/events{/privacy}",
"followers_url": "https://api.github.com/users/souris-dev/followers",
"following_url": "https://api.github.com/users/souris-dev/following{/other_user}",
"gists_url": "https://api.github.com/users/souris-dev/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/souris-dev",
"id": 5001953,
"login": "souris-dev",
"node_id": "MDQ6VXNlcjUwMDE5NTM=",
"organizations_url": "https://api.github.com/users/souris-dev/orgs",
"received_events_url": "https://api.github.com/users/souris-dev/received_events",
"repos_url": "https://api.github.com/users/souris-dev/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/souris-dev/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/souris-dev/subscriptions",
"type": "User",
"url": "https://api.github.com/users/souris-dev"
}
] |
{
"closed_at": null,
"closed_issues": 786,
"created_at": "2015-01-13T10:53:19Z",
"creator": {
"avatar_url": "https://avatars.githubusercontent.com/u/953992?v=4",
"events_url": "https://api.github.com/users/jreback/events{/privacy}",
"followers_url": "https://api.github.com/users/jreback/followers",
"following_url": "https://api.github.com/users/jreback/following{/other_user}",
"gists_url": "https://api.github.com/users/jreback/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jreback",
"id": 953992,
"login": "jreback",
"node_id": "MDQ6VXNlcjk1Mzk5Mg==",
"organizations_url": "https://api.github.com/users/jreback/orgs",
"received_events_url": "https://api.github.com/users/jreback/received_events",
"repos_url": "https://api.github.com/users/jreback/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jreback/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jreback/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jreback"
},
"description": "Changes that would be nice to have in the next release. These issues are not blocking. They will be pushed to the next release if no one has time to fix them.",
"due_on": null,
"html_url": "https://github.com/pandas-dev/pandas/milestone/32",
"id": 933188,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/32/labels",
"node_id": "MDk6TWlsZXN0b25lOTMzMTg4",
"number": 32,
"open_issues": 1053,
"state": "open",
"title": "Contributions Welcome",
"updated_at": "2021-11-21T00:50:06Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/32"
}
| 7
| 2020-08-04T21:34:20Z
| 2020-11-09T14:18:30Z
| null |
NONE
| null |
- [x] I have checked that this issue has not already been reported.
- [x] I have confirmed this bug exists on the latest version of pandas.
- [ ] (optional) I have confirmed this bug exists on the master branch of pandas.
---
#### Code Sample, a copy-pastable example
```python
import pandas as pd
import numpy as np
i = pd.Index(["AbC", "de", "FGHI", "j", "kLm"])
other = (
pd.Series(["f", "g", "h", "i", "j"]),
np.array(["f", "a", "b", "f", "a"]),
pd.Series(["f", "g", "h", "i", "j"]),
np.array(["f", "a", "b", "f", "a"]),
np.array(["f", "a", "b", "f", "a"]),
pd.Index(["1", "2", "3", "4", "5"]),
np.array(["f", "a", "b", "f", "a"]),
pd.Index(["f", "g", "h", "i", "j"]),
)
print(i.str.cat(other))
x = pd.Series(["f", "g", "h", "i", "j"])
print(i.str.cat(x))
```
0.25.3 output:
```python
Index(['AbCfffff1ff', 'degagaa2ag', 'FGHIhbhbb3bh', 'jififf4fi',
'kLmjajaa5aj'],
dtype='object')
Index(['AbCf', 'deg', 'FGHIh', 'ji', 'kLmj'], dtype='object')
```
1.1.0 output:
```python
Index([nan, nan, nan, nan, nan], dtype='object')
Index([nan, nan, nan, nan, nan], dtype='object')
```
#### Problem description
The output of 0.25.3 version seems to be correct as when we change `i` to be a `Series` the incorrect results go away:
```python
import pandas as pd
import numpy as np
i = pd.Series(["AbC", "de", "FGHI", "j", "kLm"])
other = (
pd.Series(["f", "g", "h", "i", "j"]),
np.array(["f", "a", "b", "f", "a"]),
pd.Series(["f", "g", "h", "i", "j"]),
np.array(["f", "a", "b", "f", "a"]),
np.array(["f", "a", "b", "f", "a"]),
pd.Index(["1", "2", "3", "4", "5"]),
np.array(["f", "a", "b", "f", "a"]),
pd.Index(["f", "g", "h", "i", "j"]),
)
print(i.str.cat(other))
x = pd.Series(["f", "g", "h", "i", "j"])
print(i.str.cat(x))
0 AbCfffff1ff
1 degagaa2ag
2 FGHIhbhbb3bh
3 jififf4fi
4 kLmjajaa5aj
dtype: object
0 AbCf
1 deg
2 FGHIh
3 ji
4 kLmj
dtype: object
```
#### Expected Output
The output should be similar to `Series` behaviour/ 0.25.3 behaviour.
#### Output of ``pd.show_versions()``
<details>
INSTALLED VERSIONS
------------------
commit : d9fff2792bf16178d4e450fe7384244e50635733
python : 3.7.3.final.0
python-bits : 64
OS : Darwin
OS-release : 19.6.0
Version : Darwin Kernel Version 19.6.0: Sun Jul 5 00:43:10 PDT 2020; root:xnu-6153.141.1~9/RELEASE_X86_64
machine : x86_64
processor : i386
byteorder : little
LC_ALL : None
LANG : None
LOCALE : en_US.UTF-8
pandas : 1.1.0
numpy : 1.19.0
pytz : 2020.1
dateutil : 2.8.1
pip : 20.1.1
setuptools : 49.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 : 2.11.2
IPython : None
pandas_datareader: None
bs4 : None
bottleneck : None
fsspec : None
fastparquet : None
gcsfs : None
matplotlib : None
numexpr : None
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : None
pytables : None
pyxlsb : None
s3fs : None
scipy : None
sqlalchemy : None
tables : None
tabulate : None
xarray : None
xlrd : None
xlwt : None
numba : None
</details>
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/35556/reactions"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35556/timeline
| null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/35557
|
https://api.github.com/repos/pandas-dev/pandas
|
https://api.github.com/repos/pandas-dev/pandas/issues/35557/labels{/name}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35557/comments
|
https://api.github.com/repos/pandas-dev/pandas/issues/35557/events
|
https://github.com/pandas-dev/pandas/issues/35557
| 673,153,438
|
MDU6SXNzdWU2NzMxNTM0Mzg=
| 35,557
|
BUG: 1.1.0 breaks custom indexer support in groupby().rolling()
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/39565956?v=4",
"events_url": "https://api.github.com/users/WhistleWhileYouWork/events{/privacy}",
"followers_url": "https://api.github.com/users/WhistleWhileYouWork/followers",
"following_url": "https://api.github.com/users/WhistleWhileYouWork/following{/other_user}",
"gists_url": "https://api.github.com/users/WhistleWhileYouWork/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/WhistleWhileYouWork",
"id": 39565956,
"login": "WhistleWhileYouWork",
"node_id": "MDQ6VXNlcjM5NTY1OTU2",
"organizations_url": "https://api.github.com/users/WhistleWhileYouWork/orgs",
"received_events_url": "https://api.github.com/users/WhistleWhileYouWork/received_events",
"repos_url": "https://api.github.com/users/WhistleWhileYouWork/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/WhistleWhileYouWork/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/WhistleWhileYouWork/subscriptions",
"type": "User",
"url": "https://api.github.com/users/WhistleWhileYouWork"
}
|
[
{
"color": "e10c02",
"default": false,
"description": null,
"id": 76811,
"name": "Bug",
"node_id": "MDU6TGFiZWw3NjgxMQ==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Bug"
}
] |
closed
| false
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/10647082?v=4",
"events_url": "https://api.github.com/users/mroeschke/events{/privacy}",
"followers_url": "https://api.github.com/users/mroeschke/followers",
"following_url": "https://api.github.com/users/mroeschke/following{/other_user}",
"gists_url": "https://api.github.com/users/mroeschke/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/mroeschke",
"id": 10647082,
"login": "mroeschke",
"node_id": "MDQ6VXNlcjEwNjQ3MDgy",
"organizations_url": "https://api.github.com/users/mroeschke/orgs",
"received_events_url": "https://api.github.com/users/mroeschke/received_events",
"repos_url": "https://api.github.com/users/mroeschke/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/mroeschke/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/mroeschke/subscriptions",
"type": "User",
"url": "https://api.github.com/users/mroeschke"
}
|
[
{
"avatar_url": "https://avatars.githubusercontent.com/u/10647082?v=4",
"events_url": "https://api.github.com/users/mroeschke/events{/privacy}",
"followers_url": "https://api.github.com/users/mroeschke/followers",
"following_url": "https://api.github.com/users/mroeschke/following{/other_user}",
"gists_url": "https://api.github.com/users/mroeschke/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/mroeschke",
"id": 10647082,
"login": "mroeschke",
"node_id": "MDQ6VXNlcjEwNjQ3MDgy",
"organizations_url": "https://api.github.com/users/mroeschke/orgs",
"received_events_url": "https://api.github.com/users/mroeschke/received_events",
"repos_url": "https://api.github.com/users/mroeschke/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/mroeschke/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/mroeschke/subscriptions",
"type": "User",
"url": "https://api.github.com/users/mroeschke"
}
] |
{
"closed_at": "2020-08-21T08:34:54Z",
"closed_issues": 110,
"created_at": "2020-07-10T13:54:44Z",
"creator": {
"avatar_url": "https://avatars.githubusercontent.com/u/953992?v=4",
"events_url": "https://api.github.com/users/jreback/events{/privacy}",
"followers_url": "https://api.github.com/users/jreback/followers",
"following_url": "https://api.github.com/users/jreback/following{/other_user}",
"gists_url": "https://api.github.com/users/jreback/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jreback",
"id": 953992,
"login": "jreback",
"node_id": "MDQ6VXNlcjk1Mzk5Mg==",
"organizations_url": "https://api.github.com/users/jreback/orgs",
"received_events_url": "https://api.github.com/users/jreback/received_events",
"repos_url": "https://api.github.com/users/jreback/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jreback/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jreback/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jreback"
},
"description": "on-merge: backport to 1.1.x",
"due_on": "2020-08-22T07:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/75",
"id": 5640672,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/75/labels",
"node_id": "MDk6TWlsZXN0b25lNTY0MDY3Mg==",
"number": 75,
"open_issues": 0,
"state": "closed",
"title": "1.1.1",
"updated_at": "2020-08-25T06:31:23Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/75"
}
| 4
| 2020-08-04T23:52:11Z
| 2020-08-21T17:04:43Z
| 2020-08-12T22:14:31Z
|
NONE
| null |
- [x] I have checked that this issue has not already been reported.
- [x] I have confirmed this bug exists on the latest version of pandas.
- [ ] (optional) I have confirmed this bug exists on the master branch of pandas.
---
#### Code Sample, a copy-pastable example
```python
class SimpleIndexer(pd.api.indexers.BaseIndexer):
''' Custom `Indexer` duplicating basic fixed length windowing '''
def get_window_bounds(self, num_values=0, min_periods=None, center=None, closed=None):
min_periods = self.window_size if min_periods is None else 0
end = np.arange(num_values, dtype=np.int64) + 1
start = end.copy() - self.window_size
#---- Clip to `min_periods`
start[start < 0] = min_periods
return (start, end)
x = pd.DataFrame({'a': [1.0,2.0,3.0,4.0,5.0] * 3}, index=[0]*5+[1]*5+[2]*5)
x
Out:
a
0 1.0
0 2.0
0 3.0
0 4.0
0 5.0
1 1.0
1 2.0
1 3.0
1 4.0
1 5.0
2 1.0
2 2.0
2 3.0
2 4.0
2 5.0
x.groupby(x.index).rolling(SimpleIndexer(window_size=3), min_periods=1).sum()
Out:
a
0 0 1.0
0 2.0
0 3.0
0 4.0
0 5.0
1 1 1.0
1 2.0
1 3.0
1 4.0
1 5.0
2 2 1.0
2 2.0
2 3.0
2 4.0
2 5.0
```
#### Problem description
`groupby().rolling()` does not use custom indexer supplied in `window=` likely as a result of #34052 where a `GroupbyRollingIndexer` is used instead.
The output data is always the same as the input regardless of the windowing function.
1.0.5 does not have this behavior.
#### Expected Output
```python
x.groupby(x.index).rolling(window=3, min_periods=1).sum()
Out:
a
0 0 1.0
0 3.0
0 6.0
0 9.0
0 12.0
1 1 1.0
1 3.0
1 6.0
1 9.0
1 12.0
2 2 1.0
2 3.0
2 6.0
2 9.0
2 12.0
```
#### Output of ``pd.show_versions()``
<details>
INSTALLED VERSIONS
------------------
commit : d9fff2792bf16178d4e450fe7384244e50635733
python : 3.8.2.final.0
python-bits : 64
OS : Linux
OS-release : 5.3.0-59-generic
Version : #53~18.04.1-Ubuntu SMP Thu Jun 4 14:58:26 UTC 2020
machine : x86_64
processor : x86_64
byteorder : little
LC_ALL : None
LANG : en_US.UTF-8
LOCALE : en_US.UTF-8
pandas : 1.1.0
numpy : 1.19.1
pytz : 2020.1
dateutil : 2.8.1
pip : 20.2
setuptools : 49.2.1.post20200802
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 : 7.14.0
pandas_datareader: None
bs4 : None
bottleneck : None
fsspec : None
fastparquet : None
gcsfs : None
matplotlib : 3.2.1
numexpr : 2.7.1
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : 0.17.0
pytables : None
pyxlsb : None
s3fs : None
scipy : 1.4.1
sqlalchemy : None
tables : 3.6.1
tabulate : None
xarray : None
xlrd : None
xlwt : None
numba : 0.50.1
</details>
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/35557/reactions"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35557/timeline
| null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/35558
|
https://api.github.com/repos/pandas-dev/pandas
|
https://api.github.com/repos/pandas-dev/pandas/issues/35558/labels{/name}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35558/comments
|
https://api.github.com/repos/pandas-dev/pandas/issues/35558/events
|
https://github.com/pandas-dev/pandas/issues/35558
| 673,162,151
|
MDU6SXNzdWU2NzMxNjIxNTE=
| 35,558
|
BUG: Incompatible tolerance error in merge_asof with comaptible types.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/4845845?v=4",
"events_url": "https://api.github.com/users/jkibele/events{/privacy}",
"followers_url": "https://api.github.com/users/jkibele/followers",
"following_url": "https://api.github.com/users/jkibele/following{/other_user}",
"gists_url": "https://api.github.com/users/jkibele/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jkibele",
"id": 4845845,
"login": "jkibele",
"node_id": "MDQ6VXNlcjQ4NDU4NDU=",
"organizations_url": "https://api.github.com/users/jkibele/orgs",
"received_events_url": "https://api.github.com/users/jkibele/received_events",
"repos_url": "https://api.github.com/users/jkibele/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jkibele/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jkibele/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jkibele"
}
|
[
{
"color": "e10c02",
"default": false,
"description": null,
"id": 76811,
"name": "Bug",
"node_id": "MDU6TGFiZWw3NjgxMQ==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Bug"
},
{
"color": "02d7e1",
"default": false,
"description": "Concat, Merge/Join, Stack/Unstack, Explode",
"id": 13098779,
"name": "Reshaping",
"node_id": "MDU6TGFiZWwxMzA5ODc3OQ==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Reshaping"
},
{
"color": "e11d21",
"default": false,
"description": "Functionality that used to work in a prior pandas version",
"id": 32815646,
"name": "Regression",
"node_id": "MDU6TGFiZWwzMjgxNTY0Ng==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Regression"
},
{
"color": "0e8a16",
"default": true,
"description": null,
"id": 717120670,
"name": "good first issue",
"node_id": "MDU6TGFiZWw3MTcxMjA2NzA=",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/good%20first%20issue"
}
] |
closed
| false
| null |
[] |
{
"closed_at": "2020-08-21T08:34:54Z",
"closed_issues": 110,
"created_at": "2020-07-10T13:54:44Z",
"creator": {
"avatar_url": "https://avatars.githubusercontent.com/u/953992?v=4",
"events_url": "https://api.github.com/users/jreback/events{/privacy}",
"followers_url": "https://api.github.com/users/jreback/followers",
"following_url": "https://api.github.com/users/jreback/following{/other_user}",
"gists_url": "https://api.github.com/users/jreback/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jreback",
"id": 953992,
"login": "jreback",
"node_id": "MDQ6VXNlcjk1Mzk5Mg==",
"organizations_url": "https://api.github.com/users/jreback/orgs",
"received_events_url": "https://api.github.com/users/jreback/received_events",
"repos_url": "https://api.github.com/users/jreback/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jreback/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jreback/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jreback"
},
"description": "on-merge: backport to 1.1.x",
"due_on": "2020-08-22T07:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/75",
"id": 5640672,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/75/labels",
"node_id": "MDk6TWlsZXN0b25lNTY0MDY3Mg==",
"number": 75,
"open_issues": 0,
"state": "closed",
"title": "1.1.1",
"updated_at": "2020-08-25T06:31:23Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/75"
}
| 5
| 2020-08-05T00:16:06Z
| 2020-08-16T10:08:05Z
| 2020-08-13T10:15:52Z
|
NONE
| null |
- [X ] I have checked that this issue has not already been reported.
- [X ] I have confirmed this bug exists on the latest version of pandas.
Crashes in 1.1.0, but works in 1.0.5
- [X ] (optional) I have confirmed this bug exists on the master branch of pandas.
---
#### Code Sample, a copy-pastable example
```python
import pandas as pd
dr1 = pd.date_range(start='1/1/2020', end='2/1/2020')
dr2 = pd.date_range(start='1/1/2020', end='1/20/2020', freq='2D') + pd.Timedelta(seconds=0.4)
df1 = pd.DataFrame({'val1': 'foo'}, index=pd.DatetimeIndex(dr1))
df2 = pd.DataFrame({'val2': 'bar'}, index=pd.DatetimeIndex(dr2))
td = pd.Timedelta(seconds=0.5)
pd.merge_asof(df2, df1, left_index=True, right_index=True, tolerance=td)
```
#### Problem description
When trying to use `merge_asof` in 1.1.0 (and in master), I get message about "incompatible tolerance" even though I'm using `pandas.DatetimeIndex` and `pandas.Timedelta` for the tolerance.
Well, technically, I actually get `UnbondLocalError` because a local variable is referenced before assignment while trying to generate the error message, but it looks like the underlying problem is something to do with an incompatible tolerance error.
Here's the traceback:
<details>
```python
---------------------------------------------------------------------------
UnboundLocalError Traceback (most recent call last)
<ipython-input-4-c18851904e91> in <module>
1 td = pd.Timedelta(seconds=0.5)
----> 2 pd.merge_asof(df2, df1, left_index=True, right_index=True, tolerance=td)
~/miniconda3/envs/pandas_problem/lib/python3.8/site-packages/pandas/core/reshape/merge.py in merge_asof(left, right, on, left_on, right_on, left_index, right_index, by, left_by, right_by, suffixes, tolerance, allow_exact_matches, direction)
544 4 2016-05-25 13:30:00.048 AAPL 98.00 100 NaN NaN
545 """
--> 546 op = _AsOfMerge(
547 left,
548 right,
~/miniconda3/envs/pandas_problem/lib/python3.8/site-packages/pandas/core/reshape/merge.py in __init__(self, left, right, on, left_on, right_on, left_index, right_index, by, left_by, right_by, axis, suffixes, copy, fill_method, how, tolerance, allow_exact_matches, direction)
1571 self.direction = direction
1572
-> 1573 _OrderedMerge.__init__(
1574 self,
1575 left,
~/miniconda3/envs/pandas_problem/lib/python3.8/site-packages/pandas/core/reshape/merge.py in __init__(self, left, right, on, left_on, right_on, left_index, right_index, axis, suffixes, copy, fill_method, how)
1465
1466 self.fill_method = fill_method
-> 1467 _MergeOperation.__init__(
1468 self,
1469 left,
~/miniconda3/envs/pandas_problem/lib/python3.8/site-packages/pandas/core/reshape/merge.py in __init__(self, left, right, how, on, left_on, right_on, axis, left_index, right_index, sort, suffixes, copy, indicator, validate)
650 self.right_join_keys,
651 self.join_names,
--> 652 ) = self._get_merge_keys()
653
654 # validate the merge keys dtypes. We may need to coerce
~/miniconda3/envs/pandas_problem/lib/python3.8/site-packages/pandas/core/reshape/merge.py in _get_merge_keys(self)
1667
1668 msg = (
-> 1669 f"incompatible tolerance {self.tolerance}, must be compat "
1670 f"with type {repr(lk.dtype)}"
1671 )
UnboundLocalError: local variable 'lk' referenced before assignment
```
</details>
#### Expected Output
Here's what I get in version 1.0.4, and what I think I should get.
```
val2 val1
2020-01-01 00:00:00.400 bar foo
2020-01-03 00:00:00.400 bar foo
2020-01-05 00:00:00.400 bar foo
2020-01-07 00:00:00.400 bar foo
2020-01-09 00:00:00.400 bar foo
2020-01-11 00:00:00.400 bar foo
2020-01-13 00:00:00.400 bar foo
2020-01-15 00:00:00.400 bar foo
2020-01-17 00:00:00.400 bar foo
2020-01-19 00:00:00.400 bar foo
```
#### Output of ``pd.show_versions()``
<details>
INSTALLED VERSIONS
------------------
commit : a4203cf8d440f33d50076166fad3b0577a3ef8fa
python : 3.8.5.final.0
python-bits : 64
OS : Linux
OS-release : 5.4.0-7634-generic
Version : #38~1595345317~20.04~a8480ad-Ubuntu SMP Wed Jul 22 15:13:45 UTC
machine : x86_64
processor : x86_64
byteorder : little
LC_ALL : None
LANG : en_US.UTF-8
LOCALE : en_US.UTF-8
pandas : 1.2.0.dev0+29.ga4203cf8d
numpy : 1.19.1
pytz : 2020.1
dateutil : 2.8.1
pip : 20.1.1
setuptools : 49.2.0.post20200714
Cython : None
pytest : None
hypothesis : None
sphinx : None
blosc : None
feather : None
xlsxwriter : None
lxml.etree : None
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : 2.11.2
IPython : 7.16.1
pandas_datareader: None
bs4 : None
bottleneck : None
fsspec : None
fastparquet : None
gcsfs : None
matplotlib : None
numexpr : None
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : None
pytables : None
pyxlsb : None
s3fs : None
scipy : None
sqlalchemy : None
tables : None
tabulate : None
xarray : None
xlrd : None
xlwt : None
numba : None
</details>
I hope I did this right. Just trying to help. Thanks.
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/35558/reactions"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35558/timeline
| null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/35559
|
https://api.github.com/repos/pandas-dev/pandas
|
https://api.github.com/repos/pandas-dev/pandas/issues/35559/labels{/name}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35559/comments
|
https://api.github.com/repos/pandas-dev/pandas/issues/35559/events
|
https://github.com/pandas-dev/pandas/issues/35559
| 673,189,882
|
MDU6SXNzdWU2NzMxODk4ODI=
| 35,559
|
BUG: A read-only DataFrame cannot be .diff()'ed
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/10572122?v=4",
"events_url": "https://api.github.com/users/dycw/events{/privacy}",
"followers_url": "https://api.github.com/users/dycw/followers",
"following_url": "https://api.github.com/users/dycw/following{/other_user}",
"gists_url": "https://api.github.com/users/dycw/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/dycw",
"id": 10572122,
"login": "dycw",
"node_id": "MDQ6VXNlcjEwNTcyMTIy",
"organizations_url": "https://api.github.com/users/dycw/orgs",
"received_events_url": "https://api.github.com/users/dycw/received_events",
"repos_url": "https://api.github.com/users/dycw/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/dycw/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/dycw/subscriptions",
"type": "User",
"url": "https://api.github.com/users/dycw"
}
|
[
{
"color": "e11d21",
"default": false,
"description": "Functionality that used to work in a prior pandas version",
"id": 32815646,
"name": "Regression",
"node_id": "MDU6TGFiZWwzMjgxNTY0Ng==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Regression"
},
{
"color": "eb6420",
"default": false,
"description": "Non-arithmetic algos: value_counts, factorize, sorting, isin, clip, shift, diff",
"id": 57296398,
"name": "Algos",
"node_id": "MDU6TGFiZWw1NzI5NjM5OA==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Algos"
}
] |
closed
| false
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1020496?v=4",
"events_url": "https://api.github.com/users/jorisvandenbossche/events{/privacy}",
"followers_url": "https://api.github.com/users/jorisvandenbossche/followers",
"following_url": "https://api.github.com/users/jorisvandenbossche/following{/other_user}",
"gists_url": "https://api.github.com/users/jorisvandenbossche/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jorisvandenbossche",
"id": 1020496,
"login": "jorisvandenbossche",
"node_id": "MDQ6VXNlcjEwMjA0OTY=",
"organizations_url": "https://api.github.com/users/jorisvandenbossche/orgs",
"received_events_url": "https://api.github.com/users/jorisvandenbossche/received_events",
"repos_url": "https://api.github.com/users/jorisvandenbossche/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jorisvandenbossche/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jorisvandenbossche/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jorisvandenbossche"
}
|
[
{
"avatar_url": "https://avatars.githubusercontent.com/u/1020496?v=4",
"events_url": "https://api.github.com/users/jorisvandenbossche/events{/privacy}",
"followers_url": "https://api.github.com/users/jorisvandenbossche/followers",
"following_url": "https://api.github.com/users/jorisvandenbossche/following{/other_user}",
"gists_url": "https://api.github.com/users/jorisvandenbossche/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jorisvandenbossche",
"id": 1020496,
"login": "jorisvandenbossche",
"node_id": "MDQ6VXNlcjEwMjA0OTY=",
"organizations_url": "https://api.github.com/users/jorisvandenbossche/orgs",
"received_events_url": "https://api.github.com/users/jorisvandenbossche/received_events",
"repos_url": "https://api.github.com/users/jorisvandenbossche/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jorisvandenbossche/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jorisvandenbossche/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jorisvandenbossche"
}
] |
{
"closed_at": "2020-08-21T08:34:54Z",
"closed_issues": 110,
"created_at": "2020-07-10T13:54:44Z",
"creator": {
"avatar_url": "https://avatars.githubusercontent.com/u/953992?v=4",
"events_url": "https://api.github.com/users/jreback/events{/privacy}",
"followers_url": "https://api.github.com/users/jreback/followers",
"following_url": "https://api.github.com/users/jreback/following{/other_user}",
"gists_url": "https://api.github.com/users/jreback/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jreback",
"id": 953992,
"login": "jreback",
"node_id": "MDQ6VXNlcjk1Mzk5Mg==",
"organizations_url": "https://api.github.com/users/jreback/orgs",
"received_events_url": "https://api.github.com/users/jreback/received_events",
"repos_url": "https://api.github.com/users/jreback/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jreback/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jreback/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jreback"
},
"description": "on-merge: backport to 1.1.x",
"due_on": "2020-08-22T07:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/75",
"id": 5640672,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/75/labels",
"node_id": "MDk6TWlsZXN0b25lNTY0MDY3Mg==",
"number": 75,
"open_issues": 0,
"state": "closed",
"title": "1.1.1",
"updated_at": "2020-08-25T06:31:23Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/75"
}
| 9
| 2020-08-05T01:46:19Z
| 2020-08-14T14:35:21Z
| 2020-08-14T14:35:21Z
|
NONE
| null |
- [x] I have checked that this issue has not already been reported.
- [x] I have confirmed this bug exists on the latest version of pandas.
- [ ] (optional) I have confirmed this bug exists on the master branch of pandas.
---
**Note**: Please read [this guide](https://matthewrocklin.com/blog/work/2018/02/28/minimal-bug-reports) detailing how to provide the necessary information for us to reproduce your bug.
#### Code Sample, a copy-pastable example
```python
import numpy as np
import pandas as pd
data = np.ones(2, dtype=int)
data.flags.writeable = False
df = pd.DataFrame(data)
df.diff()
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-2-df60a870b020> in <module>
2 data.flags.writeable = False
3 df = pd.DataFrame(data)
----> 4 df.diff()
~/miniconda3/envs/dts/lib/python3.8/site-packages/pandas/core/frame.py in diff(self, periods, axis)
7247 return self.T.diff(periods, axis=0).T
7248
-> 7249 new_data = self._mgr.diff(n=periods, axis=bm_axis)
7250 return self._constructor(new_data)
7251
~/miniconda3/envs/dts/lib/python3.8/site-packages/pandas/core/internals/managers.py in diff(self, n, axis)
546
547 def diff(self, n: int, axis: int) -> "BlockManager":
--> 548 return self.apply("diff", n=n, axis=axis)
549
550 def interpolate(self, **kwargs) -> "BlockManager":
~/miniconda3/envs/dts/lib/python3.8/site-packages/pandas/core/internals/managers.py in apply(self, f, align_keys, **kwargs)
394 applied = b.apply(f, **kwargs)
395 else:
--> 396 applied = getattr(b, f)(**kwargs)
397 result_blocks = _extend_blocks(applied, result_blocks)
398
~/miniconda3/envs/dts/lib/python3.8/site-packages/pandas/core/internals/blocks.py in diff(self, n, axis)
1265 def diff(self, n: int, axis: int = 1) -> List["Block"]:
1266 """ return block for the diff of the values """
-> 1267 new_values = algos.diff(self.values, n, axis=axis, stacklevel=7)
1268 return [self.make_block(values=new_values)]
1269
~/miniconda3/envs/dts/lib/python3.8/site-packages/pandas/core/algorithms.py in diff(arr, n, axis, stacklevel)
1914 # TODO: can diff_2d dtype specialization troubles be fixed by defining
1915 # out_arr inside diff_2d?
-> 1916 algos.diff_2d(arr, out_arr, n, axis)
1917 else:
1918 # To keep mypy happy, _res_indexer is a list while res_indexer is
pandas/_libs/algos.pyx in pandas._libs.algos.diff_2d()
~/miniconda3/envs/dts/lib/python3.8/site-packages/pandas/_libs/algos.cpython-38-x86_64-linux-gnu.so in View.MemoryView.memoryview_cwrapper()
~/miniconda3/envs/dts/lib/python3.8/site-packages/pandas/_libs/algos.cpython-38-x86_64-linux-gnu.so in View.MemoryView.memoryview.__cinit__()
ValueError: buffer source array is read-only
```
#### Problem description
`df.diff()` does not seem like a data-mutating operation, at least not to me. My read is that `df.iloc[]` was given the same assessment in 2015 (#10043).
#### Expected Output
```
0
0 nan
1 0.00000
```
#### Output of ``pd.show_versions()``
<details>
```
INSTALLED VERSIONS
------------------
commit : d9fff2792bf16178d4e450fe7384244e50635733
python : 3.8.3.final.0
python-bits : 64
OS : Linux
OS-release : 5.4.0-42-generic
Version : #46-Ubuntu SMP Fri Jul 10 00:24:02 UTC 2020
machine : x86_64
processor : x86_64
byteorder : little
LC_ALL : None
LANG : en_HK.UTF-8
LOCALE : en_HK.UTF-8
pandas : 1.1.0
numpy : 1.19.1
pytz : 2020.1
dateutil : 2.8.1
pip : 20.1.1
setuptools : 49.2.0.post20200714
Cython : None
pytest : 6.0.1
hypothesis : None
sphinx : None
blosc : None
feather : None
xlsxwriter : None
lxml.etree : None
html5lib : None
pymysql : None
psycopg2 : 2.8.5 (dt dec pq3 ext lo64)
jinja2 : 2.11.2
IPython : 7.16.1
pandas_datareader: None
bs4 : 4.9.1
bottleneck : None
fsspec : None
fastparquet : None
gcsfs : None
matplotlib : 3.2.2
numexpr : None
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : None
pytables : None
pyxlsb : None
s3fs : None
scipy : 1.5.0
sqlalchemy : 1.3.18
tables : None
tabulate : 0.8.3
xarray : None
xlrd : None
xlwt : None
numba : None
```
</details>
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/35559/reactions"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35559/timeline
| null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/35560
|
https://api.github.com/repos/pandas-dev/pandas
|
https://api.github.com/repos/pandas-dev/pandas/issues/35560/labels{/name}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35560/comments
|
https://api.github.com/repos/pandas-dev/pandas/issues/35560/events
|
https://github.com/pandas-dev/pandas/issues/35560
| 673,198,502
|
MDU6SXNzdWU2NzMxOTg1MDI=
| 35,560
|
BUG: series.where(boolean) works but df.where(boolean) does not
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/10572122?v=4",
"events_url": "https://api.github.com/users/dycw/events{/privacy}",
"followers_url": "https://api.github.com/users/dycw/followers",
"following_url": "https://api.github.com/users/dycw/following{/other_user}",
"gists_url": "https://api.github.com/users/dycw/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/dycw",
"id": 10572122,
"login": "dycw",
"node_id": "MDQ6VXNlcjEwNTcyMTIy",
"organizations_url": "https://api.github.com/users/dycw/orgs",
"received_events_url": "https://api.github.com/users/dycw/received_events",
"repos_url": "https://api.github.com/users/dycw/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/dycw/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/dycw/subscriptions",
"type": "User",
"url": "https://api.github.com/users/dycw"
}
|
[
{
"color": "e10c02",
"default": false,
"description": null,
"id": 76811,
"name": "Bug",
"node_id": "MDU6TGFiZWw3NjgxMQ==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Bug"
},
{
"color": "009800",
"default": false,
"description": "Duplicate issue or pull request",
"id": 40153326,
"name": "Duplicate Report",
"node_id": "MDU6TGFiZWw0MDE1MzMyNg==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Duplicate%20Report"
}
] |
closed
| false
| null |
[] | null | 1
| 2020-08-05T02:12:32Z
| 2020-08-05T11:34:46Z
| 2020-08-05T11:26:47Z
|
NONE
| null |
- [x] I have checked that this issue has not already been reported.
- [x] I have confirmed this bug exists on the latest version of pandas.
- [ ] (optional) I have confirmed this bug exists on the master branch of pandas.
---
**Note**: Please read [this guide](https://matthewrocklin.com/blog/work/2018/02/28/minimal-bug-reports) detailing how to provide the necessary information for us to reproduce your bug.
#### Code Sample, a copy-pastable example
```python
import pandas as pd
x = pd.Series(range(3), dtype=float)
mask = pd.Series([True, False, nan], dtype=pd.BooleanDtype())
print(f"x=\n{x}\n\nmask=\n{mask}\n\nx.where(mask)=\n{x.where(mask)}")
x=
0 0.00000
1 1.00000
2 2.00000
dtype: float64
mask=
0 True
1 False
2 <NA>
dtype: boolean
x.where(mask)=
0 0.00000
1 nan
2 nan
dtype: float64
```
```python
x_df = x.to_frame()
mask_df = mask.to_frame()
print(f"x_df=\n{x_df}\n\nmask_df=\n{mask_df}")
x_df.where(mask_df)
x_df=
0
0 0.00000
1 1.00000
2 2.00000
mask_df=
0
0 True
1 False
2 <NA>
---------------------------------------------------------------------------
AssertionError Traceback (most recent call last)
<ipython-input-9-7e122bb223a4> in <module>
2 mask_df = mask.to_frame()
3 print(f"x_df=\n{x_df}\n\nmask_df=\n{mask_df}")
----> 4 x_df.where(mask_df)
~/miniconda3/envs/dts/lib/python3.8/site-packages/pandas/core/generic.py in where(self, cond, other, inplace, axis, level, errors, try_cast)
8990 """
8991 other = com.apply_if_callable(other, self)
-> 8992 return self._where(
8993 cond, other, inplace, axis, level, errors=errors, try_cast=try_cast
8994 )
~/miniconda3/envs/dts/lib/python3.8/site-packages/pandas/core/generic.py in _where(self, cond, other, inplace, axis, level, errors, try_cast)
8847
8848 else:
-> 8849 new_data = self._mgr.where(
8850 other=other,
8851 cond=cond,
~/miniconda3/envs/dts/lib/python3.8/site-packages/pandas/core/internals/managers.py in where(self, other, cond, align, errors, try_cast, axis)
511 other = extract_array(other, extract_numpy=True)
512
--> 513 return self.apply(
514 "where",
515 align_keys=align_keys,
~/miniconda3/envs/dts/lib/python3.8/site-packages/pandas/core/internals/managers.py in apply(self, f, align_keys, **kwargs)
394 applied = b.apply(f, **kwargs)
395 else:
--> 396 applied = getattr(b, f)(**kwargs)
397 result_blocks = _extend_blocks(applied, result_blocks)
398
~/miniconda3/envs/dts/lib/python3.8/site-packages/pandas/core/internals/blocks.py in where(self, other, cond, errors, try_cast, axis)
1299 import pandas.core.computation.expressions as expressions
1300
-> 1301 cond = _extract_bool_array(cond)
1302 assert not isinstance(other, (ABCIndexClass, ABCSeries, ABCDataFrame))
1303
~/miniconda3/envs/dts/lib/python3.8/site-packages/pandas/core/internals/blocks.py in _extract_bool_array(mask)
2862
2863 assert isinstance(mask, np.ndarray), type(mask)
-> 2864 assert mask.dtype == bool, mask.dtype
2865 return mask
AssertionError: object
```
#### Problem description
If the truthiness of `boolean` Series is defined, then it certainly should be for DataFrames.
#### Expected Output
Equivalent to doing this columnwise, i.e.:
```python
expected = pd.concat([x.where(m) for (_, x), (_, m) in zip(x_df.items(), mask_df.items())], axis=1)
print(f"expected=\n{expected}")
expected=
0
0 0.00000
1 nan
2 nan
```
#### Output of ``pd.show_versions()``
<details>
INSTALLED VERSIONS
------------------
commit : d9fff2792bf16178d4e450fe7384244e50635733
python : 3.8.3.final.0
python-bits : 64
OS : Linux
OS-release : 5.4.0-42-generic
Version : #46-Ubuntu SMP Fri Jul 10 00:24:02 UTC 2020
machine : x86_64
processor : x86_64
byteorder : little
LC_ALL : None
LANG : en_HK.UTF-8
LOCALE : en_HK.UTF-8
pandas : 1.1.0
numpy : 1.19.1
pytz : 2020.1
dateutil : 2.8.1
pip : 20.1.1
setuptools : 49.2.0.post20200714
Cython : None
pytest : 6.0.1
hypothesis : None
sphinx : None
blosc : None
feather : None
xlsxwriter : None
lxml.etree : None
html5lib : None
pymysql : None
psycopg2 : 2.8.5 (dt dec pq3 ext lo64)
jinja2 : 2.11.2
IPython : 7.16.1
pandas_datareader: None
bs4 : 4.9.1
bottleneck : None
fsspec : None
fastparquet : None
gcsfs : None
matplotlib : 3.2.2
numexpr : None
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : None
pytables : None
pyxlsb : None
s3fs : None
scipy : 1.5.0
sqlalchemy : 1.3.18
tables : None
tabulate : 0.8.3
xarray : None
xlrd : None
xlwt : None
numba : None
</details>
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/35560/reactions"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35560/timeline
| null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/35561
|
https://api.github.com/repos/pandas-dev/pandas
|
https://api.github.com/repos/pandas-dev/pandas/issues/35561/labels{/name}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35561/comments
|
https://api.github.com/repos/pandas-dev/pandas/issues/35561/events
|
https://github.com/pandas-dev/pandas/issues/35561
| 673,209,401
|
MDU6SXNzdWU2NzMyMDk0MDE=
| 35,561
|
BUG:Dataframe.to_string, when set index=False, there is a white space in the head of every line
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/27135586?v=4",
"events_url": "https://api.github.com/users/ZephyrShannon/events{/privacy}",
"followers_url": "https://api.github.com/users/ZephyrShannon/followers",
"following_url": "https://api.github.com/users/ZephyrShannon/following{/other_user}",
"gists_url": "https://api.github.com/users/ZephyrShannon/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/ZephyrShannon",
"id": 27135586,
"login": "ZephyrShannon",
"node_id": "MDQ6VXNlcjI3MTM1NTg2",
"organizations_url": "https://api.github.com/users/ZephyrShannon/orgs",
"received_events_url": "https://api.github.com/users/ZephyrShannon/received_events",
"repos_url": "https://api.github.com/users/ZephyrShannon/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/ZephyrShannon/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/ZephyrShannon/subscriptions",
"type": "User",
"url": "https://api.github.com/users/ZephyrShannon"
}
|
[
{
"color": "e10c02",
"default": false,
"description": null,
"id": 76811,
"name": "Bug",
"node_id": "MDU6TGFiZWw3NjgxMQ==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Bug"
},
{
"color": "0052cc",
"default": false,
"description": "Issue that has not been reviewed by a pandas team member",
"id": 1954720290,
"name": "Needs Triage",
"node_id": "MDU6TGFiZWwxOTU0NzIwMjkw",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Needs%20Triage"
}
] |
closed
| false
| null |
[] | null | 2
| 2020-08-05T02:43:18Z
| 2020-09-04T17:52:01Z
| 2020-09-04T17:51:54Z
|
NONE
| null |
- [x] I have checked that this issue has not already been reported.
- [ ] I have confirmed this bug exists on the latest version of pandas.
- [ ] (optional) I have confirmed this bug exists on the master branch of pandas.
---
**Note**: Please read [this guide](https://matthewrocklin.com/blog/work/2018/02/28/minimal-bug-reports) detailing how to provide the necessary information for us to reproduce your bug.
#### Code Sample, a copy-pastable example
```python
import pandas as pd
d = {'col1': ["1", "2", "3"], 'col2': [4, 5, 6]}
df = pd.DataFrame(d)
print(df.to_string(index=False, formatters={'col1':'{:10}'.format}))
```
#### Problem description
there is a white space in the head of every line:
col1 col2
1 4
2 5
3 6
#### Expected Output
no white space in the head
col1 col2
1 4
2 5
3 6
#### Output of ``pd.show_versions()``
<details>
INSTALLED VERSIONS
------------------
commit: None
python: 3.7.3.final.0
python-bits: 64
OS: Darwin
OS-release: 19.5.0
machine: x86_64
processor: i386
byteorder: little
LC_ALL: None
LANG: None
LOCALE: zh_CN.UTF-8
pandas: 0.24.2
pytest: None
pip: 19.0.3
setuptools: 41.0.0
Cython: None
numpy: 1.16.4
scipy: 1.3.0
pyarrow: None
xarray: None
IPython: 7.5.0
sphinx: None
patsy: None
dateutil: 2.8.0
pytz: 2019.1
blosc: None
bottleneck: None
tables: None
numexpr: None
feather: None
matplotlib: 3.1.0
openpyxl: None
xlrd: None
xlwt: None
xlsxwriter: None
lxml.etree: 4.5.1
bs4: None
html5lib: None
sqlalchemy: None
pymysql: None
psycopg2: None
jinja2: 2.10.1
s3fs: None
fastparquet: None
pandas_gbq: None
pandas_datareader: 0.8.1
gcsfs: None
</details>
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/35561/reactions"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35561/timeline
| null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/35562
|
https://api.github.com/repos/pandas-dev/pandas
|
https://api.github.com/repos/pandas-dev/pandas/issues/35562/labels{/name}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35562/comments
|
https://api.github.com/repos/pandas-dev/pandas/issues/35562/events
|
https://github.com/pandas-dev/pandas/pull/35562
| 673,289,654
|
MDExOlB1bGxSZXF1ZXN0NDYzMTc1MDMx
| 35,562
|
BUG: Ensure rolling groupby doesn't segfault with center=True
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/10647082?v=4",
"events_url": "https://api.github.com/users/mroeschke/events{/privacy}",
"followers_url": "https://api.github.com/users/mroeschke/followers",
"following_url": "https://api.github.com/users/mroeschke/following{/other_user}",
"gists_url": "https://api.github.com/users/mroeschke/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/mroeschke",
"id": 10647082,
"login": "mroeschke",
"node_id": "MDQ6VXNlcjEwNjQ3MDgy",
"organizations_url": "https://api.github.com/users/mroeschke/orgs",
"received_events_url": "https://api.github.com/users/mroeschke/received_events",
"repos_url": "https://api.github.com/users/mroeschke/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/mroeschke/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/mroeschke/subscriptions",
"type": "User",
"url": "https://api.github.com/users/mroeschke"
}
|
[
{
"color": "e10c02",
"default": false,
"description": null,
"id": 76811,
"name": "Bug",
"node_id": "MDU6TGFiZWw3NjgxMQ==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Bug"
},
{
"color": "e11d21",
"default": false,
"description": "Functionality that used to work in a prior pandas version",
"id": 32815646,
"name": "Regression",
"node_id": "MDU6TGFiZWwzMjgxNTY0Ng==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Regression"
},
{
"color": "d4c5f9",
"default": false,
"description": "rolling, ewma, expanding",
"id": 1045950827,
"name": "Window",
"node_id": "MDU6TGFiZWwxMDQ1OTUwODI3",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Window"
}
] |
closed
| false
| null |
[] |
{
"closed_at": "2020-08-21T08:34:54Z",
"closed_issues": 110,
"created_at": "2020-07-10T13:54:44Z",
"creator": {
"avatar_url": "https://avatars.githubusercontent.com/u/953992?v=4",
"events_url": "https://api.github.com/users/jreback/events{/privacy}",
"followers_url": "https://api.github.com/users/jreback/followers",
"following_url": "https://api.github.com/users/jreback/following{/other_user}",
"gists_url": "https://api.github.com/users/jreback/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jreback",
"id": 953992,
"login": "jreback",
"node_id": "MDQ6VXNlcjk1Mzk5Mg==",
"organizations_url": "https://api.github.com/users/jreback/orgs",
"received_events_url": "https://api.github.com/users/jreback/received_events",
"repos_url": "https://api.github.com/users/jreback/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jreback/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jreback/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jreback"
},
"description": "on-merge: backport to 1.1.x",
"due_on": "2020-08-22T07:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/75",
"id": 5640672,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/75/labels",
"node_id": "MDk6TWlsZXN0b25lNTY0MDY3Mg==",
"number": 75,
"open_issues": 0,
"state": "closed",
"title": "1.1.1",
"updated_at": "2020-08-25T06:31:23Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/75"
}
| 3
| 2020-08-05T06:31:03Z
| 2020-08-07T19:29:31Z
| 2020-08-07T18:09:31Z
|
MEMBER
| null |
- [x] closes #35552
- [x] tests added / passed
- [x] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [x] whatsnew entry
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/35562/reactions"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35562/timeline
| null | 0
|
{
"diff_url": "https://github.com/pandas-dev/pandas/pull/35562.diff",
"html_url": "https://github.com/pandas-dev/pandas/pull/35562",
"merged_at": "2020-08-07T18:09:30Z",
"patch_url": "https://github.com/pandas-dev/pandas/pull/35562.patch",
"url": "https://api.github.com/repos/pandas-dev/pandas/pulls/35562"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35563
|
https://api.github.com/repos/pandas-dev/pandas
|
https://api.github.com/repos/pandas-dev/pandas/issues/35563/labels{/name}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35563/comments
|
https://api.github.com/repos/pandas-dev/pandas/issues/35563/events
|
https://github.com/pandas-dev/pandas/issues/35563
| 673,382,447
|
MDU6SXNzdWU2NzMzODI0NDc=
| 35,563
|
BUG: freq set to NONE when resampling pd.Multiindex (introduced in v1.1.0)
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/29901736?v=4",
"events_url": "https://api.github.com/users/andreas-vester/events{/privacy}",
"followers_url": "https://api.github.com/users/andreas-vester/followers",
"following_url": "https://api.github.com/users/andreas-vester/following{/other_user}",
"gists_url": "https://api.github.com/users/andreas-vester/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/andreas-vester",
"id": 29901736,
"login": "andreas-vester",
"node_id": "MDQ6VXNlcjI5OTAxNzM2",
"organizations_url": "https://api.github.com/users/andreas-vester/orgs",
"received_events_url": "https://api.github.com/users/andreas-vester/received_events",
"repos_url": "https://api.github.com/users/andreas-vester/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/andreas-vester/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/andreas-vester/subscriptions",
"type": "User",
"url": "https://api.github.com/users/andreas-vester"
}
|
[
{
"color": "0b02e1",
"default": false,
"description": "Related to indexing on series/frames, not to indexes themselves",
"id": 2822098,
"name": "Indexing",
"node_id": "MDU6TGFiZWwyODIyMDk4",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Indexing"
},
{
"color": "e11d21",
"default": false,
"description": "Functionality that used to work in a prior pandas version",
"id": 32815646,
"name": "Regression",
"node_id": "MDU6TGFiZWwzMjgxNTY0Ng==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Regression"
},
{
"color": "0052cc",
"default": false,
"description": "DateOffsets",
"id": 53181044,
"name": "Frequency",
"node_id": "MDU6TGFiZWw1MzE4MTA0NA==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Frequency"
},
{
"color": "207de5",
"default": false,
"description": null,
"id": 71268330,
"name": "MultiIndex",
"node_id": "MDU6TGFiZWw3MTI2ODMzMA==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/MultiIndex"
}
] |
closed
| false
| null |
[] |
{
"closed_at": "2020-12-08T12:11:38Z",
"closed_issues": 81,
"created_at": "2020-10-29T13:43:23Z",
"creator": {
"avatar_url": "https://avatars.githubusercontent.com/u/13159005?v=4",
"events_url": "https://api.github.com/users/simonjayhawkins/events{/privacy}",
"followers_url": "https://api.github.com/users/simonjayhawkins/followers",
"following_url": "https://api.github.com/users/simonjayhawkins/following{/other_user}",
"gists_url": "https://api.github.com/users/simonjayhawkins/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/simonjayhawkins",
"id": 13159005,
"login": "simonjayhawkins",
"node_id": "MDQ6VXNlcjEzMTU5MDA1",
"organizations_url": "https://api.github.com/users/simonjayhawkins/orgs",
"received_events_url": "https://api.github.com/users/simonjayhawkins/received_events",
"repos_url": "https://api.github.com/users/simonjayhawkins/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/simonjayhawkins/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/simonjayhawkins/subscriptions",
"type": "User",
"url": "https://api.github.com/users/simonjayhawkins"
},
"description": "on-merge: backport to 1.1.x",
"due_on": "2020-12-07T08:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/79",
"id": 6047124,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/79/labels",
"node_id": "MDk6TWlsZXN0b25lNjA0NzEyNA==",
"number": 79,
"open_issues": 0,
"state": "closed",
"title": "1.1.5",
"updated_at": "2020-12-08T12:11:38Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/79"
}
| 21
| 2020-08-05T09:08:42Z
| 2020-11-30T13:40:56Z
| 2020-11-30T13:40:56Z
|
NONE
| null |
- [x] I have checked that this issue has not already been reported.
- [x] I have confirmed this bug exists on the latest version of pandas.
- [ ] (optional) I have confirmed this bug exists on the master branch of pandas.
---
## Update/Summary
When dealing with a pd.multiindex the frequency `df.loc[i].index.freq` has not been set. This behavior has been introduced in v1.1.0
> ```
> idx = pd.Index(range(2), name="A")
> dti = pd.date_range("2020-01-01", periods=7, freq="D", name="B")
> mi = pd.MultiIndex.from_product([idx, dti])
>
> df = pd.DataFrame(np.random.randn(14, 2), index=mi)
>
> >>> df.loc[0].index
> ```
>
> `df.loc[0].index` matches `dti`, so it would be nice to get the `freq="D"` back on that.
> using code sample in [#35563 (comment)](https://github.com/pandas-dev/pandas/issues/35563#issuecomment-670246757) points to #31315
>
> [c988567](https://github.com/pandas-dev/pandas/commit/c9885673d6a6f9f433c570d65b664b0c2ec8c6f0) is the first bad commit
> commit [c988567](https://github.com/pandas-dev/pandas/commit/c9885673d6a6f9f433c570d65b664b0c2ec8c6f0)
> Author: jbrockmendel [jbrockmendel@gmail.com](mailto:jbrockmendel@gmail.com)
> Date: Sun Feb 9 07:01:20 2020 -0800
>
> ```
> REF: tighten what we accept in TimedeltaIndex._simple_new (#31315)
> ```
## Original post
#### Code Sample, a copy-pastable example
```python
import numpy as np
import pandas as pd
idx_level_0 = np.repeat([1, 2], 5)
dates = np.tile(
["2020-01-01", "2020-01-02", "2020-01-04", "2020-01-06", "2020-01-07"], 2
)
values1 = [1, 2, 3, 4, 5]
values2 = [6, 7, 8, 9, 10]
df = pd.DataFrame(
{"idx_level_0": idx_level_0, "dates": dates, "values": [*values1, *values2]}
)
df["dates"] = pd.to_datetime(df["dates"])
df = df.set_index(["idx_level_0", "dates"], drop=True)
df = df.groupby("idx_level_0").resample("D", level="dates").last()
# The following assertion is working properly in pandas v1.0.5
# It throws an error in pandas v1.1.0
assert df.index.get_level_values(1).freq == "D"
```
#### Problem description
When resampling a `groupby`-object, the frequency will incorrectly be set to `None`.
#### Expected Output
The frequency should be set according to the resampled frequency.
#### Output of ``pd.show_versions()``
<details>
INSTALLED VERSIONS
------------------
commit : d9fff2792bf16178d4e450fe7384244e50635733
python : 3.8.2.final.0
python-bits : 64
OS : Windows
OS-release : 10
Version : 10.0.19041
machine : AMD64
processor : Intel64 Family 6 Model 60 Stepping 3, GenuineIntel
byteorder : little
LC_ALL : None
LANG : None
LOCALE : de_DE.cp1252
pandas : 1.1.0
numpy : 1.18.4
pytz : 2020.1
dateutil : 2.8.1
pip : 20.1.1
setuptools : 45.3.0
Cython : None
pytest : None
hypothesis : None
sphinx : None
blosc : None
feather : None
xlsxwriter : None
lxml.etree : 4.5.1
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : None
IPython : None
pandas_datareader: None
bs4 : None
bottleneck : None
fsspec : None
fastparquet : None
gcsfs : None
matplotlib : 3.2.2
numexpr : None
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : None
pytables : None
pyxlsb : None
s3fs : None
scipy : 1.5.0
sqlalchemy : None
tables : None
tabulate : None
xarray : None
xlrd : None
xlwt : None
numba : None
</details>
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/35563/reactions"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35563/timeline
| null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/35564
|
https://api.github.com/repos/pandas-dev/pandas
|
https://api.github.com/repos/pandas-dev/pandas/issues/35564/labels{/name}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35564/comments
|
https://api.github.com/repos/pandas-dev/pandas/issues/35564/events
|
https://github.com/pandas-dev/pandas/issues/35564
| 673,423,086
|
MDU6SXNzdWU2NzM0MjMwODY=
| 35,564
|
BUG:df.sort_values() disturb the order of values among columns.
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/40780228?v=4",
"events_url": "https://api.github.com/users/yangyxt/events{/privacy}",
"followers_url": "https://api.github.com/users/yangyxt/followers",
"following_url": "https://api.github.com/users/yangyxt/following{/other_user}",
"gists_url": "https://api.github.com/users/yangyxt/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/yangyxt",
"id": 40780228,
"login": "yangyxt",
"node_id": "MDQ6VXNlcjQwNzgwMjI4",
"organizations_url": "https://api.github.com/users/yangyxt/orgs",
"received_events_url": "https://api.github.com/users/yangyxt/received_events",
"repos_url": "https://api.github.com/users/yangyxt/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/yangyxt/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/yangyxt/subscriptions",
"type": "User",
"url": "https://api.github.com/users/yangyxt"
}
|
[
{
"color": "e10c02",
"default": false,
"description": null,
"id": 76811,
"name": "Bug",
"node_id": "MDU6TGFiZWw3NjgxMQ==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Bug"
},
{
"color": "207de5",
"default": false,
"description": "Clarification about behavior needed to assess issue",
"id": 307649777,
"name": "Needs Info",
"node_id": "MDU6TGFiZWwzMDc2NDk3Nzc=",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Needs%20Info"
}
] |
closed
| false
| null |
[] | null | 5
| 2020-08-05T10:13:33Z
| 2020-08-19T12:19:38Z
| 2020-08-19T12:19:38Z
|
NONE
| null |
- [ ] I have checked that this issue has not already been reported.
check
- [ ] I have confirmed this bug exists on the latest version of pandas.
check
- [ ] (optional) I have confirmed this bug exists on the master branch of pandas.
check
---
**Note**: Please read [this guide](https://matthewrocklin.com/blog/work/2018/02/28/minimal-bug-reports) detailing how to provide the necessary information for us to reproduce your bug.
#### Code Sample, a copy-pastable example
```python
# Your code here
anno_table.sort_values(by=['Denovo_status', 'CLNSIG', patient_gt_col, 'ExonicFunc.refGene', 'DANN_score'], ascending=False, inplace=True)
```
#### Problem description
I have two columns named "Gene.refGene" and "AAChange.refGene" the later one is the detailed description of the amino acid change caused by a variant on the gene. So it should strictly correspond to the former column I mentioned here.
However, after the running the code pasted above, their correspondence become completely messed.
[this should explain **why** the current behaviour is a problem and why the expected output is a better solution]
#### Expected Output
Here I prepare the sample code for you to re-generate the issue.
[Archive.zip](https://github.com/pandas-dev/pandas/files/5027662/Archive.zip)
Pls de-compress the package and run the sh file. Keep them in the same folder.
#### Output of ``pd.show_versions()``
<details>

</details>
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/35564/reactions"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35564/timeline
| null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/35565
|
https://api.github.com/repos/pandas-dev/pandas
|
https://api.github.com/repos/pandas-dev/pandas/issues/35565/labels{/name}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35565/comments
|
https://api.github.com/repos/pandas-dev/pandas/issues/35565/events
|
https://github.com/pandas-dev/pandas/issues/35565
| 673,496,387
|
MDU6SXNzdWU2NzM0OTYzODc=
| 35,565
|
different behaviour of df.isin() in 1.0.5/1.1.0, when df contains None
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/33967107?v=4",
"events_url": "https://api.github.com/users/johny-b/events{/privacy}",
"followers_url": "https://api.github.com/users/johny-b/followers",
"following_url": "https://api.github.com/users/johny-b/following{/other_user}",
"gists_url": "https://api.github.com/users/johny-b/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/johny-b",
"id": 33967107,
"login": "johny-b",
"node_id": "MDQ6VXNlcjMzOTY3MTA3",
"organizations_url": "https://api.github.com/users/johny-b/orgs",
"received_events_url": "https://api.github.com/users/johny-b/received_events",
"repos_url": "https://api.github.com/users/johny-b/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/johny-b/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/johny-b/subscriptions",
"type": "User",
"url": "https://api.github.com/users/johny-b"
}
|
[
{
"color": "e10c02",
"default": false,
"description": null,
"id": 76811,
"name": "Bug",
"node_id": "MDU6TGFiZWw3NjgxMQ==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Bug"
},
{
"color": "d7e102",
"default": false,
"description": "np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate",
"id": 2822342,
"name": "Missing-data",
"node_id": "MDU6TGFiZWwyODIyMzQy",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Missing-data"
},
{
"color": "e11d21",
"default": false,
"description": "Functionality that used to work in a prior pandas version",
"id": 32815646,
"name": "Regression",
"node_id": "MDU6TGFiZWwzMjgxNTY0Ng==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Regression"
},
{
"color": "fef2c0",
"default": false,
"description": "isin method",
"id": 2468482981,
"name": "isin",
"node_id": "MDU6TGFiZWwyNDY4NDgyOTgx",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/isin"
}
] |
open
| false
| null |
[] |
{
"closed_at": null,
"closed_issues": 786,
"created_at": "2015-01-13T10:53:19Z",
"creator": {
"avatar_url": "https://avatars.githubusercontent.com/u/953992?v=4",
"events_url": "https://api.github.com/users/jreback/events{/privacy}",
"followers_url": "https://api.github.com/users/jreback/followers",
"following_url": "https://api.github.com/users/jreback/following{/other_user}",
"gists_url": "https://api.github.com/users/jreback/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jreback",
"id": 953992,
"login": "jreback",
"node_id": "MDQ6VXNlcjk1Mzk5Mg==",
"organizations_url": "https://api.github.com/users/jreback/orgs",
"received_events_url": "https://api.github.com/users/jreback/received_events",
"repos_url": "https://api.github.com/users/jreback/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jreback/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jreback/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jreback"
},
"description": "Changes that would be nice to have in the next release. These issues are not blocking. They will be pushed to the next release if no one has time to fix them.",
"due_on": null,
"html_url": "https://github.com/pandas-dev/pandas/milestone/32",
"id": 933188,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/32/labels",
"node_id": "MDk6TWlsZXN0b25lOTMzMTg4",
"number": 32,
"open_issues": 1053,
"state": "open",
"title": "Contributions Welcome",
"updated_at": "2021-11-21T00:50:06Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/32"
}
| 9
| 2020-08-05T12:20:50Z
| 2021-11-13T11:50:20Z
| null |
NONE
| null |
```
>>> import pandas as pd
>>> x = pd.DataFrame([['foo', 'bar'], [1, None]])
>>> y = x[1].copy()
# PANDAS 1.0.5
>>> x.isin(y)
0 1
0 False True
1 False True
# PANDAS 1.1.0
>>> x.isin(y)
0 1
0 False True
1 False False
```
Is this change intended?
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/35565/reactions"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35565/timeline
| null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/35566
|
https://api.github.com/repos/pandas-dev/pandas
|
https://api.github.com/repos/pandas-dev/pandas/issues/35566/labels{/name}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35566/comments
|
https://api.github.com/repos/pandas-dev/pandas/issues/35566/events
|
https://github.com/pandas-dev/pandas/issues/35566
| 673,510,416
|
MDU6SXNzdWU2NzM1MTA0MTY=
| 35,566
|
BUG: corrupted SAS datasets retain file handles
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/8394766?v=4",
"events_url": "https://api.github.com/users/rxxg/events{/privacy}",
"followers_url": "https://api.github.com/users/rxxg/followers",
"following_url": "https://api.github.com/users/rxxg/following{/other_user}",
"gists_url": "https://api.github.com/users/rxxg/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/rxxg",
"id": 8394766,
"login": "rxxg",
"node_id": "MDQ6VXNlcjgzOTQ3NjY=",
"organizations_url": "https://api.github.com/users/rxxg/orgs",
"received_events_url": "https://api.github.com/users/rxxg/received_events",
"repos_url": "https://api.github.com/users/rxxg/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/rxxg/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/rxxg/subscriptions",
"type": "User",
"url": "https://api.github.com/users/rxxg"
}
|
[
{
"color": "e10c02",
"default": false,
"description": null,
"id": 76811,
"name": "Bug",
"node_id": "MDU6TGFiZWw3NjgxMQ==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Bug"
},
{
"color": "ffa0ff",
"default": false,
"description": "Incorrect or improved errors from pandas",
"id": 42670965,
"name": "Error Reporting",
"node_id": "MDU6TGFiZWw0MjY3MDk2NQ==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Error%20Reporting"
},
{
"color": "5319e7",
"default": false,
"description": "SAS: read_sas",
"id": 258745163,
"name": "IO SAS",
"node_id": "MDU6TGFiZWwyNTg3NDUxNjM=",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/IO%20SAS"
}
] |
closed
| false
| null |
[] |
{
"closed_at": "2020-12-26T13:57:50Z",
"closed_issues": 1768,
"created_at": "2020-05-29T23:47:32Z",
"creator": {
"avatar_url": "https://avatars.githubusercontent.com/u/953992?v=4",
"events_url": "https://api.github.com/users/jreback/events{/privacy}",
"followers_url": "https://api.github.com/users/jreback/followers",
"following_url": "https://api.github.com/users/jreback/following{/other_user}",
"gists_url": "https://api.github.com/users/jreback/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jreback",
"id": 953992,
"login": "jreback",
"node_id": "MDQ6VXNlcjk1Mzk5Mg==",
"organizations_url": "https://api.github.com/users/jreback/orgs",
"received_events_url": "https://api.github.com/users/jreback/received_events",
"repos_url": "https://api.github.com/users/jreback/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jreback/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jreback/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jreback"
},
"description": "on-merge: backport to 1.2.x",
"due_on": "2020-12-15T08:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/73",
"id": 5479819,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/73/labels",
"node_id": "MDk6TWlsZXN0b25lNTQ3OTgxOQ==",
"number": 73,
"open_issues": 0,
"state": "closed",
"title": "1.2",
"updated_at": "2021-04-13T15:46:43Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/73"
}
| 0
| 2020-08-05T12:44:20Z
| 2020-09-13T22:28:12Z
| 2020-09-13T22:28:12Z
|
CONTRIBUTOR
| null |
- [ ] I have checked that this issue has not already been reported.
- [X] I have confirmed this bug exists on the latest version of pandas.
- [X] (optional) I have confirmed this bug exists on the master branch of pandas.
---
**Note**: Please read [this guide](https://matthewrocklin.com/blog/work/2018/02/28/minimal-bug-reports) detailing how to provide the necessary information for us to reproduce your bug.
#### Code Sample, a copy-pastable example
```python
import pandas as pd
from pathlib import Path
path = ...
p = Path(path, 'corrupt.sas7bdat')
try:
pd.read_sas(p)
except:
input("Press enter to release file")
```
#### Problem description
When I run the above script with a corrupt database like the one attached [corrupt.zip](https://github.com/pandas-dev/pandas/files/5028407/corrupt.zip) the Python process my Windows system ends up holding on to the open file.
I can tell that the file has not been correctly closed on error since, for example, other processes cannot open the same file.
#### Expected Output
While the main Python process is waiting for input, other processes should be able to read the given file.
I can't find any way of finding out if the current Python process has an open file handle on a given file, but it is expected behaviour that other processes should be able to access the file before
#### Output of ``pd.show_versions()``
<details>
INSTALLED VERSIONS
------------------
commit : d9fff2792bf16178d4e450fe7384244e50635733
python : 3.7.1.final.0
python-bits : 64
OS : Windows
OS-release : 10
Version : 10.0.17763
machine : AMD64
processor : Intel64 Family 6 Model 142 Stepping 9, GenuineIntel
byteorder : little
LC_ALL : None
LANG : None
LOCALE : None.None
pandas : 1.1.0
numpy : 1.18.1
pytz : 2019.3
dateutil : 2.8.1
pip : 10.0.1
setuptools : 39.0.1
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
fsspec : None
fastparquet : None
gcsfs : None
matplotlib : None
numexpr : None
odfpy : None
openpyxl : 3.0.3
pandas_gbq : None
pyarrow : None
pytables : None
pyxlsb : None
s3fs : None
scipy : 1.4.1
sqlalchemy : None
tables : None
tabulate : None
xarray : None
xlrd : 1.2.0
xlwt : 1.3.0
numba : None
</details>
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/35566/reactions"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35566/timeline
| null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/35567
|
https://api.github.com/repos/pandas-dev/pandas
|
https://api.github.com/repos/pandas-dev/pandas/issues/35567/labels{/name}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35567/comments
|
https://api.github.com/repos/pandas-dev/pandas/issues/35567/events
|
https://github.com/pandas-dev/pandas/pull/35567
| 673,511,553
|
MDExOlB1bGxSZXF1ZXN0NDYzMzYwNTI5
| 35,567
|
Ensure file is closed promptly in case of error
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/8394766?v=4",
"events_url": "https://api.github.com/users/rxxg/events{/privacy}",
"followers_url": "https://api.github.com/users/rxxg/followers",
"following_url": "https://api.github.com/users/rxxg/following{/other_user}",
"gists_url": "https://api.github.com/users/rxxg/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/rxxg",
"id": 8394766,
"login": "rxxg",
"node_id": "MDQ6VXNlcjgzOTQ3NjY=",
"organizations_url": "https://api.github.com/users/rxxg/orgs",
"received_events_url": "https://api.github.com/users/rxxg/received_events",
"repos_url": "https://api.github.com/users/rxxg/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/rxxg/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/rxxg/subscriptions",
"type": "User",
"url": "https://api.github.com/users/rxxg"
}
|
[
{
"color": "e10c02",
"default": false,
"description": null,
"id": 76811,
"name": "Bug",
"node_id": "MDU6TGFiZWw3NjgxMQ==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Bug"
},
{
"color": "5319e7",
"default": false,
"description": "SAS: read_sas",
"id": 258745163,
"name": "IO SAS",
"node_id": "MDU6TGFiZWwyNTg3NDUxNjM=",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/IO%20SAS"
}
] |
closed
| false
| null |
[] | null | 4
| 2020-08-05T12:46:05Z
| 2020-08-07T07:33:59Z
| 2020-08-06T13:19:39Z
|
CONTRIBUTOR
| null |
Fixes #35566
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/35567/reactions"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35567/timeline
| null | 0
|
{
"diff_url": "https://github.com/pandas-dev/pandas/pull/35567.diff",
"html_url": "https://github.com/pandas-dev/pandas/pull/35567",
"merged_at": null,
"patch_url": "https://github.com/pandas-dev/pandas/pull/35567.patch",
"url": "https://api.github.com/repos/pandas-dev/pandas/pulls/35567"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35568
|
https://api.github.com/repos/pandas-dev/pandas
|
https://api.github.com/repos/pandas-dev/pandas/issues/35568/labels{/name}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35568/comments
|
https://api.github.com/repos/pandas-dev/pandas/issues/35568/events
|
https://github.com/pandas-dev/pandas/pull/35568
| 673,519,341
|
MDExOlB1bGxSZXF1ZXN0NDYzMzY2NzA5
| 35,568
|
DOC: add type BinaryIO to path param #35505
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/7901364?v=4",
"events_url": "https://api.github.com/users/alexhtn/events{/privacy}",
"followers_url": "https://api.github.com/users/alexhtn/followers",
"following_url": "https://api.github.com/users/alexhtn/following{/other_user}",
"gists_url": "https://api.github.com/users/alexhtn/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/alexhtn",
"id": 7901364,
"login": "alexhtn",
"node_id": "MDQ6VXNlcjc5MDEzNjQ=",
"organizations_url": "https://api.github.com/users/alexhtn/orgs",
"received_events_url": "https://api.github.com/users/alexhtn/received_events",
"repos_url": "https://api.github.com/users/alexhtn/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/alexhtn/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/alexhtn/subscriptions",
"type": "User",
"url": "https://api.github.com/users/alexhtn"
}
|
[
{
"color": "3465A4",
"default": false,
"description": null,
"id": 134699,
"name": "Docs",
"node_id": "MDU6TGFiZWwxMzQ2OTk=",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Docs"
},
{
"color": "bfe5bf",
"default": false,
"description": "read_excel, to_excel",
"id": 49254273,
"name": "IO Excel",
"node_id": "MDU6TGFiZWw0OTI1NDI3Mw==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/IO%20Excel"
}
] |
closed
| false
| null |
[] |
{
"closed_at": "2020-12-26T13:57:50Z",
"closed_issues": 1768,
"created_at": "2020-05-29T23:47:32Z",
"creator": {
"avatar_url": "https://avatars.githubusercontent.com/u/953992?v=4",
"events_url": "https://api.github.com/users/jreback/events{/privacy}",
"followers_url": "https://api.github.com/users/jreback/followers",
"following_url": "https://api.github.com/users/jreback/following{/other_user}",
"gists_url": "https://api.github.com/users/jreback/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jreback",
"id": 953992,
"login": "jreback",
"node_id": "MDQ6VXNlcjk1Mzk5Mg==",
"organizations_url": "https://api.github.com/users/jreback/orgs",
"received_events_url": "https://api.github.com/users/jreback/received_events",
"repos_url": "https://api.github.com/users/jreback/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jreback/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jreback/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jreback"
},
"description": "on-merge: backport to 1.2.x",
"due_on": "2020-12-15T08:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/73",
"id": 5479819,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/73/labels",
"node_id": "MDk6TWlsZXN0b25lNTQ3OTgxOQ==",
"number": 73,
"open_issues": 0,
"state": "closed",
"title": "1.2",
"updated_at": "2021-04-13T15:46:43Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/73"
}
| 2
| 2020-08-05T12:57:36Z
| 2020-09-13T23:07:41Z
| 2020-09-13T23:07:21Z
|
CONTRIBUTOR
| null |
- [ ] closes #35505
- [ ] tests added / passed
- [ ] passes `black pandas`
- [ ] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] whatsnew entry
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/35568/reactions"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35568/timeline
| null | 0
|
{
"diff_url": "https://github.com/pandas-dev/pandas/pull/35568.diff",
"html_url": "https://github.com/pandas-dev/pandas/pull/35568",
"merged_at": "2020-09-13T23:07:21Z",
"patch_url": "https://github.com/pandas-dev/pandas/pull/35568.patch",
"url": "https://api.github.com/repos/pandas-dev/pandas/pulls/35568"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35569
|
https://api.github.com/repos/pandas-dev/pandas
|
https://api.github.com/repos/pandas-dev/pandas/issues/35569/labels{/name}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35569/comments
|
https://api.github.com/repos/pandas-dev/pandas/issues/35569/events
|
https://github.com/pandas-dev/pandas/issues/35569
| 673,578,105
|
MDU6SXNzdWU2NzM1NzgxMDU=
| 35,569
|
QST: Howto write a custom DateOffset
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/5927148?v=4",
"events_url": "https://api.github.com/users/MaxWinterstein/events{/privacy}",
"followers_url": "https://api.github.com/users/MaxWinterstein/followers",
"following_url": "https://api.github.com/users/MaxWinterstein/following{/other_user}",
"gists_url": "https://api.github.com/users/MaxWinterstein/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/MaxWinterstein",
"id": 5927148,
"login": "MaxWinterstein",
"node_id": "MDQ6VXNlcjU5MjcxNDg=",
"organizations_url": "https://api.github.com/users/MaxWinterstein/orgs",
"received_events_url": "https://api.github.com/users/MaxWinterstein/received_events",
"repos_url": "https://api.github.com/users/MaxWinterstein/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/MaxWinterstein/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/MaxWinterstein/subscriptions",
"type": "User",
"url": "https://api.github.com/users/MaxWinterstein"
}
|
[
{
"color": "3465A4",
"default": false,
"description": null,
"id": 134699,
"name": "Docs",
"node_id": "MDU6TGFiZWwxMzQ2OTk=",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Docs"
},
{
"color": "0052cc",
"default": false,
"description": "DateOffsets",
"id": 53181044,
"name": "Frequency",
"node_id": "MDU6TGFiZWw1MzE4MTA0NA==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Frequency"
}
] |
open
| false
| null |
[] | null | 14
| 2020-08-05T14:19:52Z
| 2021-08-08T19:55:19Z
| null |
NONE
| null |
We need multiple custom DateOffset, e.g. so called `MonthHalf`.
Until Release 1.1.0 we had a working solution:
```python
import pandas as pd
class MonthHalf(pd.offsets.DateOffset):
"""Date offset repeating on the first date of the month and a day in the middle of the month.
For February the middle day is the 15th, for all other months the 16th."""
_attributes = frozenset(["n"])
_prefix = "MH"
__init__ = pd.offsets.BaseOffset.__init__
@pandas.tseries.offsets.apply_wraps
def apply(self, other: dt.datetime):
month_half_day = self._month_half_day(other.month)
second_month_half = other.day >= month_half_day
n = self.n
new = other
if n < 0:
if not self.onOffset(other):
# Move to the left onto an offset
if second_month_half:
new = new.replace(day=month_half_day)
else:
new = new.replace(day=1)
# One step already happened
n += 1
odd_n = n % 2 == 1
if n > 0:
month_difference = n // 2 + second_month_half * odd_n
elif n == 0:
month_difference = 0
else:
month_difference = n // 2 - second_month_half * (not odd_n)
if month_difference != 0:
new = new + month_difference * pd.offsets.MonthBegin()
month_half_day = self._month_half_day(new.month)
if odd_n:
new_day = 1 if second_month_half else month_half_day
else:
new_day = month_half_day if second_month_half else 1
new = new.replace(day=new_day)
return new
def onOffset(self, date):
return date.day in {1, self._month_half_day(date.month)}
@staticmethod
def _month_half_day(month: int):
return 15 if month == 2 else 16
```
With release 1.1.0 (and i guess the merge of https://github.com/pandas-dev/pandas/pull/34062) code is broken.
E.g. The rollback is not working anymore:
```python
def test_rollback():
date = pd.to_datetime('2018-01-02')
rollback = MonthHalf().rollback(date)
assert rollback == dt.date(2018, 1, 1)
```
How can i implement such need now?
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/35569/reactions"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35569/timeline
| null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/35570
|
https://api.github.com/repos/pandas-dev/pandas
|
https://api.github.com/repos/pandas-dev/pandas/issues/35570/labels{/name}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35570/comments
|
https://api.github.com/repos/pandas-dev/pandas/issues/35570/events
|
https://github.com/pandas-dev/pandas/issues/35570
| 673,583,103
|
MDU6SXNzdWU2NzM1ODMxMDM=
| 35,570
|
Change the default of `check_freq` to `False` as it breaks existing code
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/5927148?v=4",
"events_url": "https://api.github.com/users/MaxWinterstein/events{/privacy}",
"followers_url": "https://api.github.com/users/MaxWinterstein/followers",
"following_url": "https://api.github.com/users/MaxWinterstein/following{/other_user}",
"gists_url": "https://api.github.com/users/MaxWinterstein/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/MaxWinterstein",
"id": 5927148,
"login": "MaxWinterstein",
"node_id": "MDQ6VXNlcjU5MjcxNDg=",
"organizations_url": "https://api.github.com/users/MaxWinterstein/orgs",
"received_events_url": "https://api.github.com/users/MaxWinterstein/received_events",
"repos_url": "https://api.github.com/users/MaxWinterstein/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/MaxWinterstein/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/MaxWinterstein/subscriptions",
"type": "User",
"url": "https://api.github.com/users/MaxWinterstein"
}
|
[
{
"color": "C4A000",
"default": false,
"description": "pandas testing functions or related to the test suite",
"id": 127685,
"name": "Testing",
"node_id": "MDU6TGFiZWwxMjc2ODU=",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Testing"
},
{
"color": "e11d21",
"default": false,
"description": "Functionality that used to work in a prior pandas version",
"id": 32815646,
"name": "Regression",
"node_id": "MDU6TGFiZWwzMjgxNTY0Ng==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Regression"
}
] |
closed
| false
| null |
[] |
{
"closed_at": null,
"closed_issues": 2361,
"created_at": "2015-02-26T19:29:05Z",
"creator": {
"avatar_url": "https://avatars.githubusercontent.com/u/1020496?v=4",
"events_url": "https://api.github.com/users/jorisvandenbossche/events{/privacy}",
"followers_url": "https://api.github.com/users/jorisvandenbossche/followers",
"following_url": "https://api.github.com/users/jorisvandenbossche/following{/other_user}",
"gists_url": "https://api.github.com/users/jorisvandenbossche/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jorisvandenbossche",
"id": 1020496,
"login": "jorisvandenbossche",
"node_id": "MDQ6VXNlcjEwMjA0OTY=",
"organizations_url": "https://api.github.com/users/jorisvandenbossche/orgs",
"received_events_url": "https://api.github.com/users/jorisvandenbossche/received_events",
"repos_url": "https://api.github.com/users/jorisvandenbossche/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jorisvandenbossche/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jorisvandenbossche/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jorisvandenbossche"
},
"description": "A milestone for closed or open issues for which there is no action needed (eg not a bug, just a question / discussion, nothing to resolve, wontfix, etc).\r\n\r\n",
"due_on": null,
"html_url": "https://github.com/pandas-dev/pandas/milestone/33",
"id": 997544,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/33/labels",
"node_id": "MDk6TWlsZXN0b25lOTk3NTQ0",
"number": 33,
"open_issues": 11,
"state": "open",
"title": "No action",
"updated_at": "2021-11-19T17:33:16Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/33"
}
| 2
| 2020-08-05T14:26:48Z
| 2020-08-14T13:05:35Z
| 2020-08-14T13:04:59Z
|
NONE
| null |
As already mentioned in https://github.com/pandas-dev/pandas/pull/34050 the default of `check_freq` was set to True, which leads to broken code / tests.
I suggest to change it to `False` as it ensures existing code won't break.
>k thanks. pls open an issue to change this to `check_freq=False`; I *think* this might break downstream, IIRC a comment by @jorisvandenbossche
_Originally posted by @jreback in https://github.com/pandas-dev/pandas/pull/34050#issuecomment-626227446_
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/35570/reactions"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35570/timeline
| null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/35571
|
https://api.github.com/repos/pandas-dev/pandas
|
https://api.github.com/repos/pandas-dev/pandas/issues/35571/labels{/name}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35571/comments
|
https://api.github.com/repos/pandas-dev/pandas/issues/35571/events
|
https://github.com/pandas-dev/pandas/pull/35571
| 673,588,480
|
MDExOlB1bGxSZXF1ZXN0NDYzNDI0MjUy
| 35,571
|
Change check_freq default to False
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/5927148?v=4",
"events_url": "https://api.github.com/users/MaxWinterstein/events{/privacy}",
"followers_url": "https://api.github.com/users/MaxWinterstein/followers",
"following_url": "https://api.github.com/users/MaxWinterstein/following{/other_user}",
"gists_url": "https://api.github.com/users/MaxWinterstein/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/MaxWinterstein",
"id": 5927148,
"login": "MaxWinterstein",
"node_id": "MDQ6VXNlcjU5MjcxNDg=",
"organizations_url": "https://api.github.com/users/MaxWinterstein/orgs",
"received_events_url": "https://api.github.com/users/MaxWinterstein/received_events",
"repos_url": "https://api.github.com/users/MaxWinterstein/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/MaxWinterstein/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/MaxWinterstein/subscriptions",
"type": "User",
"url": "https://api.github.com/users/MaxWinterstein"
}
|
[
{
"color": "C4A000",
"default": false,
"description": "pandas testing functions or related to the test suite",
"id": 127685,
"name": "Testing",
"node_id": "MDU6TGFiZWwxMjc2ODU=",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Testing"
},
{
"color": "e11d21",
"default": false,
"description": "Functionality that used to work in a prior pandas version",
"id": 32815646,
"name": "Regression",
"node_id": "MDU6TGFiZWwzMjgxNTY0Ng==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Regression"
}
] |
closed
| false
| null |
[] | null | 4
| 2020-08-05T14:34:01Z
| 2020-08-14T14:29:33Z
| 2020-08-14T13:03:24Z
|
NONE
| null |
- [x] closes #35570
- [x] tests added / passed
- [x] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] whatsnew entry
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/35571/reactions"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35571/timeline
| null | 0
|
{
"diff_url": "https://github.com/pandas-dev/pandas/pull/35571.diff",
"html_url": "https://github.com/pandas-dev/pandas/pull/35571",
"merged_at": null,
"patch_url": "https://github.com/pandas-dev/pandas/pull/35571.patch",
"url": "https://api.github.com/repos/pandas-dev/pandas/pulls/35571"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35572
|
https://api.github.com/repos/pandas-dev/pandas
|
https://api.github.com/repos/pandas-dev/pandas/issues/35572/labels{/name}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35572/comments
|
https://api.github.com/repos/pandas-dev/pandas/issues/35572/events
|
https://github.com/pandas-dev/pandas/pull/35572
| 673,592,169
|
MDExOlB1bGxSZXF1ZXN0NDYzNDI3Mzcy
| 35,572
|
Ensure _group_selection_context is always reset
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/425260?v=4",
"events_url": "https://api.github.com/users/eric-wieser/events{/privacy}",
"followers_url": "https://api.github.com/users/eric-wieser/followers",
"following_url": "https://api.github.com/users/eric-wieser/following{/other_user}",
"gists_url": "https://api.github.com/users/eric-wieser/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/eric-wieser",
"id": 425260,
"login": "eric-wieser",
"node_id": "MDQ6VXNlcjQyNTI2MA==",
"organizations_url": "https://api.github.com/users/eric-wieser/orgs",
"received_events_url": "https://api.github.com/users/eric-wieser/received_events",
"repos_url": "https://api.github.com/users/eric-wieser/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/eric-wieser/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/eric-wieser/subscriptions",
"type": "User",
"url": "https://api.github.com/users/eric-wieser"
}
|
[
{
"color": "729FCF",
"default": false,
"description": null,
"id": 233160,
"name": "Groupby",
"node_id": "MDU6TGFiZWwyMzMxNjA=",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Groupby"
},
{
"color": "207de5",
"default": false,
"description": null,
"id": 211029535,
"name": "Clean",
"node_id": "MDU6TGFiZWwyMTEwMjk1MzU=",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Clean"
}
] |
closed
| false
| null |
[] |
{
"closed_at": "2020-12-26T13:57:50Z",
"closed_issues": 1768,
"created_at": "2020-05-29T23:47:32Z",
"creator": {
"avatar_url": "https://avatars.githubusercontent.com/u/953992?v=4",
"events_url": "https://api.github.com/users/jreback/events{/privacy}",
"followers_url": "https://api.github.com/users/jreback/followers",
"following_url": "https://api.github.com/users/jreback/following{/other_user}",
"gists_url": "https://api.github.com/users/jreback/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jreback",
"id": 953992,
"login": "jreback",
"node_id": "MDQ6VXNlcjk1Mzk5Mg==",
"organizations_url": "https://api.github.com/users/jreback/orgs",
"received_events_url": "https://api.github.com/users/jreback/received_events",
"repos_url": "https://api.github.com/users/jreback/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jreback/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jreback/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jreback"
},
"description": "on-merge: backport to 1.2.x",
"due_on": "2020-12-15T08:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/73",
"id": 5479819,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/73/labels",
"node_id": "MDk6TWlsZXN0b25lNTQ3OTgxOQ==",
"number": 73,
"open_issues": 0,
"state": "closed",
"title": "1.2",
"updated_at": "2021-04-13T15:46:43Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/73"
}
| 2
| 2020-08-05T14:39:09Z
| 2020-08-06T15:14:51Z
| 2020-08-06T15:14:44Z
|
CONTRIBUTOR
| null |
Context managers will resume with an exception if the with block calling them fails.
This happening is not an excuse to not clean up.
- [ ] closes #xxxx
- [ ] tests added / passed
- [ ] passes `black pandas`
- [ ] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] whatsnew entry
Found by inspecting the code, not by actually finding a failing example.
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/35572/reactions"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35572/timeline
| null | 0
|
{
"diff_url": "https://github.com/pandas-dev/pandas/pull/35572.diff",
"html_url": "https://github.com/pandas-dev/pandas/pull/35572",
"merged_at": "2020-08-06T15:14:44Z",
"patch_url": "https://github.com/pandas-dev/pandas/pull/35572.patch",
"url": "https://api.github.com/repos/pandas-dev/pandas/pulls/35572"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35573
|
https://api.github.com/repos/pandas-dev/pandas
|
https://api.github.com/repos/pandas-dev/pandas/issues/35573/labels{/name}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35573/comments
|
https://api.github.com/repos/pandas-dev/pandas/issues/35573/events
|
https://github.com/pandas-dev/pandas/issues/35573
| 673,727,494
|
MDU6SXNzdWU2NzM3Mjc0OTQ=
| 35,573
|
BUG: pd.read_sql_query with chunksize = 0 should be treated like chunksize = None and it should return a DataFrame
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/69259333?v=4",
"events_url": "https://api.github.com/users/paolobellomo/events{/privacy}",
"followers_url": "https://api.github.com/users/paolobellomo/followers",
"following_url": "https://api.github.com/users/paolobellomo/following{/other_user}",
"gists_url": "https://api.github.com/users/paolobellomo/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/paolobellomo",
"id": 69259333,
"login": "paolobellomo",
"node_id": "MDQ6VXNlcjY5MjU5MzMz",
"organizations_url": "https://api.github.com/users/paolobellomo/orgs",
"received_events_url": "https://api.github.com/users/paolobellomo/received_events",
"repos_url": "https://api.github.com/users/paolobellomo/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/paolobellomo/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/paolobellomo/subscriptions",
"type": "User",
"url": "https://api.github.com/users/paolobellomo"
}
|
[
{
"color": "e10c02",
"default": false,
"description": null,
"id": 76811,
"name": "Bug",
"node_id": "MDU6TGFiZWw3NjgxMQ==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Bug"
},
{
"color": "5319e7",
"default": false,
"description": "to_sql, read_sql, read_sql_query",
"id": 47232590,
"name": "IO SQL",
"node_id": "MDU6TGFiZWw0NzIzMjU5MA==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/IO%20SQL"
}
] |
open
| false
| null |
[] | null | 3
| 2020-08-05T17:42:06Z
| 2020-08-15T16:39:51Z
| null |
NONE
| null |
- [x] I have checked that this issue has not already been reported.
- [x] I have confirmed this bug exists on the latest version of pandas.
- [ ] (optional) I have confirmed this bug exists on the master branch of pandas.
---
**Note**: Please read [this guide](https://matthewrocklin.com/blog/work/2018/02/28/minimal-bug-reports) detailing how to provide the necessary information for us to reproduce your bug.
#### Code Sample, a copy-pastable example
```python
# the details of the query are immaterial
from sqlalchemy import create_engine
_ENGINE = create_engine(
"mssql+pymssql://{user}:{password}@{server}/{database}".format(
user="my_username",
password="my_password",
server="serve.my_company.com",
database="database_name",
)
)
query = "SELECT SomeCol FROM SomeTable"
# chunksize=None, it returns a DataFrame. GOOD
test_df = pd.read_sql_query(small_query, _ENGINE, chunksize=None)
print()
print("chunksize = None")
print(type(test_df))
print(test_df.shape)
# chunksize=100, it returns a Generator. GOOD
test_df = pd.read_sql_query(small_query, _ENGINE, chunksize=100)
print()
print("chunksize = 100")
print(type(test_df))
test_df = pd.concat(test_df, axis=0)
print(test_df.shape)
# chunksize=0, it returns a Generator. BAD
# pd.concat fails because the generator fails to return anything
test_df = pd.read_sql_query(small_query, _ENGINE, chunksize=0)
print()
print("chunksize = 0")
print(type(test_df))
test_df = pd.concat(test_df, axis=0)
print(test_df.shape)
```
#### Problem description
read_sql_query:
chunksize can be either None or int.
The case chunksize = 0 should be treated like chunksize = None and it should return a DataFrame.
At the moment it returns a generator which fails to return any object when pd.concat is used
Incidentally: the DocString of read_sql_query says it will return an Iterator. Not so.
#### Expected Output
#### Output
<details>
chunksize = None
<class 'pandas.core.frame.DataFrame'>
(1854, 8)
chunksize = 100
<class 'generator'>
(1854, 8)
chunksize = 0
<class 'generator'>
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-36-16c97e2c25e0> in <module>
16 print("chunksize = 0")
17 print(type(test_df))
---> 18 test_df = pd.concat(test_df, axis=0)
19 print(test_df.shape)
/usr/local/venvs/algovenv9/lib/python3.6/site-packages/pandas/core/reshape/concat.py in concat(objs, axis, join, join_axes, ignore_index, keys, levels, names, verify_integrity, sort, copy)
226 keys=keys, levels=levels, names=names,
227 verify_integrity=verify_integrity,
--> 228 copy=copy, sort=sort)
229 return op.get_result()
230
/usr/local/venvs/algovenv9/lib/python3.6/site-packages/pandas/core/reshape/concat.py in __init__(self, objs, axis, join, join_axes, keys, levels, names, ignore_index, verify_integrity, copy, sort)
260
261 if len(objs) == 0:
--> 262 raise ValueError('No objects to concatenate')
263
264 if keys is None:
ValueError: No objects to concatenate
</details>
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/35573/reactions"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35573/timeline
| null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/35574
|
https://api.github.com/repos/pandas-dev/pandas
|
https://api.github.com/repos/pandas-dev/pandas/issues/35574/labels{/name}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35574/comments
|
https://api.github.com/repos/pandas-dev/pandas/issues/35574/events
|
https://github.com/pandas-dev/pandas/issues/35574
| 673,769,628
|
MDU6SXNzdWU2NzM3Njk2Mjg=
| 35,574
|
BUG: pd.to_timedelta() fails when arg is a Series with Int64 dtype
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/3970088?v=4",
"events_url": "https://api.github.com/users/egoddard/events{/privacy}",
"followers_url": "https://api.github.com/users/egoddard/followers",
"following_url": "https://api.github.com/users/egoddard/following{/other_user}",
"gists_url": "https://api.github.com/users/egoddard/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/egoddard",
"id": 3970088,
"login": "egoddard",
"node_id": "MDQ6VXNlcjM5NzAwODg=",
"organizations_url": "https://api.github.com/users/egoddard/orgs",
"received_events_url": "https://api.github.com/users/egoddard/received_events",
"repos_url": "https://api.github.com/users/egoddard/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/egoddard/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/egoddard/subscriptions",
"type": "User",
"url": "https://api.github.com/users/egoddard"
}
|
[
{
"color": "e10c02",
"default": false,
"description": null,
"id": 76811,
"name": "Bug",
"node_id": "MDU6TGFiZWw3NjgxMQ==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Bug"
},
{
"color": "AFEEEE",
"default": false,
"description": null,
"id": 211840,
"name": "Timeseries",
"node_id": "MDU6TGFiZWwyMTE4NDA=",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Timeseries"
},
{
"color": "8cc645",
"default": false,
"description": "Related to pd.NA and nullable extension arrays",
"id": 1817503692,
"name": "NA - MaskedArrays",
"node_id": "MDU6TGFiZWwxODE3NTAzNjky",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/NA%20-%20MaskedArrays"
}
] |
closed
| false
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/3970088?v=4",
"events_url": "https://api.github.com/users/egoddard/events{/privacy}",
"followers_url": "https://api.github.com/users/egoddard/followers",
"following_url": "https://api.github.com/users/egoddard/following{/other_user}",
"gists_url": "https://api.github.com/users/egoddard/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/egoddard",
"id": 3970088,
"login": "egoddard",
"node_id": "MDQ6VXNlcjM5NzAwODg=",
"organizations_url": "https://api.github.com/users/egoddard/orgs",
"received_events_url": "https://api.github.com/users/egoddard/received_events",
"repos_url": "https://api.github.com/users/egoddard/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/egoddard/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/egoddard/subscriptions",
"type": "User",
"url": "https://api.github.com/users/egoddard"
}
|
[
{
"avatar_url": "https://avatars.githubusercontent.com/u/3970088?v=4",
"events_url": "https://api.github.com/users/egoddard/events{/privacy}",
"followers_url": "https://api.github.com/users/egoddard/followers",
"following_url": "https://api.github.com/users/egoddard/following{/other_user}",
"gists_url": "https://api.github.com/users/egoddard/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/egoddard",
"id": 3970088,
"login": "egoddard",
"node_id": "MDQ6VXNlcjM5NzAwODg=",
"organizations_url": "https://api.github.com/users/egoddard/orgs",
"received_events_url": "https://api.github.com/users/egoddard/received_events",
"repos_url": "https://api.github.com/users/egoddard/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/egoddard/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/egoddard/subscriptions",
"type": "User",
"url": "https://api.github.com/users/egoddard"
}
] |
{
"closed_at": "2020-08-21T08:34:54Z",
"closed_issues": 110,
"created_at": "2020-07-10T13:54:44Z",
"creator": {
"avatar_url": "https://avatars.githubusercontent.com/u/953992?v=4",
"events_url": "https://api.github.com/users/jreback/events{/privacy}",
"followers_url": "https://api.github.com/users/jreback/followers",
"following_url": "https://api.github.com/users/jreback/following{/other_user}",
"gists_url": "https://api.github.com/users/jreback/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jreback",
"id": 953992,
"login": "jreback",
"node_id": "MDQ6VXNlcjk1Mzk5Mg==",
"organizations_url": "https://api.github.com/users/jreback/orgs",
"received_events_url": "https://api.github.com/users/jreback/received_events",
"repos_url": "https://api.github.com/users/jreback/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jreback/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jreback/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jreback"
},
"description": "on-merge: backport to 1.1.x",
"due_on": "2020-08-22T07:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/75",
"id": 5640672,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/75/labels",
"node_id": "MDk6TWlsZXN0b25lNTY0MDY3Mg==",
"number": 75,
"open_issues": 0,
"state": "closed",
"title": "1.1.1",
"updated_at": "2020-08-25T06:31:23Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/75"
}
| 3
| 2020-08-05T18:50:10Z
| 2020-08-07T11:49:52Z
| 2020-08-07T11:49:52Z
|
CONTRIBUTOR
| null |
- [X] I have checked that this issue has not already been reported.
- [X] I have confirmed this bug exists on the latest version of pandas.
- [X] (optional) I have confirmed this bug exists on the master branch of pandas.
---
#### Code Sample, a copy-pastable example
```python
import pandas as pd
series = pd.Series([pd.NA], dtype="Int64")
pd.to_timedelta(series, errors="coerce")
```
#### Problem description
When converting a `Series` with an `Int64` dtype to a timedelta, `to_timedelta` fails with
```python
ValueError: cannot convert to 'int64'-dtype NumPy array with missing values. Specify an appropriate 'na_value' for this dtype.
```
Passing a Python list containing a NA value works, as does passing an `Int64` Series that does not contain NA values. The functionality between these cases should be equivalent.
#### Expected Output
`pd.to_timedelta()` output returns a `timedelta64` Series containing NA values when the input is an `Int64` Series containg NA values:
```python
0 <NA>
dtype: timedelta64[ns]
```
#### Output of ``pd.show_versions()``
<details>
INSTALLED VERSIONS
------------------
commit : 3b6915ef9435b13ac5d8c19634270ae231f8e47c
python : 3.7.7.final.0
python-bits : 64
OS : Linux
OS-release : 5.4.0-7634-generic
Version : #38~1595345317~20.04~a8480ad-Ubuntu SMP Wed Jul 22 15:13:45 UTC
machine : x86_64
processor :
byteorder : little
LC_ALL : C.UTF-8
LANG : C.UTF-8
LOCALE : en_US.UTF-8
pandas : 1.2.0.dev0+28.g3b6915ef9
numpy : 1.18.5
pytz : 2020.1
dateutil : 2.8.1
pip : 20.2.1
setuptools : 45.2.0.post20200210
Cython : 0.29.21
pytest : 6.0.1
hypothesis : 5.23.11
sphinx : 3.1.1
blosc : None
feather : None
xlsxwriter : 1.3.1
lxml.etree : 4.4.1
html5lib : 1.1
pymysql : None
psycopg2 : None
jinja2 : 2.11.2
IPython : 7.17.0
pandas_datareader: None
bs4 : 4.9.1
bottleneck : 1.3.2
fsspec : 0.8.0
fastparquet : 0.4.1
gcsfs : 0.6.2
matplotlib : 3.2.1
numexpr : 2.7.1
odfpy : None
openpyxl : 3.0.4
pandas_gbq : None
pyarrow : 0.16.0
pytables : None
pyxlsb : None
s3fs : 0.4.2
scipy : 1.5.2
sqlalchemy : 1.3.18
tables : 3.6.1
tabulate : 0.8.7
xarray : 0.16.0
xlrd : 1.2.0
xlwt : 1.3.0
numba : 0.50.1
</details>
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/35574/reactions"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35574/timeline
| null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/35575
|
https://api.github.com/repos/pandas-dev/pandas
|
https://api.github.com/repos/pandas-dev/pandas/issues/35575/labels{/name}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35575/comments
|
https://api.github.com/repos/pandas-dev/pandas/issues/35575/events
|
https://github.com/pandas-dev/pandas/pull/35575
| 673,795,373
|
MDExOlB1bGxSZXF1ZXN0NDYzNTk5MDM4
| 35,575
|
CLN: remove kwargs from RangeIndex.copy
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/26364415?v=4",
"events_url": "https://api.github.com/users/topper-123/events{/privacy}",
"followers_url": "https://api.github.com/users/topper-123/followers",
"following_url": "https://api.github.com/users/topper-123/following{/other_user}",
"gists_url": "https://api.github.com/users/topper-123/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/topper-123",
"id": 26364415,
"login": "topper-123",
"node_id": "MDQ6VXNlcjI2MzY0NDE1",
"organizations_url": "https://api.github.com/users/topper-123/orgs",
"received_events_url": "https://api.github.com/users/topper-123/received_events",
"repos_url": "https://api.github.com/users/topper-123/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/topper-123/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/topper-123/subscriptions",
"type": "User",
"url": "https://api.github.com/users/topper-123"
}
|
[
{
"color": "207de5",
"default": false,
"description": null,
"id": 211029535,
"name": "Clean",
"node_id": "MDU6TGFiZWwyMTEwMjk1MzU=",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Clean"
},
{
"color": "e99695",
"default": false,
"description": "Related to the Index class or subclasses",
"id": 1218227310,
"name": "Index",
"node_id": "MDU6TGFiZWwxMjE4MjI3MzEw",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Index"
}
] |
closed
| false
| null |
[] |
{
"closed_at": "2020-12-26T13:57:50Z",
"closed_issues": 1768,
"created_at": "2020-05-29T23:47:32Z",
"creator": {
"avatar_url": "https://avatars.githubusercontent.com/u/953992?v=4",
"events_url": "https://api.github.com/users/jreback/events{/privacy}",
"followers_url": "https://api.github.com/users/jreback/followers",
"following_url": "https://api.github.com/users/jreback/following{/other_user}",
"gists_url": "https://api.github.com/users/jreback/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jreback",
"id": 953992,
"login": "jreback",
"node_id": "MDQ6VXNlcjk1Mzk5Mg==",
"organizations_url": "https://api.github.com/users/jreback/orgs",
"received_events_url": "https://api.github.com/users/jreback/received_events",
"repos_url": "https://api.github.com/users/jreback/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jreback/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jreback/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jreback"
},
"description": "on-merge: backport to 1.2.x",
"due_on": "2020-12-15T08:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/73",
"id": 5479819,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/73/labels",
"node_id": "MDk6TWlsZXN0b25lNTQ3OTgxOQ==",
"number": 73,
"open_issues": 0,
"state": "closed",
"title": "1.2",
"updated_at": "2021-04-13T15:46:43Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/73"
}
| 2
| 2020-08-05T19:33:14Z
| 2020-08-06T20:23:31Z
| 2020-08-06T15:48:00Z
|
CONTRIBUTOR
| null |
xref #31669.
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/35575/reactions"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35575/timeline
| null | 0
|
{
"diff_url": "https://github.com/pandas-dev/pandas/pull/35575.diff",
"html_url": "https://github.com/pandas-dev/pandas/pull/35575",
"merged_at": "2020-08-06T15:48:00Z",
"patch_url": "https://github.com/pandas-dev/pandas/pull/35575.patch",
"url": "https://api.github.com/repos/pandas-dev/pandas/pulls/35575"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35576
|
https://api.github.com/repos/pandas-dev/pandas
|
https://api.github.com/repos/pandas-dev/pandas/issues/35576/labels{/name}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35576/comments
|
https://api.github.com/repos/pandas-dev/pandas/issues/35576/events
|
https://github.com/pandas-dev/pandas/issues/35576
| 673,798,042
|
MDU6SXNzdWU2NzM3OTgwNDI=
| 35,576
|
ENH: way to opt-in to StringDtype instead of object dtype in read_csv()
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/632858?v=4",
"events_url": "https://api.github.com/users/chrish42/events{/privacy}",
"followers_url": "https://api.github.com/users/chrish42/followers",
"following_url": "https://api.github.com/users/chrish42/following{/other_user}",
"gists_url": "https://api.github.com/users/chrish42/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/chrish42",
"id": 632858,
"login": "chrish42",
"node_id": "MDQ6VXNlcjYzMjg1OA==",
"organizations_url": "https://api.github.com/users/chrish42/orgs",
"received_events_url": "https://api.github.com/users/chrish42/received_events",
"repos_url": "https://api.github.com/users/chrish42/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/chrish42/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/chrish42/subscriptions",
"type": "User",
"url": "https://api.github.com/users/chrish42"
}
|
[
{
"color": "4E9A06",
"default": false,
"description": null,
"id": 76812,
"name": "Enhancement",
"node_id": "MDU6TGFiZWw3NjgxMg==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Enhancement"
},
{
"color": "009800",
"default": false,
"description": "Duplicate issue or pull request",
"id": 40153326,
"name": "Duplicate Report",
"node_id": "MDU6TGFiZWw0MDE1MzMyNg==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Duplicate%20Report"
}
] |
closed
| false
| null |
[] | null | 2
| 2020-08-05T19:38:07Z
| 2020-08-21T17:04:44Z
| 2020-08-05T19:42:45Z
|
CONTRIBUTOR
| null |
I got bit recently again by the mixed types DtypeWarning while processing a CSV file. I assume that at some point, when StringDtype is not experimental anymore, `read_csv()` will use that and won't need object dtype anymore, and so this potential problem source will go away.
In the meantime though, would it be possible to have an option in `read_csv()` to use StringDtype instead of the object dtype? Both for early adopters and people who want to try it out... and it would also be a nice migration path for when StringDtype is ready. Then, it would only be a matter of flipping the default for this switch. And for people who need to revert to object dtype for some reason, that would provide them a way to do that too at that time. Thoughts? Or is it still too soon for even experimental usage of StringDtype in `read_csv()`?
I'd be willing to create a pull request for this (at last for the Python version of the CSV parser).
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/35576/reactions"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35576/timeline
| null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/35577
|
https://api.github.com/repos/pandas-dev/pandas
|
https://api.github.com/repos/pandas-dev/pandas/issues/35577/labels{/name}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35577/comments
|
https://api.github.com/repos/pandas-dev/pandas/issues/35577/events
|
https://github.com/pandas-dev/pandas/issues/35577
| 673,861,051
|
MDU6SXNzdWU2NzM4NjEwNTE=
| 35,577
|
ENH: write support for google cloud storage
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/527862?v=4",
"events_url": "https://api.github.com/users/zyxue/events{/privacy}",
"followers_url": "https://api.github.com/users/zyxue/followers",
"following_url": "https://api.github.com/users/zyxue/following{/other_user}",
"gists_url": "https://api.github.com/users/zyxue/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/zyxue",
"id": 527862,
"login": "zyxue",
"node_id": "MDQ6VXNlcjUyNzg2Mg==",
"organizations_url": "https://api.github.com/users/zyxue/orgs",
"received_events_url": "https://api.github.com/users/zyxue/received_events",
"repos_url": "https://api.github.com/users/zyxue/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/zyxue/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/zyxue/subscriptions",
"type": "User",
"url": "https://api.github.com/users/zyxue"
}
|
[
{
"color": "4E9A06",
"default": false,
"description": null,
"id": 76812,
"name": "Enhancement",
"node_id": "MDU6TGFiZWw3NjgxMg==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Enhancement"
}
] |
closed
| false
| null |
[] | null | 4
| 2020-08-05T21:33:12Z
| 2020-08-06T14:20:44Z
| 2020-08-06T11:48:55Z
|
NONE
| null |
#### Is your feature request related to a problem?
Pandas can read from google cloud storage directly. I wonder if it's a good idea to support writing data frame to google cloud storage directly.
#### Describe the solution you'd like
pd.to_parquet('gs://some-bucket/mydata.parquet')
#### API breaking implications
unaware
#### Describe alternatives you've considered
I've been writing custom functions like `write_df_to_gcs(df, gcs_uri, gcs_credentials)`, but I feel the better abstraction is to be inside `pd.to_parquet`, e.g. if to_parquet detects the path is a GCS URL, then write to GCS instead.
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/35577/reactions"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35577/timeline
| null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/35578
|
https://api.github.com/repos/pandas-dev/pandas
|
https://api.github.com/repos/pandas-dev/pandas/issues/35578/labels{/name}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35578/comments
|
https://api.github.com/repos/pandas-dev/pandas/issues/35578/events
|
https://github.com/pandas-dev/pandas/pull/35578
| 673,905,954
|
MDExOlB1bGxSZXF1ZXN0NDYzNjkxNjcw
| 35,578
|
BUG: df.shift(n, axis=1) with multiple blocks
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/8078968?v=4",
"events_url": "https://api.github.com/users/jbrockmendel/events{/privacy}",
"followers_url": "https://api.github.com/users/jbrockmendel/followers",
"following_url": "https://api.github.com/users/jbrockmendel/following{/other_user}",
"gists_url": "https://api.github.com/users/jbrockmendel/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jbrockmendel",
"id": 8078968,
"login": "jbrockmendel",
"node_id": "MDQ6VXNlcjgwNzg5Njg=",
"organizations_url": "https://api.github.com/users/jbrockmendel/orgs",
"received_events_url": "https://api.github.com/users/jbrockmendel/received_events",
"repos_url": "https://api.github.com/users/jbrockmendel/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jbrockmendel/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jbrockmendel/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jbrockmendel"
}
|
[
{
"color": "02d7e1",
"default": false,
"description": "Concat, Merge/Join, Stack/Unstack, Explode",
"id": 13098779,
"name": "Reshaping",
"node_id": "MDU6TGFiZWwxMzA5ODc3OQ==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Reshaping"
},
{
"color": "e11d21",
"default": false,
"description": "Functionality that used to work in a prior pandas version",
"id": 32815646,
"name": "Regression",
"node_id": "MDU6TGFiZWwzMjgxNTY0Ng==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Regression"
},
{
"color": "eb6420",
"default": false,
"description": "Period data type",
"id": 60635328,
"name": "Period",
"node_id": "MDU6TGFiZWw2MDYzNTMyOA==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Period"
}
] |
closed
| false
| null |
[] |
{
"closed_at": "2020-08-21T08:34:54Z",
"closed_issues": 110,
"created_at": "2020-07-10T13:54:44Z",
"creator": {
"avatar_url": "https://avatars.githubusercontent.com/u/953992?v=4",
"events_url": "https://api.github.com/users/jreback/events{/privacy}",
"followers_url": "https://api.github.com/users/jreback/followers",
"following_url": "https://api.github.com/users/jreback/following{/other_user}",
"gists_url": "https://api.github.com/users/jreback/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jreback",
"id": 953992,
"login": "jreback",
"node_id": "MDQ6VXNlcjk1Mzk5Mg==",
"organizations_url": "https://api.github.com/users/jreback/orgs",
"received_events_url": "https://api.github.com/users/jreback/received_events",
"repos_url": "https://api.github.com/users/jreback/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jreback/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jreback/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jreback"
},
"description": "on-merge: backport to 1.1.x",
"due_on": "2020-08-22T07:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/75",
"id": 5640672,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/75/labels",
"node_id": "MDk6TWlsZXN0b25lNTY0MDY3Mg==",
"number": 75,
"open_issues": 0,
"state": "closed",
"title": "1.1.1",
"updated_at": "2020-08-25T06:31:23Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/75"
}
| 2
| 2020-08-05T23:14:29Z
| 2020-08-07T20:49:51Z
| 2020-08-07T11:45:49Z
|
MEMBER
| null |
- [x] closes #35488
- [x] tests added / passed
- [x] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [x] whatsnew entry
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/35578/reactions"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35578/timeline
| null | 0
|
{
"diff_url": "https://github.com/pandas-dev/pandas/pull/35578.diff",
"html_url": "https://github.com/pandas-dev/pandas/pull/35578",
"merged_at": "2020-08-07T11:45:49Z",
"patch_url": "https://github.com/pandas-dev/pandas/pull/35578.patch",
"url": "https://api.github.com/repos/pandas-dev/pandas/pulls/35578"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35579
|
https://api.github.com/repos/pandas-dev/pandas
|
https://api.github.com/repos/pandas-dev/pandas/issues/35579/labels{/name}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35579/comments
|
https://api.github.com/repos/pandas-dev/pandas/issues/35579/events
|
https://github.com/pandas-dev/pandas/issues/35579
| 673,906,998
|
MDU6SXNzdWU2NzM5MDY5OTg=
| 35,579
|
BUG: rolling count on FixedForwardWindowIndexer returns NaN instead of 0
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/21092479?v=4",
"events_url": "https://api.github.com/users/goodwanghan/events{/privacy}",
"followers_url": "https://api.github.com/users/goodwanghan/followers",
"following_url": "https://api.github.com/users/goodwanghan/following{/other_user}",
"gists_url": "https://api.github.com/users/goodwanghan/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/goodwanghan",
"id": 21092479,
"login": "goodwanghan",
"node_id": "MDQ6VXNlcjIxMDkyNDc5",
"organizations_url": "https://api.github.com/users/goodwanghan/orgs",
"received_events_url": "https://api.github.com/users/goodwanghan/received_events",
"repos_url": "https://api.github.com/users/goodwanghan/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/goodwanghan/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/goodwanghan/subscriptions",
"type": "User",
"url": "https://api.github.com/users/goodwanghan"
}
|
[
{
"color": "e10c02",
"default": false,
"description": null,
"id": 76811,
"name": "Bug",
"node_id": "MDU6TGFiZWw3NjgxMQ==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Bug"
},
{
"color": "d4c5f9",
"default": false,
"description": "rolling, ewma, expanding",
"id": 1045950827,
"name": "Window",
"node_id": "MDU6TGFiZWwxMDQ1OTUwODI3",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Window"
}
] |
closed
| false
| null |
[] |
{
"closed_at": "2020-12-26T13:57:50Z",
"closed_issues": 1768,
"created_at": "2020-05-29T23:47:32Z",
"creator": {
"avatar_url": "https://avatars.githubusercontent.com/u/953992?v=4",
"events_url": "https://api.github.com/users/jreback/events{/privacy}",
"followers_url": "https://api.github.com/users/jreback/followers",
"following_url": "https://api.github.com/users/jreback/following{/other_user}",
"gists_url": "https://api.github.com/users/jreback/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jreback",
"id": 953992,
"login": "jreback",
"node_id": "MDQ6VXNlcjk1Mzk5Mg==",
"organizations_url": "https://api.github.com/users/jreback/orgs",
"received_events_url": "https://api.github.com/users/jreback/received_events",
"repos_url": "https://api.github.com/users/jreback/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jreback/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jreback/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jreback"
},
"description": "on-merge: backport to 1.2.x",
"due_on": "2020-12-15T08:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/73",
"id": 5479819,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/73/labels",
"node_id": "MDk6TWlsZXN0b25lNTQ3OTgxOQ==",
"number": 73,
"open_issues": 0,
"state": "closed",
"title": "1.2",
"updated_at": "2021-04-13T15:46:43Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/73"
}
| 5
| 2020-08-05T23:17:35Z
| 2020-10-02T20:35:12Z
| 2020-10-02T20:35:12Z
|
NONE
| null |
- [x] I have checked that this issue has not already been reported.
- [x] I have confirmed this bug exists on the latest version of pandas.
- [ ] (optional) I have confirmed this bug exists on the master branch of pandas.
---
**Note**: Please read [this guide](https://matthewrocklin.com/blog/work/2018/02/28/minimal-bug-reports) detailing how to provide the necessary information for us to reproduce your bug.
#### Code Sample, a copy-pastable example
```python
import pandas as pd
from pandas.core.window.indexers import FixedForwardWindowIndexer
df = pd.DataFrame([[0, None], [0, None],[0, None],[0, 7]], columns=["a", "b"])
res = df["b"].rolling(window=FixedForwardWindowIndexer(window_size=2),min_periods=0).count()
print(res)
```
#### Problem description
Current output:
0 NaN
1 NaN
2 1.0
3 1.0
#### Expected Output
0 0.0
1 0.0
2 1.0
3 1.0
#### Output of ``pd.show_versions()``
INSTALLED VERSIONS
------------------
commit : d9fff2792bf16178d4e450fe7384244e50635733
python : 3.6.9.final.0
python-bits : 64
OS : Linux
OS-release : 5.6.13-100.fc30.x86_64
Version : #1 SMP Fri May 15 00:36:06 UTC 2020
machine : x86_64
processor : x86_64
byteorder : little
LC_ALL : C.UTF-8
LANG : C.UTF-8
LOCALE : en_US.UTF-8
pandas : 1.1.0
numpy : 1.19.1
pytz : 2020.1
dateutil : 2.8.1
pip : 9.0.3
setuptools : 45.2.0
Cython : None
pytest : 4.6.4
hypothesis : None
sphinx : 3.1.2
blosc : None
feather : None
xlsxwriter : None
lxml.etree : 4.5.2
html5lib : None
pymysql : None
psycopg2 : 2.8.5 (dt dec pq3 ext lo64)
jinja2 : 2.10.1
IPython : 7.15.0
pandas_datareader: None
bs4 : 4.9.1
bottleneck : None
fsspec : 0.7.4
fastparquet : 0.4.1
gcsfs : 0.6.2
matplotlib : 3.3.0
numexpr : 2.7.1
odfpy : None
openpyxl : None
pandas_gbq : 0.10.0
pyarrow : 1.0.0
pytables : None
pyxlsb : None
s3fs : 0.2.2
scipy : 1.3.1
sqlalchemy : 1.3.18
tables : 3.6.1
tabulate : 0.8.7
xarray : None
xlrd : None
xlwt : None
numba : 0.50.1
</details>
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/35579/reactions"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35579/timeline
| null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/35580
|
https://api.github.com/repos/pandas-dev/pandas
|
https://api.github.com/repos/pandas-dev/pandas/issues/35580/labels{/name}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35580/comments
|
https://api.github.com/repos/pandas-dev/pandas/issues/35580/events
|
https://github.com/pandas-dev/pandas/issues/35580
| 673,912,827
|
MDU6SXNzdWU2NzM5MTI4Mjc=
| 35,580
|
BUG:dtype=object columns with NaNs coerce integers to floats
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/9942222?v=4",
"events_url": "https://api.github.com/users/ashtonteng/events{/privacy}",
"followers_url": "https://api.github.com/users/ashtonteng/followers",
"following_url": "https://api.github.com/users/ashtonteng/following{/other_user}",
"gists_url": "https://api.github.com/users/ashtonteng/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/ashtonteng",
"id": 9942222,
"login": "ashtonteng",
"node_id": "MDQ6VXNlcjk5NDIyMjI=",
"organizations_url": "https://api.github.com/users/ashtonteng/orgs",
"received_events_url": "https://api.github.com/users/ashtonteng/received_events",
"repos_url": "https://api.github.com/users/ashtonteng/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/ashtonteng/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/ashtonteng/subscriptions",
"type": "User",
"url": "https://api.github.com/users/ashtonteng"
}
|
[
{
"color": "0052cc",
"default": false,
"description": null,
"id": 34444536,
"name": "Usage Question",
"node_id": "MDU6TGFiZWwzNDQ0NDUzNg==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Usage%20Question"
}
] |
closed
| false
| null |
[] | null | 3
| 2020-08-05T23:34:29Z
| 2020-08-07T11:59:51Z
| 2020-08-07T11:55:03Z
|
NONE
| null |
- [x] I have checked that this issue has not already been reported.
- [x] I have confirmed this bug exists on the latest version of pandas.
- [ ] (optional) I have confirmed this bug exists on the master branch of pandas.
---
**Note**: Please read [this guide](https://matthewrocklin.com/blog/work/2018/02/28/minimal-bug-reports) detailing how to provide the necessary information for us to reproduce your bug.
#### Code Sample, a copy-pastable example
```python
df = pd.DataFrame({'name': [np.nan, "hi"],
'mask': [True, 4],
'weapon': [5, np.nan]}).astype(object)
print(df)
"""
name mask weapon
0 NaN True 5
1 hi 4 NaN
""" # everything prints out correctly
print(df.iloc[0].values) # [nan True 5.0] # during indexing, 5 gets coerced to 5.0
# ultimately I want to be able to do df.to_csv(), and get unmodified data
```
#### Problem description
I have a dataframe of mixed types, which I cast to dtype=object, and NaNs in certain grids. Printing out the dataframe works fine, but when I try indexing into specific rows, or exporting to_csv, the values in the columns with NaNs are quietly modified - integers become floats. I believe this is a bug because I would expect to_csv to produce a csv file that is similar to printing the dataframe, without data types being changed. I cannot cast the dataframe to type Int64, since I have other types in the dataframe as well.
#### Expected Output
Instead of [nan True 5.0], I should get [nan True 5]
#### Output of ``pd.show_versions()``
<details>
INSTALLED VERSIONS
------------------
commit : d9fff2792bf16178d4e450fe7384244e50635733
python : 3.7.8.final.0
python-bits : 64
OS : Darwin
OS-release : 19.6.0
Version : Darwin Kernel Version 19.6.0: Sun Jul 5 00:43:10 PDT 2020; root:xnu-6153.141.1~9/RELEASE_X86_64
machine : x86_64
processor : i386
byteorder : little
LC_ALL : None
LANG : en_US.UTF-8
LOCALE : en_US.UTF-8
pandas : 1.1.0
numpy : 1.19.1
pytz : 2020.1
dateutil : 2.8.1
pip : 20.2.1
setuptools : 49.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 : 2.11.2
IPython : 7.16.1
pandas_datareader: None
bs4 : None
bottleneck : None
fsspec : None
fastparquet : None
gcsfs : None
matplotlib : 3.3.0
numexpr : None
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : None
pytables : None
pyxlsb : None
s3fs : None
scipy : 1.5.2
sqlalchemy : None
tables : None
tabulate : None
xarray : None
xlrd : None
xlwt : None
numba : None
</details>
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/35580/reactions"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35580/timeline
| null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/35581
|
https://api.github.com/repos/pandas-dev/pandas
|
https://api.github.com/repos/pandas-dev/pandas/issues/35581/labels{/name}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35581/comments
|
https://api.github.com/repos/pandas-dev/pandas/issues/35581/events
|
https://github.com/pandas-dev/pandas/pull/35581
| 673,949,128
|
MDExOlB1bGxSZXF1ZXN0NDYzNzI2OTk4
| 35,581
|
Adding function to calculate years since a reference timestamp
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/5109449?v=4",
"events_url": "https://api.github.com/users/bryan-woods/events{/privacy}",
"followers_url": "https://api.github.com/users/bryan-woods/followers",
"following_url": "https://api.github.com/users/bryan-woods/following{/other_user}",
"gists_url": "https://api.github.com/users/bryan-woods/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/bryan-woods",
"id": 5109449,
"login": "bryan-woods",
"node_id": "MDQ6VXNlcjUxMDk0NDk=",
"organizations_url": "https://api.github.com/users/bryan-woods/orgs",
"received_events_url": "https://api.github.com/users/bryan-woods/received_events",
"repos_url": "https://api.github.com/users/bryan-woods/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/bryan-woods/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/bryan-woods/subscriptions",
"type": "User",
"url": "https://api.github.com/users/bryan-woods"
}
|
[
{
"color": "207de5",
"default": false,
"description": "Requires discussion from core team before further action",
"id": 219960758,
"name": "Needs Discussion",
"node_id": "MDU6TGFiZWwyMTk5NjA3NTg=",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Needs%20Discussion"
}
] |
closed
| false
| null |
[] | null | 5
| 2020-08-06T01:32:07Z
| 2020-08-07T15:30:47Z
| 2020-08-07T15:30:47Z
|
NONE
| null |
- [ ] closes #xxxx
- [X] tests added / passed
- [X] passes `black pandas`
- [X] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [X] whatsnew entry
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/35581/reactions"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35581/timeline
| null | 0
|
{
"diff_url": "https://github.com/pandas-dev/pandas/pull/35581.diff",
"html_url": "https://github.com/pandas-dev/pandas/pull/35581",
"merged_at": null,
"patch_url": "https://github.com/pandas-dev/pandas/pull/35581.patch",
"url": "https://api.github.com/repos/pandas-dev/pandas/pulls/35581"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35582
|
https://api.github.com/repos/pandas-dev/pandas
|
https://api.github.com/repos/pandas-dev/pandas/issues/35582/labels{/name}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35582/comments
|
https://api.github.com/repos/pandas-dev/pandas/issues/35582/events
|
https://github.com/pandas-dev/pandas/pull/35582
| 673,952,127
|
MDExOlB1bGxSZXF1ZXN0NDYzNzI5NDMw
| 35,582
|
BUG: to_timedelta fails on Int64 Series with null values
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/3970088?v=4",
"events_url": "https://api.github.com/users/egoddard/events{/privacy}",
"followers_url": "https://api.github.com/users/egoddard/followers",
"following_url": "https://api.github.com/users/egoddard/following{/other_user}",
"gists_url": "https://api.github.com/users/egoddard/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/egoddard",
"id": 3970088,
"login": "egoddard",
"node_id": "MDQ6VXNlcjM5NzAwODg=",
"organizations_url": "https://api.github.com/users/egoddard/orgs",
"received_events_url": "https://api.github.com/users/egoddard/received_events",
"repos_url": "https://api.github.com/users/egoddard/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/egoddard/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/egoddard/subscriptions",
"type": "User",
"url": "https://api.github.com/users/egoddard"
}
|
[
{
"color": "d7e102",
"default": false,
"description": "np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate",
"id": 2822342,
"name": "Missing-data",
"node_id": "MDU6TGFiZWwyODIyMzQy",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Missing-data"
},
{
"color": "5319e7",
"default": false,
"description": "Timedelta data type",
"id": 49597148,
"name": "Timedelta",
"node_id": "MDU6TGFiZWw0OTU5NzE0OA==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Timedelta"
}
] |
closed
| false
| null |
[] |
{
"closed_at": "2020-08-21T08:34:54Z",
"closed_issues": 110,
"created_at": "2020-07-10T13:54:44Z",
"creator": {
"avatar_url": "https://avatars.githubusercontent.com/u/953992?v=4",
"events_url": "https://api.github.com/users/jreback/events{/privacy}",
"followers_url": "https://api.github.com/users/jreback/followers",
"following_url": "https://api.github.com/users/jreback/following{/other_user}",
"gists_url": "https://api.github.com/users/jreback/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jreback",
"id": 953992,
"login": "jreback",
"node_id": "MDQ6VXNlcjk1Mzk5Mg==",
"organizations_url": "https://api.github.com/users/jreback/orgs",
"received_events_url": "https://api.github.com/users/jreback/received_events",
"repos_url": "https://api.github.com/users/jreback/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jreback/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jreback/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jreback"
},
"description": "on-merge: backport to 1.1.x",
"due_on": "2020-08-22T07:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/75",
"id": 5640672,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/75/labels",
"node_id": "MDk6TWlsZXN0b25lNTY0MDY3Mg==",
"number": 75,
"open_issues": 0,
"state": "closed",
"title": "1.1.1",
"updated_at": "2020-08-25T06:31:23Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/75"
}
| 3
| 2020-08-06T01:42:06Z
| 2020-08-07T11:50:28Z
| 2020-08-07T11:49:53Z
|
CONTRIBUTOR
| null |
- [X] closes #35574
- [X] tests added / passed
- [X] passes `black pandas`
- [X] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [x] whatsnew entry
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 1,
"laugh": 0,
"rocket": 0,
"total_count": 1,
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/35582/reactions"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35582/timeline
| null | 0
|
{
"diff_url": "https://github.com/pandas-dev/pandas/pull/35582.diff",
"html_url": "https://github.com/pandas-dev/pandas/pull/35582",
"merged_at": "2020-08-07T11:49:52Z",
"patch_url": "https://github.com/pandas-dev/pandas/pull/35582.patch",
"url": "https://api.github.com/repos/pandas-dev/pandas/pulls/35582"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35583
|
https://api.github.com/repos/pandas-dev/pandas
|
https://api.github.com/repos/pandas-dev/pandas/issues/35583/labels{/name}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35583/comments
|
https://api.github.com/repos/pandas-dev/pandas/issues/35583/events
|
https://github.com/pandas-dev/pandas/pull/35583
| 673,952,323
|
MDExOlB1bGxSZXF1ZXN0NDYzNzI5NTg1
| 35,583
|
BUG: TDA.__floordiv__ with NaT
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/8078968?v=4",
"events_url": "https://api.github.com/users/jbrockmendel/events{/privacy}",
"followers_url": "https://api.github.com/users/jbrockmendel/followers",
"following_url": "https://api.github.com/users/jbrockmendel/following{/other_user}",
"gists_url": "https://api.github.com/users/jbrockmendel/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jbrockmendel",
"id": 8078968,
"login": "jbrockmendel",
"node_id": "MDQ6VXNlcjgwNzg5Njg=",
"organizations_url": "https://api.github.com/users/jbrockmendel/orgs",
"received_events_url": "https://api.github.com/users/jbrockmendel/received_events",
"repos_url": "https://api.github.com/users/jbrockmendel/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jbrockmendel/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jbrockmendel/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jbrockmendel"
}
|
[
{
"color": "e10c02",
"default": false,
"description": null,
"id": 76811,
"name": "Bug",
"node_id": "MDU6TGFiZWw3NjgxMQ==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Bug"
},
{
"color": "006b75",
"default": false,
"description": "Arithmetic, Comparison, and Logical operations",
"id": 47223669,
"name": "Numeric Operations",
"node_id": "MDU6TGFiZWw0NzIyMzY2OQ==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Numeric%20Operations"
},
{
"color": "5319e7",
"default": false,
"description": "Timedelta data type",
"id": 49597148,
"name": "Timedelta",
"node_id": "MDU6TGFiZWw0OTU5NzE0OA==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Timedelta"
}
] |
closed
| false
| null |
[] |
{
"closed_at": "2020-12-26T13:57:50Z",
"closed_issues": 1768,
"created_at": "2020-05-29T23:47:32Z",
"creator": {
"avatar_url": "https://avatars.githubusercontent.com/u/953992?v=4",
"events_url": "https://api.github.com/users/jreback/events{/privacy}",
"followers_url": "https://api.github.com/users/jreback/followers",
"following_url": "https://api.github.com/users/jreback/following{/other_user}",
"gists_url": "https://api.github.com/users/jreback/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jreback",
"id": 953992,
"login": "jreback",
"node_id": "MDQ6VXNlcjk1Mzk5Mg==",
"organizations_url": "https://api.github.com/users/jreback/orgs",
"received_events_url": "https://api.github.com/users/jreback/received_events",
"repos_url": "https://api.github.com/users/jreback/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jreback/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jreback/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jreback"
},
"description": "on-merge: backport to 1.2.x",
"due_on": "2020-12-15T08:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/73",
"id": 5479819,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/73/labels",
"node_id": "MDk6TWlsZXN0b25lNTQ3OTgxOQ==",
"number": 73,
"open_issues": 0,
"state": "closed",
"title": "1.2",
"updated_at": "2021-04-13T15:46:43Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/73"
}
| 5
| 2020-08-06T01:42:45Z
| 2020-08-06T17:33:26Z
| 2020-08-06T16:20:30Z
|
MEMBER
| null |
- [x] closes #35529
- [x] tests added / passed
- [x] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [x] whatsnew entry
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/35583/reactions"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35583/timeline
| null | 0
|
{
"diff_url": "https://github.com/pandas-dev/pandas/pull/35583.diff",
"html_url": "https://github.com/pandas-dev/pandas/pull/35583",
"merged_at": "2020-08-06T16:20:29Z",
"patch_url": "https://github.com/pandas-dev/pandas/pull/35583.patch",
"url": "https://api.github.com/repos/pandas-dev/pandas/pulls/35583"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35584
|
https://api.github.com/repos/pandas-dev/pandas
|
https://api.github.com/repos/pandas-dev/pandas/issues/35584/labels{/name}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35584/comments
|
https://api.github.com/repos/pandas-dev/pandas/issues/35584/events
|
https://github.com/pandas-dev/pandas/issues/35584
| 673,956,841
|
MDU6SXNzdWU2NzM5NTY4NDE=
| 35,584
|
BUG: `Index.sort_values` fails with TypeError
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/11664259?v=4",
"events_url": "https://api.github.com/users/galipremsagar/events{/privacy}",
"followers_url": "https://api.github.com/users/galipremsagar/followers",
"following_url": "https://api.github.com/users/galipremsagar/following{/other_user}",
"gists_url": "https://api.github.com/users/galipremsagar/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/galipremsagar",
"id": 11664259,
"login": "galipremsagar",
"node_id": "MDQ6VXNlcjExNjY0MjU5",
"organizations_url": "https://api.github.com/users/galipremsagar/orgs",
"received_events_url": "https://api.github.com/users/galipremsagar/received_events",
"repos_url": "https://api.github.com/users/galipremsagar/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/galipremsagar/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/galipremsagar/subscriptions",
"type": "User",
"url": "https://api.github.com/users/galipremsagar"
}
|
[
{
"color": "e10c02",
"default": false,
"description": null,
"id": 76811,
"name": "Bug",
"node_id": "MDU6TGFiZWw3NjgxMQ==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Bug"
},
{
"color": "d7e102",
"default": false,
"description": "np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate",
"id": 2822342,
"name": "Missing-data",
"node_id": "MDU6TGFiZWwyODIyMzQy",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Missing-data"
},
{
"color": "e99695",
"default": false,
"description": "Related to the Index class or subclasses",
"id": 1218227310,
"name": "Index",
"node_id": "MDU6TGFiZWwxMjE4MjI3MzEw",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Index"
}
] |
closed
| false
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/23253999?v=4",
"events_url": "https://api.github.com/users/AlexKirko/events{/privacy}",
"followers_url": "https://api.github.com/users/AlexKirko/followers",
"following_url": "https://api.github.com/users/AlexKirko/following{/other_user}",
"gists_url": "https://api.github.com/users/AlexKirko/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/AlexKirko",
"id": 23253999,
"login": "AlexKirko",
"node_id": "MDQ6VXNlcjIzMjUzOTk5",
"organizations_url": "https://api.github.com/users/AlexKirko/orgs",
"received_events_url": "https://api.github.com/users/AlexKirko/received_events",
"repos_url": "https://api.github.com/users/AlexKirko/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/AlexKirko/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/AlexKirko/subscriptions",
"type": "User",
"url": "https://api.github.com/users/AlexKirko"
}
|
[
{
"avatar_url": "https://avatars.githubusercontent.com/u/23253999?v=4",
"events_url": "https://api.github.com/users/AlexKirko/events{/privacy}",
"followers_url": "https://api.github.com/users/AlexKirko/followers",
"following_url": "https://api.github.com/users/AlexKirko/following{/other_user}",
"gists_url": "https://api.github.com/users/AlexKirko/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/AlexKirko",
"id": 23253999,
"login": "AlexKirko",
"node_id": "MDQ6VXNlcjIzMjUzOTk5",
"organizations_url": "https://api.github.com/users/AlexKirko/orgs",
"received_events_url": "https://api.github.com/users/AlexKirko/received_events",
"repos_url": "https://api.github.com/users/AlexKirko/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/AlexKirko/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/AlexKirko/subscriptions",
"type": "User",
"url": "https://api.github.com/users/AlexKirko"
}
] |
{
"closed_at": "2020-12-26T13:57:50Z",
"closed_issues": 1768,
"created_at": "2020-05-29T23:47:32Z",
"creator": {
"avatar_url": "https://avatars.githubusercontent.com/u/953992?v=4",
"events_url": "https://api.github.com/users/jreback/events{/privacy}",
"followers_url": "https://api.github.com/users/jreback/followers",
"following_url": "https://api.github.com/users/jreback/following{/other_user}",
"gists_url": "https://api.github.com/users/jreback/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jreback",
"id": 953992,
"login": "jreback",
"node_id": "MDQ6VXNlcjk1Mzk5Mg==",
"organizations_url": "https://api.github.com/users/jreback/orgs",
"received_events_url": "https://api.github.com/users/jreback/received_events",
"repos_url": "https://api.github.com/users/jreback/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jreback/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jreback/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jreback"
},
"description": "on-merge: backport to 1.2.x",
"due_on": "2020-12-15T08:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/73",
"id": 5479819,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/73/labels",
"node_id": "MDk6TWlsZXN0b25lNTQ3OTgxOQ==",
"number": 73,
"open_issues": 0,
"state": "closed",
"title": "1.2",
"updated_at": "2021-04-13T15:46:43Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/73"
}
| 3
| 2020-08-06T01:57:41Z
| 2020-09-06T17:47:41Z
| 2020-09-06T17:47:41Z
|
NONE
| null |
- [x] I have checked that this issue has not already been reported.
- [x] I have confirmed this bug exists on the latest version of pandas.
- [ ] (optional) I have confirmed this bug exists on the master branch of pandas.
---
#### Code Sample, a copy-pastable example
```python
>>> import pandas as pd
>>> pd.__version__
'1.1.0'
>>> sr = pd.Series(['a',None,'c',None,'e'])
>>> sr.sort_values()
0 a
2 c
4 e
1 None
3 None
dtype: object
>>> idx = pd.Index(['a',None,'c',None,'e'])
>>> idx
Index(['a', None, 'c', None, 'e'], dtype='object')
>>> idx.sort_values()
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "/Users/pgali/PycharmProjects/del/venv1/lib/python3.7/site-packages/pandas/core/indexes/base.py", line 4448, in sort_values
_as = idx.argsort()
File "/Users/pgali/PycharmProjects/del/venv1/lib/python3.7/site-packages/pandas/core/indexes/base.py", line 4563, in argsort
return result.argsort(*args, **kwargs)
TypeError: '<' not supported between instances of 'NoneType' and 'str'
```
#### Problem description
`Index.sort_values()` fails when there are `None` values in it. However `Series.sort_values` performs sorting as expected in similar scenario.
#### Expected Output
We should be able to sort the values of an index similar to that of a series when there are `None` values.
#### Output of ``pd.show_versions()``
<details>
INSTALLED VERSIONS
------------------
commit : d9fff2792bf16178d4e450fe7384244e50635733
python : 3.7.3.final.0
python-bits : 64
OS : Darwin
OS-release : 19.6.0
Version : Darwin Kernel Version 19.6.0: Sun Jul 5 00:43:10 PDT 2020; root:xnu-6153.141.1~9/RELEASE_X86_64
machine : x86_64
processor : i386
byteorder : little
LC_ALL : None
LANG : None
LOCALE : en_US.UTF-8
pandas : 1.1.0
numpy : 1.19.0
pytz : 2020.1
dateutil : 2.8.1
pip : 20.1.1
setuptools : 49.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 : 2.11.2
IPython : None
pandas_datareader: None
bs4 : None
bottleneck : None
fsspec : None
fastparquet : None
gcsfs : None
matplotlib : None
numexpr : None
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : None
pytables : None
pyxlsb : None
s3fs : None
scipy : None
sqlalchemy : None
tables : None
tabulate : None
xarray : None
xlrd : None
xlwt : None
numba : None
</details>
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/35584/reactions"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35584/timeline
| null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/35585
|
https://api.github.com/repos/pandas-dev/pandas
|
https://api.github.com/repos/pandas-dev/pandas/issues/35585/labels{/name}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35585/comments
|
https://api.github.com/repos/pandas-dev/pandas/issues/35585/events
|
https://github.com/pandas-dev/pandas/pull/35585
| 673,990,696
|
MDExOlB1bGxSZXF1ZXN0NDYzNzYwNDA2
| 35,585
|
BUG: NaT.__cmp__(invalid) should raise TypeError
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/8078968?v=4",
"events_url": "https://api.github.com/users/jbrockmendel/events{/privacy}",
"followers_url": "https://api.github.com/users/jbrockmendel/followers",
"following_url": "https://api.github.com/users/jbrockmendel/following{/other_user}",
"gists_url": "https://api.github.com/users/jbrockmendel/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jbrockmendel",
"id": 8078968,
"login": "jbrockmendel",
"node_id": "MDQ6VXNlcjgwNzg5Njg=",
"organizations_url": "https://api.github.com/users/jbrockmendel/orgs",
"received_events_url": "https://api.github.com/users/jbrockmendel/received_events",
"repos_url": "https://api.github.com/users/jbrockmendel/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jbrockmendel/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jbrockmendel/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jbrockmendel"
}
|
[
{
"color": "d7e102",
"default": false,
"description": "np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate",
"id": 2822342,
"name": "Missing-data",
"node_id": "MDU6TGFiZWwyODIyMzQy",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Missing-data"
},
{
"color": "ffa0ff",
"default": false,
"description": "Incorrect or improved errors from pandas",
"id": 42670965,
"name": "Error Reporting",
"node_id": "MDU6TGFiZWw0MjY3MDk2NQ==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Error%20Reporting"
}
] |
closed
| false
| null |
[] |
{
"closed_at": "2020-12-26T13:57:50Z",
"closed_issues": 1768,
"created_at": "2020-05-29T23:47:32Z",
"creator": {
"avatar_url": "https://avatars.githubusercontent.com/u/953992?v=4",
"events_url": "https://api.github.com/users/jreback/events{/privacy}",
"followers_url": "https://api.github.com/users/jreback/followers",
"following_url": "https://api.github.com/users/jreback/following{/other_user}",
"gists_url": "https://api.github.com/users/jreback/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jreback",
"id": 953992,
"login": "jreback",
"node_id": "MDQ6VXNlcjk1Mzk5Mg==",
"organizations_url": "https://api.github.com/users/jreback/orgs",
"received_events_url": "https://api.github.com/users/jreback/received_events",
"repos_url": "https://api.github.com/users/jreback/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jreback/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jreback/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jreback"
},
"description": "on-merge: backport to 1.2.x",
"due_on": "2020-12-15T08:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/73",
"id": 5479819,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/73/labels",
"node_id": "MDk6TWlsZXN0b25lNTQ3OTgxOQ==",
"number": 73,
"open_issues": 0,
"state": "closed",
"title": "1.2",
"updated_at": "2021-04-13T15:46:43Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/73"
}
| 1
| 2020-08-06T03:42:48Z
| 2020-08-06T23:28:01Z
| 2020-08-06T22:06:47Z
|
MEMBER
| null |
- [x] closes #35046
- [x] tests added / passed
- [x] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [x] whatsnew entry
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/35585/reactions"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35585/timeline
| null | 0
|
{
"diff_url": "https://github.com/pandas-dev/pandas/pull/35585.diff",
"html_url": "https://github.com/pandas-dev/pandas/pull/35585",
"merged_at": "2020-08-06T22:06:47Z",
"patch_url": "https://github.com/pandas-dev/pandas/pull/35585.patch",
"url": "https://api.github.com/repos/pandas-dev/pandas/pulls/35585"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35586
|
https://api.github.com/repos/pandas-dev/pandas
|
https://api.github.com/repos/pandas-dev/pandas/issues/35586/labels{/name}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35586/comments
|
https://api.github.com/repos/pandas-dev/pandas/issues/35586/events
|
https://github.com/pandas-dev/pandas/issues/35586
| 674,290,285
|
MDU6SXNzdWU2NzQyOTAyODU=
| 35,586
|
BUG: Pandas Styler cell_ids Arg
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/24256554?v=4",
"events_url": "https://api.github.com/users/attack68/events{/privacy}",
"followers_url": "https://api.github.com/users/attack68/followers",
"following_url": "https://api.github.com/users/attack68/following{/other_user}",
"gists_url": "https://api.github.com/users/attack68/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/attack68",
"id": 24256554,
"login": "attack68",
"node_id": "MDQ6VXNlcjI0MjU2NTU0",
"organizations_url": "https://api.github.com/users/attack68/orgs",
"received_events_url": "https://api.github.com/users/attack68/received_events",
"repos_url": "https://api.github.com/users/attack68/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/attack68/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/attack68/subscriptions",
"type": "User",
"url": "https://api.github.com/users/attack68"
}
|
[
{
"color": "e10c02",
"default": false,
"description": null,
"id": 76811,
"name": "Bug",
"node_id": "MDU6TGFiZWw3NjgxMQ==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Bug"
},
{
"color": "006b75",
"default": false,
"description": "read_html, to_html, Styler.apply, Styler.applymap",
"id": 57395487,
"name": "IO HTML",
"node_id": "MDU6TGFiZWw1NzM5NTQ4Nw==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/IO%20HTML"
}
] |
closed
| false
| null |
[] |
{
"closed_at": "2020-08-21T08:34:54Z",
"closed_issues": 110,
"created_at": "2020-07-10T13:54:44Z",
"creator": {
"avatar_url": "https://avatars.githubusercontent.com/u/953992?v=4",
"events_url": "https://api.github.com/users/jreback/events{/privacy}",
"followers_url": "https://api.github.com/users/jreback/followers",
"following_url": "https://api.github.com/users/jreback/following{/other_user}",
"gists_url": "https://api.github.com/users/jreback/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jreback",
"id": 953992,
"login": "jreback",
"node_id": "MDQ6VXNlcjk1Mzk5Mg==",
"organizations_url": "https://api.github.com/users/jreback/orgs",
"received_events_url": "https://api.github.com/users/jreback/received_events",
"repos_url": "https://api.github.com/users/jreback/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jreback/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jreback/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jreback"
},
"description": "on-merge: backport to 1.1.x",
"due_on": "2020-08-22T07:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/75",
"id": 5640672,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/75/labels",
"node_id": "MDk6TWlsZXN0b25lNTY0MDY3Mg==",
"number": 75,
"open_issues": 0,
"state": "closed",
"title": "1.1.1",
"updated_at": "2020-08-25T06:31:23Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/75"
}
| 0
| 2020-08-06T12:52:49Z
| 2020-08-07T21:35:22Z
| 2020-08-07T21:35:22Z
|
CONTRIBUTOR
| null |
Pandas Styler has the following argument:
> cell_ids: bool, default True
If True, each cell will have an id attribute in their HTML tag. The id takes the form T_<uuid>_row<num_row>_col<num_col> where <uuid> is the unique identifier, <num_row> is the row number and <num_col> is the column number.
This doesn't seem to work.
Consider the example in the docs:
```
import pandas as pd # NOTE VERSION 1.1.0
from pandas.io.formats.style import Styler
def highlight_max(s):
x = s == s.max()
x = x.replace(False, '')
x = x.replace(True, 'background-color: yellow; color: brown')
return x
df = pd.DataFrame(data=[[0,1], [1,0]])
s = Styler(df, uuid='_', cell_ids=False)
s.apply(highlight_max)
s.render()
```
This will still render `id` css tags for all cells even though it should have been ignored on some.
#### Reason and Solution
Upon render, within the code a `ctx` defaultdict object contains the properties for each cell:
> ctx = defaultdict(<class 'list'>, {(1,0): ['background-color: yellow', 'color: brown'], (0,1): ['background-color: yellow', 'color: brown']})
On line 393 we have the condition:
```
if self.cell_ids or not (len(ctx[r, c]) == 1 and ctx[r, c][0] == ""):
row_dict["id"] = "_".join(cs[1:])
```
This fails because the `_update_ctx` function handles empty string by not adding to the `ctx` - previously I suspect it performed differently..
We should really change line 393 to:
if self.cell_ids or (r,c) in ctx:
I added a PR for this..
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/35586/reactions"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35586/timeline
| null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/35587
|
https://api.github.com/repos/pandas-dev/pandas
|
https://api.github.com/repos/pandas-dev/pandas/issues/35587/labels{/name}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35587/comments
|
https://api.github.com/repos/pandas-dev/pandas/issues/35587/events
|
https://github.com/pandas-dev/pandas/pull/35587
| 674,301,803
|
MDExOlB1bGxSZXF1ZXN0NDY0MDE3MjYz
| 35,587
|
Ensure file is closed promptly in case of error
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/8394766?v=4",
"events_url": "https://api.github.com/users/rxxg/events{/privacy}",
"followers_url": "https://api.github.com/users/rxxg/followers",
"following_url": "https://api.github.com/users/rxxg/following{/other_user}",
"gists_url": "https://api.github.com/users/rxxg/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/rxxg",
"id": 8394766,
"login": "rxxg",
"node_id": "MDQ6VXNlcjgzOTQ3NjY=",
"organizations_url": "https://api.github.com/users/rxxg/orgs",
"received_events_url": "https://api.github.com/users/rxxg/received_events",
"repos_url": "https://api.github.com/users/rxxg/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/rxxg/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/rxxg/subscriptions",
"type": "User",
"url": "https://api.github.com/users/rxxg"
}
|
[
{
"color": "e10c02",
"default": false,
"description": null,
"id": 76811,
"name": "Bug",
"node_id": "MDU6TGFiZWw3NjgxMQ==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Bug"
},
{
"color": "5319e7",
"default": false,
"description": "SAS: read_sas",
"id": 258745163,
"name": "IO SAS",
"node_id": "MDU6TGFiZWwyNTg3NDUxNjM=",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/IO%20SAS"
}
] |
closed
| false
| null |
[] |
{
"closed_at": "2020-12-26T13:57:50Z",
"closed_issues": 1768,
"created_at": "2020-05-29T23:47:32Z",
"creator": {
"avatar_url": "https://avatars.githubusercontent.com/u/953992?v=4",
"events_url": "https://api.github.com/users/jreback/events{/privacy}",
"followers_url": "https://api.github.com/users/jreback/followers",
"following_url": "https://api.github.com/users/jreback/following{/other_user}",
"gists_url": "https://api.github.com/users/jreback/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jreback",
"id": 953992,
"login": "jreback",
"node_id": "MDQ6VXNlcjk1Mzk5Mg==",
"organizations_url": "https://api.github.com/users/jreback/orgs",
"received_events_url": "https://api.github.com/users/jreback/received_events",
"repos_url": "https://api.github.com/users/jreback/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jreback/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jreback/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jreback"
},
"description": "on-merge: backport to 1.2.x",
"due_on": "2020-12-15T08:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/73",
"id": 5479819,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/73/labels",
"node_id": "MDk6TWlsZXN0b25lNTQ3OTgxOQ==",
"number": 73,
"open_issues": 0,
"state": "closed",
"title": "1.2",
"updated_at": "2021-04-13T15:46:43Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/73"
}
| 7
| 2020-08-06T13:10:10Z
| 2020-09-13T22:28:13Z
| 2020-09-13T22:28:13Z
|
CONTRIBUTOR
| null |
Fixes #35566. Replaces #35567.
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/35587/reactions"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35587/timeline
| null | 0
|
{
"diff_url": "https://github.com/pandas-dev/pandas/pull/35587.diff",
"html_url": "https://github.com/pandas-dev/pandas/pull/35587",
"merged_at": "2020-09-13T22:28:12Z",
"patch_url": "https://github.com/pandas-dev/pandas/pull/35587.patch",
"url": "https://api.github.com/repos/pandas-dev/pandas/pulls/35587"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35588
|
https://api.github.com/repos/pandas-dev/pandas
|
https://api.github.com/repos/pandas-dev/pandas/issues/35588/labels{/name}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35588/comments
|
https://api.github.com/repos/pandas-dev/pandas/issues/35588/events
|
https://github.com/pandas-dev/pandas/pull/35588
| 674,371,938
|
MDExOlB1bGxSZXF1ZXN0NDY0MDc1NjQ2
| 35,588
|
BUG: fix styler cell_ids arg so that blank style is ignored on False
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/24256554?v=4",
"events_url": "https://api.github.com/users/attack68/events{/privacy}",
"followers_url": "https://api.github.com/users/attack68/followers",
"following_url": "https://api.github.com/users/attack68/following{/other_user}",
"gists_url": "https://api.github.com/users/attack68/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/attack68",
"id": 24256554,
"login": "attack68",
"node_id": "MDQ6VXNlcjI0MjU2NTU0",
"organizations_url": "https://api.github.com/users/attack68/orgs",
"received_events_url": "https://api.github.com/users/attack68/received_events",
"repos_url": "https://api.github.com/users/attack68/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/attack68/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/attack68/subscriptions",
"type": "User",
"url": "https://api.github.com/users/attack68"
}
|
[
{
"color": "006b75",
"default": false,
"description": "conditional formatting using DataFrame.style",
"id": 1728592794,
"name": "Styler",
"node_id": "MDU6TGFiZWwxNzI4NTkyNzk0",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Styler"
}
] |
closed
| false
| null |
[] |
{
"closed_at": "2020-08-21T08:34:54Z",
"closed_issues": 110,
"created_at": "2020-07-10T13:54:44Z",
"creator": {
"avatar_url": "https://avatars.githubusercontent.com/u/953992?v=4",
"events_url": "https://api.github.com/users/jreback/events{/privacy}",
"followers_url": "https://api.github.com/users/jreback/followers",
"following_url": "https://api.github.com/users/jreback/following{/other_user}",
"gists_url": "https://api.github.com/users/jreback/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jreback",
"id": 953992,
"login": "jreback",
"node_id": "MDQ6VXNlcjk1Mzk5Mg==",
"organizations_url": "https://api.github.com/users/jreback/orgs",
"received_events_url": "https://api.github.com/users/jreback/received_events",
"repos_url": "https://api.github.com/users/jreback/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jreback/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jreback/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jreback"
},
"description": "on-merge: backport to 1.1.x",
"due_on": "2020-08-22T07:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/75",
"id": 5640672,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/75/labels",
"node_id": "MDk6TWlsZXN0b25lNTY0MDY3Mg==",
"number": 75,
"open_issues": 0,
"state": "closed",
"title": "1.1.1",
"updated_at": "2020-08-25T06:31:23Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/75"
}
| 7
| 2020-08-06T14:47:19Z
| 2020-08-08T09:44:21Z
| 2020-08-07T21:35:22Z
|
CONTRIBUTOR
| null |
- [x] closes #35586
- [ ] tests added / passed
- [x] passes `black pandas`
- [ ] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [x] whatsnew entry
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/35588/reactions"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35588/timeline
| null | 0
|
{
"diff_url": "https://github.com/pandas-dev/pandas/pull/35588.diff",
"html_url": "https://github.com/pandas-dev/pandas/pull/35588",
"merged_at": "2020-08-07T21:35:22Z",
"patch_url": "https://github.com/pandas-dev/pandas/pull/35588.patch",
"url": "https://api.github.com/repos/pandas-dev/pandas/pulls/35588"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35589
|
https://api.github.com/repos/pandas-dev/pandas
|
https://api.github.com/repos/pandas-dev/pandas/issues/35589/labels{/name}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35589/comments
|
https://api.github.com/repos/pandas-dev/pandas/issues/35589/events
|
https://github.com/pandas-dev/pandas/issues/35589
| 674,374,346
|
MDU6SXNzdWU2NzQzNzQzNDY=
| 35,589
|
BUG: `DataFrame.reset_index()` discards `MultiIndex` dtypes if `DataFrame` is empty
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/18488?v=4",
"events_url": "https://api.github.com/users/batterseapower/events{/privacy}",
"followers_url": "https://api.github.com/users/batterseapower/followers",
"following_url": "https://api.github.com/users/batterseapower/following{/other_user}",
"gists_url": "https://api.github.com/users/batterseapower/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/batterseapower",
"id": 18488,
"login": "batterseapower",
"node_id": "MDQ6VXNlcjE4NDg4",
"organizations_url": "https://api.github.com/users/batterseapower/orgs",
"received_events_url": "https://api.github.com/users/batterseapower/received_events",
"repos_url": "https://api.github.com/users/batterseapower/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/batterseapower/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/batterseapower/subscriptions",
"type": "User",
"url": "https://api.github.com/users/batterseapower"
}
|
[
{
"color": "e10c02",
"default": false,
"description": null,
"id": 76811,
"name": "Bug",
"node_id": "MDU6TGFiZWw3NjgxMQ==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Bug"
},
{
"color": "009800",
"default": false,
"description": "Duplicate issue or pull request",
"id": 40153326,
"name": "Duplicate Report",
"node_id": "MDU6TGFiZWw0MDE1MzMyNg==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Duplicate%20Report"
},
{
"color": "207de5",
"default": false,
"description": "Clarification about behavior needed to assess issue",
"id": 307649777,
"name": "Needs Info",
"node_id": "MDU6TGFiZWwzMDc2NDk3Nzc=",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Needs%20Info"
}
] |
closed
| false
| null |
[] | null | 2
| 2020-08-06T14:50:31Z
| 2020-08-06T15:48:20Z
| 2020-08-06T15:48:13Z
|
CONTRIBUTOR
| null |
- [x] I have checked that this issue has not already been reported.
- [x] I have confirmed this bug exists on the latest version of pandas. (tried on v1.0.5 -- the latest in Conda -- and checked the release notes for the new version to make sure they don't mention anything related)
- [ ] (optional) I have confirmed this bug exists on the master branch of pandas.
---
#### Code Sample, a copy-pastable example
```python
x = pd.DataFrame.from_dict({
'A': pd.Categorical.from_codes([1], categories=['G', 'H']),
'B': np.array([0], dtype='i8'),
})
x.dtypes # category and int64
# This is the bug:
x.iloc[:0].set_index(['A', 'B']).reset_index().dtypes # float64 and float64
# These cases all work correctly i.e. the dtypes are category and int64
x.set_index(['A', 'B']).reset_index().dtypes
x.set_index('A').reset_index().dtypes
x.iloc[:0].set_index('A').reset_index().dtypes
# This is CategoricalDtype as expected, so the MultiIndex construction is correct: it's just the `reset_index()` which is throwing away the info
x.iloc[:0].set_index(['A', 'B']).index.get_level_values('A').dtype
```
#### Problem description
`reset_index` shouldn't throw away dtype information in the special case where the `DataFrame` has zero rows. Sometimes it's hard to avoid throwing away info when you manipulate zero-element DataFrames, but in this case there is no reason to do it.
#### Expected Output
category and int64 dtypes from `reset_index` in all cases
#### Output of ``pd.show_versions()``
<details>
INSTALLED VERSIONS
------------------
commit : None
python : 3.8.5.final.0
python-bits : 64
OS : Windows
OS-release : 10
machine : AMD64
processor : Intel64 Family 6 Model 63 Stepping 2, GenuineIntel
byteorder : little
LC_ALL : None
LANG : None
LOCALE : English_United Kingdom.936
pandas : 1.0.5
numpy : 1.19.1
pytz : 2020.1
dateutil : 2.8.1
pip : 20.1.1
setuptools : 49.2.0.post20200714
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 : 7.16.1
pandas_datareader: None
bs4 : None
bottleneck : 1.3.2
fastparquet : None
gcsfs : None
lxml.etree : None
matplotlib : None
numexpr : None
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : None
pytables : None
pytest : None
pyxlsb : None
s3fs : None
scipy : 1.5.0
sqlalchemy : None
tables : None
tabulate : None
xarray : None
xlrd : None
xlwt : None
xlsxwriter : None
numba : None
</details>
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/35589/reactions"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35589/timeline
| null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/35590
|
https://api.github.com/repos/pandas-dev/pandas
|
https://api.github.com/repos/pandas-dev/pandas/issues/35590/labels{/name}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35590/comments
|
https://api.github.com/repos/pandas-dev/pandas/issues/35590/events
|
https://github.com/pandas-dev/pandas/pull/35590
| 674,532,326
|
MDExOlB1bGxSZXF1ZXN0NDY0MjA3MjA5
| 35,590
|
BUG: validate index/data length match in DataFrame construction
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/8078968?v=4",
"events_url": "https://api.github.com/users/jbrockmendel/events{/privacy}",
"followers_url": "https://api.github.com/users/jbrockmendel/followers",
"following_url": "https://api.github.com/users/jbrockmendel/following{/other_user}",
"gists_url": "https://api.github.com/users/jbrockmendel/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jbrockmendel",
"id": 8078968,
"login": "jbrockmendel",
"node_id": "MDQ6VXNlcjgwNzg5Njg=",
"organizations_url": "https://api.github.com/users/jbrockmendel/orgs",
"received_events_url": "https://api.github.com/users/jbrockmendel/received_events",
"repos_url": "https://api.github.com/users/jbrockmendel/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jbrockmendel/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jbrockmendel/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jbrockmendel"
}
|
[
{
"color": "e10c02",
"default": false,
"description": null,
"id": 76811,
"name": "Bug",
"node_id": "MDU6TGFiZWw3NjgxMQ==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Bug"
},
{
"color": "d4c5f9",
"default": false,
"description": "Series/DataFrame/Index/pd.array Constructors",
"id": 1465286368,
"name": "Constructors",
"node_id": "MDU6TGFiZWwxNDY1Mjg2MzY4",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Constructors"
}
] |
closed
| false
| null |
[] |
{
"closed_at": "2020-08-21T08:34:54Z",
"closed_issues": 110,
"created_at": "2020-07-10T13:54:44Z",
"creator": {
"avatar_url": "https://avatars.githubusercontent.com/u/953992?v=4",
"events_url": "https://api.github.com/users/jreback/events{/privacy}",
"followers_url": "https://api.github.com/users/jreback/followers",
"following_url": "https://api.github.com/users/jreback/following{/other_user}",
"gists_url": "https://api.github.com/users/jreback/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jreback",
"id": 953992,
"login": "jreback",
"node_id": "MDQ6VXNlcjk1Mzk5Mg==",
"organizations_url": "https://api.github.com/users/jreback/orgs",
"received_events_url": "https://api.github.com/users/jreback/received_events",
"repos_url": "https://api.github.com/users/jreback/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jreback/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jreback/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jreback"
},
"description": "on-merge: backport to 1.1.x",
"due_on": "2020-08-22T07:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/75",
"id": 5640672,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/75/labels",
"node_id": "MDk6TWlsZXN0b25lNTY0MDY3Mg==",
"number": 75,
"open_issues": 0,
"state": "closed",
"title": "1.1.1",
"updated_at": "2020-08-25T06:31:23Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/75"
}
| 4
| 2020-08-06T18:56:01Z
| 2020-08-07T07:45:04Z
| 2020-08-07T02:20:04Z
|
MEMBER
| null |
- [x] closes #33437
- [x] tests added / passed
- [x] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [x] whatsnew entry
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/35590/reactions"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35590/timeline
| null | 0
|
{
"diff_url": "https://github.com/pandas-dev/pandas/pull/35590.diff",
"html_url": "https://github.com/pandas-dev/pandas/pull/35590",
"merged_at": "2020-08-07T02:20:03Z",
"patch_url": "https://github.com/pandas-dev/pandas/pull/35590.patch",
"url": "https://api.github.com/repos/pandas-dev/pandas/pulls/35590"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35591
|
https://api.github.com/repos/pandas-dev/pandas
|
https://api.github.com/repos/pandas-dev/pandas/issues/35591/labels{/name}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35591/comments
|
https://api.github.com/repos/pandas-dev/pandas/issues/35591/events
|
https://github.com/pandas-dev/pandas/pull/35591
| 674,544,494
|
MDExOlB1bGxSZXF1ZXN0NDY0MjE3MDU2
| 35,591
|
Backport PR #35513 on branch 1.1.x (BUG: RollingGroupby respects __getitem__)
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/39504233?v=4",
"events_url": "https://api.github.com/users/meeseeksmachine/events{/privacy}",
"followers_url": "https://api.github.com/users/meeseeksmachine/followers",
"following_url": "https://api.github.com/users/meeseeksmachine/following{/other_user}",
"gists_url": "https://api.github.com/users/meeseeksmachine/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/meeseeksmachine",
"id": 39504233,
"login": "meeseeksmachine",
"node_id": "MDQ6VXNlcjM5NTA0MjMz",
"organizations_url": "https://api.github.com/users/meeseeksmachine/orgs",
"received_events_url": "https://api.github.com/users/meeseeksmachine/received_events",
"repos_url": "https://api.github.com/users/meeseeksmachine/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/meeseeksmachine/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/meeseeksmachine/subscriptions",
"type": "User",
"url": "https://api.github.com/users/meeseeksmachine"
}
|
[
{
"color": "729FCF",
"default": false,
"description": null,
"id": 233160,
"name": "Groupby",
"node_id": "MDU6TGFiZWwyMzMxNjA=",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Groupby"
},
{
"color": "d4c5f9",
"default": false,
"description": "rolling, ewma, expanding",
"id": 1045950827,
"name": "Window",
"node_id": "MDU6TGFiZWwxMDQ1OTUwODI3",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Window"
}
] |
closed
| false
| null |
[] |
{
"closed_at": "2020-08-21T08:34:54Z",
"closed_issues": 110,
"created_at": "2020-07-10T13:54:44Z",
"creator": {
"avatar_url": "https://avatars.githubusercontent.com/u/953992?v=4",
"events_url": "https://api.github.com/users/jreback/events{/privacy}",
"followers_url": "https://api.github.com/users/jreback/followers",
"following_url": "https://api.github.com/users/jreback/following{/other_user}",
"gists_url": "https://api.github.com/users/jreback/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jreback",
"id": 953992,
"login": "jreback",
"node_id": "MDQ6VXNlcjk1Mzk5Mg==",
"organizations_url": "https://api.github.com/users/jreback/orgs",
"received_events_url": "https://api.github.com/users/jreback/received_events",
"repos_url": "https://api.github.com/users/jreback/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jreback/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jreback/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jreback"
},
"description": "on-merge: backport to 1.1.x",
"due_on": "2020-08-22T07:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/75",
"id": 5640672,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/75/labels",
"node_id": "MDk6TWlsZXN0b25lNTY0MDY3Mg==",
"number": 75,
"open_issues": 0,
"state": "closed",
"title": "1.1.1",
"updated_at": "2020-08-25T06:31:23Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/75"
}
| 0
| 2020-08-06T19:18:42Z
| 2020-08-06T21:50:03Z
| 2020-08-06T21:50:03Z
|
NONE
| null |
Backport PR #35513: BUG: RollingGroupby respects __getitem__
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/35591/reactions"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35591/timeline
| null | 0
|
{
"diff_url": "https://github.com/pandas-dev/pandas/pull/35591.diff",
"html_url": "https://github.com/pandas-dev/pandas/pull/35591",
"merged_at": "2020-08-06T21:50:03Z",
"patch_url": "https://github.com/pandas-dev/pandas/pull/35591.patch",
"url": "https://api.github.com/repos/pandas-dev/pandas/pulls/35591"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35592
|
https://api.github.com/repos/pandas-dev/pandas
|
https://api.github.com/repos/pandas-dev/pandas/issues/35592/labels{/name}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35592/comments
|
https://api.github.com/repos/pandas-dev/pandas/issues/35592/events
|
https://github.com/pandas-dev/pandas/pull/35592
| 674,608,965
|
MDExOlB1bGxSZXF1ZXN0NDY0MjcwNDcy
| 35,592
|
REF: Simplify Index.copy
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/26364415?v=4",
"events_url": "https://api.github.com/users/topper-123/events{/privacy}",
"followers_url": "https://api.github.com/users/topper-123/followers",
"following_url": "https://api.github.com/users/topper-123/following{/other_user}",
"gists_url": "https://api.github.com/users/topper-123/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/topper-123",
"id": 26364415,
"login": "topper-123",
"node_id": "MDQ6VXNlcjI2MzY0NDE1",
"organizations_url": "https://api.github.com/users/topper-123/orgs",
"received_events_url": "https://api.github.com/users/topper-123/received_events",
"repos_url": "https://api.github.com/users/topper-123/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/topper-123/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/topper-123/subscriptions",
"type": "User",
"url": "https://api.github.com/users/topper-123"
}
|
[
{
"color": "e99695",
"default": false,
"description": "Related to the Index class or subclasses",
"id": 1218227310,
"name": "Index",
"node_id": "MDU6TGFiZWwxMjE4MjI3MzEw",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Index"
},
{
"color": "d4c5f9",
"default": false,
"description": "Series/DataFrame/Index/pd.array Constructors",
"id": 1465286368,
"name": "Constructors",
"node_id": "MDU6TGFiZWwxNDY1Mjg2MzY4",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Constructors"
}
] |
closed
| false
| null |
[] |
{
"closed_at": "2020-12-26T13:57:50Z",
"closed_issues": 1768,
"created_at": "2020-05-29T23:47:32Z",
"creator": {
"avatar_url": "https://avatars.githubusercontent.com/u/953992?v=4",
"events_url": "https://api.github.com/users/jreback/events{/privacy}",
"followers_url": "https://api.github.com/users/jreback/followers",
"following_url": "https://api.github.com/users/jreback/following{/other_user}",
"gists_url": "https://api.github.com/users/jreback/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jreback",
"id": 953992,
"login": "jreback",
"node_id": "MDQ6VXNlcjk1Mzk5Mg==",
"organizations_url": "https://api.github.com/users/jreback/orgs",
"received_events_url": "https://api.github.com/users/jreback/received_events",
"repos_url": "https://api.github.com/users/jreback/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jreback/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jreback/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jreback"
},
"description": "on-merge: backport to 1.2.x",
"due_on": "2020-12-15T08:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/73",
"id": 5479819,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/73/labels",
"node_id": "MDk6TWlsZXN0b25lNTQ3OTgxOQ==",
"number": 73,
"open_issues": 0,
"state": "closed",
"title": "1.2",
"updated_at": "2021-04-13T15:46:43Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/73"
}
| 5
| 2020-08-06T21:22:05Z
| 2020-08-10T17:52:34Z
| 2020-08-10T13:24:30Z
|
CONTRIBUTOR
| null |
Avoid the use of the ``Index.set_names`` in ``Index.copy``, which is a slightly awkward method to use here (it calls ``_shallow_copy`` + is longwinded).
This is archieved by tightening up the checks in ``_validate_names``.
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/35592/reactions"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35592/timeline
| null | 0
|
{
"diff_url": "https://github.com/pandas-dev/pandas/pull/35592.diff",
"html_url": "https://github.com/pandas-dev/pandas/pull/35592",
"merged_at": "2020-08-10T13:24:30Z",
"patch_url": "https://github.com/pandas-dev/pandas/pull/35592.patch",
"url": "https://api.github.com/repos/pandas-dev/pandas/pulls/35592"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35593
|
https://api.github.com/repos/pandas-dev/pandas
|
https://api.github.com/repos/pandas-dev/pandas/issues/35593/labels{/name}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35593/comments
|
https://api.github.com/repos/pandas-dev/pandas/issues/35593/events
|
https://github.com/pandas-dev/pandas/pull/35593
| 674,625,709
|
MDExOlB1bGxSZXF1ZXN0NDY0Mjg0NDI1
| 35,593
|
Backport PR #35554 on branch 1.1.x (DOC: Document that read_hdf can use pickle)
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/39504233?v=4",
"events_url": "https://api.github.com/users/meeseeksmachine/events{/privacy}",
"followers_url": "https://api.github.com/users/meeseeksmachine/followers",
"following_url": "https://api.github.com/users/meeseeksmachine/following{/other_user}",
"gists_url": "https://api.github.com/users/meeseeksmachine/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/meeseeksmachine",
"id": 39504233,
"login": "meeseeksmachine",
"node_id": "MDQ6VXNlcjM5NTA0MjMz",
"organizations_url": "https://api.github.com/users/meeseeksmachine/orgs",
"received_events_url": "https://api.github.com/users/meeseeksmachine/received_events",
"repos_url": "https://api.github.com/users/meeseeksmachine/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/meeseeksmachine/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/meeseeksmachine/subscriptions",
"type": "User",
"url": "https://api.github.com/users/meeseeksmachine"
}
|
[
{
"color": "3465A4",
"default": false,
"description": null,
"id": 134699,
"name": "Docs",
"node_id": "MDU6TGFiZWwxMzQ2OTk=",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Docs"
},
{
"color": "5319e7",
"default": false,
"description": "read_hdf, HDFStore",
"id": 47229190,
"name": "IO HDF5",
"node_id": "MDU6TGFiZWw0NzIyOTE5MA==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/IO%20HDF5"
}
] |
closed
| false
| null |
[] |
{
"closed_at": "2020-08-21T08:34:54Z",
"closed_issues": 110,
"created_at": "2020-07-10T13:54:44Z",
"creator": {
"avatar_url": "https://avatars.githubusercontent.com/u/953992?v=4",
"events_url": "https://api.github.com/users/jreback/events{/privacy}",
"followers_url": "https://api.github.com/users/jreback/followers",
"following_url": "https://api.github.com/users/jreback/following{/other_user}",
"gists_url": "https://api.github.com/users/jreback/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jreback",
"id": 953992,
"login": "jreback",
"node_id": "MDQ6VXNlcjk1Mzk5Mg==",
"organizations_url": "https://api.github.com/users/jreback/orgs",
"received_events_url": "https://api.github.com/users/jreback/received_events",
"repos_url": "https://api.github.com/users/jreback/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jreback/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jreback/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jreback"
},
"description": "on-merge: backport to 1.1.x",
"due_on": "2020-08-22T07:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/75",
"id": 5640672,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/75/labels",
"node_id": "MDk6TWlsZXN0b25lNTY0MDY3Mg==",
"number": 75,
"open_issues": 0,
"state": "closed",
"title": "1.1.1",
"updated_at": "2020-08-25T06:31:23Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/75"
}
| 0
| 2020-08-06T22:00:39Z
| 2020-08-06T23:19:31Z
| 2020-08-06T23:19:31Z
|
NONE
| null |
Backport PR #35554: DOC: Document that read_hdf can use pickle
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/35593/reactions"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35593/timeline
| null | 0
|
{
"diff_url": "https://github.com/pandas-dev/pandas/pull/35593.diff",
"html_url": "https://github.com/pandas-dev/pandas/pull/35593",
"merged_at": "2020-08-06T23:19:30Z",
"patch_url": "https://github.com/pandas-dev/pandas/pull/35593.patch",
"url": "https://api.github.com/repos/pandas-dev/pandas/pulls/35593"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35594
|
https://api.github.com/repos/pandas-dev/pandas
|
https://api.github.com/repos/pandas-dev/pandas/issues/35594/labels{/name}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35594/comments
|
https://api.github.com/repos/pandas-dev/pandas/issues/35594/events
|
https://github.com/pandas-dev/pandas/issues/35594
| 674,718,608
|
MDU6SXNzdWU2NzQ3MTg2MDg=
| 35,594
|
BUG: to_sql if_exists not working properly when schema is set on PostgreSQL
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/4845289?v=4",
"events_url": "https://api.github.com/users/westhyena/events{/privacy}",
"followers_url": "https://api.github.com/users/westhyena/followers",
"following_url": "https://api.github.com/users/westhyena/following{/other_user}",
"gists_url": "https://api.github.com/users/westhyena/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/westhyena",
"id": 4845289,
"login": "westhyena",
"node_id": "MDQ6VXNlcjQ4NDUyODk=",
"organizations_url": "https://api.github.com/users/westhyena/orgs",
"received_events_url": "https://api.github.com/users/westhyena/received_events",
"repos_url": "https://api.github.com/users/westhyena/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/westhyena/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/westhyena/subscriptions",
"type": "User",
"url": "https://api.github.com/users/westhyena"
}
|
[
{
"color": "e10c02",
"default": false,
"description": null,
"id": 76811,
"name": "Bug",
"node_id": "MDU6TGFiZWw3NjgxMQ==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Bug"
},
{
"color": "5319e7",
"default": false,
"description": "to_sql, read_sql, read_sql_query",
"id": 47232590,
"name": "IO SQL",
"node_id": "MDU6TGFiZWw0NzIzMjU5MA==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/IO%20SQL"
}
] |
closed
| false
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/16733618?v=4",
"events_url": "https://api.github.com/users/alimcmaster1/events{/privacy}",
"followers_url": "https://api.github.com/users/alimcmaster1/followers",
"following_url": "https://api.github.com/users/alimcmaster1/following{/other_user}",
"gists_url": "https://api.github.com/users/alimcmaster1/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/alimcmaster1",
"id": 16733618,
"login": "alimcmaster1",
"node_id": "MDQ6VXNlcjE2NzMzNjE4",
"organizations_url": "https://api.github.com/users/alimcmaster1/orgs",
"received_events_url": "https://api.github.com/users/alimcmaster1/received_events",
"repos_url": "https://api.github.com/users/alimcmaster1/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/alimcmaster1/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/alimcmaster1/subscriptions",
"type": "User",
"url": "https://api.github.com/users/alimcmaster1"
}
|
[
{
"avatar_url": "https://avatars.githubusercontent.com/u/16733618?v=4",
"events_url": "https://api.github.com/users/alimcmaster1/events{/privacy}",
"followers_url": "https://api.github.com/users/alimcmaster1/followers",
"following_url": "https://api.github.com/users/alimcmaster1/following{/other_user}",
"gists_url": "https://api.github.com/users/alimcmaster1/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/alimcmaster1",
"id": 16733618,
"login": "alimcmaster1",
"node_id": "MDQ6VXNlcjE2NzMzNjE4",
"organizations_url": "https://api.github.com/users/alimcmaster1/orgs",
"received_events_url": "https://api.github.com/users/alimcmaster1/received_events",
"repos_url": "https://api.github.com/users/alimcmaster1/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/alimcmaster1/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/alimcmaster1/subscriptions",
"type": "User",
"url": "https://api.github.com/users/alimcmaster1"
}
] | null | 3
| 2020-08-07T02:52:40Z
| 2020-09-13T08:01:50Z
| 2020-09-13T08:01:50Z
|
NONE
| null |
- [x] I have checked that this issue has not already been reported.
- [x] I have confirmed this bug exists on the latest version of pandas.
- [x] (optional) I have confirmed this bug exists on the master branch of pandas.
---
#### Code Sample, a copy-pastable example
```python
import sqlalchemy
import pandas as pd
uri = "some uri to postgresql
engine = sqlalchemy.create_engine(uri)
conn = engine.connect()
df = pd.DataFrame([[1,2,3], [2,1,3]], columns=["A", "B", "C"])
# works
df.to_sql("tt", conn, schema="pg_temp", if_exists="append", index=False)
# causes error
df.to_sql("tt", conn, schema="pg_temp", if_exists="append", index=False)
# works
df.to_sql("tt", conn, if_exists="append", index=False)
```
#### Problem description
```
sqlalchemy.exc.ProgrammingError: (psycopg2.errors.DuplicateTable) relation "tt" already exists
[SQL:
CREATE TABLE pg_temp.tt (
"A" BIGINT,
"B" BIGINT,
"C" BIGINT
)
]
(Background on this error at: http://sqlalche.me/e/f405)
```
When I set to_sql with schema and if_exists="append", it works at first call(when table doesn't exists).
But when I call to_sql again(when table exists), it doesn't append the data. It tries to create table again and causes error.
Not setting the schema parameter worked fine when table exists.
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/35594/reactions"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35594/timeline
| null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/35595
|
https://api.github.com/repos/pandas-dev/pandas
|
https://api.github.com/repos/pandas-dev/pandas/issues/35595/labels{/name}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35595/comments
|
https://api.github.com/repos/pandas-dev/pandas/issues/35595/events
|
https://github.com/pandas-dev/pandas/issues/35595
| 674,737,005
|
MDU6SXNzdWU2NzQ3MzcwMDU=
| 35,595
|
BUG: The query method does not support index or column named `datetime`
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/58352906?v=4",
"events_url": "https://api.github.com/users/esse-byte/events{/privacy}",
"followers_url": "https://api.github.com/users/esse-byte/followers",
"following_url": "https://api.github.com/users/esse-byte/following{/other_user}",
"gists_url": "https://api.github.com/users/esse-byte/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/esse-byte",
"id": 58352906,
"login": "esse-byte",
"node_id": "MDQ6VXNlcjU4MzUyOTA2",
"organizations_url": "https://api.github.com/users/esse-byte/orgs",
"received_events_url": "https://api.github.com/users/esse-byte/received_events",
"repos_url": "https://api.github.com/users/esse-byte/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/esse-byte/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/esse-byte/subscriptions",
"type": "User",
"url": "https://api.github.com/users/esse-byte"
}
|
[
{
"color": "e10c02",
"default": false,
"description": null,
"id": 76811,
"name": "Bug",
"node_id": "MDU6TGFiZWw3NjgxMQ==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Bug"
},
{
"color": "f3afff",
"default": false,
"description": "pd.eval, query",
"id": 1631985267,
"name": "expressions",
"node_id": "MDU6TGFiZWwxNjMxOTg1MjY3",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/expressions"
}
] |
open
| false
| null |
[] | null | 3
| 2020-08-07T03:53:17Z
| 2020-09-02T23:47:04Z
| null |
NONE
| null |
```python
In [1]: import pandas as pd
In [2]: index = pd.MultiIndex.from_product([['T0', 'T1'], ['A', 'B']], names=['datetime', 'count'])
In [3]: frame = pd.DataFrame({'isnull': range(len(index))}, index=index)
In [4]: frame.query('count == "A"') # works
Out[4]:
isnull
datetime count
T0 A 0
T1 A 2
In [5]: frame.query('isnull < 2') # works
Out[5]:
isnull
datetime count
T0 A 0
B 1
In [6]: frame.query('datetime == "T0"') # failed caused by KeyError
---------------------------------------------------------------------------
KeyError Traceback (most recent call last)
D:\home\tools\Anaconda\lib\site-packages\pandas\core\indexes\base.py in get_loc(self, key, method, tolerance)
2645 try:
-> 2646 return self._engine.get_loc(key)
2647 except KeyError:
...
D:\home\tools\Anaconda\lib\site-packages\pandas\core\indexes\base.py in get_loc(self, key, method, tolerance)
2646 return self._engine.get_loc(key)
2647 except KeyError:
-> 2648 return self._engine.get_loc(self._maybe_cast_indexer(key))
2649 indexer = self.get_indexer([key], method=method, tolerance=tolerance)
2650 if indexer.ndim > 1 or indexer.size > 1:
pandas\_libs\index.pyx in pandas._libs.index.IndexEngine.get_loc()
pandas\_libs\index.pyx in pandas._libs.index.IndexEngine.get_loc()
pandas\_libs\hashtable_class_helper.pxi in pandas._libs.hashtable.PyObjectHashTable.get_item()
pandas\_libs\hashtable_class_helper.pxi in pandas._libs.hashtable.PyObjectHashTable.get_item()
KeyError: False
In [7]: index2 = pd.MultiIndex.from_product([pd.date_range('20200101', '20200202'), ['A', 'B']], names=['datetime', 'count'])
In [8]: frame2 = pd.DataFrame({'isnull': range(len(index2))}, index=index2)
In [9]: frame2.query('datetime == "2020-01-01"') # failed caused by TypeError
---------------------------------------------------------------------------
KeyError Traceback (most recent call last)
D:\home\tools\Anaconda\lib\site-packages\pandas\core\indexes\base.py in get_loc(self, key, method, tolerance)
2645 try:
-> 2646 return self._engine.get_loc(key)
2647 except KeyError:
...
D:\home\tools\Anaconda\lib\site-packages\pandas\core\indexes\datetimes.py in get_loc(self, key, method, tolerance)
721
722 try:
--> 723 stamp = Timestamp(key)
724 if stamp.tzinfo is not None and self.tz is not None:
725 stamp = stamp.tz_convert(self.tz)
pandas\_libs\tslibs\timestamps.pyx in pandas._libs.tslibs.timestamps.Timestamp.__new__()
pandas\_libs\tslibs\conversion.pyx in pandas._libs.tslibs.conversion.convert_to_tsobject()
TypeError: Cannot convert input [False] of type <class 'numpy.bool_'> to Timestamp
```
#### Problem description
The `query` method failed when the query expression contains `datetime`.
#### Expected Output
#### Output of ``pd.show_versions()``
<details>
INSTALLED VERSIONS
------------------
commit : None
python : 3.8.3.final.0
python-bits : 64
OS : Windows
OS-release : 10
machine : AMD64
processor : Intel64 Family 6 Model 158 Stepping 10, GenuineIntel
byteorder : little
LC_ALL : None
LANG : None
LOCALE : Chinese (Simplified)_China.936
pandas : 1.0.5
numpy : 1.18.5
pytz : 2020.1
dateutil : 2.8.1
pip : 20.1.1
setuptools : 49.2.0.post20200714
Cython : None
pytest : None
hypothesis : None
sphinx : 3.1.2
blosc : None
feather : None
xlsxwriter : None
lxml.etree : None
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : 2.11.2
IPython : 7.16.1
pandas_datareader: None
bs4 : None
bottleneck : None
fastparquet : None
gcsfs : None
lxml.etree : None
matplotlib : 3.2.2
numexpr : 2.7.1
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : None
pytables : None
pytest : None
pyxlsb : None
s3fs : None
scipy : 1.5.0
sqlalchemy : None
tables : 3.6.1
tabulate : 0.8.3
xarray : None
xlrd : 1.2.0
xlwt : None
xlsxwriter : None
numba : 0.50.1
</details>
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/35595/reactions"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35595/timeline
| null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/35596
|
https://api.github.com/repos/pandas-dev/pandas
|
https://api.github.com/repos/pandas-dev/pandas/issues/35596/labels{/name}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35596/comments
|
https://api.github.com/repos/pandas-dev/pandas/issues/35596/events
|
https://github.com/pandas-dev/pandas/issues/35596
| 674,827,928
|
MDU6SXNzdWU2NzQ4Mjc5Mjg=
| 35,596
|
How to stop a rolling window at nan values and continue after it?
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/44056649?v=4",
"events_url": "https://api.github.com/users/HarryStengel/events{/privacy}",
"followers_url": "https://api.github.com/users/HarryStengel/followers",
"following_url": "https://api.github.com/users/HarryStengel/following{/other_user}",
"gists_url": "https://api.github.com/users/HarryStengel/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/HarryStengel",
"id": 44056649,
"login": "HarryStengel",
"node_id": "MDQ6VXNlcjQ0MDU2NjQ5",
"organizations_url": "https://api.github.com/users/HarryStengel/orgs",
"received_events_url": "https://api.github.com/users/HarryStengel/received_events",
"repos_url": "https://api.github.com/users/HarryStengel/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/HarryStengel/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/HarryStengel/subscriptions",
"type": "User",
"url": "https://api.github.com/users/HarryStengel"
}
|
[
{
"color": "e10c02",
"default": false,
"description": null,
"id": 76811,
"name": "Bug",
"node_id": "MDU6TGFiZWw3NjgxMQ==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Bug"
},
{
"color": "d4c5f9",
"default": false,
"description": "rolling, ewma, expanding",
"id": 1045950827,
"name": "Window",
"node_id": "MDU6TGFiZWwxMDQ1OTUwODI3",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Window"
}
] |
closed
| false
| null |
[] |
{
"closed_at": "2020-12-26T13:57:50Z",
"closed_issues": 1768,
"created_at": "2020-05-29T23:47:32Z",
"creator": {
"avatar_url": "https://avatars.githubusercontent.com/u/953992?v=4",
"events_url": "https://api.github.com/users/jreback/events{/privacy}",
"followers_url": "https://api.github.com/users/jreback/followers",
"following_url": "https://api.github.com/users/jreback/following{/other_user}",
"gists_url": "https://api.github.com/users/jreback/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jreback",
"id": 953992,
"login": "jreback",
"node_id": "MDQ6VXNlcjk1Mzk5Mg==",
"organizations_url": "https://api.github.com/users/jreback/orgs",
"received_events_url": "https://api.github.com/users/jreback/received_events",
"repos_url": "https://api.github.com/users/jreback/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jreback/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jreback/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jreback"
},
"description": "on-merge: backport to 1.2.x",
"due_on": "2020-12-15T08:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/73",
"id": 5479819,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/73/labels",
"node_id": "MDk6TWlsZXN0b25lNTQ3OTgxOQ==",
"number": 73,
"open_issues": 0,
"state": "closed",
"title": "1.2",
"updated_at": "2021-04-13T15:46:43Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/73"
}
| 3
| 2020-08-07T07:40:36Z
| 2020-09-19T22:04:00Z
| 2020-09-19T22:04:00Z
|
NONE
| null |
Posted the same question on stackoverflow. A user there said I should open a issue here on the github page, since it is a bug.
I have the following dataframe:
```
df = pd.DataFrame([[0, 1, 2, 4, np.nan, np.nan, np.nan],
[0, 1, 2 ,np.nan, np.nan, np.nan,np.nan],
[0, 2, 2 ,np.nan, 2, np.nan,1]])
```
With output:
```
0 1 2 3 4 5 6
0 0 1 2 4.0 NaN NaN NaN
1 0 1 2 NaN NaN NaN NaN
2 0 2 2 NaN 2.0 NaN 1.0
```
with dtypes:
`
df.dtypes`
```
0 int64
1 int64
2 int64
3 float64
4 float64
5 float64
6 float64
dtype: object
```
Then the underneath rolling summation is applied:
df.rolling(window = 7, min_periods =1, axis = 'columns').sum()
And the output is as follows:
```
0 1 2 3 4 5 6
0 0.0 1.0 3.0 4.0 4.0 4.0 4.0
1 0.0 1.0 3.0 NaN NaN NaN NaN
2 0.0 2.0 4.0 NaN 2.0 2.0 3.0
```
I notice that the rolling window stops and starts again whenever the `dtype` of the next column is different.
I however have a dataframe whereby all columns are of the same `object` type.
`
` df = df.astype('object')``
which has output:
```
0 1 2 3 4 5 6
0 0.0 1.0 3.0 7.0 7.0 7.0 7.0
1 0.0 1.0 3.0 3.0 3.0 3.0 3.0
2 0.0 2.0 4.0 4.0 6.0 6.0 7.0
```
My desired output however, stops and starts again after a `nan` value appears. This would look like:
```
0 1 2 3 4 5 6
0 0.0 1.0 3.0 7.0 NaN NaN NaN
1 0.0 1.0 3.0 NaN NaN NaN NaN
2 0.0 2.0 4.0 NaN 2.0 NaN 3.0
```
I figured there must be a way that NaN values are not considered but also not filled in with values obtained from the rolling window.
Anything would help!
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/35596/reactions"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35596/timeline
| null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/35597
|
https://api.github.com/repos/pandas-dev/pandas
|
https://api.github.com/repos/pandas-dev/pandas/issues/35597/labels{/name}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35597/comments
|
https://api.github.com/repos/pandas-dev/pandas/issues/35597/events
|
https://github.com/pandas-dev/pandas/pull/35597
| 674,830,478
|
MDExOlB1bGxSZXF1ZXN0NDY0NDUwMjI3
| 35,597
|
Backport PR #35590 on branch 1.1.x (BUG: validate index/data length match in DataFrame construction)
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/39504233?v=4",
"events_url": "https://api.github.com/users/meeseeksmachine/events{/privacy}",
"followers_url": "https://api.github.com/users/meeseeksmachine/followers",
"following_url": "https://api.github.com/users/meeseeksmachine/following{/other_user}",
"gists_url": "https://api.github.com/users/meeseeksmachine/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/meeseeksmachine",
"id": 39504233,
"login": "meeseeksmachine",
"node_id": "MDQ6VXNlcjM5NTA0MjMz",
"organizations_url": "https://api.github.com/users/meeseeksmachine/orgs",
"received_events_url": "https://api.github.com/users/meeseeksmachine/received_events",
"repos_url": "https://api.github.com/users/meeseeksmachine/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/meeseeksmachine/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/meeseeksmachine/subscriptions",
"type": "User",
"url": "https://api.github.com/users/meeseeksmachine"
}
|
[
{
"color": "e10c02",
"default": false,
"description": null,
"id": 76811,
"name": "Bug",
"node_id": "MDU6TGFiZWw3NjgxMQ==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Bug"
},
{
"color": "d4c5f9",
"default": false,
"description": "Series/DataFrame/Index/pd.array Constructors",
"id": 1465286368,
"name": "Constructors",
"node_id": "MDU6TGFiZWwxNDY1Mjg2MzY4",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Constructors"
}
] |
closed
| false
| null |
[] |
{
"closed_at": "2020-08-21T08:34:54Z",
"closed_issues": 110,
"created_at": "2020-07-10T13:54:44Z",
"creator": {
"avatar_url": "https://avatars.githubusercontent.com/u/953992?v=4",
"events_url": "https://api.github.com/users/jreback/events{/privacy}",
"followers_url": "https://api.github.com/users/jreback/followers",
"following_url": "https://api.github.com/users/jreback/following{/other_user}",
"gists_url": "https://api.github.com/users/jreback/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jreback",
"id": 953992,
"login": "jreback",
"node_id": "MDQ6VXNlcjk1Mzk5Mg==",
"organizations_url": "https://api.github.com/users/jreback/orgs",
"received_events_url": "https://api.github.com/users/jreback/received_events",
"repos_url": "https://api.github.com/users/jreback/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jreback/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jreback/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jreback"
},
"description": "on-merge: backport to 1.1.x",
"due_on": "2020-08-22T07:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/75",
"id": 5640672,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/75/labels",
"node_id": "MDk6TWlsZXN0b25lNTY0MDY3Mg==",
"number": 75,
"open_issues": 0,
"state": "closed",
"title": "1.1.1",
"updated_at": "2020-08-25T06:31:23Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/75"
}
| 0
| 2020-08-07T07:45:37Z
| 2020-08-07T08:32:55Z
| 2020-08-07T08:32:55Z
|
NONE
| null |
Backport PR #35590: BUG: validate index/data length match in DataFrame construction
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/35597/reactions"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35597/timeline
| null | 0
|
{
"diff_url": "https://github.com/pandas-dev/pandas/pull/35597.diff",
"html_url": "https://github.com/pandas-dev/pandas/pull/35597",
"merged_at": "2020-08-07T08:32:55Z",
"patch_url": "https://github.com/pandas-dev/pandas/pull/35597.patch",
"url": "https://api.github.com/repos/pandas-dev/pandas/pulls/35597"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35598
|
https://api.github.com/repos/pandas-dev/pandas
|
https://api.github.com/repos/pandas-dev/pandas/issues/35598/labels{/name}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35598/comments
|
https://api.github.com/repos/pandas-dev/pandas/issues/35598/events
|
https://github.com/pandas-dev/pandas/issues/35598
| 674,861,801
|
MDU6SXNzdWU2NzQ4NjE4MDE=
| 35,598
|
BUG: interpolate gives a TypeError on empty dataframes
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/48946947?v=4",
"events_url": "https://api.github.com/users/sanderland/events{/privacy}",
"followers_url": "https://api.github.com/users/sanderland/followers",
"following_url": "https://api.github.com/users/sanderland/following{/other_user}",
"gists_url": "https://api.github.com/users/sanderland/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/sanderland",
"id": 48946947,
"login": "sanderland",
"node_id": "MDQ6VXNlcjQ4OTQ2OTQ3",
"organizations_url": "https://api.github.com/users/sanderland/orgs",
"received_events_url": "https://api.github.com/users/sanderland/received_events",
"repos_url": "https://api.github.com/users/sanderland/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/sanderland/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sanderland/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sanderland"
}
|
[
{
"color": "e10c02",
"default": false,
"description": null,
"id": 76811,
"name": "Bug",
"node_id": "MDU6TGFiZWw3NjgxMQ==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Bug"
},
{
"color": "d7e102",
"default": false,
"description": "np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate",
"id": 2822342,
"name": "Missing-data",
"node_id": "MDU6TGFiZWwyODIyMzQy",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Missing-data"
},
{
"color": "e11d21",
"default": false,
"description": "Functionality that used to work in a prior pandas version",
"id": 32815646,
"name": "Regression",
"node_id": "MDU6TGFiZWwzMjgxNTY0Ng==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Regression"
},
{
"color": "eb6420",
"default": false,
"description": "Non-arithmetic algos: value_counts, factorize, sorting, isin, clip, shift, diff",
"id": 57296398,
"name": "Algos",
"node_id": "MDU6TGFiZWw1NzI5NjM5OA==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Algos"
}
] |
closed
| false
| null |
[] |
{
"closed_at": "2020-08-21T08:34:54Z",
"closed_issues": 110,
"created_at": "2020-07-10T13:54:44Z",
"creator": {
"avatar_url": "https://avatars.githubusercontent.com/u/953992?v=4",
"events_url": "https://api.github.com/users/jreback/events{/privacy}",
"followers_url": "https://api.github.com/users/jreback/followers",
"following_url": "https://api.github.com/users/jreback/following{/other_user}",
"gists_url": "https://api.github.com/users/jreback/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jreback",
"id": 953992,
"login": "jreback",
"node_id": "MDQ6VXNlcjk1Mzk5Mg==",
"organizations_url": "https://api.github.com/users/jreback/orgs",
"received_events_url": "https://api.github.com/users/jreback/received_events",
"repos_url": "https://api.github.com/users/jreback/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jreback/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jreback/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jreback"
},
"description": "on-merge: backport to 1.1.x",
"due_on": "2020-08-22T07:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/75",
"id": 5640672,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/75/labels",
"node_id": "MDk6TWlsZXN0b25lNTY0MDY3Mg==",
"number": 75,
"open_issues": 0,
"state": "closed",
"title": "1.1.1",
"updated_at": "2020-08-25T06:31:23Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/75"
}
| 1
| 2020-08-07T08:42:21Z
| 2020-08-17T19:32:54Z
| 2020-08-17T19:32:54Z
|
CONTRIBUTOR
| null |
Already fixed in #35543, making an issue for linking/discussion.
- [x] I have checked that this issue has not already been reported.
- [x] I have confirmed this bug exists on the latest version of pandas.
- [x] (optional) I have confirmed this bug exists on the master branch of pandas.
---
**Note**: Please read [this guide](https://matthewrocklin.com/blog/work/2018/02/28/minimal-bug-reports) detailing how to provide the necessary information for us to reproduce your bug.
#### Code Sample, a copy-pastable example
```python
from pandas import DataFrame
DataFrame().interpolate()
```
"Cannot interpolate with all object-dtype columns "
TypeError: Cannot interpolate with all object-dtype columns in the DataFrame. Try setting at least one column to a numeric dtype.
#### Problem description
This is a regression, 1.0.5 handles it fine.
The problem appeared due to checking `np.all(obj.dtypes == np.dtype(object))` since the all of an empty set is True
#### Expected Output
#### Output of ``pd.show_versions()``
pandas : 1.1.0
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/35598/reactions"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35598/timeline
| null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/35599
|
https://api.github.com/repos/pandas-dev/pandas
|
https://api.github.com/repos/pandas-dev/pandas/issues/35599/labels{/name}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35599/comments
|
https://api.github.com/repos/pandas-dev/pandas/issues/35599/events
|
https://github.com/pandas-dev/pandas/issues/35599
| 674,879,859
|
MDU6SXNzdWU2NzQ4Nzk4NTk=
| 35,599
|
BUG: After sort_values() is executed, a large block of memory is not freed
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/8284922?v=4",
"events_url": "https://api.github.com/users/wjsi/events{/privacy}",
"followers_url": "https://api.github.com/users/wjsi/followers",
"following_url": "https://api.github.com/users/wjsi/following{/other_user}",
"gists_url": "https://api.github.com/users/wjsi/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/wjsi",
"id": 8284922,
"login": "wjsi",
"node_id": "MDQ6VXNlcjgyODQ5MjI=",
"organizations_url": "https://api.github.com/users/wjsi/orgs",
"received_events_url": "https://api.github.com/users/wjsi/received_events",
"repos_url": "https://api.github.com/users/wjsi/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/wjsi/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/wjsi/subscriptions",
"type": "User",
"url": "https://api.github.com/users/wjsi"
}
|
[
{
"color": "e10c02",
"default": false,
"description": null,
"id": 76811,
"name": "Bug",
"node_id": "MDU6TGFiZWw3NjgxMQ==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Bug"
}
] |
closed
| false
| null |
[] | null | 3
| 2020-08-07T09:12:50Z
| 2020-08-21T17:04:44Z
| 2020-08-07T12:20:54Z
|
CONTRIBUTOR
| null |
- [x] I have checked that this issue has not already been reported.
- [x] I have confirmed this bug exists on the latest version of pandas.
- [ ] (optional) I have confirmed this bug exists on the master branch of pandas.
---
**Note**: Please read [this guide](https://matthewrocklin.com/blog/work/2018/02/28/minimal-bug-reports) detailing how to provide the necessary information for us to reproduce your bug.
#### Code Sample, a copy-pastable example
```python
import psutil
import pandas as pd
print(psutil.Process().memory_info().rss) # outputs 77533184
# first execution
arrow_ser = pd.Series(['abcdefg'] * (10 * 1024 ** 2))
arrow_ser = arrow_ser.sort_values() # same behavior as sort_values(inplace=True)
del arrow_ser
print(psutil.Process().memory_info().rss) # outputs 686264320
# second execution
arrow_ser = pd.Series(['abcdefg'] * (10 * 1024 ** 2))
arrow_ser = arrow_ser.sort_values()
del arrow_ser
print(psutil.Process().memory_info().rss) # outputs 686456832
```
#### Problem description
When calling ``sort_values()`` on dataframes or series, we discover that a large block of memory is allocated and not freed even if all related objects are deleted. When sort_values() is executed again, the size of allocated memory does not increase significantly. When the line of ``sort_values()`` is commented out, memory sizes are ok. We guess if there is a cache or memory pool when calling ``sort_values()``, but we cannot spot it.
We test ``sort_values()`` under 1.1.0, 1.0.5 and 0.24.1, and they share the same behavior. The test environment is an independent conda env without MKL, thus MKL buffers is not a problem.
#### Expected Output
The memory shall be freed once the related object is deleted, or a method cleaning the caches is needed.
#### Output of ``pd.show_versions()``
<details>
INSTALLED VERSIONS
------------------
commit : d9fff2792bf16178d4e450fe7384244e50635733
python : 3.7.7.final.0
python-bits : 64
OS : Darwin
OS-release : 19.6.0
Version : Darwin Kernel Version 19.6.0: Sun Jul 5 00:43:10 PDT 2020; root:xnu-6153.141.1~9/RELEASE_X86_64
machine : x86_64
processor : i386
byteorder : little
LC_ALL : None
LANG : None
LOCALE : zh_CN.UTF-8
pandas : 1.1.0
numpy : 1.19.1
pytz : 2020.1
dateutil : 2.8.1
pip : 20.1.1
setuptools : 49.2.0.post20200714
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 : 7.16.1
pandas_datareader: None
bs4 : None
bottleneck : None
fsspec : None
fastparquet : None
gcsfs : None
matplotlib : None
numexpr : None
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : None
pytables : None
pyxlsb : None
s3fs : None
scipy : None
sqlalchemy : None
tables : None
tabulate : None
xarray : None
xlrd : None
xlwt : None
numba : None
</details>
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/35599/reactions"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35599/timeline
| null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/35600
|
https://api.github.com/repos/pandas-dev/pandas
|
https://api.github.com/repos/pandas-dev/pandas/issues/35600/labels{/name}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35600/comments
|
https://api.github.com/repos/pandas-dev/pandas/issues/35600/events
|
https://github.com/pandas-dev/pandas/pull/35600
| 674,958,205
|
MDExOlB1bGxSZXF1ZXN0NDY0NTU2OTgx
| 35,600
|
Backport PR #35547 on branch 1.1.x (Bug fix one element series truncate)
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/39504233?v=4",
"events_url": "https://api.github.com/users/meeseeksmachine/events{/privacy}",
"followers_url": "https://api.github.com/users/meeseeksmachine/followers",
"following_url": "https://api.github.com/users/meeseeksmachine/following{/other_user}",
"gists_url": "https://api.github.com/users/meeseeksmachine/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/meeseeksmachine",
"id": 39504233,
"login": "meeseeksmachine",
"node_id": "MDQ6VXNlcjM5NTA0MjMz",
"organizations_url": "https://api.github.com/users/meeseeksmachine/orgs",
"received_events_url": "https://api.github.com/users/meeseeksmachine/received_events",
"repos_url": "https://api.github.com/users/meeseeksmachine/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/meeseeksmachine/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/meeseeksmachine/subscriptions",
"type": "User",
"url": "https://api.github.com/users/meeseeksmachine"
}
|
[
{
"color": "0b02e1",
"default": false,
"description": "Related to indexing on series/frames, not to indexes themselves",
"id": 2822098,
"name": "Indexing",
"node_id": "MDU6TGFiZWwyODIyMDk4",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Indexing"
},
{
"color": "e11d21",
"default": false,
"description": "Functionality that used to work in a prior pandas version",
"id": 32815646,
"name": "Regression",
"node_id": "MDU6TGFiZWwzMjgxNTY0Ng==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Regression"
}
] |
closed
| false
| null |
[] |
{
"closed_at": "2020-08-21T08:34:54Z",
"closed_issues": 110,
"created_at": "2020-07-10T13:54:44Z",
"creator": {
"avatar_url": "https://avatars.githubusercontent.com/u/953992?v=4",
"events_url": "https://api.github.com/users/jreback/events{/privacy}",
"followers_url": "https://api.github.com/users/jreback/followers",
"following_url": "https://api.github.com/users/jreback/following{/other_user}",
"gists_url": "https://api.github.com/users/jreback/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jreback",
"id": 953992,
"login": "jreback",
"node_id": "MDQ6VXNlcjk1Mzk5Mg==",
"organizations_url": "https://api.github.com/users/jreback/orgs",
"received_events_url": "https://api.github.com/users/jreback/received_events",
"repos_url": "https://api.github.com/users/jreback/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jreback/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jreback/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jreback"
},
"description": "on-merge: backport to 1.1.x",
"due_on": "2020-08-22T07:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/75",
"id": 5640672,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/75/labels",
"node_id": "MDk6TWlsZXN0b25lNTY0MDY3Mg==",
"number": 75,
"open_issues": 0,
"state": "closed",
"title": "1.1.1",
"updated_at": "2020-08-25T06:31:23Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/75"
}
| 0
| 2020-08-07T11:39:43Z
| 2020-08-07T12:29:44Z
| 2020-08-07T12:29:44Z
|
NONE
| null |
Backport PR #35547: Bug fix one element series truncate
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/35600/reactions"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35600/timeline
| null | 0
|
{
"diff_url": "https://github.com/pandas-dev/pandas/pull/35600.diff",
"html_url": "https://github.com/pandas-dev/pandas/pull/35600",
"merged_at": "2020-08-07T12:29:44Z",
"patch_url": "https://github.com/pandas-dev/pandas/pull/35600.patch",
"url": "https://api.github.com/repos/pandas-dev/pandas/pulls/35600"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35601
|
https://api.github.com/repos/pandas-dev/pandas
|
https://api.github.com/repos/pandas-dev/pandas/issues/35601/labels{/name}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35601/comments
|
https://api.github.com/repos/pandas-dev/pandas/issues/35601/events
|
https://github.com/pandas-dev/pandas/pull/35601
| 674,961,877
|
MDExOlB1bGxSZXF1ZXN0NDY0NTYwMDc5
| 35,601
|
Backport PR #35578 on branch 1.1.x (BUG: df.shift(n, axis=1) with multiple blocks)
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/39504233?v=4",
"events_url": "https://api.github.com/users/meeseeksmachine/events{/privacy}",
"followers_url": "https://api.github.com/users/meeseeksmachine/followers",
"following_url": "https://api.github.com/users/meeseeksmachine/following{/other_user}",
"gists_url": "https://api.github.com/users/meeseeksmachine/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/meeseeksmachine",
"id": 39504233,
"login": "meeseeksmachine",
"node_id": "MDQ6VXNlcjM5NTA0MjMz",
"organizations_url": "https://api.github.com/users/meeseeksmachine/orgs",
"received_events_url": "https://api.github.com/users/meeseeksmachine/received_events",
"repos_url": "https://api.github.com/users/meeseeksmachine/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/meeseeksmachine/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/meeseeksmachine/subscriptions",
"type": "User",
"url": "https://api.github.com/users/meeseeksmachine"
}
|
[
{
"color": "02d7e1",
"default": false,
"description": "Concat, Merge/Join, Stack/Unstack, Explode",
"id": 13098779,
"name": "Reshaping",
"node_id": "MDU6TGFiZWwxMzA5ODc3OQ==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Reshaping"
}
] |
closed
| false
| null |
[] |
{
"closed_at": "2020-08-21T08:34:54Z",
"closed_issues": 110,
"created_at": "2020-07-10T13:54:44Z",
"creator": {
"avatar_url": "https://avatars.githubusercontent.com/u/953992?v=4",
"events_url": "https://api.github.com/users/jreback/events{/privacy}",
"followers_url": "https://api.github.com/users/jreback/followers",
"following_url": "https://api.github.com/users/jreback/following{/other_user}",
"gists_url": "https://api.github.com/users/jreback/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jreback",
"id": 953992,
"login": "jreback",
"node_id": "MDQ6VXNlcjk1Mzk5Mg==",
"organizations_url": "https://api.github.com/users/jreback/orgs",
"received_events_url": "https://api.github.com/users/jreback/received_events",
"repos_url": "https://api.github.com/users/jreback/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jreback/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jreback/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jreback"
},
"description": "on-merge: backport to 1.1.x",
"due_on": "2020-08-22T07:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/75",
"id": 5640672,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/75/labels",
"node_id": "MDk6TWlsZXN0b25lNTY0MDY3Mg==",
"number": 75,
"open_issues": 0,
"state": "closed",
"title": "1.1.1",
"updated_at": "2020-08-25T06:31:23Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/75"
}
| 2
| 2020-08-07T11:47:28Z
| 2020-08-07T13:34:25Z
| 2020-08-07T13:34:24Z
|
NONE
| null |
Backport PR #35578: BUG: df.shift(n, axis=1) with multiple blocks
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/35601/reactions"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35601/timeline
| null | 0
|
{
"diff_url": "https://github.com/pandas-dev/pandas/pull/35601.diff",
"html_url": "https://github.com/pandas-dev/pandas/pull/35601",
"merged_at": "2020-08-07T13:34:24Z",
"patch_url": "https://github.com/pandas-dev/pandas/pull/35601.patch",
"url": "https://api.github.com/repos/pandas-dev/pandas/pulls/35601"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35602
|
https://api.github.com/repos/pandas-dev/pandas
|
https://api.github.com/repos/pandas-dev/pandas/issues/35602/labels{/name}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35602/comments
|
https://api.github.com/repos/pandas-dev/pandas/issues/35602/events
|
https://github.com/pandas-dev/pandas/pull/35602
| 674,963,378
|
MDExOlB1bGxSZXF1ZXN0NDY0NTYxMzIy
| 35,602
|
Backport PR #35582 on branch 1.1.x (BUG: to_timedelta fails on Int64 Series with null values)
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/39504233?v=4",
"events_url": "https://api.github.com/users/meeseeksmachine/events{/privacy}",
"followers_url": "https://api.github.com/users/meeseeksmachine/followers",
"following_url": "https://api.github.com/users/meeseeksmachine/following{/other_user}",
"gists_url": "https://api.github.com/users/meeseeksmachine/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/meeseeksmachine",
"id": 39504233,
"login": "meeseeksmachine",
"node_id": "MDQ6VXNlcjM5NTA0MjMz",
"organizations_url": "https://api.github.com/users/meeseeksmachine/orgs",
"received_events_url": "https://api.github.com/users/meeseeksmachine/received_events",
"repos_url": "https://api.github.com/users/meeseeksmachine/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/meeseeksmachine/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/meeseeksmachine/subscriptions",
"type": "User",
"url": "https://api.github.com/users/meeseeksmachine"
}
|
[
{
"color": "d7e102",
"default": false,
"description": "np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate",
"id": 2822342,
"name": "Missing-data",
"node_id": "MDU6TGFiZWwyODIyMzQy",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Missing-data"
},
{
"color": "5319e7",
"default": false,
"description": "Timedelta data type",
"id": 49597148,
"name": "Timedelta",
"node_id": "MDU6TGFiZWw0OTU5NzE0OA==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Timedelta"
},
{
"color": "8cc645",
"default": false,
"description": "Related to pd.NA and nullable extension arrays",
"id": 1817503692,
"name": "NA - MaskedArrays",
"node_id": "MDU6TGFiZWwxODE3NTAzNjky",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/NA%20-%20MaskedArrays"
}
] |
closed
| false
| null |
[] |
{
"closed_at": "2020-08-21T08:34:54Z",
"closed_issues": 110,
"created_at": "2020-07-10T13:54:44Z",
"creator": {
"avatar_url": "https://avatars.githubusercontent.com/u/953992?v=4",
"events_url": "https://api.github.com/users/jreback/events{/privacy}",
"followers_url": "https://api.github.com/users/jreback/followers",
"following_url": "https://api.github.com/users/jreback/following{/other_user}",
"gists_url": "https://api.github.com/users/jreback/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jreback",
"id": 953992,
"login": "jreback",
"node_id": "MDQ6VXNlcjk1Mzk5Mg==",
"organizations_url": "https://api.github.com/users/jreback/orgs",
"received_events_url": "https://api.github.com/users/jreback/received_events",
"repos_url": "https://api.github.com/users/jreback/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jreback/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jreback/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jreback"
},
"description": "on-merge: backport to 1.1.x",
"due_on": "2020-08-22T07:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/75",
"id": 5640672,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/75/labels",
"node_id": "MDk6TWlsZXN0b25lNTY0MDY3Mg==",
"number": 75,
"open_issues": 0,
"state": "closed",
"title": "1.1.1",
"updated_at": "2020-08-25T06:31:23Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/75"
}
| 1
| 2020-08-07T11:50:37Z
| 2020-08-07T12:52:48Z
| 2020-08-07T12:52:48Z
|
NONE
| null |
Backport PR #35582: BUG: to_timedelta fails on Int64 Series with null values
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/35602/reactions"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35602/timeline
| null | 0
|
{
"diff_url": "https://github.com/pandas-dev/pandas/pull/35602.diff",
"html_url": "https://github.com/pandas-dev/pandas/pull/35602",
"merged_at": "2020-08-07T12:52:48Z",
"patch_url": "https://github.com/pandas-dev/pandas/pull/35602.patch",
"url": "https://api.github.com/repos/pandas-dev/pandas/pulls/35602"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35603
|
https://api.github.com/repos/pandas-dev/pandas
|
https://api.github.com/repos/pandas-dev/pandas/issues/35603/labels{/name}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35603/comments
|
https://api.github.com/repos/pandas-dev/pandas/issues/35603/events
|
https://github.com/pandas-dev/pandas/issues/35603
| 674,967,700
|
MDU6SXNzdWU2NzQ5Njc3MDA=
| 35,603
|
BUG: Incorrect float format in object column
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/13159005?v=4",
"events_url": "https://api.github.com/users/simonjayhawkins/events{/privacy}",
"followers_url": "https://api.github.com/users/simonjayhawkins/followers",
"following_url": "https://api.github.com/users/simonjayhawkins/following{/other_user}",
"gists_url": "https://api.github.com/users/simonjayhawkins/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/simonjayhawkins",
"id": 13159005,
"login": "simonjayhawkins",
"node_id": "MDQ6VXNlcjEzMTU5MDA1",
"organizations_url": "https://api.github.com/users/simonjayhawkins/orgs",
"received_events_url": "https://api.github.com/users/simonjayhawkins/received_events",
"repos_url": "https://api.github.com/users/simonjayhawkins/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/simonjayhawkins/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/simonjayhawkins/subscriptions",
"type": "User",
"url": "https://api.github.com/users/simonjayhawkins"
}
|
[
{
"color": "ededed",
"default": false,
"description": "__repr__ of pandas objects, to_string",
"id": 13101118,
"name": "Output-Formatting",
"node_id": "MDU6TGFiZWwxMzEwMTExOA==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Output-Formatting"
},
{
"color": "0e8a16",
"default": true,
"description": null,
"id": 717120670,
"name": "good first issue",
"node_id": "MDU6TGFiZWw3MTcxMjA2NzA=",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/good%20first%20issue"
},
{
"color": "cdea3c",
"default": false,
"description": "Unit test(s) needed to prevent regressions",
"id": 986278782,
"name": "Needs Tests",
"node_id": "MDU6TGFiZWw5ODYyNzg3ODI=",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Needs%20Tests"
}
] |
closed
| false
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/52055110?v=4",
"events_url": "https://api.github.com/users/mdhsieh/events{/privacy}",
"followers_url": "https://api.github.com/users/mdhsieh/followers",
"following_url": "https://api.github.com/users/mdhsieh/following{/other_user}",
"gists_url": "https://api.github.com/users/mdhsieh/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/mdhsieh",
"id": 52055110,
"login": "mdhsieh",
"node_id": "MDQ6VXNlcjUyMDU1MTEw",
"organizations_url": "https://api.github.com/users/mdhsieh/orgs",
"received_events_url": "https://api.github.com/users/mdhsieh/received_events",
"repos_url": "https://api.github.com/users/mdhsieh/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/mdhsieh/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/mdhsieh/subscriptions",
"type": "User",
"url": "https://api.github.com/users/mdhsieh"
}
|
[
{
"avatar_url": "https://avatars.githubusercontent.com/u/52055110?v=4",
"events_url": "https://api.github.com/users/mdhsieh/events{/privacy}",
"followers_url": "https://api.github.com/users/mdhsieh/followers",
"following_url": "https://api.github.com/users/mdhsieh/following{/other_user}",
"gists_url": "https://api.github.com/users/mdhsieh/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/mdhsieh",
"id": 52055110,
"login": "mdhsieh",
"node_id": "MDQ6VXNlcjUyMDU1MTEw",
"organizations_url": "https://api.github.com/users/mdhsieh/orgs",
"received_events_url": "https://api.github.com/users/mdhsieh/received_events",
"repos_url": "https://api.github.com/users/mdhsieh/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/mdhsieh/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/mdhsieh/subscriptions",
"type": "User",
"url": "https://api.github.com/users/mdhsieh"
}
] |
{
"closed_at": "2021-07-02T07:59:17Z",
"closed_issues": 2396,
"created_at": "2020-11-11T19:05:43Z",
"creator": {
"avatar_url": "https://avatars.githubusercontent.com/u/953992?v=4",
"events_url": "https://api.github.com/users/jreback/events{/privacy}",
"followers_url": "https://api.github.com/users/jreback/followers",
"following_url": "https://api.github.com/users/jreback/following{/other_user}",
"gists_url": "https://api.github.com/users/jreback/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jreback",
"id": 953992,
"login": "jreback",
"node_id": "MDQ6VXNlcjk1Mzk5Mg==",
"organizations_url": "https://api.github.com/users/jreback/orgs",
"received_events_url": "https://api.github.com/users/jreback/received_events",
"repos_url": "https://api.github.com/users/jreback/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jreback/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jreback/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jreback"
},
"description": "on-merge: backport to 1.3.x",
"due_on": "2021-06-30T07:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/80",
"id": 6095818,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/80/labels",
"node_id": "MDk6TWlsZXN0b25lNjA5NTgxOA==",
"number": 80,
"open_issues": 1,
"state": "closed",
"title": "1.3",
"updated_at": "2021-08-25T20:34:06Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/80"
}
| 3
| 2020-08-07T11:59:11Z
| 2021-05-27T18:41:06Z
| 2021-05-27T18:41:06Z
|
MEMBER
| null |
from https://github.com/pandas-dev/pandas/issues/35580#issuecomment-670245569
---
**Note**: Please read [this guide](https://matthewrocklin.com/blog/work/2018/02/28/minimal-bug-reports) detailing how to provide the necessary information for us to reproduce your bug.
#### Code Sample, a copy-pastable example
```
>>> pd.Series([1.0]).astype(object)
0 1
dtype: object
>>>
```
#### Problem description
[this should explain **why** the current behaviour is a problem and why the expected output is a better solution]
#### Expected Output
```
>>> pd.Series([1.0]).astype(object)
0 1.0
dtype: object
```
#### Output of ``pd.show_versions()``
<details>
[paste the output of ``pd.show_versions()`` here leaving a blank line after the details tag]
</details>
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/35603/reactions"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35603/timeline
| null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/35604
|
https://api.github.com/repos/pandas-dev/pandas
|
https://api.github.com/repos/pandas-dev/pandas/issues/35604/labels{/name}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35604/comments
|
https://api.github.com/repos/pandas-dev/pandas/issues/35604/events
|
https://github.com/pandas-dev/pandas/pull/35604
| 674,976,012
|
MDExOlB1bGxSZXF1ZXN0NDY0NTcxODc3
| 35,604
|
BUG: allow missing values in Index when calling Index.sort_values
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/23253999?v=4",
"events_url": "https://api.github.com/users/AlexKirko/events{/privacy}",
"followers_url": "https://api.github.com/users/AlexKirko/followers",
"following_url": "https://api.github.com/users/AlexKirko/following{/other_user}",
"gists_url": "https://api.github.com/users/AlexKirko/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/AlexKirko",
"id": 23253999,
"login": "AlexKirko",
"node_id": "MDQ6VXNlcjIzMjUzOTk5",
"organizations_url": "https://api.github.com/users/AlexKirko/orgs",
"received_events_url": "https://api.github.com/users/AlexKirko/received_events",
"repos_url": "https://api.github.com/users/AlexKirko/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/AlexKirko/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/AlexKirko/subscriptions",
"type": "User",
"url": "https://api.github.com/users/AlexKirko"
}
|
[
{
"color": "e10c02",
"default": false,
"description": null,
"id": 76811,
"name": "Bug",
"node_id": "MDU6TGFiZWw3NjgxMQ==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Bug"
},
{
"color": "d7e102",
"default": false,
"description": "np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate",
"id": 2822342,
"name": "Missing-data",
"node_id": "MDU6TGFiZWwyODIyMzQy",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Missing-data"
},
{
"color": "e99695",
"default": false,
"description": "Related to the Index class or subclasses",
"id": 1218227310,
"name": "Index",
"node_id": "MDU6TGFiZWwxMjE4MjI3MzEw",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Index"
}
] |
closed
| false
| null |
[] |
{
"closed_at": "2020-12-26T13:57:50Z",
"closed_issues": 1768,
"created_at": "2020-05-29T23:47:32Z",
"creator": {
"avatar_url": "https://avatars.githubusercontent.com/u/953992?v=4",
"events_url": "https://api.github.com/users/jreback/events{/privacy}",
"followers_url": "https://api.github.com/users/jreback/followers",
"following_url": "https://api.github.com/users/jreback/following{/other_user}",
"gists_url": "https://api.github.com/users/jreback/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jreback",
"id": 953992,
"login": "jreback",
"node_id": "MDQ6VXNlcjk1Mzk5Mg==",
"organizations_url": "https://api.github.com/users/jreback/orgs",
"received_events_url": "https://api.github.com/users/jreback/received_events",
"repos_url": "https://api.github.com/users/jreback/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jreback/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jreback/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jreback"
},
"description": "on-merge: backport to 1.2.x",
"due_on": "2020-12-15T08:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/73",
"id": 5479819,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/73/labels",
"node_id": "MDk6TWlsZXN0b25lNTQ3OTgxOQ==",
"number": 73,
"open_issues": 0,
"state": "closed",
"title": "1.2",
"updated_at": "2021-04-13T15:46:43Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/73"
}
| 19
| 2020-08-07T12:15:38Z
| 2020-09-07T05:01:21Z
| 2020-09-06T17:47:41Z
|
MEMBER
| null |
- [X] closes #35584, xref #35922
- [X] tests added 1 / passed 1
- [X] passes `black pandas`
- [X] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [X] whatsnew entry
### Problem
`Index.sort_values` breaks when `Index` includes `None`. The OP points out that a `Series` doesn't break in a similar case. In my opinion, there is a number of ways missing values can creep into an Index, and `sort_values` shoudn't be breaking.
### Details
When we do `Series.sort_values` we shunt the missing values to the end or the beginning of the Series depending on `na_position`, and then `argsort` the rest. When we currently do `sort_values` on an `Index`, we try to `argsort` the whole thing, and it expectedly breaks.
### Solution and alternatives
I propose we do the same stuff for `Index` that `Series` does, that is send the missing values to the end or the beginning. Added the `na_position` kwarg that works similar to how it works in `Series`.
Another possible solution is to explicitly forbid Indices with missing values and raise a clear error. I don't think it's advisable, since there isn't much of a practical difference between non-unique indices, which we allow, and this case.
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/35604/reactions"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35604/timeline
| null | 0
|
{
"diff_url": "https://github.com/pandas-dev/pandas/pull/35604.diff",
"html_url": "https://github.com/pandas-dev/pandas/pull/35604",
"merged_at": "2020-09-06T17:47:41Z",
"patch_url": "https://github.com/pandas-dev/pandas/pull/35604.patch",
"url": "https://api.github.com/repos/pandas-dev/pandas/pulls/35604"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35605
|
https://api.github.com/repos/pandas-dev/pandas
|
https://api.github.com/repos/pandas-dev/pandas/issues/35605/labels{/name}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35605/comments
|
https://api.github.com/repos/pandas-dev/pandas/issues/35605/events
|
https://github.com/pandas-dev/pandas/issues/35605
| 674,994,328
|
MDU6SXNzdWU2NzQ5OTQzMjg=
| 35,605
|
ENH: Styler for specific column styling
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/24256554?v=4",
"events_url": "https://api.github.com/users/attack68/events{/privacy}",
"followers_url": "https://api.github.com/users/attack68/followers",
"following_url": "https://api.github.com/users/attack68/following{/other_user}",
"gists_url": "https://api.github.com/users/attack68/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/attack68",
"id": 24256554,
"login": "attack68",
"node_id": "MDQ6VXNlcjI0MjU2NTU0",
"organizations_url": "https://api.github.com/users/attack68/orgs",
"received_events_url": "https://api.github.com/users/attack68/received_events",
"repos_url": "https://api.github.com/users/attack68/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/attack68/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/attack68/subscriptions",
"type": "User",
"url": "https://api.github.com/users/attack68"
}
|
[
{
"color": "4E9A06",
"default": false,
"description": null,
"id": 76812,
"name": "Enhancement",
"node_id": "MDU6TGFiZWw3NjgxMg==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Enhancement"
},
{
"color": "006b75",
"default": false,
"description": "conditional formatting using DataFrame.style",
"id": 1728592794,
"name": "Styler",
"node_id": "MDU6TGFiZWwxNzI4NTkyNzk0",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Styler"
}
] |
closed
| false
| null |
[] |
{
"closed_at": "2020-12-26T13:57:50Z",
"closed_issues": 1768,
"created_at": "2020-05-29T23:47:32Z",
"creator": {
"avatar_url": "https://avatars.githubusercontent.com/u/953992?v=4",
"events_url": "https://api.github.com/users/jreback/events{/privacy}",
"followers_url": "https://api.github.com/users/jreback/followers",
"following_url": "https://api.github.com/users/jreback/following{/other_user}",
"gists_url": "https://api.github.com/users/jreback/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jreback",
"id": 953992,
"login": "jreback",
"node_id": "MDQ6VXNlcjk1Mzk5Mg==",
"organizations_url": "https://api.github.com/users/jreback/orgs",
"received_events_url": "https://api.github.com/users/jreback/received_events",
"repos_url": "https://api.github.com/users/jreback/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jreback/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jreback/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jreback"
},
"description": "on-merge: backport to 1.2.x",
"due_on": "2020-12-15T08:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/73",
"id": 5479819,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/73/labels",
"node_id": "MDk6TWlsZXN0b25lNTQ3OTgxOQ==",
"number": 73,
"open_issues": 0,
"state": "closed",
"title": "1.2",
"updated_at": "2021-04-13T15:46:43Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/73"
}
| 0
| 2020-08-07T12:50:24Z
| 2020-11-24T14:01:40Z
| 2020-11-24T14:01:40Z
|
CONTRIBUTOR
| null |
Pandas Styler already contains the functionality needed for specific `row` and `column` styling via CSS class referencing.
Firstly it can add `table_styles` within the preliminary `<style>` tag, based on given `selectors`.
Secondly it adds specific CSS classes to each element, be it, `heading0` `col1` `row0` etc.
The current solution to add styling to a specific column can be done in two ways:
1) **Using Apply**: this is kind of hinted at in the docs and how most people attack the problem initially.
```
df = pd.DataFrame(data=[[0,1],[1,2],[3,4]], columns=['A', 'B'])
s = df.style.set_uuid('_')
s.apply(lambda x: ['color: red' for v in x], subset=['A'])
s
```
The problem with this approach is that it generates a lot of HTML code, each cell needs an id, and each id is added in the
initial <style> tag as the means of identifying elements. Without manually specifying the UUID (which are typically about 45bytes long) this creates a lot of useless data transmission and slows down websites for large tables:
`'<style type="text/css" >\n#T__row0_col0,#T__row1_col0,#T__row2_col0{\n color: red;\n color: red;\n color: red;\n }</style><table id="T__" ><thead> <tr> <th class="blank level0" ></th> <th class="col_heading level0 col0" >A</th> <th class="col_heading level0 col1" >B</th> </tr></thead><tbody>\n <tr>\n <th id="T__level0_row0" class="row_heading level0 row0" >0</th>\n <td id="T__row0_col0" class="data row0 col0" >0</td>\n <td id="T__row0_col1" class="data row0 col1" >1</td>\n </tr>\n <tr>\n <th id="T__level0_row1" class="row_heading level0 row1" >1</th>\n <td id="T__row1_col0" class="data row1 col0" >1</td>\n <td id="T__row1_col1" class="data row1 col1" >2</td>\n </tr>\n <tr>\n <th id="T__level0_row2" class="row_heading level0 row2" >2</th>\n <td id="T__row2_col0" class="data row2 col0" >3</td>\n <td id="T__row2_col1" class="data row2 col1" >4</td>\n </tr>\n </tbody></table>'`
2) **Using Table Styles**: since `col0` is a class identifier added to each cell relevant to column 'A' one can use table styles to apply directly:
```
df = pd.DataFrame(data=[[0,1],[1,2],[3,4]], columns=['A', 'B'])
s = Styler(df, uuid='_', cell_ids=False)
s.set_table_styles([{'selector': '.col0', 'props': [('color', 'red')]}])
s
```
This might be preferred in some instances since it can reduce the amount of HTML, particularly when combined with `cell_ids` argument. It only outputs the class type and can ignore individual ids, including their UUIDs.
`'<style type="text/css" >
#T__ .col0 {
color: red;
}</style><table id="T__" ><thead> <tr> <th class="blank level0" ></th> <th class="col_heading level0 col0" >A</th> <th class="col_heading level0 col1" >B</th> </tr></thead><tbody>
<tr>
<th id="T__level0_row0" class="row_heading level0 row0" >0</th>
<td class="data row0 col0" >0</td>
<td class="data row0 col1" >1</td>
</tr>
<tr>
<th id="T__level0_row1" class="row_heading level0 row1" >1</th>
<td class="data row1 col0" >1</td>
<td class="data row1 col1" >2</td>
</tr>
<tr>
<th id="T__level0_row2" class="row_heading level0 row2" >2</th>
<td class="data row2 col0" >3</td>
<td class="data row2 col1" >4</td>
</tr>
</tbody></table>'`
Therefore the **only missing code** is to put this together in a function which automatically maps the column name to the added CSS class and appends it to the existing table styles.
#### API breaking implications
This only provides new functionality and will not impact previous versions.
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/35605/reactions"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35605/timeline
| null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/35606
|
https://api.github.com/repos/pandas-dev/pandas
|
https://api.github.com/repos/pandas-dev/pandas/issues/35606/labels{/name}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35606/comments
|
https://api.github.com/repos/pandas-dev/pandas/issues/35606/events
|
https://github.com/pandas-dev/pandas/issues/35606
| 674,999,864
|
MDU6SXNzdWU2NzQ5OTk4NjQ=
| 35,606
|
REGR: ValueError: cannot convert float NaN to integer - on dataframe.reset_index() in pandas 1.1.0
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/12735464?v=4",
"events_url": "https://api.github.com/users/ndhansen/events{/privacy}",
"followers_url": "https://api.github.com/users/ndhansen/followers",
"following_url": "https://api.github.com/users/ndhansen/following{/other_user}",
"gists_url": "https://api.github.com/users/ndhansen/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/ndhansen",
"id": 12735464,
"login": "ndhansen",
"node_id": "MDQ6VXNlcjEyNzM1NDY0",
"organizations_url": "https://api.github.com/users/ndhansen/orgs",
"received_events_url": "https://api.github.com/users/ndhansen/received_events",
"repos_url": "https://api.github.com/users/ndhansen/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/ndhansen/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/ndhansen/subscriptions",
"type": "User",
"url": "https://api.github.com/users/ndhansen"
}
|
[
{
"color": "e10c02",
"default": false,
"description": null,
"id": 76811,
"name": "Bug",
"node_id": "MDU6TGFiZWw3NjgxMQ==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Bug"
},
{
"color": "AFEEEE",
"default": false,
"description": null,
"id": 211840,
"name": "Timeseries",
"node_id": "MDU6TGFiZWwyMTE4NDA=",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Timeseries"
},
{
"color": "e11d21",
"default": false,
"description": "Functionality that used to work in a prior pandas version",
"id": 32815646,
"name": "Regression",
"node_id": "MDU6TGFiZWwzMjgxNTY0Ng==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Regression"
},
{
"color": "207de5",
"default": false,
"description": null,
"id": 71268330,
"name": "MultiIndex",
"node_id": "MDU6TGFiZWw3MTI2ODMzMA==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/MultiIndex"
}
] |
closed
| false
| null |
[] |
{
"closed_at": "2020-08-21T08:34:54Z",
"closed_issues": 110,
"created_at": "2020-07-10T13:54:44Z",
"creator": {
"avatar_url": "https://avatars.githubusercontent.com/u/953992?v=4",
"events_url": "https://api.github.com/users/jreback/events{/privacy}",
"followers_url": "https://api.github.com/users/jreback/followers",
"following_url": "https://api.github.com/users/jreback/following{/other_user}",
"gists_url": "https://api.github.com/users/jreback/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jreback",
"id": 953992,
"login": "jreback",
"node_id": "MDQ6VXNlcjk1Mzk5Mg==",
"organizations_url": "https://api.github.com/users/jreback/orgs",
"received_events_url": "https://api.github.com/users/jreback/received_events",
"repos_url": "https://api.github.com/users/jreback/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jreback/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jreback/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jreback"
},
"description": "on-merge: backport to 1.1.x",
"due_on": "2020-08-22T07:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/75",
"id": 5640672,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/75/labels",
"node_id": "MDk6TWlsZXN0b25lNTY0MDY3Mg==",
"number": 75,
"open_issues": 0,
"state": "closed",
"title": "1.1.1",
"updated_at": "2020-08-25T06:31:23Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/75"
}
| 5
| 2020-08-07T12:59:58Z
| 2020-08-14T01:50:52Z
| 2020-08-14T01:50:52Z
|
NONE
| null |
- [x] I have checked that this issue has not already been reported.
- [x] I have confirmed this bug exists on the latest version of pandas.
- [ ] (optional) I have confirmed this bug exists on the master branch of pandas.
---
#### Code Sample, a copy-pastable example
```python
from pandas.core.dtypes.cast import construct_1d_arraylike_from_scalar
from pandas.core.dtypes.missing import na_value_for_dtype
import numpy as np
dtype = np.datetime64().dtype
length = 10
works_value = np.NaN
fails_value = na_value_for_dtype(dtype)
# works
construct_1d_arraylike_from_scalar(works_value, length, dtype)
# fails
construct_1d_arraylike_from_scalar(fails_value, length, dtype)
```
Results in:
```
Traceback (most recent call last):
File "<input>", line 1, in <module>
construct_1d_arraylike_from_scalar(value, length, dtype)
File "/usr/lib/python3.8/site-packages/pandas/core/dtypes/cast.py", line 1453, in construct_1d_arraylike_from_scalar
subarr.fill(value)
ValueError: cannot convert float NaN to integer
```
#### Problem description
This is a problem was found when calling `reset_index` on a MultiIndex Dataframe with an index containing datetime information. The expected behaviour would be that it would return an array of NaTs, which ironically only happens if you pass it `np.NaN`.
I'm not familiar with the source code of numpy, so I can only speculate on how to fix it, but I would assume we would need special handling for time values, so we fill time arrays with `np.NaN`s instead of `pandas._libs.tslibs.nattype.NaTType`s.
#### Expected Output
`array(['NaT', 'NaT', 'NaT', 'NaT', 'NaT', 'NaT', 'NaT', 'NaT', 'NaT', 'NaT'], dtype=datetime64)`
#### Output of ``pd.show_versions()``
<details>
INSTALLED VERSIONS
------------------
commit : None
python : 3.8.3.final.0
python-bits : 64
OS : Linux
OS-release : 5.7.9-1-MANJARO
machine : x86_64
processor :
byteorder : little
LC_ALL : None
LANG : en_GB.UTF-8
LOCALE : en_GB.UTF-8
pandas : 1.0.5
numpy : 1.19.1
pytz : 2020.1
dateutil : 2.8.1
pip : 20.1.1
setuptools : 49.2.0
Cython : 0.29.21
pytest : 5.4.3
hypothesis : None
sphinx : None
blosc : None
feather : None
xlsxwriter : None
lxml.etree : 4.5.2
html5lib : 1.1
pymysql : None
psycopg2 : None
jinja2 : 2.11.2
IPython : 7.16.1
pandas_datareader: 0.10.0dev0
bs4 : 4.9.1
bottleneck : 1.3.2
fastparquet : None
gcsfs : None
lxml.etree : 4.5.2
matplotlib : 3.3.0
numexpr : 2.7.1
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : None
pytables : None
pytest : 5.4.3
pyxlsb : None
s3fs : None
scipy : 1.5.1
sqlalchemy : 1.3.17
tables : None
tabulate : None
xarray : None
xlrd : None
xlwt : None
xlsxwriter : None
numba : None
</details>
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/35606/reactions"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35606/timeline
| null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/35607
|
https://api.github.com/repos/pandas-dev/pandas
|
https://api.github.com/repos/pandas-dev/pandas/issues/35607/labels{/name}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35607/comments
|
https://api.github.com/repos/pandas-dev/pandas/issues/35607/events
|
https://github.com/pandas-dev/pandas/pull/35607
| 675,002,862
|
MDExOlB1bGxSZXF1ZXN0NDY0NTk0MjE0
| 35,607
|
ENH: Styler column and row styles
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/24256554?v=4",
"events_url": "https://api.github.com/users/attack68/events{/privacy}",
"followers_url": "https://api.github.com/users/attack68/followers",
"following_url": "https://api.github.com/users/attack68/following{/other_user}",
"gists_url": "https://api.github.com/users/attack68/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/attack68",
"id": 24256554,
"login": "attack68",
"node_id": "MDQ6VXNlcjI0MjU2NTU0",
"organizations_url": "https://api.github.com/users/attack68/orgs",
"received_events_url": "https://api.github.com/users/attack68/received_events",
"repos_url": "https://api.github.com/users/attack68/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/attack68/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/attack68/subscriptions",
"type": "User",
"url": "https://api.github.com/users/attack68"
}
|
[
{
"color": "006b75",
"default": false,
"description": "conditional formatting using DataFrame.style",
"id": 1728592794,
"name": "Styler",
"node_id": "MDU6TGFiZWwxNzI4NTkyNzk0",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Styler"
},
{
"color": "7fcce8",
"default": false,
"description": "",
"id": 2347992045,
"name": "Stale",
"node_id": "MDU6TGFiZWwyMzQ3OTkyMDQ1",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Stale"
}
] |
closed
| false
| null |
[] |
{
"closed_at": "2020-12-26T13:57:50Z",
"closed_issues": 1768,
"created_at": "2020-05-29T23:47:32Z",
"creator": {
"avatar_url": "https://avatars.githubusercontent.com/u/953992?v=4",
"events_url": "https://api.github.com/users/jreback/events{/privacy}",
"followers_url": "https://api.github.com/users/jreback/followers",
"following_url": "https://api.github.com/users/jreback/following{/other_user}",
"gists_url": "https://api.github.com/users/jreback/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jreback",
"id": 953992,
"login": "jreback",
"node_id": "MDQ6VXNlcjk1Mzk5Mg==",
"organizations_url": "https://api.github.com/users/jreback/orgs",
"received_events_url": "https://api.github.com/users/jreback/received_events",
"repos_url": "https://api.github.com/users/jreback/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jreback/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jreback/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jreback"
},
"description": "on-merge: backport to 1.2.x",
"due_on": "2020-12-15T08:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/73",
"id": 5479819,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/73/labels",
"node_id": "MDk6TWlsZXN0b25lNTQ3OTgxOQ==",
"number": 73,
"open_issues": 0,
"state": "closed",
"title": "1.2",
"updated_at": "2021-04-13T15:46:43Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/73"
}
| 12
| 2020-08-07T13:05:09Z
| 2021-01-26T08:10:55Z
| 2020-11-24T14:01:40Z
|
CONTRIBUTOR
| null |
- [x] closes #35605
- [x] tests added / passed
- [x] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [x] whatsnew entry
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/35607/reactions"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35607/timeline
| null | 0
|
{
"diff_url": "https://github.com/pandas-dev/pandas/pull/35607.diff",
"html_url": "https://github.com/pandas-dev/pandas/pull/35607",
"merged_at": "2020-11-24T14:01:40Z",
"patch_url": "https://github.com/pandas-dev/pandas/pull/35607.patch",
"url": "https://api.github.com/repos/pandas-dev/pandas/pulls/35607"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35608
|
https://api.github.com/repos/pandas-dev/pandas
|
https://api.github.com/repos/pandas-dev/pandas/issues/35608/labels{/name}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35608/comments
|
https://api.github.com/repos/pandas-dev/pandas/issues/35608/events
|
https://github.com/pandas-dev/pandas/pull/35608
| 675,040,411
|
MDExOlB1bGxSZXF1ZXN0NDY0NjI1NjM2
| 35,608
|
Doc notes for core team members
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/1312546?v=4",
"events_url": "https://api.github.com/users/TomAugspurger/events{/privacy}",
"followers_url": "https://api.github.com/users/TomAugspurger/followers",
"following_url": "https://api.github.com/users/TomAugspurger/following{/other_user}",
"gists_url": "https://api.github.com/users/TomAugspurger/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/TomAugspurger",
"id": 1312546,
"login": "TomAugspurger",
"node_id": "MDQ6VXNlcjEzMTI1NDY=",
"organizations_url": "https://api.github.com/users/TomAugspurger/orgs",
"received_events_url": "https://api.github.com/users/TomAugspurger/received_events",
"repos_url": "https://api.github.com/users/TomAugspurger/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/TomAugspurger/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/TomAugspurger/subscriptions",
"type": "User",
"url": "https://api.github.com/users/TomAugspurger"
}
|
[
{
"color": "3465A4",
"default": false,
"description": null,
"id": 134699,
"name": "Docs",
"node_id": "MDU6TGFiZWwxMzQ2OTk=",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Docs"
}
] |
closed
| false
| null |
[] |
{
"closed_at": "2020-12-26T13:57:50Z",
"closed_issues": 1768,
"created_at": "2020-05-29T23:47:32Z",
"creator": {
"avatar_url": "https://avatars.githubusercontent.com/u/953992?v=4",
"events_url": "https://api.github.com/users/jreback/events{/privacy}",
"followers_url": "https://api.github.com/users/jreback/followers",
"following_url": "https://api.github.com/users/jreback/following{/other_user}",
"gists_url": "https://api.github.com/users/jreback/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jreback",
"id": 953992,
"login": "jreback",
"node_id": "MDQ6VXNlcjk1Mzk5Mg==",
"organizations_url": "https://api.github.com/users/jreback/orgs",
"received_events_url": "https://api.github.com/users/jreback/received_events",
"repos_url": "https://api.github.com/users/jreback/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jreback/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jreback/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jreback"
},
"description": "on-merge: backport to 1.2.x",
"due_on": "2020-12-15T08:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/73",
"id": 5479819,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/73/labels",
"node_id": "MDk6TWlsZXN0b25lNTQ3OTgxOQ==",
"number": 73,
"open_issues": 0,
"state": "closed",
"title": "1.2",
"updated_at": "2021-04-13T15:46:43Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/73"
}
| 3
| 2020-08-07T14:07:24Z
| 2020-08-10T23:02:17Z
| 2020-08-10T23:02:12Z
|
CONTRIBUTOR
| null |
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/35608/reactions"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35608/timeline
| null | 0
|
{
"diff_url": "https://github.com/pandas-dev/pandas/pull/35608.diff",
"html_url": "https://github.com/pandas-dev/pandas/pull/35608",
"merged_at": "2020-08-10T23:02:12Z",
"patch_url": "https://github.com/pandas-dev/pandas/pull/35608.patch",
"url": "https://api.github.com/repos/pandas-dev/pandas/pulls/35608"
}
|
|
https://api.github.com/repos/pandas-dev/pandas/issues/35609
|
https://api.github.com/repos/pandas-dev/pandas
|
https://api.github.com/repos/pandas-dev/pandas/issues/35609/labels{/name}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35609/comments
|
https://api.github.com/repos/pandas-dev/pandas/issues/35609/events
|
https://github.com/pandas-dev/pandas/issues/35609
| 675,106,043
|
MDU6SXNzdWU2NzUxMDYwNDM=
| 35,609
|
BUG: Pandas merge DFs on index and column
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/55836583?v=4",
"events_url": "https://api.github.com/users/carlosg-m/events{/privacy}",
"followers_url": "https://api.github.com/users/carlosg-m/followers",
"following_url": "https://api.github.com/users/carlosg-m/following{/other_user}",
"gists_url": "https://api.github.com/users/carlosg-m/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/carlosg-m",
"id": 55836583,
"login": "carlosg-m",
"node_id": "MDQ6VXNlcjU1ODM2NTgz",
"organizations_url": "https://api.github.com/users/carlosg-m/orgs",
"received_events_url": "https://api.github.com/users/carlosg-m/received_events",
"repos_url": "https://api.github.com/users/carlosg-m/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/carlosg-m/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/carlosg-m/subscriptions",
"type": "User",
"url": "https://api.github.com/users/carlosg-m"
}
|
[
{
"color": "0052cc",
"default": false,
"description": null,
"id": 34444536,
"name": "Usage Question",
"node_id": "MDU6TGFiZWwzNDQ0NDUzNg==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Usage%20Question"
},
{
"color": "009800",
"default": false,
"description": "Duplicate issue or pull request",
"id": 40153326,
"name": "Duplicate Report",
"node_id": "MDU6TGFiZWw0MDE1MzMyNg==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Duplicate%20Report"
}
] |
closed
| false
| null |
[] | null | 4
| 2020-08-07T15:55:06Z
| 2020-08-10T15:15:34Z
| 2020-08-10T15:08:38Z
|
NONE
| null |
- [x] I have checked that this issue has not already been reported.
- [x] I have confirmed this bug exists on the latest version of pandas.
- [ ] (optional) I have confirmed this bug exists on the master branch of pandas.
---
#### Code Sample, a copy-pastable example
```python
# Your code here
df = pd.DataFrame([0.5,0.6,6,6,7,12],index=[0,0,1,1,1,2], columns=['distance'])
print(df)
distance
0 0.5
0 0.6
1 6.0
1 6.0
1 7.0
2 12.0
result = df.merge(df.groupby(df.index)['distance'].min(), left_index=True, right_index=True, on='distance')
print(result)
distance
0 0.5
0 0.6
1 6.0
1 6.0
1 7.0
2 12.0
```
#### Problem description
Merging two DataFrames using left and right index and a column does not seem to be possible.
I only have two options, reset the index on both DFs and merge on both columns which is slower, or create a multiindex which is unnecessary.
#### Expected Output
```
result = df.reset_index().merge(df.groupby(df.index)['distance'].min().reset_index(), on=['index','distance'])
print(result)
index distance
0 0 0.5
1 1 6.0
2 1 6.0
3 2 12.0
```
#### Output of ``pd.show_versions()``
<details>
INSTALLED VERSIONS
------------------
commit : d9fff2792bf16178d4e450fe7384244e50635733
python : 3.6.9.final.0
python-bits : 64
OS : Linux
OS-release : 4.19.112+
Version : #1 SMP Thu Jul 23 08:00:38 PDT 2020
machine : x86_64
processor : x86_64
byteorder : little
LC_ALL : None
LANG : en_US.UTF-8
LOCALE : en_US.UTF-8
pandas : 1.1.0
numpy : 1.18.5
pytz : 2018.9
dateutil : 2.8.1
pip : 19.3.1
setuptools : 49.2.0
Cython : 0.29.21
pytest : 3.6.4
hypothesis : None
sphinx : 1.8.5
blosc : None
feather : 0.4.1
xlsxwriter : None
lxml.etree : 4.2.6
html5lib : 1.0.1
pymysql : None
psycopg2 : 2.7.6.1 (dt dec pq3 ext lo64)
jinja2 : 2.11.2
IPython : 5.5.0
pandas_datareader: None
bs4 : 4.6.3
bottleneck : 1.3.2
fsspec : 0.8.0
fastparquet : None
gcsfs : None
matplotlib : 3.2.2
numexpr : 2.7.1
odfpy : None
openpyxl : 2.5.9
pandas_gbq : 0.11.0
pyarrow : 0.14.1
pytables : None
pyxlsb : None
s3fs : 0.4.2
scipy : 1.4.1
sqlalchemy : 1.3.18
tables : 3.4.4
tabulate : 0.8.7
xarray : 0.15.1
xlrd : 1.1.0
xlwt : 1.3.0
numba : 0.48.0
</details>
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/35609/reactions"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35609/timeline
| null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/35610
|
https://api.github.com/repos/pandas-dev/pandas
|
https://api.github.com/repos/pandas-dev/pandas/issues/35610/labels{/name}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35610/comments
|
https://api.github.com/repos/pandas-dev/pandas/issues/35610/events
|
https://github.com/pandas-dev/pandas/pull/35610
| 675,188,476
|
MDExOlB1bGxSZXF1ZXN0NDY0NzQ4NzA3
| 35,610
|
Backport PR #35562 on branch 1.1.x (BUG: Ensure rolling groupby doesn't segfault with center=True)
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/39504233?v=4",
"events_url": "https://api.github.com/users/meeseeksmachine/events{/privacy}",
"followers_url": "https://api.github.com/users/meeseeksmachine/followers",
"following_url": "https://api.github.com/users/meeseeksmachine/following{/other_user}",
"gists_url": "https://api.github.com/users/meeseeksmachine/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/meeseeksmachine",
"id": 39504233,
"login": "meeseeksmachine",
"node_id": "MDQ6VXNlcjM5NTA0MjMz",
"organizations_url": "https://api.github.com/users/meeseeksmachine/orgs",
"received_events_url": "https://api.github.com/users/meeseeksmachine/received_events",
"repos_url": "https://api.github.com/users/meeseeksmachine/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/meeseeksmachine/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/meeseeksmachine/subscriptions",
"type": "User",
"url": "https://api.github.com/users/meeseeksmachine"
}
|
[
{
"color": "729FCF",
"default": false,
"description": null,
"id": 233160,
"name": "Groupby",
"node_id": "MDU6TGFiZWwyMzMxNjA=",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Groupby"
},
{
"color": "e11d21",
"default": false,
"description": "Functionality that used to work in a prior pandas version",
"id": 32815646,
"name": "Regression",
"node_id": "MDU6TGFiZWwzMjgxNTY0Ng==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Regression"
},
{
"color": "d4c5f9",
"default": false,
"description": "rolling, ewma, expanding",
"id": 1045950827,
"name": "Window",
"node_id": "MDU6TGFiZWwxMDQ1OTUwODI3",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Window"
}
] |
closed
| false
| null |
[] |
{
"closed_at": "2020-08-21T08:34:54Z",
"closed_issues": 110,
"created_at": "2020-07-10T13:54:44Z",
"creator": {
"avatar_url": "https://avatars.githubusercontent.com/u/953992?v=4",
"events_url": "https://api.github.com/users/jreback/events{/privacy}",
"followers_url": "https://api.github.com/users/jreback/followers",
"following_url": "https://api.github.com/users/jreback/following{/other_user}",
"gists_url": "https://api.github.com/users/jreback/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jreback",
"id": 953992,
"login": "jreback",
"node_id": "MDQ6VXNlcjk1Mzk5Mg==",
"organizations_url": "https://api.github.com/users/jreback/orgs",
"received_events_url": "https://api.github.com/users/jreback/received_events",
"repos_url": "https://api.github.com/users/jreback/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jreback/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jreback/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jreback"
},
"description": "on-merge: backport to 1.1.x",
"due_on": "2020-08-22T07:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/75",
"id": 5640672,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/75/labels",
"node_id": "MDk6TWlsZXN0b25lNTY0MDY3Mg==",
"number": 75,
"open_issues": 0,
"state": "closed",
"title": "1.1.1",
"updated_at": "2020-08-25T06:31:23Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/75"
}
| 0
| 2020-08-07T18:19:30Z
| 2020-08-07T19:00:47Z
| 2020-08-07T19:00:47Z
|
NONE
| null |
Backport PR #35562: BUG: Ensure rolling groupby doesn't segfault with center=True
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/35610/reactions"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35610/timeline
| null | 0
|
{
"diff_url": "https://github.com/pandas-dev/pandas/pull/35610.diff",
"html_url": "https://github.com/pandas-dev/pandas/pull/35610",
"merged_at": "2020-08-07T19:00:47Z",
"patch_url": "https://github.com/pandas-dev/pandas/pull/35610.patch",
"url": "https://api.github.com/repos/pandas-dev/pandas/pulls/35610"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35611
|
https://api.github.com/repos/pandas-dev/pandas
|
https://api.github.com/repos/pandas-dev/pandas/issues/35611/labels{/name}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35611/comments
|
https://api.github.com/repos/pandas-dev/pandas/issues/35611/events
|
https://github.com/pandas-dev/pandas/issues/35611
| 675,212,832
|
MDU6SXNzdWU2NzUyMTI4MzI=
| 35,611
|
ENH: Make top-level Pandas functions serializable
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/306380?v=4",
"events_url": "https://api.github.com/users/mrocklin/events{/privacy}",
"followers_url": "https://api.github.com/users/mrocklin/followers",
"following_url": "https://api.github.com/users/mrocklin/following{/other_user}",
"gists_url": "https://api.github.com/users/mrocklin/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/mrocklin",
"id": 306380,
"login": "mrocklin",
"node_id": "MDQ6VXNlcjMwNjM4MA==",
"organizations_url": "https://api.github.com/users/mrocklin/orgs",
"received_events_url": "https://api.github.com/users/mrocklin/received_events",
"repos_url": "https://api.github.com/users/mrocklin/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/mrocklin/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/mrocklin/subscriptions",
"type": "User",
"url": "https://api.github.com/users/mrocklin"
}
|
[
{
"color": "0e8a16",
"default": true,
"description": null,
"id": 717120670,
"name": "good first issue",
"node_id": "MDU6TGFiZWw3MTcxMjA2NzA=",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/good%20first%20issue"
},
{
"color": "cdea3c",
"default": false,
"description": "Unit test(s) needed to prevent regressions",
"id": 986278782,
"name": "Needs Tests",
"node_id": "MDU6TGFiZWw5ODYyNzg3ODI=",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Needs%20Tests"
},
{
"color": "6c1cdb",
"default": false,
"description": "read_pickle, to_pickle",
"id": 1625435109,
"name": "IO Pickle",
"node_id": "MDU6TGFiZWwxNjI1NDM1MTA5",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/IO%20Pickle"
}
] |
closed
| false
| null |
[] |
{
"closed_at": "2020-12-26T13:57:50Z",
"closed_issues": 1768,
"created_at": "2020-05-29T23:47:32Z",
"creator": {
"avatar_url": "https://avatars.githubusercontent.com/u/953992?v=4",
"events_url": "https://api.github.com/users/jreback/events{/privacy}",
"followers_url": "https://api.github.com/users/jreback/followers",
"following_url": "https://api.github.com/users/jreback/following{/other_user}",
"gists_url": "https://api.github.com/users/jreback/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jreback",
"id": 953992,
"login": "jreback",
"node_id": "MDQ6VXNlcjk1Mzk5Mg==",
"organizations_url": "https://api.github.com/users/jreback/orgs",
"received_events_url": "https://api.github.com/users/jreback/received_events",
"repos_url": "https://api.github.com/users/jreback/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jreback/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jreback/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jreback"
},
"description": "on-merge: backport to 1.2.x",
"due_on": "2020-12-15T08:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/73",
"id": 5479819,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/73/labels",
"node_id": "MDk6TWlsZXN0b25lNTQ3OTgxOQ==",
"number": 73,
"open_issues": 0,
"state": "closed",
"title": "1.2",
"updated_at": "2021-04-13T15:46:43Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/73"
}
| 5
| 2020-08-07T18:56:19Z
| 2020-08-19T18:02:56Z
| 2020-08-19T18:02:56Z
|
CONTRIBUTOR
| null |
```python
import pandas as pd
import pickle
pickle.dumps(pd.read_csv)
```
```python-traceback
AttributeError: Can't pickle local object '_make_parser_function.<locals>.parser_f'
```
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/35611/reactions"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35611/timeline
| null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/35612
|
https://api.github.com/repos/pandas-dev/pandas
|
https://api.github.com/repos/pandas-dev/pandas/issues/35612/labels{/name}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35612/comments
|
https://api.github.com/repos/pandas-dev/pandas/issues/35612/events
|
https://github.com/pandas-dev/pandas/issues/35612
| 675,224,104
|
MDU6SXNzdWU2NzUyMjQxMDQ=
| 35,612
|
BUG: DataFrameGroupBy.__getitem__ fails to propagate dropna=True
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/48889395?v=4",
"events_url": "https://api.github.com/users/arw2019/events{/privacy}",
"followers_url": "https://api.github.com/users/arw2019/followers",
"following_url": "https://api.github.com/users/arw2019/following{/other_user}",
"gists_url": "https://api.github.com/users/arw2019/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/arw2019",
"id": 48889395,
"login": "arw2019",
"node_id": "MDQ6VXNlcjQ4ODg5Mzk1",
"organizations_url": "https://api.github.com/users/arw2019/orgs",
"received_events_url": "https://api.github.com/users/arw2019/received_events",
"repos_url": "https://api.github.com/users/arw2019/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/arw2019/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/arw2019/subscriptions",
"type": "User",
"url": "https://api.github.com/users/arw2019"
}
|
[
{
"color": "e10c02",
"default": false,
"description": null,
"id": 76811,
"name": "Bug",
"node_id": "MDU6TGFiZWw3NjgxMQ==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Bug"
},
{
"color": "729FCF",
"default": false,
"description": null,
"id": 233160,
"name": "Groupby",
"node_id": "MDU6TGFiZWwyMzMxNjA=",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Groupby"
},
{
"color": "d7e102",
"default": false,
"description": "np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate",
"id": 2822342,
"name": "Missing-data",
"node_id": "MDU6TGFiZWwyODIyMzQy",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Missing-data"
}
] |
closed
| false
| null |
[] |
{
"closed_at": "2021-07-02T07:59:17Z",
"closed_issues": 2396,
"created_at": "2020-11-11T19:05:43Z",
"creator": {
"avatar_url": "https://avatars.githubusercontent.com/u/953992?v=4",
"events_url": "https://api.github.com/users/jreback/events{/privacy}",
"followers_url": "https://api.github.com/users/jreback/followers",
"following_url": "https://api.github.com/users/jreback/following{/other_user}",
"gists_url": "https://api.github.com/users/jreback/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jreback",
"id": 953992,
"login": "jreback",
"node_id": "MDQ6VXNlcjk1Mzk5Mg==",
"organizations_url": "https://api.github.com/users/jreback/orgs",
"received_events_url": "https://api.github.com/users/jreback/received_events",
"repos_url": "https://api.github.com/users/jreback/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jreback/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jreback/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jreback"
},
"description": "on-merge: backport to 1.3.x",
"due_on": "2021-06-30T07:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/80",
"id": 6095818,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/80/labels",
"node_id": "MDk6TWlsZXN0b25lNjA5NTgxOA==",
"number": 80,
"open_issues": 1,
"state": "closed",
"title": "1.3",
"updated_at": "2021-08-25T20:34:06Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/80"
}
| 0
| 2020-08-07T19:18:05Z
| 2020-12-19T02:34:44Z
| 2020-12-19T02:34:44Z
|
MEMBER
| null |
- [x] I have checked that this issue has not already been reported.
- [x] I have confirmed this bug exists on the latest version of pandas.
- [x] (optional) I have confirmed this bug exists on the master branch of pandas.
xref #35014
Creating a separate issue as the `dropna=True` requires a different fix to `dropna=False` (resolved by #35078)
#### Problem description
The setup is:
``` python
In [1]: import pandas as pd
In [2]: df = pd.DataFrame({"A": [0, 0, 1, None], "B": [1, 2, 3, None]})
In [3]: gb = df.groupby("A", dropna=True)
```
All three of these commands:
``` python
In [4]: gb['B'].transform(len)
In [5]: gb[['B']].transform(len)
In [6]: gb.transform(len)
```
generate a variant of this error
``` python
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-4-3bae7d67a46f> in <module>
----> 1 gb['B'].transform(len)
/workspaces/pandas-arw2019/pandas/core/groupby/generic.py in transform(self, func, engine, engine_kwargs, *args, **kwargs)
487
488 if not isinstance(func, str):
--> 489 return self._transform_general(
490 func, *args, engine=engine, engine_kwargs=engine_kwargs, **kwargs
491 )
/workspaces/pandas-arw2019/pandas/core/groupby/generic.py in _transform_general(self, func, engine, engine_kwargs, *args, **kwargs)
556
557 result.name = self._selected_obj.name
--> 558 result.index = self._selected_obj.index
559 return result
560
/workspaces/pandas-arw2019/pandas/core/generic.py in __setattr__(self, name, value)
5167 try:
5168 object.__getattribute__(self, name)
-> 5169 return object.__setattr__(self, name, value)
5170 except AttributeError:
5171 pass
/workspaces/pandas-arw2019/pandas/_libs/properties.pyx in pandas._libs.properties.AxisProperty.__set__()
64
65 def __set__(self, obj, value):
---> 66 obj._set_axis(self.axis, value)
/workspaces/pandas-arw2019/pandas/core/series.py in _set_axis(self, axis, labels, fastpath)
422 if not fastpath:
423 # The ensure_index call above ensures we have an Index object
--> 424 self._mgr.set_axis(axis, labels)
425
426 # ndarray compatibility
/workspaces/pandas-arw2019/pandas/core/internals/managers.py in set_axis(self, axis, new_labels)
214
215 if new_len != old_len:
--> 216 raise ValueError(
217 f"Length mismatch: Expected axis has {old_len} elements, new "
218 f"values have {new_len} elements"
ValueError: Length mismatch: Expected axis has 3 elements, new values have 4 elements
```
#### Expected Output
All three should return:
``` python
Out[9]:
B
0 2
1 2
2 1
```
#### Output of ``pd.show_versions()``
<details>
INSTALLED VERSIONS
------------------
commit : 9843926e39dee88f689afc51cbf0f2fdc232dcd3
python : 3.8.3.final.0
python-bits : 64
OS : Linux
OS-release : 5.4.0-42-generic
Version : #46-Ubuntu SMP Fri Jul 10 00:24:02 UTC 2020
machine : x86_64
processor :
byteorder : little
LC_ALL : C.UTF-8
LANG : C.UTF-8
LOCALE : en_US.UTF-8
pandas : 1.2.0.dev0+54.g9843926e3
numpy : 1.18.5
pytz : 2020.1
dateutil : 2.8.1
pip : 20.1.1
setuptools : 49.1.0.post20200704
Cython : 0.29.21
pytest : 5.4.3
hypothesis : 5.19.0
sphinx : 3.1.1
blosc : None
feather : None
xlsxwriter : 1.2.9
lxml.etree : 4.5.2
html5lib : 1.1
pymysql : None
psycopg2 : 2.8.5 (dt dec pq3 ext lo64)
jinja2 : 2.11.2
IPython : 7.16.1
pandas_datareader: None
bs4 : 4.9.1
bottleneck : 1.3.2
fsspec : 0.7.4
fastparquet : 0.4.0
gcsfs : 0.6.2
matplotlib : 3.2.2
numexpr : 2.7.1
odfpy : None
openpyxl : 3.0.4
pandas_gbq : None
pyarrow : 0.17.1
pytables : None
pyxlsb : None
s3fs : 0.4.2
scipy : 1.5.0
sqlalchemy : 1.3.18
tables : 3.6.1
tabulate : 0.8.7
xarray : 0.15.1
xlrd : 1.2.0
xlwt : 1.3.0
numba : 0.50.1
</details>
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/35612/reactions"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35612/timeline
| null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/35613
|
https://api.github.com/repos/pandas-dev/pandas
|
https://api.github.com/repos/pandas-dev/pandas/issues/35613/labels{/name}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35613/comments
|
https://api.github.com/repos/pandas-dev/pandas/issues/35613/events
|
https://github.com/pandas-dev/pandas/pull/35613
| 675,301,107
|
MDExOlB1bGxSZXF1ZXN0NDY0ODQyMjc5
| 35,613
|
REF: use consistent pattern in tslibs.vectorized
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/8078968?v=4",
"events_url": "https://api.github.com/users/jbrockmendel/events{/privacy}",
"followers_url": "https://api.github.com/users/jbrockmendel/followers",
"following_url": "https://api.github.com/users/jbrockmendel/following{/other_user}",
"gists_url": "https://api.github.com/users/jbrockmendel/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jbrockmendel",
"id": 8078968,
"login": "jbrockmendel",
"node_id": "MDQ6VXNlcjgwNzg5Njg=",
"organizations_url": "https://api.github.com/users/jbrockmendel/orgs",
"received_events_url": "https://api.github.com/users/jbrockmendel/received_events",
"repos_url": "https://api.github.com/users/jbrockmendel/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jbrockmendel/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jbrockmendel/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jbrockmendel"
}
|
[
{
"color": "FCE94F",
"default": false,
"description": "Internal refactoring of code",
"id": 127681,
"name": "Refactor",
"node_id": "MDU6TGFiZWwxMjc2ODE=",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Refactor"
},
{
"color": "5319e7",
"default": false,
"description": "Timezone data dtype",
"id": 60458168,
"name": "Timezones",
"node_id": "MDU6TGFiZWw2MDQ1ODE2OA==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Timezones"
}
] |
closed
| false
| null |
[] |
{
"closed_at": "2020-12-26T13:57:50Z",
"closed_issues": 1768,
"created_at": "2020-05-29T23:47:32Z",
"creator": {
"avatar_url": "https://avatars.githubusercontent.com/u/953992?v=4",
"events_url": "https://api.github.com/users/jreback/events{/privacy}",
"followers_url": "https://api.github.com/users/jreback/followers",
"following_url": "https://api.github.com/users/jreback/following{/other_user}",
"gists_url": "https://api.github.com/users/jreback/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jreback",
"id": 953992,
"login": "jreback",
"node_id": "MDQ6VXNlcjk1Mzk5Mg==",
"organizations_url": "https://api.github.com/users/jreback/orgs",
"received_events_url": "https://api.github.com/users/jreback/received_events",
"repos_url": "https://api.github.com/users/jreback/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jreback/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jreback/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jreback"
},
"description": "on-merge: backport to 1.2.x",
"due_on": "2020-12-15T08:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/73",
"id": 5479819,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/73/labels",
"node_id": "MDk6TWlsZXN0b25lNTQ3OTgxOQ==",
"number": 73,
"open_issues": 0,
"state": "closed",
"title": "1.2",
"updated_at": "2021-04-13T15:46:43Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/73"
}
| 3
| 2020-08-07T21:31:30Z
| 2020-08-11T15:30:43Z
| 2020-08-11T00:35:39Z
|
MEMBER
| null |
DO NOT MERGE - Performance takes a hit
We have edited some of the functions in `tslibs.vectorized to do some pre-processing in order to de-duplicate some code. This new pattern is conducive to refactoring out helper functions for further de-duplication.
So far, moving to the new pattern has been performance-neutral or better. But for the functions which this branch moves to the new pattern, performance takes a hit, particularly for dt64arr_to_periodarray. I am at a loss as to why this would be, hoping more eyeballs will help. cc @WillAyd
```
asv continuous -E virtualenv -f 1.01 master HEAD -b tslibs
[...]
before after ratio
[d82e5403] [9f5d9ef6]
<master~4> <ref-vectorized>
+ 21.4±0.3ms 53.7±6ms 2.51 tslibs.period.TimeDT64ArrToPeriodArr.time_dt64arr_to_periodarr(1000000, 1011, datetime.timezone(datetime.timedelta(seconds=3600)))
+ 248±4μs 613±50μs 2.48 tslibs.period.TimeDT64ArrToPeriodArr.time_dt64arr_to_periodarr(10000, 3000, datetime.timezone(datetime.timedelta(seconds=3600)))
+ 21.9±0.3ms 53.8±6ms 2.46 tslibs.period.TimeDT64ArrToPeriodArr.time_dt64arr_to_periodarr(1000000, 1000, datetime.timezone(datetime.timedelta(seconds=3600)))
+ 238±8μs 574±60μs 2.41 tslibs.period.TimeDT64ArrToPeriodArr.time_dt64arr_to_periodarr(10000, 1011, datetime.timezone(datetime.timedelta(seconds=3600)))
+ 268±3μs 617±70μs 2.30 tslibs.period.TimeDT64ArrToPeriodArr.time_dt64arr_to_periodarr(10000, 7000, datetime.timezone(datetime.timedelta(seconds=3600)))
+ 246±5μs 562±70μs 2.28 tslibs.period.TimeDT64ArrToPeriodArr.time_dt64arr_to_periodarr(10000, 2011, datetime.timezone(datetime.timedelta(seconds=3600)))
+ 282±10μs 636±70μs 2.26 tslibs.period.TimeDT64ArrToPeriodArr.time_dt64arr_to_periodarr(10000, 12000, datetime.timezone(datetime.timedelta(seconds=3600)))
+ 274±20μs 616±70μs 2.24 tslibs.period.TimeDT64ArrToPeriodArr.time_dt64arr_to_periodarr(10000, 11000, datetime.timezone(datetime.timedelta(seconds=3600)))
+ 270±6μs 599±60μs 2.22 tslibs.period.TimeDT64ArrToPeriodArr.time_dt64arr_to_periodarr(10000, 6000, datetime.timezone(datetime.timedelta(seconds=3600)))
+ 248±4μs 544±40μs 2.20 tslibs.period.TimeDT64ArrToPeriodArr.time_dt64arr_to_periodarr(10000, 2000, datetime.timezone(datetime.timedelta(seconds=3600)))
+ 23.4±0.4ms 51.3±2ms 2.19 tslibs.period.TimeDT64ArrToPeriodArr.time_dt64arr_to_periodarr(1000000, 2000, datetime.timezone(datetime.timedelta(seconds=3600)))
+ 278±8μs 605±70μs 2.18 tslibs.period.TimeDT64ArrToPeriodArr.time_dt64arr_to_periodarr(10000, 8000, datetime.timezone(datetime.timedelta(seconds=3600)))
+ 290±9μs 620±100μs 2.14 tslibs.period.TimeDT64ArrToPeriodArr.time_dt64arr_to_periodarr(10000, 9000, datetime.timezone(datetime.timedelta(seconds=3600)))
+ 286±40μs 611±60μs 2.14 tslibs.period.TimeDT64ArrToPeriodArr.time_dt64arr_to_periodarr(10000, 10000, datetime.timezone(datetime.timedelta(seconds=3600)))
+ 259±20μs 538±60μs 2.08 tslibs.period.TimeDT64ArrToPeriodArr.time_dt64arr_to_periodarr(10000, 1000, datetime.timezone(datetime.timedelta(seconds=3600)))
+ 35.5±10ms 73.5±20ms 2.07 tslibs.period.TimeDT64ArrToPeriodArr.time_dt64arr_to_periodarr(1000000, 9000, datetime.timezone(datetime.timedelta(seconds=3600)))
+ 300±5μs 610±60μs 2.03 tslibs.period.TimeDT64ArrToPeriodArr.time_dt64arr_to_periodarr(10000, 4006, datetime.timezone(datetime.timedelta(seconds=3600)))
+ 289±8μs 586±60μs 2.03 tslibs.period.TimeDT64ArrToPeriodArr.time_dt64arr_to_periodarr(10000, 4000, datetime.timezone(datetime.timedelta(seconds=3600)))
+ 38.3±10ms 77.3±20ms 2.02 tslibs.period.TimeDT64ArrToPeriodArr.time_dt64arr_to_periodarr(1000000, 10000, datetime.timezone(datetime.timedelta(seconds=3600)))
+ 36.6±10ms 70.9±20ms 1.94 tslibs.period.TimeDT64ArrToPeriodArr.time_dt64arr_to_periodarr(1000000, 11000, datetime.timezone(datetime.timedelta(seconds=3600)))
+ 26.1±1ms 49.9±1ms 1.91 tslibs.period.TimeDT64ArrToPeriodArr.time_dt64arr_to_periodarr(1000000, 2011, datetime.timezone(datetime.timedelta(seconds=3600)))
+ 38.8±10ms 72.4±20ms 1.87 tslibs.period.TimeDT64ArrToPeriodArr.time_dt64arr_to_periodarr(1000000, 12000, datetime.timezone(datetime.timedelta(seconds=3600)))
+ 27.0±3ms 50.2±0.5ms 1.86 tslibs.period.TimeDT64ArrToPeriodArr.time_dt64arr_to_periodarr(1000000, 3000, datetime.timezone(datetime.timedelta(seconds=3600)))
+ 35.3±10ms 64.6±10ms 1.83 tslibs.period.TimeDT64ArrToPeriodArr.time_dt64arr_to_periodarr(1000000, 7000, datetime.timezone(datetime.timedelta(seconds=3600)))
+ 35.2±9ms 64.3±10ms 1.83 tslibs.period.TimeDT64ArrToPeriodArr.time_dt64arr_to_periodarr(1000000, 6000, datetime.timezone(datetime.timedelta(seconds=3600)))
+ 38.0±1ms 67.7±10ms 1.78 tslibs.period.TimeDT64ArrToPeriodArr.time_dt64arr_to_periodarr(1000000, 4006, datetime.timezone(datetime.timedelta(seconds=3600)))
+ 358±7μs 637±70μs 1.78 tslibs.period.TimeDT64ArrToPeriodArr.time_dt64arr_to_periodarr(10000, 5000, datetime.timezone(datetime.timedelta(seconds=3600)))
+ 9.43±0.2μs 16.7±2μs 1.77 tslibs.resolution.TimeResolution.time_get_resolution('s', 100, tzfile('/usr/share/zoneinfo/Asia/Tokyo'))
+ 3.10±0.04μs 5.49±1μs 1.77 tslibs.fields.TimeGetStartEndField.time_get_start_end_field(1, 'start', 'month', None, 5)
+ 37.7±10ms 66.5±10ms 1.76 tslibs.period.TimeDT64ArrToPeriodArr.time_dt64arr_to_periodarr(1000000, 8000, datetime.timezone(datetime.timedelta(seconds=3600)))
+ 33.5±5ms 57.0±2ms 1.70 tslibs.period.TimeDT64ArrToPeriodArr.time_dt64arr_to_periodarr(1000000, 4000, datetime.timezone(datetime.timedelta(seconds=3600)))
+ 26.5±0.1μs 42.8±10μs 1.61 tslibs.tz_convert.TimeTZConvert.time_tz_localize_to_utc(100, datetime.timezone(datetime.timedelta(seconds=3600)))
+ 45.3±8ms 70.5±10ms 1.56 tslibs.period.TimeDT64ArrToPeriodArr.time_dt64arr_to_periodarr(1000000, 5000, datetime.timezone(datetime.timedelta(seconds=3600)))
+ 24.7±0.2μs 38.2±10μs 1.54 tslibs.tz_convert.TimeTZConvert.time_tz_localize_to_utc(100, <DstTzInfo 'US/Pacific' LMT-1 day, 16:07:00 STD>)
+ 1.55±0.08ms 2.36±0.2ms 1.52 tslibs.normalize.Normalize.time_is_date_array_normalized(1000000, datetime.timezone(datetime.timedelta(seconds=3600)))
+ 327±4ms 491±100ms 1.50 tslibs.tslib.TimeIntsToPydatetime.time_ints_to_pydatetime('time', 1000000, None)
+ 24.7±0.9ms 36.6±10ms 1.48 tslibs.fields.TimeGetDateField.time_get_date_field(1000000, 'dow')
+ 3.29±0.06μs 4.87±1μs 1.48 tslibs.fields.TimeGetStartEndField.time_get_start_end_field(1, 'start', 'month', None, 12)
+ 338±2ms 497±100ms 1.47 tslibs.tslib.TimeIntsToPydatetime.time_ints_to_pydatetime('time', 1000000, datetime.timezone(datetime.timedelta(seconds=3600)))
+ 22.7±0.3μs 32.0±3μs 1.41 tslibs.normalize.Normalize.time_is_date_array_normalized(10000, datetime.timezone(datetime.timedelta(seconds=3600)))
+ 12.2±0.5μs 17.1±4μs 1.41 tslibs.period.TimeDT64ArrToPeriodArr.time_dt64arr_to_periodarr(100, 2000, datetime.timezone(datetime.timedelta(seconds=3600)))
+ 12.0±0.4μs 16.5±4μs 1.38 tslibs.period.TimeDT64ArrToPeriodArr.time_dt64arr_to_periodarr(100, 2011, datetime.timezone(datetime.timedelta(seconds=3600)))
+ 12.1±0.3μs 16.8±2μs 1.38 tslibs.period.TimeDT64ArrToPeriodArr.time_dt64arr_to_periodarr(100, 12000, datetime.timezone(datetime.timedelta(seconds=3600)))
+ 12.2±0.2μs 16.6±2μs 1.36 tslibs.period.TimeDT64ArrToPeriodArr.time_dt64arr_to_periodarr(100, 11000, datetime.timezone(datetime.timedelta(seconds=3600)))
+ 11.7±0.3μs 15.9±1μs 1.35 tslibs.period.TimeDT64ArrToPeriodArr.time_dt64arr_to_periodarr(100, 3000, datetime.timezone(datetime.timedelta(seconds=3600)))
+ 12.6±0.3μs 16.5±2μs 1.31 tslibs.period.TimeDT64ArrToPeriodArr.time_dt64arr_to_periodarr(100, 4000, datetime.timezone(datetime.timedelta(seconds=3600)))
+ 8.89±0.6μs 11.3±1μs 1.27 tslibs.period.TimeDT64ArrToPeriodArr.time_dt64arr_to_periodarr(0, 2000, tzfile('/usr/share/zoneinfo/Asia/Tokyo'))
+ 115±2μs 143±20μs 1.25 tslibs.normalize.Normalize.time_is_date_array_normalized(10000, <DstTzInfo 'US/Pacific' LMT-1 day, 16:07:00 STD>)
+ 12.8±0.3μs 15.9±2μs 1.24 tslibs.period.TimeDT64ArrToPeriodArr.time_dt64arr_to_periodarr(100, 6000, datetime.timezone(datetime.timedelta(seconds=3600)))
+ 61.7±2μs 75.0±7μs 1.22 tslibs.normalize.Normalize.time_is_date_array_normalized(10000, tzfile('/usr/share/zoneinfo/Asia/Tokyo'))
+ 7.58±0.08ms 8.61±0.1ms 1.14 tslibs.normalize.Normalize.time_is_date_array_normalized(1000000, tzfile('/usr/share/zoneinfo/Asia/Tokyo'))
+ 8.80±0.07ms 9.55±0.4ms 1.09 tslibs.normalize.Normalize.time_normalize_i8_timestamps(1000000, tzfile('/usr/share/zoneinfo/Asia/Tokyo'))
- 3.46±0.05μs 3.06±0.1μs 0.89 tslibs.period.TimeDT64ArrToPeriodArr.time_dt64arr_to_periodarr(1, 3000, tzlocal())
- 25.2±0.9ms 21.2±0.5ms 0.84 tslibs.period.TimeDT64ArrToPeriodArr.time_dt64arr_to_periodarr(1000000, 2011, datetime.timezone.utc)
- 2.39±0.1ms 2.01±0.3ms 0.84 tslibs.normalize.Normalize.time_normalize_i8_timestamps(1000000, datetime.timezone(datetime.timedelta(seconds=3600)))
- 47.0±0.5ms 38.7±0.8ms 0.82 tslibs.period.TimeDT64ArrToPeriodArr.time_dt64arr_to_periodarr(1000000, 2011, <DstTzInfo 'US/Pacific' LMT-1 day, 16:07:00 STD>)
- 38.5±3ms 31.2±0.4ms 0.81 tslibs.period.TimeDT64ArrToPeriodArr.time_dt64arr_to_periodarr(1000000, 3000, tzfile('/usr/share/zoneinfo/Asia/Tokyo'))
- 36.4±1ms 29.3±0.7ms 0.81 tslibs.period.TimeDT64ArrToPeriodArr.time_dt64arr_to_periodarr(1000000, 2011, tzfile('/usr/share/zoneinfo/Asia/Tokyo'))
- 25.7±3ms 20.7±0.2ms 0.80 tslibs.period.TimeDT64ArrToPeriodArr.time_dt64arr_to_periodarr(1000000, 3000, datetime.timezone.utc)
- 25.7±3ms 20.5±0.2ms 0.80 tslibs.period.TimeDT64ArrToPeriodArr.time_dt64arr_to_periodarr(1000000, 3000, None)
- 1.88±0.02ms 607±200μs 0.32 tslibs.tz_convert.TimeTZConvert.time_tz_convert_from_utc(1000000, datetime.timezone.utc)
```
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/35613/reactions"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35613/timeline
| null | 0
|
{
"diff_url": "https://github.com/pandas-dev/pandas/pull/35613.diff",
"html_url": "https://github.com/pandas-dev/pandas/pull/35613",
"merged_at": "2020-08-11T00:35:39Z",
"patch_url": "https://github.com/pandas-dev/pandas/pull/35613.patch",
"url": "https://api.github.com/repos/pandas-dev/pandas/pulls/35613"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35614
|
https://api.github.com/repos/pandas-dev/pandas
|
https://api.github.com/repos/pandas-dev/pandas/issues/35614/labels{/name}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35614/comments
|
https://api.github.com/repos/pandas-dev/pandas/issues/35614/events
|
https://github.com/pandas-dev/pandas/issues/35614
| 675,313,247
|
MDU6SXNzdWU2NzUzMTMyNDc=
| 35,614
|
ENH: Make Series.explode work for sets
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/2658661?v=4",
"events_url": "https://api.github.com/users/dsaxton/events{/privacy}",
"followers_url": "https://api.github.com/users/dsaxton/followers",
"following_url": "https://api.github.com/users/dsaxton/following{/other_user}",
"gists_url": "https://api.github.com/users/dsaxton/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/dsaxton",
"id": 2658661,
"login": "dsaxton",
"node_id": "MDQ6VXNlcjI2NTg2NjE=",
"organizations_url": "https://api.github.com/users/dsaxton/orgs",
"received_events_url": "https://api.github.com/users/dsaxton/received_events",
"repos_url": "https://api.github.com/users/dsaxton/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/dsaxton/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/dsaxton/subscriptions",
"type": "User",
"url": "https://api.github.com/users/dsaxton"
}
|
[
{
"color": "4E9A06",
"default": false,
"description": null,
"id": 76812,
"name": "Enhancement",
"node_id": "MDU6TGFiZWw3NjgxMg==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Enhancement"
},
{
"color": "02d7e1",
"default": false,
"description": "Concat, Merge/Join, Stack/Unstack, Explode",
"id": 13098779,
"name": "Reshaping",
"node_id": "MDU6TGFiZWwxMzA5ODc3OQ==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Reshaping"
}
] |
closed
| false
| null |
[] |
{
"closed_at": "2020-12-26T13:57:50Z",
"closed_issues": 1768,
"created_at": "2020-05-29T23:47:32Z",
"creator": {
"avatar_url": "https://avatars.githubusercontent.com/u/953992?v=4",
"events_url": "https://api.github.com/users/jreback/events{/privacy}",
"followers_url": "https://api.github.com/users/jreback/followers",
"following_url": "https://api.github.com/users/jreback/following{/other_user}",
"gists_url": "https://api.github.com/users/jreback/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jreback",
"id": 953992,
"login": "jreback",
"node_id": "MDQ6VXNlcjk1Mzk5Mg==",
"organizations_url": "https://api.github.com/users/jreback/orgs",
"received_events_url": "https://api.github.com/users/jreback/received_events",
"repos_url": "https://api.github.com/users/jreback/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jreback/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jreback/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jreback"
},
"description": "on-merge: backport to 1.2.x",
"due_on": "2020-12-15T08:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/73",
"id": 5479819,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/73/labels",
"node_id": "MDk6TWlsZXN0b25lNTQ3OTgxOQ==",
"number": 73,
"open_issues": 0,
"state": "closed",
"title": "1.2",
"updated_at": "2021-04-13T15:46:43Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/73"
}
| 0
| 2020-08-07T22:06:58Z
| 2020-09-05T22:36:43Z
| 2020-09-05T22:36:43Z
|
MEMBER
| null |
Currently Series.explode does nothing for sets but I think this would be just as useful as lists or tuples. It also allows for a way to easily enforce uniqueness at the row level before exploding.
I don't think this would be breaking, unless something is specifically relying on the operation not working.
```python
import pandas as pd
ser = pd.Series([{1, 2}, {1, 2, 3}])
ser
# 0 {1, 2}
# 1 {1, 2, 3}
# dtype: object
ser.explode()
# 0 {1, 2}
# 1 {1, 2, 3}
# dtype: object
```
Desired output:
```python
ser.explode()
# 0 1
# 0 2
# 1 1
# 1 2
# 1 3
# dtype: object
```
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/35614/reactions"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35614/timeline
| null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/35615
|
https://api.github.com/repos/pandas-dev/pandas
|
https://api.github.com/repos/pandas-dev/pandas/issues/35615/labels{/name}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35615/comments
|
https://api.github.com/repos/pandas-dev/pandas/issues/35615/events
|
https://github.com/pandas-dev/pandas/pull/35615
| 675,325,326
|
MDExOlB1bGxSZXF1ZXN0NDY0ODYyMDY1
| 35,615
|
DOC: compression support for file objects in to_csv
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/6618166?v=4",
"events_url": "https://api.github.com/users/twoertwein/events{/privacy}",
"followers_url": "https://api.github.com/users/twoertwein/followers",
"following_url": "https://api.github.com/users/twoertwein/following{/other_user}",
"gists_url": "https://api.github.com/users/twoertwein/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/twoertwein",
"id": 6618166,
"login": "twoertwein",
"node_id": "MDQ6VXNlcjY2MTgxNjY=",
"organizations_url": "https://api.github.com/users/twoertwein/orgs",
"received_events_url": "https://api.github.com/users/twoertwein/received_events",
"repos_url": "https://api.github.com/users/twoertwein/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/twoertwein/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/twoertwein/subscriptions",
"type": "User",
"url": "https://api.github.com/users/twoertwein"
}
|
[
{
"color": "3465A4",
"default": false,
"description": null,
"id": 134699,
"name": "Docs",
"node_id": "MDU6TGFiZWwxMzQ2OTk=",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Docs"
},
{
"color": "5319e7",
"default": false,
"description": "read_csv, to_csv",
"id": 47229171,
"name": "IO CSV",
"node_id": "MDU6TGFiZWw0NzIyOTE3MQ==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/IO%20CSV"
}
] |
closed
| false
| null |
[] |
{
"closed_at": "2020-12-26T13:57:50Z",
"closed_issues": 1768,
"created_at": "2020-05-29T23:47:32Z",
"creator": {
"avatar_url": "https://avatars.githubusercontent.com/u/953992?v=4",
"events_url": "https://api.github.com/users/jreback/events{/privacy}",
"followers_url": "https://api.github.com/users/jreback/followers",
"following_url": "https://api.github.com/users/jreback/following{/other_user}",
"gists_url": "https://api.github.com/users/jreback/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jreback",
"id": 953992,
"login": "jreback",
"node_id": "MDQ6VXNlcjk1Mzk5Mg==",
"organizations_url": "https://api.github.com/users/jreback/orgs",
"received_events_url": "https://api.github.com/users/jreback/received_events",
"repos_url": "https://api.github.com/users/jreback/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jreback/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jreback/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jreback"
},
"description": "on-merge: backport to 1.2.x",
"due_on": "2020-12-15T08:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/73",
"id": 5479819,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/73/labels",
"node_id": "MDk6TWlsZXN0b25lNTQ3OTgxOQ==",
"number": 73,
"open_issues": 0,
"state": "closed",
"title": "1.2",
"updated_at": "2021-04-13T15:46:43Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/73"
}
| 2
| 2020-08-07T22:45:08Z
| 2020-08-08T01:27:40Z
| 2020-08-08T01:27:40Z
|
CONTRIBUTOR
| null |
- [ ] closes #xxxx
- [ ] tests added / passed
- [x] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] whatsnew entry
I made a mistake in #35129: `to_csv` supports the compression argument for file objects in binary mode (not for file objects in text/non-binary mode).
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/35615/reactions"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35615/timeline
| null | 0
|
{
"diff_url": "https://github.com/pandas-dev/pandas/pull/35615.diff",
"html_url": "https://github.com/pandas-dev/pandas/pull/35615",
"merged_at": "2020-08-08T01:27:39Z",
"patch_url": "https://github.com/pandas-dev/pandas/pull/35615.patch",
"url": "https://api.github.com/repos/pandas-dev/pandas/pulls/35615"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35616
|
https://api.github.com/repos/pandas-dev/pandas
|
https://api.github.com/repos/pandas-dev/pandas/issues/35616/labels{/name}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35616/comments
|
https://api.github.com/repos/pandas-dev/pandas/issues/35616/events
|
https://github.com/pandas-dev/pandas/issues/35616
| 675,327,647
|
MDU6SXNzdWU2NzUzMjc2NDc=
| 35,616
|
QST:TypeError: sum() got an unexpected keyword argument 'skipna'
|
{
"avatar_url": "https://avatars.githubusercontent.com/u/30016993?v=4",
"events_url": "https://api.github.com/users/zanwar369/events{/privacy}",
"followers_url": "https://api.github.com/users/zanwar369/followers",
"following_url": "https://api.github.com/users/zanwar369/following{/other_user}",
"gists_url": "https://api.github.com/users/zanwar369/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/zanwar369",
"id": 30016993,
"login": "zanwar369",
"node_id": "MDQ6VXNlcjMwMDE2OTkz",
"organizations_url": "https://api.github.com/users/zanwar369/orgs",
"received_events_url": "https://api.github.com/users/zanwar369/received_events",
"repos_url": "https://api.github.com/users/zanwar369/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/zanwar369/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/zanwar369/subscriptions",
"type": "User",
"url": "https://api.github.com/users/zanwar369"
}
|
[
{
"color": "729FCF",
"default": false,
"description": null,
"id": 233160,
"name": "Groupby",
"node_id": "MDU6TGFiZWwyMzMxNjA=",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Groupby"
},
{
"color": "009800",
"default": false,
"description": "Duplicate issue or pull request",
"id": 40153326,
"name": "Duplicate Report",
"node_id": "MDU6TGFiZWw0MDE1MzMyNg==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Duplicate%20Report"
}
] |
closed
| false
| null |
[] |
{
"closed_at": null,
"closed_issues": 2361,
"created_at": "2015-02-26T19:29:05Z",
"creator": {
"avatar_url": "https://avatars.githubusercontent.com/u/1020496?v=4",
"events_url": "https://api.github.com/users/jorisvandenbossche/events{/privacy}",
"followers_url": "https://api.github.com/users/jorisvandenbossche/followers",
"following_url": "https://api.github.com/users/jorisvandenbossche/following{/other_user}",
"gists_url": "https://api.github.com/users/jorisvandenbossche/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jorisvandenbossche",
"id": 1020496,
"login": "jorisvandenbossche",
"node_id": "MDQ6VXNlcjEwMjA0OTY=",
"organizations_url": "https://api.github.com/users/jorisvandenbossche/orgs",
"received_events_url": "https://api.github.com/users/jorisvandenbossche/received_events",
"repos_url": "https://api.github.com/users/jorisvandenbossche/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jorisvandenbossche/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jorisvandenbossche/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jorisvandenbossche"
},
"description": "A milestone for closed or open issues for which there is no action needed (eg not a bug, just a question / discussion, nothing to resolve, wontfix, etc).\r\n\r\n",
"due_on": null,
"html_url": "https://github.com/pandas-dev/pandas/milestone/33",
"id": 997544,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/33/labels",
"node_id": "MDk6TWlsZXN0b25lOTk3NTQ0",
"number": 33,
"open_issues": 11,
"state": "open",
"title": "No action",
"updated_at": "2021-11-19T17:33:16Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/33"
}
| 10
| 2020-08-07T22:51:40Z
| 2020-11-20T13:05:40Z
| 2020-11-20T13:05:32Z
|
NONE
| null |
Got the following error when trying to run a groupby sum after updating to the latest pandas:
TypeError: sum() got an unexpected keyword argument 'skipna'
->for row in Holdings[Holdings.Date>HP].groupby(['a','b','c']).sum(skipna=False)[['Balance','Withdrawal']:
....
|
{
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 0,
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/35616/reactions"
}
|
https://api.github.com/repos/pandas-dev/pandas/issues/35616/timeline
| null | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.