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/12804 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/12804/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/12804/comments | https://api.github.com/repos/pandas-dev/pandas/issues/12804/events | https://github.com/pandas-dev/pandas/pull/12804 | 146,115,459 | MDExOlB1bGxSZXF1ZXN0NjUzNzY4NzU= | 12,804 | CLN: cleaning core/common.py | {
"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"
} | [
{
"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": "2016-05-05T00:34:40Z",
"closed_issues": 306,
"created_at": "2016-02-08T15:29:59Z",
"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": "after 0.18.0 of course!",
"due_on": "2016-05-04T07:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/38",
"id": 1570594,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/38/labels",
"node_id": "MDk6TWlsZXN0b25lMTU3MDU5NA==",
"number": 38,
"open_issues": 0,
"state": "closed",
"title": "0.18.1",
"updated_at": "2017-08-10T09:01:26Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/38"
} | 22 | 2016-04-05T21:53:42Z | 2016-04-07T15:03:51Z | 2016-04-06T23:02:33Z | CONTRIBUTOR | null | partial on #12503
- create `pandas/types`
- moved _some_ dtype to `pandas/types`
- move _some_ missing value utils to `pandas/core/missing`
- move `.take` and `.diff` to `core/algorithms`
- create `formats` with `core/formats,style` moved and `printing.py` (form `core/common.py`)
- removed some non-used functions
| {
"+1": 0,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 1,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 1,
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/12804/reactions"
} | https://api.github.com/repos/pandas-dev/pandas/issues/12804/timeline | null | 0 | {
"diff_url": "https://github.com/pandas-dev/pandas/pull/12804.diff",
"html_url": "https://github.com/pandas-dev/pandas/pull/12804",
"merged_at": null,
"patch_url": "https://github.com/pandas-dev/pandas/pull/12804.patch",
"url": "https://api.github.com/repos/pandas-dev/pandas/pulls/12804"
} |
https://api.github.com/repos/pandas-dev/pandas/issues/12805 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/12805/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/12805/comments | https://api.github.com/repos/pandas-dev/pandas/issues/12805/events | https://github.com/pandas-dev/pandas/issues/12805 | 146,122,540 | MDU6SXNzdWUxNDYxMjI1NDA= | 12,805 | ENH: add month_name to DatetimeIndex and .dt | {
"avatar_url": "https://avatars.githubusercontent.com/u/478375?v=4",
"events_url": "https://api.github.com/users/BastiaanBergman/events{/privacy}",
"followers_url": "https://api.github.com/users/BastiaanBergman/followers",
"following_url": "https://api.github.com/users/BastiaanBergman/following{/other_user}",
"gists_url": "https://api.github.com/users/BastiaanBergman/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/BastiaanBergman",
"id": 478375,
"login": "BastiaanBergman",
"node_id": "MDQ6VXNlcjQ3ODM3NQ==",
"organizations_url": "https://api.github.com/users/BastiaanBergman/orgs",
"received_events_url": "https://api.github.com/users/BastiaanBergman/received_events",
"repos_url": "https://api.github.com/users/BastiaanBergman/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/BastiaanBergman/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/BastiaanBergman/subscriptions",
"type": "User",
"url": "https://api.github.com/users/BastiaanBergman"
} | [
{
"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": "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"
}
]
| closed | false | null | []
| {
"closed_at": "2018-05-16T03:09:58Z",
"closed_issues": 1645,
"created_at": "2017-10-20T10:17:09Z",
"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": "after 0.22",
"due_on": "2018-05-15T07:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/53",
"id": 2853937,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/53/labels",
"node_id": "MDk6TWlsZXN0b25lMjg1MzkzNw==",
"number": 53,
"open_issues": 0,
"state": "closed",
"title": "0.23.0",
"updated_at": "2018-08-20T06:48:57Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/53"
} | 1 | 2016-04-05T22:24:33Z | 2018-03-04T20:15:38Z | 2018-03-04T20:15:38Z | NONE | null | Add a month name property to DatetimeIndex and the .dt accessor; similar to weekday_name (GH12803).
#### Code Sample:
```
i = pd.date_range('20150112 08:34:23', periods = 4, freq = '1D')
i.month_name
d = pd.Timestamp("2016-04-04")
d.month_name
s = pd.Series(i, range(4))
s.dt.month_name
```
#### Expected Output:
```
array(['January', 'January', 'January', 'January'], dtype=object)
'April'
0 January
1 January
2 January
3 January
dtype: object
```
| {
"+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/12805/reactions"
} | https://api.github.com/repos/pandas-dev/pandas/issues/12805/timeline | null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/12806 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/12806/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/12806/comments | https://api.github.com/repos/pandas-dev/pandas/issues/12806/events | https://github.com/pandas-dev/pandas/issues/12806 | 146,125,796 | MDU6SXNzdWUxNDYxMjU3OTY= | 12,806 | ENH: Use LocaleTime for date_field_name output | {
"avatar_url": "https://avatars.githubusercontent.com/u/478375?v=4",
"events_url": "https://api.github.com/users/BastiaanBergman/events{/privacy}",
"followers_url": "https://api.github.com/users/BastiaanBergman/followers",
"following_url": "https://api.github.com/users/BastiaanBergman/following{/other_user}",
"gists_url": "https://api.github.com/users/BastiaanBergman/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/BastiaanBergman",
"id": 478375,
"login": "BastiaanBergman",
"node_id": "MDQ6VXNlcjQ3ODM3NQ==",
"organizations_url": "https://api.github.com/users/BastiaanBergman/orgs",
"received_events_url": "https://api.github.com/users/BastiaanBergman/received_events",
"repos_url": "https://api.github.com/users/BastiaanBergman/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/BastiaanBergman/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/BastiaanBergman/subscriptions",
"type": "User",
"url": "https://api.github.com/users/BastiaanBergman"
} | [
{
"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": "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"
}
]
| closed | false | null | []
| {
"closed_at": "2018-05-16T03:09:58Z",
"closed_issues": 1645,
"created_at": "2017-10-20T10:17:09Z",
"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": "after 0.22",
"due_on": "2018-05-15T07:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/53",
"id": 2853937,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/53/labels",
"node_id": "MDk6TWlsZXN0b25lMjg1MzkzNw==",
"number": 53,
"open_issues": 0,
"state": "closed",
"title": "0.23.0",
"updated_at": "2018-08-20T06:48:57Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/53"
} | 0 | 2016-04-05T22:34:10Z | 2018-03-04T20:15:38Z | 2018-03-04T20:15:38Z | NONE | null | Instantiate LocaleTime and use the property .f_weekday to generate weekday and month names.
Currently datename strings are pulled from a hard coded (English) array in get_date_name_field() in tslib.py, better to pull these from a Locale adjusted array.
### Code Sample:
pd.Timestamp("2016-04-06").weekday_name
### Expected Output
e.g. for the a platform with Dutch locale:
'woensdag'
| {
"+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/12806/reactions"
} | https://api.github.com/repos/pandas-dev/pandas/issues/12806/timeline | null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/12807 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/12807/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/12807/comments | https://api.github.com/repos/pandas-dev/pandas/issues/12807/events | https://github.com/pandas-dev/pandas/issues/12807 | 146,129,460 | MDU6SXNzdWUxNDYxMjk0NjA= | 12,807 | BUG: test_clipboard fails | {
"avatar_url": "https://avatars.githubusercontent.com/u/478375?v=4",
"events_url": "https://api.github.com/users/BastiaanBergman/events{/privacy}",
"followers_url": "https://api.github.com/users/BastiaanBergman/followers",
"following_url": "https://api.github.com/users/BastiaanBergman/following{/other_user}",
"gists_url": "https://api.github.com/users/BastiaanBergman/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/BastiaanBergman",
"id": 478375,
"login": "BastiaanBergman",
"node_id": "MDQ6VXNlcjQ3ODM3NQ==",
"organizations_url": "https://api.github.com/users/BastiaanBergman/orgs",
"received_events_url": "https://api.github.com/users/BastiaanBergman/received_events",
"repos_url": "https://api.github.com/users/BastiaanBergman/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/BastiaanBergman/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/BastiaanBergman/subscriptions",
"type": "User",
"url": "https://api.github.com/users/BastiaanBergman"
} | [
{
"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": "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"
}
]
| closed | false | null | []
| {
"closed_at": "2016-12-24T22:50:46Z",
"closed_issues": 107,
"created_at": "2016-11-12T15:44:46Z",
"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": "after 0.19.1",
"due_on": "2016-12-24T08:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/45",
"id": 2131068,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/45/labels",
"node_id": "MDk6TWlsZXN0b25lMjEzMTA2OA==",
"number": 45,
"open_issues": 0,
"state": "closed",
"title": "0.19.2",
"updated_at": "2017-01-29T09:53:52Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/45"
} | 1 | 2016-04-05T22:46:07Z | 2016-11-18T22:43:19Z | 2016-11-18T22:42:37Z | NONE | null | nosetests pandas/io/tests/test_clipboard.py
fails on Windows 7 Professional SP1
### Code Sample
`nosetests pandas/io/tests/test_clipboard.py`
### Output
```
.EE.
======================================================================
ERROR: test_round_trip_frame (pandas.io.tests.test_clipboard.TestClipboard)
----------------------------------------------------------------------
Traceback (most recent call last):
File "C:\...\pandas\io\tests\test_clipboard.py", line 81, in test_rou
nd_trip_frame
self.check_round_trip_frame(dt)
File "C:\...\pandas\io\tests\test_clipboard.py", line 68, in check_ro
und_trip_frame
result = read_clipboard()
File "C:\...\pandas\io\clipboard.py", line 36, in read_clipboard
lines = text[:10000].split('\n')[:-1][:10]
TypeError: 'NoneType' object has no attribute '__getitem__'
======================================================================
ERROR: test_round_trip_frame_sep (pandas.io.tests.test_clipboard.TestClipboard)
----------------------------------------------------------------------
Traceback (most recent call last):
File "C:\...\pandas\io\tests\test_clipboard.py", line 73, in test_rou
nd_trip_frame_sep
self.check_round_trip_frame(dt, sep=',')
File "C:\...\pandas\io\tests\test_clipboard.py", line 69, in check_ro
und_trip_frame
tm.assert_frame_equal(data, result, check_dtype=False)
File "C:\...\pandas\util\testing.py", line 1164, in assert_frame_equa
l
obj='DataFrame.iloc[:, {0}]'.format(i))
File "C:\...\pandas\util\testing.py", line 1047, in assert_series_equ
al
check_less_precise, obj='{0}'.format(obj))
File "pandas\src\testing.pyx", line 58, in pandas._testing.assert_almost_equal (pandas\src\testing.c:3809)
cpdef assert_almost_equal(a, b, bint check_less_precise=False,
File "pandas\src\testing.pyx", line 147, in pandas._testing.assert_almost_equal (pandas\src\testing.c:2685)
raise_assert_detail(obj, msg, lobj, robj)
File "C:\...\pandas\util\testing.py", line 912, in raise_assert_detai
l
[right]: {3}""".format(obj, message, left, right)
UnicodeEncodeError: 'ascii' codec can't encode character u'\xf1' in position 9: ordinal not in range(128)
----------------------------------------------------------------------
Ran 4 tests in 0.132s
FAILED (errors=2)
```
### output of `pd.show_versions()`
```
>>> pd.show_versions()
INSTALLED VERSIONS
------------------
commit: 6f246d5022dec8c9d85e4103ec8dc89f8d981502
python: 2.7.11.final.0
python-bits: 64
OS: Windows
OS-release: 7
machine: AMD64
processor: Intel64 Family 6 Model 69 Stepping 1, GenuineIntel
byteorder: little
LC_ALL: None
LANG: None
pandas: 0.18.0+80.g6f246d5
nose: 1.3.7
pip: 8.1.1
setuptools: 20.3
Cython: 0.23.4
numpy: 1.10.4
scipy: None
statsmodels: None
xarray: None
IPython: None
sphinx: None
patsy: None
dateutil: 2.5.1
pytz: 2016.2
blosc: None
bottleneck: None
tables: None
numexpr: None
matplotlib: None
openpyxl: None
xlrd: None
xlwt: None
xlsxwriter: None
lxml: None
bs4: None
html5lib: None
httplib2: None
apiclient: None
sqlalchemy: None
pymysql: None
psycopg2: None
jinja2: None
boto: None
pandas_datareader: None
>>>
```
| {
"+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/12807/reactions"
} | https://api.github.com/repos/pandas-dev/pandas/issues/12807/timeline | null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/12808 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/12808/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/12808/comments | https://api.github.com/repos/pandas-dev/pandas/issues/12808/events | https://github.com/pandas-dev/pandas/issues/12808 | 146,137,101 | MDU6SXNzdWUxNDYxMzcxMDE= | 12,808 | Garbled dates in pandas 0.18.0 | {
"avatar_url": "https://avatars.githubusercontent.com/u/1923000?v=4",
"events_url": "https://api.github.com/users/aisthesis/events{/privacy}",
"followers_url": "https://api.github.com/users/aisthesis/followers",
"following_url": "https://api.github.com/users/aisthesis/following{/other_user}",
"gists_url": "https://api.github.com/users/aisthesis/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/aisthesis",
"id": 1923000,
"login": "aisthesis",
"node_id": "MDQ6VXNlcjE5MjMwMDA=",
"organizations_url": "https://api.github.com/users/aisthesis/orgs",
"received_events_url": "https://api.github.com/users/aisthesis/received_events",
"repos_url": "https://api.github.com/users/aisthesis/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/aisthesis/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/aisthesis/subscriptions",
"type": "User",
"url": "https://api.github.com/users/aisthesis"
} | [
{
"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"
}
]
| closed | false | null | []
| null | 9 | 2016-04-05T23:27:01Z | 2016-04-06T16:47:29Z | 2016-04-05T23:39:47Z | NONE | null | Using pandas 0.18.0 and pandas-datareader 0.2.1:
```
>>> from pandas_datareader.data import Options
>>> tsla = Options('tsla', 'yahoo')
>>> data = tsla.get_all_data()
>>> data.index.levels[1]
DatetimeIndex(['2008-04-16', '2015-04-16', '2016-09-16', '2017-06-16',
'2019-01-18', '2020-01-17', '2020-05-16', '2022-04-16',
'2029-04-16'],
dtype='datetime64[ns]', name='Expiry', freq=None)
```
The above expiries are non-sensical and are the result of confusing the day of the month with the year. Using pandas 0.17.1 and pandas-datareader 0.2.1, I correctly get:
```
>>> from pandas_datareader.data import Options
>>> tsla = Options('tsla', 'yahoo')
>>> data = tsla.get_all_data()
>>> data.index.levels[1]
DatetimeIndex(['2016-04-08', '2016-04-15', '2016-04-22', '2016-04-29',
'2016-05-06', '2016-05-13', '2016-05-20', '2016-06-17',
'2016-09-16', '2017-01-20', '2018-01-19'],
dtype='datetime64[ns]', name='Expiry', freq=None)
```
The relevant code seems to be run by `pandas.io.parsers.TextParser`, but I haven't tracked it further.
Cf. pydata/pandas-datareader#193 and aisthesis/pynance#28
| {
"+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/12808/reactions"
} | https://api.github.com/repos/pandas-dev/pandas/issues/12808/timeline | null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/12809 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/12809/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/12809/comments | https://api.github.com/repos/pandas-dev/pandas/issues/12809/events | https://github.com/pandas-dev/pandas/issues/12809 | 146,142,409 | MDU6SXNzdWUxNDYxNDI0MDk= | 12,809 | Pandas read_sas error: 'ascii' codec can't decode byte 0xd8 in position 0: ordinal not in range(128) | {
"avatar_url": "https://avatars.githubusercontent.com/u/8282510?v=4",
"events_url": "https://api.github.com/users/randomgambit/events{/privacy}",
"followers_url": "https://api.github.com/users/randomgambit/followers",
"following_url": "https://api.github.com/users/randomgambit/following{/other_user}",
"gists_url": "https://api.github.com/users/randomgambit/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/randomgambit",
"id": 8282510,
"login": "randomgambit",
"node_id": "MDQ6VXNlcjgyODI1MTA=",
"organizations_url": "https://api.github.com/users/randomgambit/orgs",
"received_events_url": "https://api.github.com/users/randomgambit/received_events",
"repos_url": "https://api.github.com/users/randomgambit/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/randomgambit/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/randomgambit/subscriptions",
"type": "User",
"url": "https://api.github.com/users/randomgambit"
} | [
{
"color": "444444",
"default": false,
"description": "Unicode strings",
"id": 36380025,
"name": "Unicode",
"node_id": "MDU6TGFiZWwzNjM4MDAyNQ==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Unicode"
},
{
"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": "2016-05-05T00:34:40Z",
"closed_issues": 306,
"created_at": "2016-02-08T15:29:59Z",
"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": "after 0.18.0 of course!",
"due_on": "2016-05-04T07:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/38",
"id": 1570594,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/38/labels",
"node_id": "MDk6TWlsZXN0b25lMTU3MDU5NA==",
"number": 38,
"open_issues": 0,
"state": "closed",
"title": "0.18.1",
"updated_at": "2017-08-10T09:01:26Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/38"
} | 22 | 2016-04-05T23:54:25Z | 2016-04-22T15:09:57Z | 2016-04-22T15:09:57Z | NONE | null | Hello everybody,
I am using **Pandas 0.18** to open a `sas7bdat` dataset
I simply use:
```
df=pd.read_sas('P:/myfile.sas7bdat')
```
and I get the following error
```
buf[0:text_block_size].rstrip(b"\x00 ").decode())
UnicodeDecodeError: 'ascii' codec can't decode byte 0xd8 in position 0: ordinal not in range(128)
```
If I use
```
import sys
reload(sys)
sys.setdefaultencoding("utf-8")
```
I get
```
UnicodeDecodeError: 'utf8' codec can't decode byte 0xd8 in position 0: invalid continuation byte
```
Other `sas7bdat` files in my folder are handled just fine by Pandas.
When I open the file in SAS I see that the column names are very long and span several lines, but otherwise the files look just fine.
There are not so many possible options in `read_sas`... what should I do? Is this a bug in `read_sas`?
Many 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/12809/reactions"
} | https://api.github.com/repos/pandas-dev/pandas/issues/12809/timeline | null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/12810 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/12810/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/12810/comments | https://api.github.com/repos/pandas-dev/pandas/issues/12810/events | https://github.com/pandas-dev/pandas/pull/12810 | 146,284,924 | MDExOlB1bGxSZXF1ZXN0NjU0NTA5MzI= | 12,810 | COMPAT: Expand compatibility with fromnumeric.py | {
"avatar_url": "https://avatars.githubusercontent.com/u/9273653?v=4",
"events_url": "https://api.github.com/users/gfyoung/events{/privacy}",
"followers_url": "https://api.github.com/users/gfyoung/followers",
"following_url": "https://api.github.com/users/gfyoung/following{/other_user}",
"gists_url": "https://api.github.com/users/gfyoung/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/gfyoung",
"id": 9273653,
"login": "gfyoung",
"node_id": "MDQ6VXNlcjkyNzM2NTM=",
"organizations_url": "https://api.github.com/users/gfyoung/orgs",
"received_events_url": "https://api.github.com/users/gfyoung/received_events",
"repos_url": "https://api.github.com/users/gfyoung/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/gfyoung/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/gfyoung/subscriptions",
"type": "User",
"url": "https://api.github.com/users/gfyoung"
} | [
{
"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"
}
]
| closed | false | null | []
| {
"closed_at": "2016-05-05T00:34:40Z",
"closed_issues": 306,
"created_at": "2016-02-08T15:29:59Z",
"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": "after 0.18.0 of course!",
"due_on": "2016-05-04T07:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/38",
"id": 1570594,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/38/labels",
"node_id": "MDk6TWlsZXN0b25lMTU3MDU5NA==",
"number": 38,
"open_issues": 0,
"state": "closed",
"title": "0.18.1",
"updated_at": "2017-08-10T09:01:26Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/38"
} | 47 | 2016-04-06T11:35:00Z | 2018-06-28T03:09:34Z | 2016-05-01T15:11:59Z | MEMBER | null | Fixes up OR addresses what are AFAICT almost if not all of the incompatibilities `pandas` currently has with `numpy.core.fromnumeric`. My goodness, were there a lot of them.
Closes #12638.
Closes #12644.
Closes #12687.
| {
"+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/12810/reactions"
} | https://api.github.com/repos/pandas-dev/pandas/issues/12810/timeline | null | 0 | {
"diff_url": "https://github.com/pandas-dev/pandas/pull/12810.diff",
"html_url": "https://github.com/pandas-dev/pandas/pull/12810",
"merged_at": null,
"patch_url": "https://github.com/pandas-dev/pandas/pull/12810.patch",
"url": "https://api.github.com/repos/pandas-dev/pandas/pulls/12810"
} |
https://api.github.com/repos/pandas-dev/pandas/issues/12811 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/12811/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/12811/comments | https://api.github.com/repos/pandas-dev/pandas/issues/12811/events | https://github.com/pandas-dev/pandas/issues/12811 | 146,310,797 | MDU6SXNzdWUxNDYzMTA3OTc= | 12,811 | fromnumeric.py compatibility with GroupBy, Window, and tslib functions | {
"avatar_url": "https://avatars.githubusercontent.com/u/9273653?v=4",
"events_url": "https://api.github.com/users/gfyoung/events{/privacy}",
"followers_url": "https://api.github.com/users/gfyoung/followers",
"following_url": "https://api.github.com/users/gfyoung/following{/other_user}",
"gists_url": "https://api.github.com/users/gfyoung/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/gfyoung",
"id": 9273653,
"login": "gfyoung",
"node_id": "MDQ6VXNlcjkyNzM2NTM=",
"organizations_url": "https://api.github.com/users/gfyoung/orgs",
"received_events_url": "https://api.github.com/users/gfyoung/received_events",
"repos_url": "https://api.github.com/users/gfyoung/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/gfyoung/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/gfyoung/subscriptions",
"type": "User",
"url": "https://api.github.com/users/gfyoung"
} | [
{
"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"
}
]
| closed | false | null | []
| {
"closed_at": "2016-10-03T08:52:13Z",
"closed_issues": 733,
"created_at": "2016-03-11T21:24:45Z",
"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": "",
"due_on": "2016-09-30T07:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/40",
"id": 1639795,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/40/labels",
"node_id": "MDk6TWlsZXN0b25lMTYzOTc5NQ==",
"number": 40,
"open_issues": 0,
"state": "closed",
"title": "0.19.0",
"updated_at": "2017-11-06T02:01:14Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/40"
} | 8 | 2016-04-06T13:16:42Z | 2016-05-20T13:19:33Z | 2016-05-20T13:19:33Z | MEMBER | null | In #12810, it was decided that compatibility for `groupby` (including `resample.py`) and `window` functions would be left for a separate PR / discussion, which seems reasonable given how massive #12810 already is. This issue serves a reminder to tackle this after landing #12810, as it seems like this can be easily addressed afterwards.
| {
"+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/12811/reactions"
} | https://api.github.com/repos/pandas-dev/pandas/issues/12811/timeline | null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/12812 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/12812/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/12812/comments | https://api.github.com/repos/pandas-dev/pandas/issues/12812/events | https://github.com/pandas-dev/pandas/pull/12812 | 146,343,578 | MDExOlB1bGxSZXF1ZXN0NjU0ODI3ODk= | 12,812 | TST: Split sparse tests | {
"avatar_url": "https://avatars.githubusercontent.com/u/1696302?v=4",
"events_url": "https://api.github.com/users/sinhrks/events{/privacy}",
"followers_url": "https://api.github.com/users/sinhrks/followers",
"following_url": "https://api.github.com/users/sinhrks/following{/other_user}",
"gists_url": "https://api.github.com/users/sinhrks/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/sinhrks",
"id": 1696302,
"login": "sinhrks",
"node_id": "MDQ6VXNlcjE2OTYzMDI=",
"organizations_url": "https://api.github.com/users/sinhrks/orgs",
"received_events_url": "https://api.github.com/users/sinhrks/received_events",
"repos_url": "https://api.github.com/users/sinhrks/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/sinhrks/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sinhrks/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sinhrks"
} | [
{
"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": "009800",
"default": false,
"description": "Sparse Data Type",
"id": 49182326,
"name": "Sparse",
"node_id": "MDU6TGFiZWw0OTE4MjMyNg==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Sparse"
}
]
| closed | false | null | []
| {
"closed_at": "2016-05-05T00:34:40Z",
"closed_issues": 306,
"created_at": "2016-02-08T15:29:59Z",
"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": "after 0.18.0 of course!",
"due_on": "2016-05-04T07:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/38",
"id": 1570594,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/38/labels",
"node_id": "MDk6TWlsZXN0b25lMTU3MDU5NA==",
"number": 38,
"open_issues": 0,
"state": "closed",
"title": "0.18.1",
"updated_at": "2017-08-10T09:01:26Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/38"
} | 1 | 2016-04-06T15:07:31Z | 2016-04-06T22:43:33Z | 2016-04-06T22:43:29Z | MEMBER | null | - [x] tests added / passed
- [x] passes `git diff upstream/master | flake8 --diff`
split series, frame and panel tests to separated files.
| {
"+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/12812/reactions"
} | https://api.github.com/repos/pandas-dev/pandas/issues/12812/timeline | null | 0 | {
"diff_url": "https://github.com/pandas-dev/pandas/pull/12812.diff",
"html_url": "https://github.com/pandas-dev/pandas/pull/12812",
"merged_at": null,
"patch_url": "https://github.com/pandas-dev/pandas/pull/12812.patch",
"url": "https://api.github.com/repos/pandas-dev/pandas/pulls/12812"
} |
https://api.github.com/repos/pandas-dev/pandas/issues/12813 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/12813/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/12813/comments | https://api.github.com/repos/pandas-dev/pandas/issues/12813/events | https://github.com/pandas-dev/pandas/issues/12813 | 146,345,258 | MDU6SXNzdWUxNDYzNDUyNTg= | 12,813 | Factorize fails with read-only array | {
"avatar_url": "https://avatars.githubusercontent.com/u/1197350?v=4",
"events_url": "https://api.github.com/users/rabernat/events{/privacy}",
"followers_url": "https://api.github.com/users/rabernat/followers",
"following_url": "https://api.github.com/users/rabernat/following{/other_user}",
"gists_url": "https://api.github.com/users/rabernat/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/rabernat",
"id": 1197350,
"login": "rabernat",
"node_id": "MDQ6VXNlcjExOTczNTA=",
"organizations_url": "https://api.github.com/users/rabernat/orgs",
"received_events_url": "https://api.github.com/users/rabernat/received_events",
"repos_url": "https://api.github.com/users/rabernat/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/rabernat/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/rabernat/subscriptions",
"type": "User",
"url": "https://api.github.com/users/rabernat"
} | [
{
"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": "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"
}
]
| closed | false | null | []
| {
"closed_at": "2019-01-26T00:51:26Z",
"closed_issues": 2048,
"created_at": "2018-03-29T12:00:12Z",
"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": "",
"due_on": "2019-01-31T08:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/55",
"id": 3228419,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/55/labels",
"node_id": "MDk6TWlsZXN0b25lMzIyODQxOQ==",
"number": 55,
"open_issues": 0,
"state": "closed",
"title": "0.24.0",
"updated_at": "2019-01-29T07:42:40Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/55"
} | 2 | 2016-04-06T15:14:20Z | 2018-07-08T14:14:25Z | 2018-07-08T14:14:25Z | NONE | null | same as in #15286
Factorize raises a cython error when used with a read-only array. Seems related to #10043 and #10070. I discovered this via xarray via pydata/xarray#818.
#### Code Sample, a copy-pastable example if possible
``` python
a = np.arange(2)
a.flags.writeable = False
pd.factorize(a)
```
Raises the following
```
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-54-dddd925d767a> in <module>()
1 a = np.arange(10)
2 a.flags.writeable = False
----> 3 pd.factorize(a)
/Users/rpa/anaconda/lib/python2.7/site-packages/pandas/core/algorithms.pyc in factorize(values, sort, order, na_sentinel, size_hint)
194 table = hash_klass(size_hint or len(vals))
195 uniques = vec_klass()
--> 196 labels = table.get_labels(vals, uniques, 0, na_sentinel, True)
197
198 labels = com._ensure_platform_int(labels)
pandas/hashtable.pyx in pandas.hashtable.Int64HashTable.get_labels (pandas/hashtable.c:7893)()
/Users/rpa/anaconda/lib/python2.7/site-packages/pandas/hashtable.so in View.MemoryView.memoryview_cwrapper (pandas/hashtable.c:29882)()
/Users/rpa/anaconda/lib/python2.7/site-packages/pandas/hashtable.so in View.MemoryView.memoryview.__cinit__ (pandas/hashtable.c:26251)()
ValueError: buffer source array is read-only
```
#### Expected Output
Should be the same as with a non-read-only array
``` python
>>> pd.factorize(np.arange(2))
(array([0, 1]), array([0, 1]))
```
#### output of `pd.show_versions()`
commit: None
python: 2.7.11.final.0
python-bits: 64
OS: Darwin
OS-release: 14.5.0
machine: x86_64
processor: i386
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8
pandas: 0.18.0
nose: 1.3.7
pip: 8.1.0
setuptools: 20.2.2
Cython: 0.22.1
numpy: 1.10.4
scipy: 0.16.0
statsmodels: 0.6.1
xarray: 0.7.2-4-g33efdcd
IPython: 4.0.0
sphinx: 1.2.3
patsy: 0.3.0
dateutil: 2.5.0
pytz: 2016.1
blosc: None
bottleneck: 1.0.0
tables: 3.2.1.1
numexpr: 2.5.1
matplotlib: 1.4.3
openpyxl: 1.8.5
xlrd: 0.9.3
xlwt: 1.0.0
xlsxwriter: 0.7.3
lxml: 3.4.4
bs4: 4.3.2
html5lib: None
httplib2: None
apiclient: None
sqlalchemy: 1.0.5
pymysql: None
psycopg2: 2.6 (dt dec pq3 ext)
jinja2: 2.8
boto: 2.38.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/12813/reactions"
} | https://api.github.com/repos/pandas-dev/pandas/issues/12813/timeline | null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/12814 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/12814/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/12814/comments | https://api.github.com/repos/pandas-dev/pandas/issues/12814/events | https://github.com/pandas-dev/pandas/issues/12814 | 146,359,801 | MDU6SXNzdWUxNDYzNTk4MDE= | 12,814 | BUG: merging with mixed types objects in py3 when unorderable | {
"avatar_url": "https://avatars.githubusercontent.com/u/949444?v=4",
"events_url": "https://api.github.com/users/sbuser/events{/privacy}",
"followers_url": "https://api.github.com/users/sbuser/followers",
"following_url": "https://api.github.com/users/sbuser/following{/other_user}",
"gists_url": "https://api.github.com/users/sbuser/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/sbuser",
"id": 949444,
"login": "sbuser",
"node_id": "MDQ6VXNlcjk0OTQ0NA==",
"organizations_url": "https://api.github.com/users/sbuser/orgs",
"received_events_url": "https://api.github.com/users/sbuser/received_events",
"repos_url": "https://api.github.com/users/sbuser/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/sbuser/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sbuser/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sbuser"
} | [
{
"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": "e102d8",
"default": false,
"description": "Unexpected or buggy dtype conversions",
"id": 31404521,
"name": "Dtype Conversions",
"node_id": "MDU6TGFiZWwzMTQwNDUyMQ==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Dtype%20Conversions"
}
]
| closed | false | null | []
| {
"closed_at": "2016-10-03T08:52:13Z",
"closed_issues": 733,
"created_at": "2016-03-11T21:24:45Z",
"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": "",
"due_on": "2016-09-30T07:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/40",
"id": 1639795,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/40/labels",
"node_id": "MDk6TWlsZXN0b25lMTYzOTc5NQ==",
"number": 40,
"open_issues": 0,
"state": "closed",
"title": "0.19.0",
"updated_at": "2017-11-06T02:01:14Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/40"
} | 6 | 2016-04-06T16:03:22Z | 2016-07-19T01:52:00Z | 2016-07-19T01:52:00Z | NONE | null | #### Code Sample, a copy-pastable example if possible
```
df1 = dfAllStudies.copy(deep=True) #make 2 copies of the same data
df2 = dfAllStudies.copy(deep=True)
#take a subset of 1 of the identical frames by dropping rows with certain dates
df2 = df2[(df2['Reviewed on'] >= np.datetime64(DateWindowStart))]
#attempt to merge the frames on indexes
common = pd.merge(df1, df2, left_index=True, right_index=True)
```
Whatever my data looks like, a copy, minus some rows, merged (on indexes) with a copy should function without error, no?
#### Expected Output
> ```
> a merged dataframe and not:
> ```
`\Anaconda3\lib\site-packages\pandas\tools\merge.py", line 535, in _get_join_indexers
llab, rlab, shape = map(list, zip(* map(fkeys, left_keys, right_keys)))
TypeError: type object argument after * must be a sequence, not map`
#### output of `pd.show_versions()`
## INSTALLED VERSIONS
commit: None
python: 3.5.1.final.0
python-bits: 64
OS: Windows
OS-release: 7
machine: AMD64
processor: Intel64 Family 6 Model 30 Stepping 5, GenuineIntel
byteorder: little
LC_ALL: None
LANG: None
pandas: 0.18.0
nose: 1.3.7
pip: 8.1.0
setuptools: 20.2.2
Cython: 0.23.4
numpy: 1.10.4
scipy: 0.17.0
statsmodels: 0.6.1
xarray: None
IPython: 4.0.3
sphinx: 1.3.1
patsy: 0.4.0
dateutil: 2.4.2
pytz: 2015.7
blosc: None
bottleneck: 1.0.0
tables: 3.2.2
numexpr: 2.4.6
matplotlib: 1.5.1
openpyxl: 2.3.2
xlrd: 0.9.4
xlwt: 1.0.0
xlsxwriter: 0.8.4
lxml: 3.5.0
bs4: 4.4.1
html5lib: None
httplib2: None
apiclient: None
sqlalchemy: 1.0.11
pymysql: None
psycopg2: None
jinja2: 2.8
boto: 2.39.0
None
| {
"+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/12814/reactions"
} | https://api.github.com/repos/pandas-dev/pandas/issues/12814/timeline | null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/12815 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/12815/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/12815/comments | https://api.github.com/repos/pandas-dev/pandas/issues/12815/events | https://github.com/pandas-dev/pandas/issues/12815 | 146,360,337 | MDU6SXNzdWUxNDYzNjAzMzc= | 12,815 | BUG: unstacking with object columns defaults to None as a fill value | {
"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"
} | [
{
"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"
}
]
| closed | false | null | []
| {
"closed_at": "2018-05-16T03:09:58Z",
"closed_issues": 1645,
"created_at": "2017-10-20T10:17:09Z",
"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": "after 0.22",
"due_on": "2018-05-15T07:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/53",
"id": 2853937,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/53/labels",
"node_id": "MDk6TWlsZXN0b25lMjg1MzkzNw==",
"number": 53,
"open_issues": 0,
"state": "closed",
"title": "0.23.0",
"updated_at": "2018-08-20T06:48:57Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/53"
} | 5 | 2016-04-06T16:05:34Z | 2017-11-21T00:41:13Z | 2017-11-21T00:41:13Z | CONTRIBUTOR | null | ```
In [41]: df = DataFrame({'A' : [1,1,2], 'B' : list('aba'), 'C' : ['foo', np.nan, 'bar']}).set_index(['A','B'])
In [42]: df.unstack('B')
Out[42]:
C
B a b
A
1 foo NaN
2 bar None
In [43]: df.unstack('B', fill_value=np.nan)
Out[43]:
C
B a b
A
1 foo NaN
2 bar NaN
```
Introduced is this PR: https://github.com/pydata/pandas/pull/10246
you can make a case to do this as we DO support `None` as a fill value, but almost always even with object columns we use `np.nan`, unless very explicity set by the user.
| {
"+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/12815/reactions"
} | https://api.github.com/repos/pandas-dev/pandas/issues/12815/timeline | null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/12816 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/12816/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/12816/comments | https://api.github.com/repos/pandas-dev/pandas/issues/12816/events | https://github.com/pandas-dev/pandas/issues/12816 | 146,365,901 | MDU6SXNzdWUxNDYzNjU5MDE= | 12,816 | CLN: Small inconsistency in weekday property of DatetimeIndex and Timestamp | {
"avatar_url": "https://avatars.githubusercontent.com/u/478375?v=4",
"events_url": "https://api.github.com/users/BastiaanBergman/events{/privacy}",
"followers_url": "https://api.github.com/users/BastiaanBergman/followers",
"following_url": "https://api.github.com/users/BastiaanBergman/following{/other_user}",
"gists_url": "https://api.github.com/users/BastiaanBergman/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/BastiaanBergman",
"id": 478375,
"login": "BastiaanBergman",
"node_id": "MDQ6VXNlcjQ3ODM3NQ==",
"organizations_url": "https://api.github.com/users/BastiaanBergman/orgs",
"received_events_url": "https://api.github.com/users/BastiaanBergman/received_events",
"repos_url": "https://api.github.com/users/BastiaanBergman/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/BastiaanBergman/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/BastiaanBergman/subscriptions",
"type": "User",
"url": "https://api.github.com/users/BastiaanBergman"
} | [
{
"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": "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"
}
]
| open | false | null | []
| null | 5 | 2016-04-06T16:28:56Z | 2020-05-07T03:43:10Z | null | NONE | null | All date and time derivatives are implemented as properties of DatetimeIndex and Timestamp, except for the weekday **method** of Timestamp. This is because it is inherited from the datetime class. I don't know if it is _possible_, but it would be nice if it was consistent.
### Code Sample, a copy-pastable example if possible
```
i=pd.date_range('2015-09-01', periods=4, freq='D')
i.dayofweek[0]
i[0].dayofweek
i.weekday[0]
i[0].weekday() # weekday is a **method** of Timestamp class
```
### Expected Output
```
1
1
1
1
```
| {
"+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/12816/reactions"
} | https://api.github.com/repos/pandas-dev/pandas/issues/12816/timeline | null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/12817 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/12817/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/12817/comments | https://api.github.com/repos/pandas-dev/pandas/issues/12817/events | https://github.com/pandas-dev/pandas/issues/12817 | 146,415,490 | MDU6SXNzdWUxNDY0MTU0OTA= | 12,817 | ENH: Faster hashing of Period objects | {
"avatar_url": "https://avatars.githubusercontent.com/u/379413?v=4",
"events_url": "https://api.github.com/users/wcbeard/events{/privacy}",
"followers_url": "https://api.github.com/users/wcbeard/followers",
"following_url": "https://api.github.com/users/wcbeard/following{/other_user}",
"gists_url": "https://api.github.com/users/wcbeard/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/wcbeard",
"id": 379413,
"login": "wcbeard",
"node_id": "MDQ6VXNlcjM3OTQxMw==",
"organizations_url": "https://api.github.com/users/wcbeard/orgs",
"received_events_url": "https://api.github.com/users/wcbeard/received_events",
"repos_url": "https://api.github.com/users/wcbeard/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/wcbeard/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/wcbeard/subscriptions",
"type": "User",
"url": "https://api.github.com/users/wcbeard"
} | [
{
"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": "e102d8",
"default": false,
"description": "Unexpected or buggy dtype conversions",
"id": 31404521,
"name": "Dtype Conversions",
"node_id": "MDU6TGFiZWwzMTQwNDUyMQ==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Dtype%20Conversions"
},
{
"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": "2016-10-03T08:52:13Z",
"closed_issues": 733,
"created_at": "2016-03-11T21:24:45Z",
"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": "",
"due_on": "2016-09-30T07:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/40",
"id": 1639795,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/40/labels",
"node_id": "MDk6TWlsZXN0b25lMTYzOTc5NQ==",
"number": 40,
"open_issues": 0,
"state": "closed",
"title": "0.19.0",
"updated_at": "2017-11-06T02:01:14Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/40"
} | 2 | 2016-04-06T19:53:51Z | 2016-07-20T21:23:30Z | 2016-07-20T21:23:30Z | CONTRIBUTOR | null | I've noticed that a lot of manipulations using Periods are pretty slow. It [looks like it's hashing](https://github.com/pydata/pandas/blob/48f39af49a9ae76c2c7d8f519df6069e7af00755/pandas/src/period.pyx#L789) the tuple of the `ordinal` and `freq` attributes. I'm not sure what the mapping is between `freq` and `freqstr` is, but if `freqstr` can stand in for `freq`, it looks like hashing the string gives a decent speedup. Subclassing `Period` with this change speeds up operations like `drop_duplicates` a lot on my machine.
```
class Period_hsh(Period):
def __hash__(self):
return hash((self.ordinal, self.freqstr))
p = Period('2016', 'A-DEC')
ph = Period_hsh(p)
%timeit Series([p] * 100000).drop_duplicates()
%timeit Series([ph] * 100000).drop_duplicates()
"""
1 loops, best of 3: 1.14 s per loop
10 loops, best of 3: 171 ms per loop
"""
```
Does this change seem reasonable?
#### output of `pd.show_versions()`
## INSTALLED VERSIONS
commit: None
python: 3.5.1.final.0
python-bits: 64
OS: Darwin
OS-release: 15.3.0
machine: x86_64
processor: i386
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8
pandas: 0.18.0
nose: None
pip: 8.1.1
setuptools: 20.3
Cython: 0.23.5
numpy: 1.10.4
scipy: 0.17.0
statsmodels: None
xarray: None
IPython: 3.2.3
sphinx: None
patsy: None
dateutil: 2.5.2
pytz: 2016.3
blosc: None
bottleneck: None
tables: None
numexpr: 2.5.1
matplotlib: 1.5.1
openpyxl: None
xlrd: 0.9.4
xlwt: None
xlsxwriter: None
lxml: None
bs4: None
html5lib: None
httplib2: None
apiclient: None
sqlalchemy: None
pymysql: None
psycopg2: None
jinja2: 2.8
boto: None
| {
"+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/12817/reactions"
} | https://api.github.com/repos/pandas-dev/pandas/issues/12817/timeline | null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/12818 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/12818/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/12818/comments | https://api.github.com/repos/pandas-dev/pandas/issues/12818/events | https://github.com/pandas-dev/pandas/issues/12818 | 146,450,836 | MDU6SXNzdWUxNDY0NTA4MzY= | 12,818 | Problems with snap (closest index) indexing | {
"avatar_url": "https://avatars.githubusercontent.com/u/6526066?v=4",
"events_url": "https://api.github.com/users/amelio-dx/events{/privacy}",
"followers_url": "https://api.github.com/users/amelio-dx/followers",
"following_url": "https://api.github.com/users/amelio-dx/following{/other_user}",
"gists_url": "https://api.github.com/users/amelio-dx/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/amelio-dx",
"id": 6526066,
"login": "amelio-dx",
"node_id": "MDQ6VXNlcjY1MjYwNjY=",
"organizations_url": "https://api.github.com/users/amelio-dx/orgs",
"received_events_url": "https://api.github.com/users/amelio-dx/received_events",
"repos_url": "https://api.github.com/users/amelio-dx/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/amelio-dx/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/amelio-dx/subscriptions",
"type": "User",
"url": "https://api.github.com/users/amelio-dx"
} | [
{
"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": "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 | 5 | 2016-04-06T22:16:22Z | 2016-04-06T22:54:42Z | 2016-04-06T22:49:05Z | NONE | null | Say we have:
```
df = pd.Series(index=pd.DatetimeIndex(['2016-04-06 17:21:17', '2016-04-06 17:23:06',
'2016-04-06 17:25:50', '2016-04-06 17:26:10',
'2016-04-06 17:30:09', '2016-04-06 17:30:47',
'2016-04-06 17:35:51', '2016-04-06 17:40:48',
'2016-04-06 17:45:55', '2016-04-06 17:50:48'],
dtype='datetime64[ns]', freq=None), data=range(10))
```
which results in:
```
2016-04-06 17:21:17 0
2016-04-06 17:23:06 1
2016-04-06 17:25:50 2
2016-04-06 17:26:10 3
2016-04-06 17:30:09 4
2016-04-06 17:30:47 5
2016-04-06 17:35:51 6
2016-04-06 17:40:48 7
2016-04-06 17:45:55 8
2016-04-06 17:50:48 9
dtype: int64
```
Now, say I want to index the **closest** values between:
```
from_ix = pd.Timestamp('2016-04-06 17:40:00')
to_ix = pd.Timestamp('2016-04-06 17:50:00')
```
If I do:
```
> df.loc[from_ix:to_ix]
2016-04-06 17:40:48 7
2016-04-06 17:45:55 8
```
I don't get the closest value to my indices.
Instead I am looking for:
```
2016-04-06 17:40:48 7
2016-04-06 17:45:55 8
2016-04-06 17:50:48 9
```
How can I do that in Pandas?
I thought the following would work, but it fails
```
> df.index.get_loc(from_ix)
KeyError: Timestamp('2016-04-06 17:40:00')
```
| {
"+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/12818/reactions"
} | https://api.github.com/repos/pandas-dev/pandas/issues/12818/timeline | null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/12819 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/12819/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/12819/comments | https://api.github.com/repos/pandas-dev/pandas/issues/12819/events | https://github.com/pandas-dev/pandas/issues/12819 | 146,528,179 | MDU6SXNzdWUxNDY1MjgxNzk= | 12,819 | How to select content store in the Panel using 'item' index | {
"avatar_url": "https://avatars.githubusercontent.com/u/18323233?v=4",
"events_url": "https://api.github.com/users/Fredericxian/events{/privacy}",
"followers_url": "https://api.github.com/users/Fredericxian/followers",
"following_url": "https://api.github.com/users/Fredericxian/following{/other_user}",
"gists_url": "https://api.github.com/users/Fredericxian/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Fredericxian",
"id": 18323233,
"login": "Fredericxian",
"node_id": "MDQ6VXNlcjE4MzIzMjMz",
"organizations_url": "https://api.github.com/users/Fredericxian/orgs",
"received_events_url": "https://api.github.com/users/Fredericxian/received_events",
"repos_url": "https://api.github.com/users/Fredericxian/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Fredericxian/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Fredericxian/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Fredericxian"
} | []
| closed | false | null | []
| null | 1 | 2016-04-07T07:10:50Z | 2016-04-07T13:02:19Z | 2016-04-07T13:02:19Z | NONE | null | #### wp
Out[50]:
<class 'pandas.core.panel.Panel'>
Dimensions: 2 (items) x 55640 (major_axis) x 9 (minor_axis)
Items axis: 0 to 1
Major_axis axis: 0 to 55639
Minor_axis axis: TradingDay to AskVolume1
store.select('wp','items>0')
Traceback (most recent call last):
File "<ipython-input-51-79d40b638607>", line 1, in <module>
store.select('wp','items>0')
File "C:\Anaconda3\lib\site-packages\pandas\io\pytables.py", line 680, in select
return it.get_result()
File "C:\Anaconda3\lib\site-packages\pandas\io\pytables.py", line 1364, in get_result
results = self.func(self.start, self.stop, where)
File "C:\Anaconda3\lib\site-packages\pandas\io\pytables.py", line 673, in func
columns=columns, **kwargs)
File "C:\Anaconda3\lib\site-packages\pandas\io\pytables.py", line 3671, in read
if not self.read_axes(where=where, **kwargs):
File "C:\Anaconda3\lib\site-packages\pandas\io\pytables.py", line 3222, in read_axes
self.selection = Selection(self, where=where, **kwargs)
File "C:\Anaconda3\lib\site-packages\pandas\io\pytables.py", line 4584, in **init**
self.condition, self.filter = self.terms.evaluate()
File "C:\Anaconda3\lib\site-packages\pandas\computation\pytables.py", line 586, in evaluate
self.filter = self.terms.prune(FilterBinOp)
File "C:\Anaconda3\lib\site-packages\pandas\computation\pytables.py", line 117, in prune
res = pr(left.value, right.value)
File "C:\Anaconda3\lib\site-packages\pandas\computation\pytables.py", line 112, in pr
encoding=self.encoding).evaluate()
File "C:\Anaconda3\lib\site-packages\pandas\computation\pytables.py", line 276, in evaluate
self)
File "C:\Anaconda3\lib\site-packages\pandas\core\base.py", line 42, in **str**
return self.**unicode**()
File "C:\Anaconda3\lib\site-packages\pandas\computation\pytables.py", line 228, in **unicode**
"[{1}]".format(self.filter[0], self.filter[1]))
TypeError: 'NoneType' object is not subscriptable
if I use item==0, it can be selected successfully.
store.select('wp','items==0')
Out[52]:
<class 'pandas.core.panel.Panel'>
Dimensions: 1 (items) x 55640 (major_axis) x 9 (minor_axis)
Items axis: 0 to 0
Major_axis axis: 0 to 55639
Minor_axis axis: AskPrice1 to UpdateTime
#### Expected Output
#### output of `pd.show_versions()`
## INSTALLED VERSIONS
commit: None
python: 3.5.1.final.0
python-bits: 64
OS: Windows
OS-release: 8.1
machine: AMD64
processor: Intel64 Family 6 Model 60 Stepping 3, GenuineIntel
byteorder: little
LC_ALL: None
LANG: zh_CN
pandas: 0.18.0
nose: 1.3.7
pip: 8.1.1
setuptools: 20.3
Cython: 0.23.4
numpy: 1.10.4
scipy: 0.17.0
statsmodels: None
xarray: None
IPython: 4.0.3
sphinx: 1.3.1
patsy: 0.4.0
dateutil: 2.4.2
pytz: 2015.7
blosc: None
bottleneck: 1.0.0
tables: 3.2.2
numexpr: 2.4.6
matplotlib: 1.5.1
openpyxl: 2.3.2
xlrd: 0.9.4
xlwt: 1.0.0
xlsxwriter: 0.8.4
lxml: 3.5.0
bs4: 4.4.1
html5lib: None
httplib2: None
apiclient: None
sqlalchemy: 1.0.11
pymysql: None
psycopg2: None
jinja2: 2.8
boto: 2.39.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/12819/reactions"
} | https://api.github.com/repos/pandas-dev/pandas/issues/12819/timeline | null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/12820 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/12820/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/12820/comments | https://api.github.com/repos/pandas-dev/pandas/issues/12820/events | https://github.com/pandas-dev/pandas/issues/12820 | 146,528,623 | MDU6SXNzdWUxNDY1Mjg2MjM= | 12,820 | How to select content store in the Panel using 'item' index | {
"avatar_url": "https://avatars.githubusercontent.com/u/18323233?v=4",
"events_url": "https://api.github.com/users/Fredericxian/events{/privacy}",
"followers_url": "https://api.github.com/users/Fredericxian/followers",
"following_url": "https://api.github.com/users/Fredericxian/following{/other_user}",
"gists_url": "https://api.github.com/users/Fredericxian/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Fredericxian",
"id": 18323233,
"login": "Fredericxian",
"node_id": "MDQ6VXNlcjE4MzIzMjMz",
"organizations_url": "https://api.github.com/users/Fredericxian/orgs",
"received_events_url": "https://api.github.com/users/Fredericxian/received_events",
"repos_url": "https://api.github.com/users/Fredericxian/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Fredericxian/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Fredericxian/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Fredericxian"
} | [
{
"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": "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 | []
| null | 4 | 2016-04-07T07:13:09Z | 2016-04-08T02:47:14Z | 2016-04-07T13:07:02Z | NONE | null | #### wp
```
Out[50]:
<class 'pandas.core.panel.Panel'>
Dimensions: 2 (items) x 55640 (major_axis) x 9 (minor_axis)
Items axis: 0 to 1
Major_axis axis: 0 to 55639
Minor_axis axis: TradingDay to AskVolume1
store.select('wp','items>0')
Traceback (most recent call last):
File "<ipython-input-51-79d40b638607>", line 1, in <module>
store.select('wp','items>0')
File "C:\Anaconda3\lib\site-packages\pandas\io\pytables.py", line 680, in select
return it.get_result()
File "C:\Anaconda3\lib\site-packages\pandas\io\pytables.py", line 1364, in get_result
results = self.func(self.start, self.stop, where)
File "C:\Anaconda3\lib\site-packages\pandas\io\pytables.py", line 673, in func
columns=columns, **kwargs)
File "C:\Anaconda3\lib\site-packages\pandas\io\pytables.py", line 3671, in read
if not self.read_axes(where=where, **kwargs):
File "C:\Anaconda3\lib\site-packages\pandas\io\pytables.py", line 3222, in read_axes
self.selection = Selection(self, where=where, **kwargs)
File "C:\Anaconda3\lib\site-packages\pandas\io\pytables.py", line 4584, in __init__
self.condition, self.filter = self.terms.evaluate()
File "C:\Anaconda3\lib\site-packages\pandas\computation\pytables.py", line 586, in evaluate
self.filter = self.terms.prune(FilterBinOp)
File "C:\Anaconda3\lib\site-packages\pandas\computation\pytables.py", line 117, in prune
res = pr(left.value, right.value)
File "C:\Anaconda3\lib\site-packages\pandas\computation\pytables.py", line 112, in pr
encoding=self.encoding).evaluate()
File "C:\Anaconda3\lib\site-packages\pandas\computation\pytables.py", line 276, in evaluate
self)
File "C:\Anaconda3\lib\site-packages\pandas\core\base.py", line 42, in __str__
return self.__unicode__()
File "C:\Anaconda3\lib\site-packages\pandas\computation\pytables.py", line 228, in __unicode__
"[{1}]".format(self.filter[0], self.filter[1]))
TypeError: 'NoneType' object is not subscriptable
```
if I use item==0, it can be selected successfully.
```
store.select('wp','items==0')
Out[52]:
<class 'pandas.core.panel.Panel'>
Dimensions: 1 (items) x 55640 (major_axis) x 9 (minor_axis)
Items axis: 0 to 0
Major_axis axis: 0 to 55639
Minor_axis axis: AskPrice1 to UpdateTime
```
#### output of `pd.show_versions()`
## INSTALLED VERSIONS
commit: None
python: 3.5.1.final.0
python-bits: 64
OS: Windows
OS-release: 8.1
machine: AMD64
processor: Intel64 Family 6 Model 60 Stepping 3, GenuineIntel
byteorder: little
LC_ALL: None
LANG: zh_CN
pandas: 0.18.0
nose: 1.3.7
pip: 8.1.1
setuptools: 20.3
Cython: 0.23.4
numpy: 1.10.4
scipy: 0.17.0
statsmodels: None
xarray: None
IPython: 4.0.3
sphinx: 1.3.1
patsy: 0.4.0
dateutil: 2.4.2
pytz: 2015.7
blosc: None
bottleneck: 1.0.0
tables: 3.2.2
numexpr: 2.4.6
matplotlib: 1.5.1
openpyxl: 2.3.2
xlrd: 0.9.4
xlwt: 1.0.0
xlsxwriter: 0.8.4
lxml: 3.5.0
bs4: 4.4.1
html5lib: None
httplib2: None
apiclient: None
sqlalchemy: 1.0.11
pymysql: None
psycopg2: None
jinja2: 2.8
boto: 2.39.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/12820/reactions"
} | https://api.github.com/repos/pandas-dev/pandas/issues/12820/timeline | null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/12821 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/12821/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/12821/comments | https://api.github.com/repos/pandas-dev/pandas/issues/12821/events | https://github.com/pandas-dev/pandas/issues/12821 | 146,602,567 | MDU6SXNzdWUxNDY2MDI1Njc= | 12,821 | agg() function on groupby dataframe changes dtype of datetime64[ns] column to float64 if all items in a single group are NaT | {
"avatar_url": "https://avatars.githubusercontent.com/u/15664307?v=4",
"events_url": "https://api.github.com/users/lvphj/events{/privacy}",
"followers_url": "https://api.github.com/users/lvphj/followers",
"following_url": "https://api.github.com/users/lvphj/following{/other_user}",
"gists_url": "https://api.github.com/users/lvphj/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/lvphj",
"id": 15664307,
"login": "lvphj",
"node_id": "MDQ6VXNlcjE1NjY0MzA3",
"organizations_url": "https://api.github.com/users/lvphj/orgs",
"received_events_url": "https://api.github.com/users/lvphj/received_events",
"repos_url": "https://api.github.com/users/lvphj/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/lvphj/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/lvphj/subscriptions",
"type": "User",
"url": "https://api.github.com/users/lvphj"
} | [
{
"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": "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": "2016-10-03T08:52:13Z",
"closed_issues": 733,
"created_at": "2016-03-11T21:24:45Z",
"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": "",
"due_on": "2016-09-30T07:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/40",
"id": 1639795,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/40/labels",
"node_id": "MDk6TWlsZXN0b25lMTYzOTc5NQ==",
"number": 40,
"open_issues": 0,
"state": "closed",
"title": "0.19.0",
"updated_at": "2017-11-06T02:01:14Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/40"
} | 2 | 2016-04-07T12:24:32Z | 2016-08-06T22:57:12Z | 2016-08-06T22:57:12Z | NONE | null | The example below shows two variations of a dataframe which contains a date column set to datetime64[ns] format.
In the first example, there is a single missing (NaT) date. After groupby and agg(), the dtypes of all the columns in the aggregated dataframe are the same as the original dataframe, as expected (and as desired).
However, in the second example, there are several missing dates, arranged so that all the dates in one group are NaT. After the same groupby and agg() procedures, the dtype of the date column is changed to float64. This is undesired behaviour in my situation and I believe it is a bug.
#### Code Sample, a copy-pastable example if possible
```
# Introduce single missing values in the date column
print('Datafreme with single missing date value')
print('========================================')
phjTempDF = pd.DataFrame({'id': [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20],
'date': ["02/04/2015 02:34","06/04/2015 12:34","09/04/2015 23:03","12/04/2015 01:00","15/04/2015 07:12","21/04/2015 12:59","29/04/2015 17:33","04/05/2015 10:44","06/05/2015 11:12","10/05/2015 08:52","12/05/2015 14:19","19/05/2015 19:22","27/05/2015 22:31","01/06/2015 11:09","04/06/2015 12:57","10/06/2015 04:00","15/06/2015 03:23","19/06/2015 05:37","23/06/2015 13:41","27/06/2015 15:43"],
'gender': ["male","female","female","male","male","female","female",np.nan,"male","male","female","male","female","female","male","female","male","female",np.nan,"male"],
'age': ["young","old","old","old","old","old",np.nan,"old","old","young","young","old","young","young","old",np.nan,"old","young",np.nan,np.nan]})
phjTempDF = phjTempDF.sort_values(['gender','age','date'])
phjTempDF.ix[1,'date'] = 'missing'
# Convert date to datetime64 format
phjTempDF['date'] = pd.to_datetime(phjTempDF['date'],errors='coerce')
print('\nWhole dataframe')
print('---------------')
print(phjzempdf)
print('\nOriginal types')
print('---------------')
print(phjTempDF.dtypes)
phjTempDF = phjTempDF.sort_values(['gender','age','id']).groupby(['gender','age']).agg({'date': 'first','id': 'first'}).reset_index(drop=False)
print('\nAggregated dataframe')
print('--------------------')
print(phjzempdf)
print('\nPost-aggregation types')
print('-----------------------')
print(phjTempDF.dtypes)
# Introduce multiple missing values in the date column (one group contains all missing values)
# Introduce single missing values in the date column
print('\n\nDataframe with multiple missing dates values')
print('============================================')
phjTempDF = pd.DataFrame({'id': [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20],
'date': ["02/04/2015 02:34","06/04/2015 12:34","09/04/2015 23:03","12/04/2015 01:00","15/04/2015 07:12","21/04/2015 12:59","29/04/2015 17:33","04/05/2015 10:44","06/05/2015 11:12","10/05/2015 08:52","12/05/2015 14:19","19/05/2015 19:22","27/05/2015 22:31","01/06/2015 11:09","04/06/2015 12:57","10/06/2015 04:00","15/06/2015 03:23","19/06/2015 05:37","23/06/2015 13:41","27/06/2015 15:43"],
'gender': ["male","female","female","male","male","female","female",np.nan,"male","male","female","male","female","female","male","female","male","female",np.nan,"male"],
'age': ["young","old","old","old","old","old",np.nan,"old","old","young","young","old","young","young","old",np.nan,"old","young",np.nan,np.nan]})
phjTempDF = phjTempDF.sort_values(['gender','age','date'])
phjTempDF.ix[[1,2,5],'date'] = 'missing'
# Convert date to datetime64 format
phjTempDF['date'] = pd.to_datetime(phjTempDF['date'],errors='coerce')
print('\nWhole dataframe')
print('---------------')
print(phjzempdf)
print('\nOriginal types')#
print('---------------')
print(phjTempDF.dtypes)
phjTempDF = phjTempDF.sort_values(['gender','age','id']).groupby(['gender','age']).agg({'date': 'first','id': 'first'}).reset_index(drop=False)
print('\nAggregated dataframe')
print('--------------------')
print(phjzempdf)
print('\nPost-aggregation types')#
print('-----------------------')
print(phjTempDF.dtypes)
```
## Expected Output
The expected output would be for the dtypes in the dataframe after aggregation to be the same as those in the original dataframe.
#### output of `pd.show_versions()`
## INSTALLED VERSIONS
commit: None
python: 3.4.1.final.0
python-bits: 64
OS: Darwin
OS-release: 15.3.0
machine: x86_64
processor: i386
byteorder: little
LC_ALL: None
LANG: en_GB.UTF-8
pandas: 0.17.0
nose: 1.3.7
pip: 1.5.6
setuptools: 3.6
Cython: None
numpy: 1.10.1
scipy: None
statsmodels: None
IPython: 4.0.0
sphinx: None
patsy: None
dateutil: 2.4.2
pytz: 2015.7
blosc: None
bottleneck: None
tables: None
numexpr: None
matplotlib: 1.4.3
openpyxl: 2.3.0
xlrd: None
xlwt: None
xlsxwriter: None
lxml: None
bs4: None
html5lib: None
httplib2: None
apiclient: None
sqlalchemy: None
pymysql: None
psycopg2: None
| {
"+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/12821/reactions"
} | https://api.github.com/repos/pandas-dev/pandas/issues/12821/timeline | null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/12822 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/12822/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/12822/comments | https://api.github.com/repos/pandas-dev/pandas/issues/12822/events | https://github.com/pandas-dev/pandas/issues/12822 | 146,612,508 | MDU6SXNzdWUxNDY2MTI1MDg= | 12,822 | pandas dataframe.drop(col,axis=1) does not drop column from column.levels in multiindex dataframe | {
"avatar_url": "https://avatars.githubusercontent.com/u/1150402?v=4",
"events_url": "https://api.github.com/users/kdebrab/events{/privacy}",
"followers_url": "https://api.github.com/users/kdebrab/followers",
"following_url": "https://api.github.com/users/kdebrab/following{/other_user}",
"gists_url": "https://api.github.com/users/kdebrab/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/kdebrab",
"id": 1150402,
"login": "kdebrab",
"node_id": "MDQ6VXNlcjExNTA0MDI=",
"organizations_url": "https://api.github.com/users/kdebrab/orgs",
"received_events_url": "https://api.github.com/users/kdebrab/received_events",
"repos_url": "https://api.github.com/users/kdebrab/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/kdebrab/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/kdebrab/subscriptions",
"type": "User",
"url": "https://api.github.com/users/kdebrab"
} | [
{
"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": "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 | []
| null | 3 | 2016-04-07T12:53:15Z | 2019-04-23T10:30:31Z | 2016-04-07T12:58:44Z | CONTRIBUTOR | null | bug in pandas version 0.18.0 (long time ago seemingly same issue has been reported on [StackOverflow](http://stackoverflow.com/questions/16682190/pandas-dataframe-dropcol-axis-1-does-not-drop-column-from-column-levels-in-mul)):
``` python
In[1]: import pandas as pd
...: import numpy as np
...: iterables = [['bar', 'baz', 'foo', 'qux'], ['one', 'two']]
...: index = pd.MultiIndex.from_product(iterables, names=['first', 'second'])
...: df = pd.DataFrame(np.random.randn(3, 8), index=['A', 'B', 'C'], columns=index)
...: df2 = df.drop('bar', axis=1)
```
At first sight, bar seems dropped from the dataframe:
``` python
In[2]: df2
Out[2]:
first baz foo qux
second one two one two one two
A -0.625880 0.154829 -0.416494 -1.423776 0.942012 -1.495733
B -0.704217 0.132563 1.382712 -0.123216 1.773185 1.530121
C 0.925705 -0.702249 0.113887 -0.307644 0.369242 -0.798391
```
Though not completely, as 'bar' is still listed in the columns:
``` python
In[3]: df2.columns
Out[3]:
MultiIndex(levels=[[u'bar', u'baz', u'foo', u'qux'], [u'one', u'two']],
labels=[[1, 1, 2, 2, 3, 3], [0, 1, 0, 1, 0, 1]],
names=[u'first', u'second'])
```
| {
"+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/12822/reactions"
} | https://api.github.com/repos/pandas-dev/pandas/issues/12822/timeline | null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/12823 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/12823/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/12823/comments | https://api.github.com/repos/pandas-dev/pandas/issues/12823/events | https://github.com/pandas-dev/pandas/issues/12823 | 146,667,371 | MDU6SXNzdWUxNDY2NjczNzE= | 12,823 | Time Zone problem with tz_localize | {
"avatar_url": "https://avatars.githubusercontent.com/u/13064792?v=4",
"events_url": "https://api.github.com/users/LorenzoBottaccioli/events{/privacy}",
"followers_url": "https://api.github.com/users/LorenzoBottaccioli/followers",
"following_url": "https://api.github.com/users/LorenzoBottaccioli/following{/other_user}",
"gists_url": "https://api.github.com/users/LorenzoBottaccioli/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/LorenzoBottaccioli",
"id": 13064792,
"login": "LorenzoBottaccioli",
"node_id": "MDQ6VXNlcjEzMDY0Nzky",
"organizations_url": "https://api.github.com/users/LorenzoBottaccioli/orgs",
"received_events_url": "https://api.github.com/users/LorenzoBottaccioli/received_events",
"repos_url": "https://api.github.com/users/LorenzoBottaccioli/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/LorenzoBottaccioli/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/LorenzoBottaccioli/subscriptions",
"type": "User",
"url": "https://api.github.com/users/LorenzoBottaccioli"
} | [
{
"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 | []
| null | 10 | 2016-04-07T15:54:27Z | 2020-03-30T14:12:14Z | 2016-04-07T16:07:45Z | NONE | null | Hi All,
I'm having a issue with tz_localize, maybe is my misunderstanding.
I'm importing a dataframe and I want to se the timezone for central Europe:
So if I use **Eurpe/Rome** I get:
```
In [303]: df.index.tz_localize('Europe/Rome')
Out[303]:
DatetimeIndex(['2012-12-15 00:00:00+01:00', '2012-12-15 00:15:00+01:00',
'2012-12-15 00:30:00+01:00', '2012-12-15 00:45:00+01:00',
'2012-12-15 01:00:00+01:00', '2012-12-15 01:15:00+01:00',
'2012-12-15 01:30:00+01:00', '2012-12-15 01:45:00+01:00',
'2012-12-15 02:00:00+01:00', '2012-12-15 02:15:00+01:00',
...
'2015-10-20 21:30:00+02:00', '2015-10-20 21:45:00+02:00',
'2015-10-20 22:00:00+02:00', '2015-10-20 22:15:00+02:00',
'2015-10-20 22:30:00+02:00', '2015-10-20 22:45:00+02:00',
'2015-10-20 23:00:00+02:00', '2015-10-20 23:15:00+02:00',
'2015-10-20 23:30:00+02:00', '2015-10-20 23:45:00+02:00'],
dtype='datetime64[ns, Europe/Rome]', name=u'Date Time', length=8064, freq=None)
```
But I dont want to use dst because my timeseries is with no dst so I tried to use **Etc/GMT+1**
```
In [305]: df.index.tz_localize('Etc/GMT+1')
Out[305]:
DatetimeIndex(['2012-12-15 00:00:00-01:00', '2012-12-15 00:15:00-01:00',
'2012-12-15 00:30:00-01:00', '2012-12-15 00:45:00-01:00',
'2012-12-15 01:00:00-01:00', '2012-12-15 01:15:00-01:00',
'2012-12-15 01:30:00-01:00', '2012-12-15 01:45:00-01:00',
'2012-12-15 02:00:00-01:00', '2012-12-15 02:15:00-01:00',
...
'2015-10-20 21:30:00-01:00', '2015-10-20 21:45:00-01:00',
'2015-10-20 22:00:00-01:00', '2015-10-20 22:15:00-01:00',
'2015-10-20 22:30:00-01:00', '2015-10-20 22:45:00-01:00',
'2015-10-20 23:00:00-01:00', '2015-10-20 23:15:00-01:00',
'2015-10-20 23:30:00-01:00', '2015-10-20 23:45:00-01:00'],
dtype='datetime64[ns, Etc/GMT+1]', name=u'Date Time', length=8064, freq=None)
```
I don't get why now I have -1 in stead of +1.
If I use **Etc/GMT-1** I get:
```
In [304]: df.index.tz_localize('Etc/GMT-1')
Out[304]:
DatetimeIndex(['2012-12-15 00:00:00+01:00', '2012-12-15 00:15:00+01:00',
'2012-12-15 00:30:00+01:00', '2012-12-15 00:45:00+01:00',
'2012-12-15 01:00:00+01:00', '2012-12-15 01:15:00+01:00',
'2012-12-15 01:30:00+01:00', '2012-12-15 01:45:00+01:00',
'2012-12-15 02:00:00+01:00', '2012-12-15 02:15:00+01:00',
...
'2015-10-20 21:30:00+01:00', '2015-10-20 21:45:00+01:00',
'2015-10-20 22:00:00+01:00', '2015-10-20 22:15:00+01:00',
'2015-10-20 22:30:00+01:00', '2015-10-20 22:45:00+01:00',
'2015-10-20 23:00:00+01:00', '2015-10-20 23:15:00+01:00',
'2015-10-20 23:30:00+01:00', '2015-10-20 23:45:00+01:00'],
dtype='datetime64[ns, Etc/GMT-1]', name=u'Date Time', length=8064, freq=None)
```
Central Europe should be **Etc/GMT+1** is it rigth?
Tnx
| {
"+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/12823/reactions"
} | https://api.github.com/repos/pandas-dev/pandas/issues/12823/timeline | null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/12824 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/12824/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/12824/comments | https://api.github.com/repos/pandas-dev/pandas/issues/12824/events | https://github.com/pandas-dev/pandas/issues/12824 | 146,846,474 | MDU6SXNzdWUxNDY4NDY0NzQ= | 12,824 | groupby().apply() returns different result depends on the first result is None or not. | {
"avatar_url": "https://avatars.githubusercontent.com/u/826871?v=4",
"events_url": "https://api.github.com/users/ruoyu0088/events{/privacy}",
"followers_url": "https://api.github.com/users/ruoyu0088/followers",
"following_url": "https://api.github.com/users/ruoyu0088/following{/other_user}",
"gists_url": "https://api.github.com/users/ruoyu0088/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/ruoyu0088",
"id": 826871,
"login": "ruoyu0088",
"node_id": "MDQ6VXNlcjgyNjg3MQ==",
"organizations_url": "https://api.github.com/users/ruoyu0088/orgs",
"received_events_url": "https://api.github.com/users/ruoyu0088/received_events",
"repos_url": "https://api.github.com/users/ruoyu0088/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/ruoyu0088/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/ruoyu0088/subscriptions",
"type": "User",
"url": "https://api.github.com/users/ruoyu0088"
} | [
{
"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": "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": "2016-10-03T08:52:13Z",
"closed_issues": 733,
"created_at": "2016-03-11T21:24:45Z",
"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": "",
"due_on": "2016-09-30T07:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/40",
"id": 1639795,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/40/labels",
"node_id": "MDk6TWlsZXN0b25lMTYzOTc5NQ==",
"number": 40,
"open_issues": 0,
"state": "closed",
"title": "0.19.0",
"updated_at": "2017-11-06T02:01:14Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/40"
} | 1 | 2016-04-08T07:50:09Z | 2016-05-20T14:09:29Z | 2016-05-20T14:09:29Z | NONE | null | The apply document says that it can:
> apply can act as a reducer, transformer, or filter function, depending on exactly what is passed to apply. So depending on the path taken, and exactly what you are grouping. Thus the grouped columns(s) may be included in the output as well as set the indices.
So, I think it may discard the group if the callback function returns None. Here is two exmaple that works and not works:
```
import pandas as pd
import numpy as np
df = pd.DataFrame({"A":np.arange(10), "B":[1, 1, 1, 2, 3, 3, 3, 4, 4, 4]})
print(df.groupby("B").apply(lambda df2:None if df2.shape[0] <= 2 else df2.iloc[[0, -1]]))
df = pd.DataFrame({"A":np.arange(10), "B":[1, 2, 2, 2, 3, 3, 3, 4, 4, 4]})
print(df.groupby("B").apply(lambda x:None if x.shape[0] <= 2 else x.iloc[[0, -1]]))
```
the output is as following, the first one returns a DataFrame, the second one returns a Series with DataFrames inside:
```
A B
B
1 0 0 1
2 2 1
3 4 4 3
6 6 3
4 7 7 4
9 9 4
B
1 A B
1 NaN NaN
3 NaN NaN
2 A B
1 1 2
3 3 2
3 A B
4 4 3
6 6 3
4 A B
7 7 4
9 9 4
dtype: object
```
The problem is that `_wrap_applied_output()` in `groupby.py` checks the first element to determine the concat method:
```
if isinstance(values[0], DataFrame):
return self._concat_objects(keys, values,
not_indexed_same=not_indexed_same)
```
I want to know, does `groupby().apply()` support discarding groups?
| {
"+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/12824/reactions"
} | https://api.github.com/repos/pandas-dev/pandas/issues/12824/timeline | null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/12825 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/12825/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/12825/comments | https://api.github.com/repos/pandas-dev/pandas/issues/12825/events | https://github.com/pandas-dev/pandas/issues/12825 | 146,888,250 | MDU6SXNzdWUxNDY4ODgyNTA= | 12,825 | Low performance with sum() | {
"avatar_url": "https://avatars.githubusercontent.com/u/3187951?v=4",
"events_url": "https://api.github.com/users/rushter/events{/privacy}",
"followers_url": "https://api.github.com/users/rushter/followers",
"following_url": "https://api.github.com/users/rushter/following{/other_user}",
"gists_url": "https://api.github.com/users/rushter/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/rushter",
"id": 3187951,
"login": "rushter",
"node_id": "MDQ6VXNlcjMxODc5NTE=",
"organizations_url": "https://api.github.com/users/rushter/orgs",
"received_events_url": "https://api.github.com/users/rushter/received_events",
"repos_url": "https://api.github.com/users/rushter/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/rushter/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/rushter/subscriptions",
"type": "User",
"url": "https://api.github.com/users/rushter"
} | [
{
"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": "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 | []
| null | 1 | 2016-04-08T10:34:27Z | 2016-04-08T12:58:55Z | 2016-04-08T12:58:42Z | NONE | null | I have encountered a problem where manual addition ~25 times faster than `sum` function.
Is there a bug or bad use case?
```
In[3]: %timeit test_1()
1 loops, best of 3: 212 ms per loop
In[4]: %timeit test_2()
1 loops, best of 3: 5.66 s per loop
```
```
import pandas as pd
import numpy as np
import itertools
r, c = 10000, 25
def test_1():
df = pd.DataFrame(np.random.rand(r, c), columns=[str(x) for x in range(c)])
combs = itertools.combinations(df.columns.tolist(), 2)
for x, y in combs:
df['%s+%s' % (x, y)] = df[x] + df[y]
def test_2():
df = pd.DataFrame(np.random.rand(r, c), columns=[str(x) for x in range(c)])
combs = itertools.combinations(df.columns.tolist(), 2)
for x, y in combs:
df['%s+%s' % (x, y)] = df[[x, y]].sum(axis=1)
```
```
INSTALLED VERSIONS
------------------
commit: None
python: 2.7.11.final.0
python-bits: 64
OS: Darwin
OS-release: 15.3.0
machine: x86_64
processor: i386
byteorder: little
LC_ALL: en_US.UTF-8
LANG: None
pandas: 0.18.0
nose: 1.3.7
pip: 8.1.1
setuptools: 20.6.7
Cython: 0.23.4
numpy: 1.11.0
scipy: 0.16.0
statsmodels: 0.6.1
xarray: None
IPython: 4.0.1
sphinx: 1.3.1
patsy: 0.4.0
dateutil: 2.5.2
pytz: 2016.3
blosc: None
bottleneck: 1.0.0
tables: 3.2.2
numexpr: 2.5.2
matplotlib: 1.5.0
openpyxl: 2.2.6
xlrd: 0.9.4
xlwt: 1.0.0
xlsxwriter: 0.7.7
lxml: None
bs4: 4.4.1
html5lib: None
httplib2: 0.9.1
apiclient: 1.4.0
sqlalchemy: 1.0.9
pymysql: None
psycopg2: 2.6 (dt dec pq3 ext)
jinja2: 2.8
boto: 2.38.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/12825/reactions"
} | https://api.github.com/repos/pandas-dev/pandas/issues/12825/timeline | null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/12826 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/12826/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/12826/comments | https://api.github.com/repos/pandas-dev/pandas/issues/12826/events | https://github.com/pandas-dev/pandas/issues/12826 | 146,889,628 | MDU6SXNzdWUxNDY4ODk2Mjg= | 12,826 | resample() / DatetimeIndexResampler is not resampling according to the given frequency rule | {
"avatar_url": "https://avatars.githubusercontent.com/u/209902?v=4",
"events_url": "https://api.github.com/users/gabrielcnr/events{/privacy}",
"followers_url": "https://api.github.com/users/gabrielcnr/followers",
"following_url": "https://api.github.com/users/gabrielcnr/following{/other_user}",
"gists_url": "https://api.github.com/users/gabrielcnr/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/gabrielcnr",
"id": 209902,
"login": "gabrielcnr",
"node_id": "MDQ6VXNlcjIwOTkwMg==",
"organizations_url": "https://api.github.com/users/gabrielcnr/orgs",
"received_events_url": "https://api.github.com/users/gabrielcnr/received_events",
"repos_url": "https://api.github.com/users/gabrielcnr/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/gabrielcnr/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/gabrielcnr/subscriptions",
"type": "User",
"url": "https://api.github.com/users/gabrielcnr"
} | [
{
"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": "DateOffsets",
"id": 53181044,
"name": "Frequency",
"node_id": "MDU6TGFiZWw1MzE4MTA0NA==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Frequency"
},
{
"color": "207de5",
"default": false,
"description": "resample method",
"id": 74975453,
"name": "Resample",
"node_id": "MDU6TGFiZWw3NDk3NTQ1Mw==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Resample"
}
]
| open | false | null | []
| null | 1 | 2016-04-08T10:41:54Z | 2020-05-11T18:54:04Z | null | NONE | null | When using frequency rule `2Q-SEP` it depends on the index of the time series it gives different resampled results. We should expect always March and September dates when using 2Q-SEP, however we might get June and December sometimes.
#### Code Sample, a copy-pastable example if possible
``` python
import pandas as pd
values = [100, 100, 100, 200, 200, 200, 200, 200, 200, 300, 300, 300]
index = pd.date_range('2016-01-01', '2016-12-31', freq='MS')
df = pd.DataFrame({'values': values}, index=index)
df_2Q_SEP = df.resample('2Q-SEP').mean()
# After resampling in 2Q-SEP we have March and September dates
print 'GOOD:'
print df_2Q_SEP
print
# Starting the TimeSeries in April
df_2 = pd.DataFrame({'values': values[3:]}, index=index[3:])
df_2_2Q_SEP = df_2.resample('2Q-SEP').mean()
# However here now after resampling in 2Q-SEP we have June and December dates
# which is not what we expected (given the desired frequency rule)
print 'BAD:'
print df_2_2Q_SEP
```
#### Expected Output
```
GOOD:
values
2016-03-31 100
2016-09-30 200
2017-03-31 300
BAD:
values
2016-06-30 200
2016-12-31 250
```
#### output of `pd.show_versions()`
```
INSTALLED VERSIONS
------------------
commit: None
python: 2.7.11.final.0
python-bits: 64
OS: Windows
OS-release: 7
machine: AMD64
processor: Intel64 Family 6 Model 44 Stepping 2, GenuineIntel
byteorder: little
LC_ALL: None
LANG: None
pandas: 0.18.0
nose: None
pip: 8.1.1
setuptools: 20.6.7
Cython: None
numpy: 1.11.0
scipy: None
statsmodels: None
xarray: None
IPython: None
sphinx: None
patsy: None
dateutil: 2.5.2
pytz: 2016.3
blosc: None
bottleneck: None
tables: None
numexpr: None
matplotlib: None
openpyxl: None
xlrd: None
xlwt: None
xlsxwriter: None
lxml: None
bs4: None
html5lib: None
httplib2: None
apiclient: None
sqlalchemy: None
pymysql: None
psycopg2: None
jinja2: None
boto: None
```
| {
"+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/12826/reactions"
} | https://api.github.com/repos/pandas-dev/pandas/issues/12826/timeline | null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/12827 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/12827/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/12827/comments | https://api.github.com/repos/pandas-dev/pandas/issues/12827/events | https://github.com/pandas-dev/pandas/issues/12827 | 146,933,234 | MDU6SXNzdWUxNDY5MzMyMzQ= | 12,827 | Indexing MultiIndex level depends on chosen level | {
"avatar_url": "https://avatars.githubusercontent.com/u/1224492?v=4",
"events_url": "https://api.github.com/users/toobaz/events{/privacy}",
"followers_url": "https://api.github.com/users/toobaz/followers",
"following_url": "https://api.github.com/users/toobaz/following{/other_user}",
"gists_url": "https://api.github.com/users/toobaz/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/toobaz",
"id": 1224492,
"login": "toobaz",
"node_id": "MDQ6VXNlcjEyMjQ0OTI=",
"organizations_url": "https://api.github.com/users/toobaz/orgs",
"received_events_url": "https://api.github.com/users/toobaz/received_events",
"repos_url": "https://api.github.com/users/toobaz/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/toobaz/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/toobaz/subscriptions",
"type": "User",
"url": "https://api.github.com/users/toobaz"
} | [
{
"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": "207de5",
"default": false,
"description": null,
"id": 71268330,
"name": "MultiIndex",
"node_id": "MDU6TGFiZWw3MTI2ODMzMA==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/MultiIndex"
}
]
| open | false | null | []
| null | 17 | 2016-04-08T13:45:29Z | 2021-04-23T03:04:11Z | null | MEMBER | null | #### Code Sample, a copy-pastable example if possible
```
In [2]: ss = pd.Series(range(4),
...: index=pd.MultiIndex.from_product([[1,2], [1,2]]))
In [3]: ss.loc[:, 1].index.__class__
Out[3]: pandas.indexes.numeric.Int64Index
In [4]: ss.loc[1,:].index.__class__
Out[4]: pandas.indexes.multi.MultiIndex
```
#### Expected Output
The first: the level I am indexing on should disappear from the index.
This is related to http://stackoverflow.com/q/36459311/2858145 (I think)
#### output of `pd.show_versions()`
```
In [5]: pd.show_versions()
INSTALLED VERSIONS
------------------
commit: None
python: 2.7.10.final.0
python-bits: 64
OS: Linux
OS-release: 4.4.0-1-amd64
machine: x86_64
processor:
byteorder: little
LC_ALL: None
LANG: it_IT.utf8
pandas: 0.18.0+88.g5e11243.dirty
nose: 1.3.6
pip: 1.5.6
setuptools: 18.4
Cython: 0.23.2
numpy: 1.10.4
scipy: 0.16.0
statsmodels: 0.8.0.dev0+755fa81
xarray: None
IPython: 2.4.1
sphinx: 1.3.1
patsy: 0.3.0-dev
dateutil: 2.2
pytz: 2012c
blosc: None
bottleneck: None
tables: 3.2.2
numexpr: 2.4.3
matplotlib: 1.5.0rc2
openpyxl: 2.3.0
xlrd: 0.9.4
xlwt: 0.7.5
xlsxwriter: 0.7.3
lxml: 3.4.4
bs4: 4.4.0
html5lib: 0.999
httplib2: 0.9.1
apiclient: None
sqlalchemy: 1.0.11
pymysql: None
psycopg2: 2.6.1 (dt dec mx pq3 ext lo64)
jinja2: 2.8
boto: 2.38.0
pandas_datareader: None
```
| {
"+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/12827/reactions"
} | https://api.github.com/repos/pandas-dev/pandas/issues/12827/timeline | null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/12828 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/12828/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/12828/comments | https://api.github.com/repos/pandas-dev/pandas/issues/12828/events | https://github.com/pandas-dev/pandas/issues/12828 | 146,975,602 | MDU6SXNzdWUxNDY5NzU2MDI= | 12,828 | API: extend resample to handle non-datetime numeric axes? | {
"avatar_url": "https://avatars.githubusercontent.com/u/1217238?v=4",
"events_url": "https://api.github.com/users/shoyer/events{/privacy}",
"followers_url": "https://api.github.com/users/shoyer/followers",
"following_url": "https://api.github.com/users/shoyer/following{/other_user}",
"gists_url": "https://api.github.com/users/shoyer/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/shoyer",
"id": 1217238,
"login": "shoyer",
"node_id": "MDQ6VXNlcjEyMTcyMzg=",
"organizations_url": "https://api.github.com/users/shoyer/orgs",
"received_events_url": "https://api.github.com/users/shoyer/received_events",
"repos_url": "https://api.github.com/users/shoyer/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/shoyer/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/shoyer/subscriptions",
"type": "User",
"url": "https://api.github.com/users/shoyer"
} | [
{
"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": "resample method",
"id": 74975453,
"name": "Resample",
"node_id": "MDU6TGFiZWw3NDk3NTQ1Mw==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Resample"
}
]
| open | false | null | []
| null | 1 | 2016-04-08T16:29:21Z | 2021-04-23T03:04:54Z | null | MEMBER | null | Numeric indexes are pretty common with scientific datasets and [xarray](http://xarray.pydata.org). For such data, resampling to a new resolution is a pretty common operation.
Currently, resampling only works for dates. Any thoughts on making it work for all numeric axes? I think every argument in the [signature](http://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.resample.html) would still make sense for numbers, except the rule would be expected to be a number, not a string.
I expect the implementation would be relatively straightforward, given that we don't need to handle the complexity of datetime frequencies.
xref https://github.com/pydata/xarray/pull/818
| {
"+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/12828/reactions"
} | https://api.github.com/repos/pandas-dev/pandas/issues/12828/timeline | null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/12829 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/12829/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/12829/comments | https://api.github.com/repos/pandas-dev/pandas/issues/12829/events | https://github.com/pandas-dev/pandas/issues/12829 | 146,995,402 | MDU6SXNzdWUxNDY5OTU0MDI= | 12,829 | Bug when combining .groupby() apply with .expanding() apply | {
"avatar_url": "https://avatars.githubusercontent.com/u/5126549?v=4",
"events_url": "https://api.github.com/users/lminer/events{/privacy}",
"followers_url": "https://api.github.com/users/lminer/followers",
"following_url": "https://api.github.com/users/lminer/following{/other_user}",
"gists_url": "https://api.github.com/users/lminer/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/lminer",
"id": 5126549,
"login": "lminer",
"node_id": "MDQ6VXNlcjUxMjY1NDk=",
"organizations_url": "https://api.github.com/users/lminer/orgs",
"received_events_url": "https://api.github.com/users/lminer/received_events",
"repos_url": "https://api.github.com/users/lminer/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/lminer/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/lminer/subscriptions",
"type": "User",
"url": "https://api.github.com/users/lminer"
} | [
{
"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": "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 | 9 | 2016-04-08T17:56:52Z | 2016-04-08T18:59:58Z | 2016-04-08T18:21:38Z | NONE | null | In this example, the aim is to use an expanding window to create an expanding count, by group, of the occurrence of a predetermined set of strings. Seemed like there might be some sort of bug in the performance of `expanding` when combined with `groupby` and `apply`.
In this case the strings are `['tito', 'bar', 'feep']`
```
category group
2000-01-01 'foo' a
2000-01-02 'tito' a
2000-01-03 'bar' a
2000-01-04 'zip' b
2000-01-05 'zorp' b
2000-01-03 'feep' c
```
So this would become:
```
category group count
2000-01-01 'foo' a 0
2000-01-02 'tito' a 1
2000-01-03 'bar' a 2
2000-01-04 'zip' b 0
2000-01-05 'zorp' b 0
2000-01-03 'feep' c 1
```
However, when I run the following code, it's just the `category` column that gets returned as `count`. The same thing happens when I use `window` in the place of `expanding`.
``` python
from operator import or_
df = pd.DataFrame({'category':['foo', 'tito', 'bar', 'zip', 'zorp', 'feep'],
'group': ['a', 'a', 'a', 'b', 'b', 'c']},
index=pd.to_datetime(['2000-01-01', '2000-01-02', '2000-01-03',
'2000-01-04', '2000-01-05', '2000-01-03']))
def count_categories(ser):
categories_to_count = ['tito',
'bar',
'feep']
conditions = [ser == val for val in categories_to_count]
mask = reduce(or_, conditions)
return mask.sum()
def expanding_count_categories(s):
return s.expanding().apply(count_categories)
df.groupby('group')['category'].apply(expanding_count_categories)
>> '2000-01-01' foo
>> '2000-01-02' tito
>> '2000-01-03' bar
>> '2000-01-04' zip
>> '2000-01-05' zorp
>> '2000-01-03' feep
>> dtype: object
```
## INSTALLED VERSIONS
commit: None
python: 2.7.6.final.0
python-bits: 64
OS: Linux
OS-release: 3.13.0-76-generic
machine: x86_64
processor: x86_64
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8
pandas: 0.18.0
nose: 1.3.1
pip: 8.0.2
setuptools: 19.1.1
Cython: 0.23.4
numpy: 1.11.0
scipy: 0.16.1
statsmodels: 0.6.1
xarray: None
IPython: 4.0.2
sphinx: 1.2.2
patsy: 0.4.1
dateutil: 2.5.2
pytz: 2016.3
blosc: None
bottleneck: None
tables: None
numexpr: None
matplotlib: 1.5.1
openpyxl: None
xlrd: None
xlwt: 0.7.5
xlsxwriter: None
lxml: None
bs4: None
html5lib: None
httplib2: None
apiclient: None
sqlalchemy: None
pymysql: None
psycopg2: None
jinja2: 2.8
boto: None
| {
"+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/12829/reactions"
} | https://api.github.com/repos/pandas-dev/pandas/issues/12829/timeline | null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/12830 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/12830/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/12830/comments | https://api.github.com/repos/pandas-dev/pandas/issues/12830/events | https://github.com/pandas-dev/pandas/issues/12830 | 147,037,690 | MDU6SXNzdWUxNDcwMzc2OTA= | 12,830 | Datetime series cannot subtract numpy.datetime64 | {
"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": "AFEEEE",
"default": false,
"description": null,
"id": 211840,
"name": "Timeseries",
"node_id": "MDU6TGFiZWwyMTE4NDA=",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Timeseries"
},
{
"color": "e102d8",
"default": false,
"description": "Unexpected or buggy dtype conversions",
"id": 31404521,
"name": "Dtype Conversions",
"node_id": "MDU6TGFiZWwzMTQwNDUyMQ==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Dtype%20Conversions"
},
{
"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"
} | 2 | 2016-04-08T20:55:41Z | 2016-04-08T21:17:27Z | 2016-04-08T21:15:40Z | CONTRIBUTOR | null | For some reason, it's not possible to subtract a `numpy.datetime64` object from a `Series`, even though subtracting a `datetime.datetime` object is possible. I found this bug when trying to work around issue #8554.
#### Code Sample, a copy-pastable example if possible
``` python
import pandas as pd
import numpy as np
from datetime import datetime
EPOCH = datetime(1970, 1, 1)
EPOCH64 = np.datetime64(EPOCH)
df = pd.DataFrame(pd.date_range('2014-11-19', '2014-11-21', freq='D'))
epoch_ts = df[0] - EPOCH # Works
epoch_tsnp = pd.Series(df[0].values - EPOCH64, name=0) # Works
epoch_ts64 = df[0] - EPOCH64 # TypeError
```
#### Expected Output
`epoch_ts` and `epoch_tsnp` are both:
```
0 16393 days
1 16394 days
2 16395 days
Name: 0, dtype: timedelta64[ns]
```
There is a `TypeError` raised when `epoch_ts64` is calculated. A full stack trace follows:
```
~/anaconda3/lib/python3.5/site-packages/pandas/core/ops.py in wrapper(left, right, name, na_op)
605
606 time_converted = _TimeOp.maybe_convert_for_time_op(left, right, name,
--> 607 na_op)
608
609 if time_converted is None:
~/anaconda3/lib/python3.5/site-packages/pandas/core/ops.py in maybe_convert_for_time_op(cls, left, right, name, na_op)
565 return None
566
--> 567 return cls(left, right, name, na_op)
568
569
~/anaconda3/lib/python3.5/site-packages/pandas/core/ops.py in __init__(self, left, right, name, na_op)
279
280 lvalues = self._convert_to_array(left, name=name)
--> 281 rvalues = self._convert_to_array(right, name=name, other=lvalues)
282
283 self.name = name
~/anaconda3/lib/python3.5/site-packages/pandas/core/ops.py in _convert_to_array(self, values, name, other)
400 if (supplied_dtype is None and other is not None and
401 (other.dtype in ('timedelta64[ns]', 'datetime64[ns]')) and
--> 402 isnull(values).all()):
403 values = np.empty(values.shape, dtype='timedelta64[ns]')
404 values[:] = iNaT
~/anaconda3/lib/python3.5/site-packages/pandas/core/common.py in isnull(obj)
174 pandas.notnull: boolean inverse of pandas.isnull
175 """
--> 176 return _isnull(obj)
177
178
~/anaconda3/lib/python3.5/site-packages/pandas/core/common.py in _isnull_new(obj)
184 raise NotImplementedError("isnull is not defined for MultiIndex")
185 elif isinstance(obj, (ABCSeries, np.ndarray, pd.Index)):
--> 186 return _isnull_ndarraylike(obj)
187 elif isinstance(obj, ABCGeneric):
188 return obj._constructor(obj._data.isnull(func=isnull))
~/anaconda3/lib/python3.5/site-packages/pandas/core/common.py in _isnull_ndarraylike(obj)
275 result = values.view('i8') == tslib.iNaT
276 else:
--> 277 result = np.isnan(values)
278
279 # box
TypeError: ufunc 'isnan' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''
```
#### output of `pd.show_versions()`
```
INSTALLED VERSIONS
------------------
commit: None
python: 3.5.1.final.0
python-bits: 64
OS: Linux
OS-release: 3.19.0-58-generic
machine: x86_64
processor: x86_64
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8
pandas: 0.18.0
nose: 1.3.7
pip: 8.1.1
setuptools: 20.2.2
Cython: 0.23.4
numpy: 1.10.4
scipy: 0.17.0
statsmodels: 0.6.1
xarray: None
IPython: 4.0.3
sphinx: 1.3.5
patsy: 0.4.0
dateutil: 2.5.1
pytz: 2016.3
blosc: None
bottleneck: 1.0.0
tables: 3.2.2
numexpr: 2.4.6
matplotlib: 1.5.1
openpyxl: 2.3.2
xlrd: 0.9.4
xlwt: 1.0.0
xlsxwriter: 0.8.4
lxml: 3.5.0
bs4: 4.4.1
html5lib: None
httplib2: None
apiclient: None
sqlalchemy: 1.0.11
pymysql: None
psycopg2: None
jinja2: 2.8
boto: 2.39.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/12830/reactions"
} | https://api.github.com/repos/pandas-dev/pandas/issues/12830/timeline | null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/12831 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/12831/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/12831/comments | https://api.github.com/repos/pandas-dev/pandas/issues/12831/events | https://github.com/pandas-dev/pandas/pull/12831 | 147,049,682 | MDExOlB1bGxSZXF1ZXN0NjU4NTMwOTI= | 12,831 | BUG: SparseSeries.reindex with fill_value | {
"avatar_url": "https://avatars.githubusercontent.com/u/1696302?v=4",
"events_url": "https://api.github.com/users/sinhrks/events{/privacy}",
"followers_url": "https://api.github.com/users/sinhrks/followers",
"following_url": "https://api.github.com/users/sinhrks/following{/other_user}",
"gists_url": "https://api.github.com/users/sinhrks/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/sinhrks",
"id": 1696302,
"login": "sinhrks",
"node_id": "MDQ6VXNlcjE2OTYzMDI=",
"organizations_url": "https://api.github.com/users/sinhrks/orgs",
"received_events_url": "https://api.github.com/users/sinhrks/received_events",
"repos_url": "https://api.github.com/users/sinhrks/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/sinhrks/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sinhrks/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sinhrks"
} | [
{
"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": "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": "009800",
"default": false,
"description": "Sparse Data Type",
"id": 49182326,
"name": "Sparse",
"node_id": "MDU6TGFiZWw0OTE4MjMyNg==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Sparse"
}
]
| closed | false | null | []
| {
"closed_at": "2016-05-05T00:34:40Z",
"closed_issues": 306,
"created_at": "2016-02-08T15:29:59Z",
"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": "after 0.18.0 of course!",
"due_on": "2016-05-04T07:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/38",
"id": 1570594,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/38/labels",
"node_id": "MDk6TWlsZXN0b25lMTU3MDU5NA==",
"number": 38,
"open_issues": 0,
"state": "closed",
"title": "0.18.1",
"updated_at": "2017-08-10T09:01:26Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/38"
} | 1 | 2016-04-08T21:57:48Z | 2016-04-09T14:44:55Z | 2016-04-09T14:44:21Z | MEMBER | null | - [x] closes #12797
- [x] tests added / passed
- [x] passes `git diff upstream/master | 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/12831/reactions"
} | https://api.github.com/repos/pandas-dev/pandas/issues/12831/timeline | null | 0 | {
"diff_url": "https://github.com/pandas-dev/pandas/pull/12831.diff",
"html_url": "https://github.com/pandas-dev/pandas/pull/12831",
"merged_at": null,
"patch_url": "https://github.com/pandas-dev/pandas/pull/12831.patch",
"url": "https://api.github.com/repos/pandas-dev/pandas/pulls/12831"
} |
https://api.github.com/repos/pandas-dev/pandas/issues/12832 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/12832/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/12832/comments | https://api.github.com/repos/pandas-dev/pandas/issues/12832/events | https://github.com/pandas-dev/pandas/pull/12832 | 147,066,756 | MDExOlB1bGxSZXF1ZXN0NjU4NjI2MTA= | 12,832 | Refactor test __tmp_* file cleanup | {
"avatar_url": "https://avatars.githubusercontent.com/u/50109?v=4",
"events_url": "https://api.github.com/users/gliptak/events{/privacy}",
"followers_url": "https://api.github.com/users/gliptak/followers",
"following_url": "https://api.github.com/users/gliptak/following{/other_user}",
"gists_url": "https://api.github.com/users/gliptak/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/gliptak",
"id": 50109,
"login": "gliptak",
"node_id": "MDQ6VXNlcjUwMTA5",
"organizations_url": "https://api.github.com/users/gliptak/orgs",
"received_events_url": "https://api.github.com/users/gliptak/received_events",
"repos_url": "https://api.github.com/users/gliptak/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/gliptak/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/gliptak/subscriptions",
"type": "User",
"url": "https://api.github.com/users/gliptak"
} | [
{
"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": "2016-05-05T00:34:40Z",
"closed_issues": 306,
"created_at": "2016-02-08T15:29:59Z",
"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": "after 0.18.0 of course!",
"due_on": "2016-05-04T07:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/38",
"id": 1570594,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/38/labels",
"node_id": "MDk6TWlsZXN0b25lMTU3MDU5NA==",
"number": 38,
"open_issues": 0,
"state": "closed",
"title": "0.18.1",
"updated_at": "2017-08-10T09:01:26Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/38"
} | 1 | 2016-04-08T23:58:21Z | 2016-04-09T14:35:00Z | 2016-04-09T14:34:51Z | CONTRIBUTOR | null | - [x] closes #9249
- [x] tests added / passed
- [x] passes `git diff upstream/master | 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/12832/reactions"
} | https://api.github.com/repos/pandas-dev/pandas/issues/12832/timeline | null | 0 | {
"diff_url": "https://github.com/pandas-dev/pandas/pull/12832.diff",
"html_url": "https://github.com/pandas-dev/pandas/pull/12832",
"merged_at": null,
"patch_url": "https://github.com/pandas-dev/pandas/pull/12832.patch",
"url": "https://api.github.com/repos/pandas-dev/pandas/pulls/12832"
} |
https://api.github.com/repos/pandas-dev/pandas/issues/12833 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/12833/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/12833/comments | https://api.github.com/repos/pandas-dev/pandas/issues/12833/events | https://github.com/pandas-dev/pandas/pull/12833 | 147,071,535 | MDExOlB1bGxSZXF1ZXN0NjU4NjQ1NTM= | 12,833 | Implement Akima1DInterpolator | {
"avatar_url": "https://avatars.githubusercontent.com/u/50109?v=4",
"events_url": "https://api.github.com/users/gliptak/events{/privacy}",
"followers_url": "https://api.github.com/users/gliptak/followers",
"following_url": "https://api.github.com/users/gliptak/following{/other_user}",
"gists_url": "https://api.github.com/users/gliptak/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/gliptak",
"id": 50109,
"login": "gliptak",
"node_id": "MDQ6VXNlcjUwMTA5",
"organizations_url": "https://api.github.com/users/gliptak/orgs",
"received_events_url": "https://api.github.com/users/gliptak/received_events",
"repos_url": "https://api.github.com/users/gliptak/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/gliptak/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/gliptak/subscriptions",
"type": "User",
"url": "https://api.github.com/users/gliptak"
} | [
{
"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": "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": "2016-05-05T00:34:40Z",
"closed_issues": 306,
"created_at": "2016-02-08T15:29:59Z",
"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": "after 0.18.0 of course!",
"due_on": "2016-05-04T07:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/38",
"id": 1570594,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/38/labels",
"node_id": "MDk6TWlsZXN0b25lMTU3MDU5NA==",
"number": 38,
"open_issues": 0,
"state": "closed",
"title": "0.18.1",
"updated_at": "2017-08-10T09:01:26Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/38"
} | 17 | 2016-04-09T00:34:14Z | 2016-04-11T22:32:44Z | 2016-04-11T15:03:58Z | CONTRIBUTOR | null | - [x] closes #7588
- [x] tests added / passed
- [x] passes `git diff upstream/master | 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/12833/reactions"
} | https://api.github.com/repos/pandas-dev/pandas/issues/12833/timeline | null | 0 | {
"diff_url": "https://github.com/pandas-dev/pandas/pull/12833.diff",
"html_url": "https://github.com/pandas-dev/pandas/pull/12833",
"merged_at": null,
"patch_url": "https://github.com/pandas-dev/pandas/pull/12833.patch",
"url": "https://api.github.com/repos/pandas-dev/pandas/pulls/12833"
} |
https://api.github.com/repos/pandas-dev/pandas/issues/12834 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/12834/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/12834/comments | https://api.github.com/repos/pandas-dev/pandas/issues/12834/events | https://github.com/pandas-dev/pandas/pull/12834 | 147,089,283 | MDExOlB1bGxSZXF1ZXN0NjU4NzA4MDA= | 12,834 | BUG 12800 fixed inconsistent behavior of last_valid_index and first_valid_index | {
"avatar_url": "https://avatars.githubusercontent.com/u/2932225?v=4",
"events_url": "https://api.github.com/users/gregorylivschitz/events{/privacy}",
"followers_url": "https://api.github.com/users/gregorylivschitz/followers",
"following_url": "https://api.github.com/users/gregorylivschitz/following{/other_user}",
"gists_url": "https://api.github.com/users/gregorylivschitz/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/gregorylivschitz",
"id": 2932225,
"login": "gregorylivschitz",
"node_id": "MDQ6VXNlcjI5MzIyMjU=",
"organizations_url": "https://api.github.com/users/gregorylivschitz/orgs",
"received_events_url": "https://api.github.com/users/gregorylivschitz/received_events",
"repos_url": "https://api.github.com/users/gregorylivschitz/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/gregorylivschitz/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/gregorylivschitz/subscriptions",
"type": "User",
"url": "https://api.github.com/users/gregorylivschitz"
} | [
{
"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"
}
]
| closed | false | null | []
| {
"closed_at": "2016-05-05T00:34:40Z",
"closed_issues": 306,
"created_at": "2016-02-08T15:29:59Z",
"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": "after 0.18.0 of course!",
"due_on": "2016-05-04T07:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/38",
"id": 1570594,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/38/labels",
"node_id": "MDk6TWlsZXN0b25lMTU3MDU5NA==",
"number": 38,
"open_issues": 0,
"state": "closed",
"title": "0.18.1",
"updated_at": "2017-08-10T09:01:26Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/38"
} | 3 | 2016-04-09T04:40:27Z | 2016-04-11T13:00:05Z | 2016-04-11T12:59:59Z | CONTRIBUTOR | null | - [x] closes #12800
- [x] tests added / passed
- [ ] passes `git diff upstream/master | 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/12834/reactions"
} | https://api.github.com/repos/pandas-dev/pandas/issues/12834/timeline | null | 0 | {
"diff_url": "https://github.com/pandas-dev/pandas/pull/12834.diff",
"html_url": "https://github.com/pandas-dev/pandas/pull/12834",
"merged_at": null,
"patch_url": "https://github.com/pandas-dev/pandas/pull/12834.patch",
"url": "https://api.github.com/repos/pandas-dev/pandas/pulls/12834"
} |
https://api.github.com/repos/pandas-dev/pandas/issues/12835 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/12835/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/12835/comments | https://api.github.com/repos/pandas-dev/pandas/issues/12835/events | https://github.com/pandas-dev/pandas/pull/12835 | 147,093,660 | MDExOlB1bGxSZXF1ZXN0NjU4NzE3NjU= | 12,835 | BUG: SparseSeries.value_counts ignores fill_value | {
"avatar_url": "https://avatars.githubusercontent.com/u/1696302?v=4",
"events_url": "https://api.github.com/users/sinhrks/events{/privacy}",
"followers_url": "https://api.github.com/users/sinhrks/followers",
"following_url": "https://api.github.com/users/sinhrks/following{/other_user}",
"gists_url": "https://api.github.com/users/sinhrks/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/sinhrks",
"id": 1696302,
"login": "sinhrks",
"node_id": "MDQ6VXNlcjE2OTYzMDI=",
"organizations_url": "https://api.github.com/users/sinhrks/orgs",
"received_events_url": "https://api.github.com/users/sinhrks/received_events",
"repos_url": "https://api.github.com/users/sinhrks/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/sinhrks/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sinhrks/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sinhrks"
} | [
{
"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": "Sparse Data Type",
"id": 49182326,
"name": "Sparse",
"node_id": "MDU6TGFiZWw0OTE4MjMyNg==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Sparse"
},
{
"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"
},
{
"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"
},
{
"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"
}
]
| closed | false | null | []
| {
"closed_at": "2016-05-05T00:34:40Z",
"closed_issues": 306,
"created_at": "2016-02-08T15:29:59Z",
"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": "after 0.18.0 of course!",
"due_on": "2016-05-04T07:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/38",
"id": 1570594,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/38/labels",
"node_id": "MDk6TWlsZXN0b25lMTU3MDU5NA==",
"number": 38,
"open_issues": 0,
"state": "closed",
"title": "0.18.1",
"updated_at": "2017-08-10T09:01:26Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/38"
} | 4 | 2016-04-09T05:33:29Z | 2016-04-29T17:17:59Z | 2016-04-29T17:17:59Z | MEMBER | null | - [x] closes #6749
- [x] tests added / passed
- [x] passes `git diff upstream/master | flake8 --diff`
- [x] whatsnew entry
Also fixed an issue which categorical `value_counts` resets name.
| {
"+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/12835/reactions"
} | https://api.github.com/repos/pandas-dev/pandas/issues/12835/timeline | null | 0 | {
"diff_url": "https://github.com/pandas-dev/pandas/pull/12835.diff",
"html_url": "https://github.com/pandas-dev/pandas/pull/12835",
"merged_at": null,
"patch_url": "https://github.com/pandas-dev/pandas/pull/12835.patch",
"url": "https://api.github.com/repos/pandas-dev/pandas/pulls/12835"
} |
https://api.github.com/repos/pandas-dev/pandas/issues/12836 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/12836/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/12836/comments | https://api.github.com/repos/pandas-dev/pandas/issues/12836/events | https://github.com/pandas-dev/pandas/pull/12836 | 147,093,943 | MDExOlB1bGxSZXF1ZXN0NjU4NzE4MzA= | 12,836 | BUG: SparseSeries.to_frame results in dense | {
"avatar_url": "https://avatars.githubusercontent.com/u/1696302?v=4",
"events_url": "https://api.github.com/users/sinhrks/events{/privacy}",
"followers_url": "https://api.github.com/users/sinhrks/followers",
"following_url": "https://api.github.com/users/sinhrks/following{/other_user}",
"gists_url": "https://api.github.com/users/sinhrks/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/sinhrks",
"id": 1696302,
"login": "sinhrks",
"node_id": "MDQ6VXNlcjE2OTYzMDI=",
"organizations_url": "https://api.github.com/users/sinhrks/orgs",
"received_events_url": "https://api.github.com/users/sinhrks/received_events",
"repos_url": "https://api.github.com/users/sinhrks/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/sinhrks/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sinhrks/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sinhrks"
} | [
{
"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": "Sparse Data Type",
"id": 49182326,
"name": "Sparse",
"node_id": "MDU6TGFiZWw0OTE4MjMyNg==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Sparse"
}
]
| closed | false | null | []
| {
"closed_at": "2016-05-05T00:34:40Z",
"closed_issues": 306,
"created_at": "2016-02-08T15:29:59Z",
"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": "after 0.18.0 of course!",
"due_on": "2016-05-04T07:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/38",
"id": 1570594,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/38/labels",
"node_id": "MDk6TWlsZXN0b25lMTU3MDU5NA==",
"number": 38,
"open_issues": 0,
"state": "closed",
"title": "0.18.1",
"updated_at": "2017-08-10T09:01:26Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/38"
} | 3 | 2016-04-09T05:36:48Z | 2016-04-09T18:02:18Z | 2016-04-09T18:01:56Z | MEMBER | null | - [x] closes #9850
- [x] tests added / passed
- [x] passes `git diff upstream/master | flake8 --diff`
- [x] whatsnew entry
This should be after #12831.
| {
"+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/12836/reactions"
} | https://api.github.com/repos/pandas-dev/pandas/issues/12836/timeline | null | 0 | {
"diff_url": "https://github.com/pandas-dev/pandas/pull/12836.diff",
"html_url": "https://github.com/pandas-dev/pandas/pull/12836",
"merged_at": null,
"patch_url": "https://github.com/pandas-dev/pandas/pull/12836.patch",
"url": "https://api.github.com/repos/pandas-dev/pandas/pulls/12836"
} |
https://api.github.com/repos/pandas-dev/pandas/issues/12837 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/12837/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/12837/comments | https://api.github.com/repos/pandas-dev/pandas/issues/12837/events | https://github.com/pandas-dev/pandas/issues/12837 | 147,138,486 | MDU6SXNzdWUxNDcxMzg0ODY= | 12,837 | fill_value in pandas.DataFrame.add: Why must be float? | {
"avatar_url": "https://avatars.githubusercontent.com/u/824529?v=4",
"events_url": "https://api.github.com/users/chengs/events{/privacy}",
"followers_url": "https://api.github.com/users/chengs/followers",
"following_url": "https://api.github.com/users/chengs/following{/other_user}",
"gists_url": "https://api.github.com/users/chengs/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/chengs",
"id": 824529,
"login": "chengs",
"node_id": "MDQ6VXNlcjgyNDUyOQ==",
"organizations_url": "https://api.github.com/users/chengs/orgs",
"received_events_url": "https://api.github.com/users/chengs/received_events",
"repos_url": "https://api.github.com/users/chengs/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/chengs/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/chengs/subscriptions",
"type": "User",
"url": "https://api.github.com/users/chengs"
} | [
{
"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": "e102d8",
"default": false,
"description": "Unexpected or buggy dtype conversions",
"id": 31404521,
"name": "Dtype Conversions",
"node_id": "MDU6TGFiZWwzMTQwNDUyMQ==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Dtype%20Conversions"
},
{
"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 | 2016-04-09T15:32:19Z | 2016-04-09T16:23:32Z | 2016-04-09T15:35:18Z | NONE | null | In pandas.DataFrame.add, the description of fill_value is:
```
fill_value : None or float value, default None
Fill missing (NaN) values with this value. If both DataFrame locations are missing, the result will be missing
```
So its type is None or float, which causes that all dtypes in results are floats.
In practise, I find that it impacts memory usage and performance.
For example, after being converted to float64, the size of an int32 DF will be doubled.
#### Code Sample, a copy-pastable example if possible
``` python
import pandas as pd
t1 = pd.DataFrame([(1,2),(3,4),(5,6)], columns=["A","B"],dtype='uint32')
t2 = pd.DataFrame([(1,2),(3,4),(5,6)], columns=["D","C"],dtype='uint32')
t3 = t1.add(t2,axis='index',fill_value=0)
print t3.dtypes
```
```
A float64
B float64
C float64
D float64
dtype: object
```
#### output of `pd.show_versions()`
```
INSTALLED VERSIONS
------------------
commit: None
python: 2.7.11.final.0
python-bits: 64
OS: Darwin
OS-release: 15.4.0
machine: x86_64
processor: i386
byteorder: little
LC_ALL: en_US.UTF-8
LANG: en_US.UTF-8
pandas: 0.18.0
nose: 1.3.7
pip: 8.1.1
setuptools: 20.0
Cython: None
numpy: 1.11.0
scipy: 0.17.0
statsmodels: None
xarray: None
IPython: 4.1.2
sphinx: None
patsy: None
dateutil: 2.4.2
pytz: 2015.7
blosc: None
bottleneck: None
tables: None
numexpr: None
matplotlib: 1.5.0
openpyxl: None
xlrd: None
xlwt: None
xlsxwriter: None
lxml: None
bs4: None
html5lib: None
httplib2: None
apiclient: None
sqlalchemy: None
pymysql: None
psycopg2: None
jinja2: 2.8
boto: None
```
| {
"+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/12837/reactions"
} | https://api.github.com/repos/pandas-dev/pandas/issues/12837/timeline | null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/12838 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/12838/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/12838/comments | https://api.github.com/repos/pandas-dev/pandas/issues/12838/events | https://github.com/pandas-dev/pandas/issues/12838 | 147,144,333 | MDU6SXNzdWUxNDcxNDQzMzM= | 12,838 | BUG: fillna(inplace=True) method in DataFrame with list of column | {
"avatar_url": "https://avatars.githubusercontent.com/u/4370169?v=4",
"events_url": "https://api.github.com/users/chinskiy/events{/privacy}",
"followers_url": "https://api.github.com/users/chinskiy/followers",
"following_url": "https://api.github.com/users/chinskiy/following{/other_user}",
"gists_url": "https://api.github.com/users/chinskiy/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/chinskiy",
"id": 4370169,
"login": "chinskiy",
"node_id": "MDQ6VXNlcjQzNzAxNjk=",
"organizations_url": "https://api.github.com/users/chinskiy/orgs",
"received_events_url": "https://api.github.com/users/chinskiy/received_events",
"repos_url": "https://api.github.com/users/chinskiy/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/chinskiy/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/chinskiy/subscriptions",
"type": "User",
"url": "https://api.github.com/users/chinskiy"
} | [
{
"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": "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 | 1 | 2016-04-09T16:47:32Z | 2016-04-09T17:09:14Z | 2016-04-09T17:09:06Z | CONTRIBUTOR | null | #### Code Sample, a copy-pastable example if possible
```
df = pd.DataFrame([[None,2,3], [1,None,3], [1,2,None]], columns=['one', 'two', 'three'])
df
# one two three
#0 NaN 2.0 3.0
#1 1.0 NaN 3.0
#2 1.0 2.0 NaN
#Here work as expected
df.loc[:, ['one', 'two', 'three']].fillna(0.)
# one two three
#0 0.0 2.0 3.0
#1 1.0 0.0 3.0
#2 1.0 2.0 0.0
df.loc[:, ['one', 'two', 'three']].fillna(0., inplace=True)
df
# one two three
#0 NaN 2.0 3.0
#1 1.0 NaN 3.0
#2 1.0 2.0 NaN
```
#### Expected Output
```
df.loc[:, ['one', 'two', 'three']].fillna(0., inplace=True)
df
# one two three
#0 0.0 2.0 3.0
#1 1.0 0.0 3.0
#2 1.0 2.0 0.0
```
#### output of `pd.show_versions()`
## INSTALLED VERSIONS
commit: None
python: 2.7.6.final.0
python-bits: 64
OS: Linux
OS-release: 4.4.0-14-generic
machine: x86_64
processor: x86_64
byteorder: little
LC_ALL: None
LANG: en_GB.UTF-8
pandas: 0.18.0+38.gfc077b7
nose: 1.3.7
pip: 8.1.1
setuptools: 20.6.7
Cython: 0.24
numpy: 1.11.0
scipy: 0.17.0
statsmodels: 0.6.1
xarray: None
IPython: 4.1.2
sphinx: 1.4
patsy: 0.4.1
dateutil: 2.5.2
pytz: 2016.3
blosc: None
bottleneck: 1.0.0
tables: None
numexpr: 2.5.2
matplotlib: 1.5.1
openpyxl: 2.3.4
xlrd: 0.9.4
xlwt: None
xlsxwriter: 0.8.4
lxml: 3.6.0
bs4: 4.4.1
html5lib: 1.0b8
httplib2: 0.9.2
apiclient: None
sqlalchemy: 1.0.12
pymysql: None
psycopg2: 2.6.1 (dt dec pq3 ext lo64)
jinja2: 2.8
boto: None
| {
"+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/12838/reactions"
} | https://api.github.com/repos/pandas-dev/pandas/issues/12838/timeline | null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/12839 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/12839/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/12839/comments | https://api.github.com/repos/pandas-dev/pandas/issues/12839/events | https://github.com/pandas-dev/pandas/issues/12839 | 147,149,218 | MDU6SXNzdWUxNDcxNDkyMTg= | 12,839 | GroupBy.nth includes group key inconsistently | {
"avatar_url": "https://avatars.githubusercontent.com/u/1696302?v=4",
"events_url": "https://api.github.com/users/sinhrks/events{/privacy}",
"followers_url": "https://api.github.com/users/sinhrks/followers",
"following_url": "https://api.github.com/users/sinhrks/following{/other_user}",
"gists_url": "https://api.github.com/users/sinhrks/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/sinhrks",
"id": 1696302,
"login": "sinhrks",
"node_id": "MDQ6VXNlcjE2OTYzMDI=",
"organizations_url": "https://api.github.com/users/sinhrks/orgs",
"received_events_url": "https://api.github.com/users/sinhrks/received_events",
"repos_url": "https://api.github.com/users/sinhrks/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/sinhrks/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sinhrks/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sinhrks"
} | [
{
"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"
}
]
| closed | false | null | []
| {
"closed_at": "2016-10-03T08:52:13Z",
"closed_issues": 733,
"created_at": "2016-03-11T21:24:45Z",
"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": "",
"due_on": "2016-09-30T07:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/40",
"id": 1639795,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/40/labels",
"node_id": "MDk6TWlsZXN0b25lMTYzOTc5NQ==",
"number": 40,
"open_issues": 0,
"state": "closed",
"title": "0.19.0",
"updated_at": "2017-11-06T02:01:14Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/40"
} | 9 | 2016-04-09T18:15:06Z | 2016-07-06T21:47:54Z | 2016-07-06T21:47:54Z | MEMBER | null | #### Code Sample, a copy-pastable example if possible
`nth` doesn't inlcude group key as the same as `first` and `last`.
```
df = pd.DataFrame({'A': [1, 2, 3, 4, 5], 'B': [1, 2, 3, 4, 5],
'G': [1, 1, 2, 2, 1]})
g = df.groupby('G')
g.nth(1)
# A B
# G
#1 2 2
#2 4 4
```
However, calling `head` makes the behavior change. Looks to be caused by `_set_selection_from_grouper` caches its selection.
```
g = df.groupby('G')
g.head()
g.nth(1)
# A B G
# G
#1 2 2 1
#2 4 4 2
```
#### Expected Output
always as below.
```
g.nth(1)
# A B
# G
#1 2 2
#2 4 4
```
#### output of `pd.show_versions()`
current master.
| {
"+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/12839/reactions"
} | https://api.github.com/repos/pandas-dev/pandas/issues/12839/timeline | null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/12840 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/12840/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/12840/comments | https://api.github.com/repos/pandas-dev/pandas/issues/12840/events | https://github.com/pandas-dev/pandas/pull/12840 | 147,149,836 | MDExOlB1bGxSZXF1ZXN0NjU4ODgyODM= | 12,840 | BUG: GroupBy with TimeGrouper sorts unstably | {
"avatar_url": "https://avatars.githubusercontent.com/u/1696302?v=4",
"events_url": "https://api.github.com/users/sinhrks/events{/privacy}",
"followers_url": "https://api.github.com/users/sinhrks/followers",
"following_url": "https://api.github.com/users/sinhrks/following{/other_user}",
"gists_url": "https://api.github.com/users/sinhrks/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/sinhrks",
"id": 1696302,
"login": "sinhrks",
"node_id": "MDQ6VXNlcjE2OTYzMDI=",
"organizations_url": "https://api.github.com/users/sinhrks/orgs",
"received_events_url": "https://api.github.com/users/sinhrks/received_events",
"repos_url": "https://api.github.com/users/sinhrks/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/sinhrks/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sinhrks/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sinhrks"
} | [
{
"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"
}
]
| closed | false | null | []
| {
"closed_at": "2016-05-05T00:34:40Z",
"closed_issues": 306,
"created_at": "2016-02-08T15:29:59Z",
"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": "after 0.18.0 of course!",
"due_on": "2016-05-04T07:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/38",
"id": 1570594,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/38/labels",
"node_id": "MDk6TWlsZXN0b25lMTU3MDU5NA==",
"number": 38,
"open_issues": 0,
"state": "closed",
"title": "0.18.1",
"updated_at": "2017-08-10T09:01:26Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/38"
} | 2 | 2016-04-09T18:21:06Z | 2016-04-10T14:04:45Z | 2016-04-10T14:04:45Z | MEMBER | null | - [x] closes #7453
- [x] tests added / passed
- [x] passes `git diff upstream/master | flake8 --diff`
- [x] whatsnew entry
Because it may affect to resample perf, alternative idea is to add `TimeGropuper` path to `GroupBy.first` and `last`.
| {
"+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/12840/reactions"
} | https://api.github.com/repos/pandas-dev/pandas/issues/12840/timeline | null | 0 | {
"diff_url": "https://github.com/pandas-dev/pandas/pull/12840.diff",
"html_url": "https://github.com/pandas-dev/pandas/pull/12840",
"merged_at": null,
"patch_url": "https://github.com/pandas-dev/pandas/pull/12840.patch",
"url": "https://api.github.com/repos/pandas-dev/pandas/pulls/12840"
} |
https://api.github.com/repos/pandas-dev/pandas/issues/12841 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/12841/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/12841/comments | https://api.github.com/repos/pandas-dev/pandas/issues/12841/events | https://github.com/pandas-dev/pandas/pull/12841 | 147,151,240 | MDExOlB1bGxSZXF1ZXN0NjU4ODg3Mjk= | 12,841 | TST: Add numeric coercion tests | {
"avatar_url": "https://avatars.githubusercontent.com/u/1696302?v=4",
"events_url": "https://api.github.com/users/sinhrks/events{/privacy}",
"followers_url": "https://api.github.com/users/sinhrks/followers",
"following_url": "https://api.github.com/users/sinhrks/following{/other_user}",
"gists_url": "https://api.github.com/users/sinhrks/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/sinhrks",
"id": 1696302,
"login": "sinhrks",
"node_id": "MDQ6VXNlcjE2OTYzMDI=",
"organizations_url": "https://api.github.com/users/sinhrks/orgs",
"received_events_url": "https://api.github.com/users/sinhrks/received_events",
"repos_url": "https://api.github.com/users/sinhrks/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/sinhrks/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sinhrks/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sinhrks"
} | [
{
"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": "e102d8",
"default": false,
"description": "Unexpected or buggy dtype conversions",
"id": 31404521,
"name": "Dtype Conversions",
"node_id": "MDU6TGFiZWwzMTQwNDUyMQ==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Dtype%20Conversions"
},
{
"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"
}
]
| closed | false | null | []
| {
"closed_at": "2016-05-05T00:34:40Z",
"closed_issues": 306,
"created_at": "2016-02-08T15:29:59Z",
"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": "after 0.18.0 of course!",
"due_on": "2016-05-04T07:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/38",
"id": 1570594,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/38/labels",
"node_id": "MDk6TWlsZXN0b25lMTU3MDU5NA==",
"number": 38,
"open_issues": 0,
"state": "closed",
"title": "0.18.1",
"updated_at": "2017-08-10T09:01:26Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/38"
} | 2 | 2016-04-09T18:38:56Z | 2016-04-10T14:29:50Z | 2016-04-10T14:29:46Z | MEMBER | null | - [x] related to #12747 and #12780
- [x] tests added / passed
- [x] passes `git diff upstream/master | flake8 --diff`
Because dtype coercion affects to lots of functions, would like to fix in the following steps. The behavior which looks incorrect are commented with `TODO_GH12747`
1(this PR) Add numeric related tests to clarify the current behaviour (and future change)
2. Fix numeric coercion.
3. Add datetime-like tests.
4. Fix datetime-like coercion.
| {
"+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/12841/reactions"
} | https://api.github.com/repos/pandas-dev/pandas/issues/12841/timeline | null | 0 | {
"diff_url": "https://github.com/pandas-dev/pandas/pull/12841.diff",
"html_url": "https://github.com/pandas-dev/pandas/pull/12841",
"merged_at": null,
"patch_url": "https://github.com/pandas-dev/pandas/pull/12841.patch",
"url": "https://api.github.com/repos/pandas-dev/pandas/pulls/12841"
} |
https://api.github.com/repos/pandas-dev/pandas/issues/12842 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/12842/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/12842/comments | https://api.github.com/repos/pandas-dev/pandas/issues/12842/events | https://github.com/pandas-dev/pandas/pull/12842 | 147,186,478 | MDExOlB1bGxSZXF1ZXN0NjU4OTkxMzI= | 12,842 | ENH: Add Index.str.get_dummies | {
"avatar_url": "https://avatars.githubusercontent.com/u/1696302?v=4",
"events_url": "https://api.github.com/users/sinhrks/events{/privacy}",
"followers_url": "https://api.github.com/users/sinhrks/followers",
"following_url": "https://api.github.com/users/sinhrks/following{/other_user}",
"gists_url": "https://api.github.com/users/sinhrks/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/sinhrks",
"id": 1696302,
"login": "sinhrks",
"node_id": "MDQ6VXNlcjE2OTYzMDI=",
"organizations_url": "https://api.github.com/users/sinhrks/orgs",
"received_events_url": "https://api.github.com/users/sinhrks/received_events",
"repos_url": "https://api.github.com/users/sinhrks/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/sinhrks/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sinhrks/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sinhrks"
} | [
{
"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": "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": "2016-05-05T00:34:40Z",
"closed_issues": 306,
"created_at": "2016-02-08T15:29:59Z",
"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": "after 0.18.0 of course!",
"due_on": "2016-05-04T07:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/38",
"id": 1570594,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/38/labels",
"node_id": "MDk6TWlsZXN0b25lMTU3MDU5NA==",
"number": 38,
"open_issues": 0,
"state": "closed",
"title": "0.18.1",
"updated_at": "2017-08-10T09:01:26Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/38"
} | 3 | 2016-04-10T02:47:28Z | 2016-04-11T14:15:39Z | 2016-04-11T12:54:39Z | MEMBER | null | - [x] closes #10103
- [x] tests added / passed
- [x] passes `git diff upstream/master | flake8 --diff`
- [x] whatsnew entry
Add `Index.str.get_dummies` which always returns `MultiIndex`.
| {
"+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/12842/reactions"
} | https://api.github.com/repos/pandas-dev/pandas/issues/12842/timeline | null | 0 | {
"diff_url": "https://github.com/pandas-dev/pandas/pull/12842.diff",
"html_url": "https://github.com/pandas-dev/pandas/pull/12842",
"merged_at": null,
"patch_url": "https://github.com/pandas-dev/pandas/pull/12842.patch",
"url": "https://api.github.com/repos/pandas-dev/pandas/pulls/12842"
} |
https://api.github.com/repos/pandas-dev/pandas/issues/12843 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/12843/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/12843/comments | https://api.github.com/repos/pandas-dev/pandas/issues/12843/events | https://github.com/pandas-dev/pandas/pull/12843 | 147,187,860 | MDExOlB1bGxSZXF1ZXN0NjU4OTk2Mjg= | 12,843 | BUG: .str methods with expand=True may raise ValueError if input has name | {
"avatar_url": "https://avatars.githubusercontent.com/u/1696302?v=4",
"events_url": "https://api.github.com/users/sinhrks/events{/privacy}",
"followers_url": "https://api.github.com/users/sinhrks/followers",
"following_url": "https://api.github.com/users/sinhrks/following{/other_user}",
"gists_url": "https://api.github.com/users/sinhrks/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/sinhrks",
"id": 1696302,
"login": "sinhrks",
"node_id": "MDQ6VXNlcjE2OTYzMDI=",
"organizations_url": "https://api.github.com/users/sinhrks/orgs",
"received_events_url": "https://api.github.com/users/sinhrks/received_events",
"repos_url": "https://api.github.com/users/sinhrks/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/sinhrks/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sinhrks/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sinhrks"
} | [
{
"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": "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": "2016-05-05T00:34:40Z",
"closed_issues": 306,
"created_at": "2016-02-08T15:29:59Z",
"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": "after 0.18.0 of course!",
"due_on": "2016-05-04T07:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/38",
"id": 1570594,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/38/labels",
"node_id": "MDk6TWlsZXN0b25lMTU3MDU5NA==",
"number": 38,
"open_issues": 0,
"state": "closed",
"title": "0.18.1",
"updated_at": "2017-08-10T09:01:26Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/38"
} | 1 | 2016-04-10T03:18:14Z | 2016-04-10T14:26:31Z | 2016-04-10T14:26:28Z | MEMBER | null | - [x] closes #12617
- [x] tests added / passed
- [x] passes `git diff upstream/master | 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/12843/reactions"
} | https://api.github.com/repos/pandas-dev/pandas/issues/12843/timeline | null | 0 | {
"diff_url": "https://github.com/pandas-dev/pandas/pull/12843.diff",
"html_url": "https://github.com/pandas-dev/pandas/pull/12843",
"merged_at": null,
"patch_url": "https://github.com/pandas-dev/pandas/pull/12843.patch",
"url": "https://api.github.com/repos/pandas-dev/pandas/pulls/12843"
} |
https://api.github.com/repos/pandas-dev/pandas/issues/12844 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/12844/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/12844/comments | https://api.github.com/repos/pandas-dev/pandas/issues/12844/events | https://github.com/pandas-dev/pandas/pull/12844 | 147,191,159 | MDExOlB1bGxSZXF1ZXN0NjU5MDA0MTA= | 12,844 | BUG: SparseSeries concat results in dense | {
"avatar_url": "https://avatars.githubusercontent.com/u/1696302?v=4",
"events_url": "https://api.github.com/users/sinhrks/events{/privacy}",
"followers_url": "https://api.github.com/users/sinhrks/followers",
"following_url": "https://api.github.com/users/sinhrks/following{/other_user}",
"gists_url": "https://api.github.com/users/sinhrks/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/sinhrks",
"id": 1696302,
"login": "sinhrks",
"node_id": "MDQ6VXNlcjE2OTYzMDI=",
"organizations_url": "https://api.github.com/users/sinhrks/orgs",
"received_events_url": "https://api.github.com/users/sinhrks/received_events",
"repos_url": "https://api.github.com/users/sinhrks/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/sinhrks/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sinhrks/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sinhrks"
} | [
{
"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": "009800",
"default": false,
"description": "Sparse Data Type",
"id": 49182326,
"name": "Sparse",
"node_id": "MDU6TGFiZWw0OTE4MjMyNg==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Sparse"
}
]
| closed | false | null | []
| {
"closed_at": "2016-05-05T00:34:40Z",
"closed_issues": 306,
"created_at": "2016-02-08T15:29:59Z",
"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": "after 0.18.0 of course!",
"due_on": "2016-05-04T07:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/38",
"id": 1570594,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/38/labels",
"node_id": "MDk6TWlsZXN0b25lMTU3MDU5NA==",
"number": 38,
"open_issues": 0,
"state": "closed",
"title": "0.18.1",
"updated_at": "2017-08-10T09:01:26Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/38"
} | 3 | 2016-04-10T04:09:27Z | 2016-04-18T19:55:34Z | 2016-04-18T19:55:34Z | MEMBER | null | - [x] closes #10536
- [x] tests added / passed
- [x] passes `git diff upstream/master | 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/12844/reactions"
} | https://api.github.com/repos/pandas-dev/pandas/issues/12844/timeline | null | 0 | {
"diff_url": "https://github.com/pandas-dev/pandas/pull/12844.diff",
"html_url": "https://github.com/pandas-dev/pandas/pull/12844",
"merged_at": null,
"patch_url": "https://github.com/pandas-dev/pandas/pull/12844.patch",
"url": "https://api.github.com/repos/pandas-dev/pandas/pulls/12844"
} |
https://api.github.com/repos/pandas-dev/pandas/issues/12845 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/12845/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/12845/comments | https://api.github.com/repos/pandas-dev/pandas/issues/12845/events | https://github.com/pandas-dev/pandas/pull/12845 | 147,191,817 | MDExOlB1bGxSZXF1ZXN0NjU5MDA2ODQ= | 12,845 | BUG: SparseSeries slicing with Ellipsis raises KeyError | {
"avatar_url": "https://avatars.githubusercontent.com/u/1696302?v=4",
"events_url": "https://api.github.com/users/sinhrks/events{/privacy}",
"followers_url": "https://api.github.com/users/sinhrks/followers",
"following_url": "https://api.github.com/users/sinhrks/following{/other_user}",
"gists_url": "https://api.github.com/users/sinhrks/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/sinhrks",
"id": 1696302,
"login": "sinhrks",
"node_id": "MDQ6VXNlcjE2OTYzMDI=",
"organizations_url": "https://api.github.com/users/sinhrks/orgs",
"received_events_url": "https://api.github.com/users/sinhrks/received_events",
"repos_url": "https://api.github.com/users/sinhrks/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/sinhrks/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sinhrks/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sinhrks"
} | [
{
"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": "009800",
"default": false,
"description": "Sparse Data Type",
"id": 49182326,
"name": "Sparse",
"node_id": "MDU6TGFiZWw0OTE4MjMyNg==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Sparse"
}
]
| closed | false | null | []
| {
"closed_at": "2016-05-05T00:34:40Z",
"closed_issues": 306,
"created_at": "2016-02-08T15:29:59Z",
"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": "after 0.18.0 of course!",
"due_on": "2016-05-04T07:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/38",
"id": 1570594,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/38/labels",
"node_id": "MDk6TWlsZXN0b25lMTU3MDU5NA==",
"number": 38,
"open_issues": 0,
"state": "closed",
"title": "0.18.1",
"updated_at": "2017-08-10T09:01:26Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/38"
} | 1 | 2016-04-10T04:26:03Z | 2016-04-10T14:33:13Z | 2016-04-10T14:32:47Z | MEMBER | null | - [x] closes #9467
- [x] tests added / passed
- [x] passes `git diff upstream/master | 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/12845/reactions"
} | https://api.github.com/repos/pandas-dev/pandas/issues/12845/timeline | null | 0 | {
"diff_url": "https://github.com/pandas-dev/pandas/pull/12845.diff",
"html_url": "https://github.com/pandas-dev/pandas/pull/12845",
"merged_at": null,
"patch_url": "https://github.com/pandas-dev/pandas/pull/12845.patch",
"url": "https://api.github.com/repos/pandas-dev/pandas/pulls/12845"
} |
https://api.github.com/repos/pandas-dev/pandas/issues/12846 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/12846/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/12846/comments | https://api.github.com/repos/pandas-dev/pandas/issues/12846/events | https://github.com/pandas-dev/pandas/pull/12846 | 147,205,382 | MDExOlB1bGxSZXF1ZXN0NjU5MDQ0NTU= | 12,846 | BUG: empty Series concat has no effect | {
"avatar_url": "https://avatars.githubusercontent.com/u/1696302?v=4",
"events_url": "https://api.github.com/users/sinhrks/events{/privacy}",
"followers_url": "https://api.github.com/users/sinhrks/followers",
"following_url": "https://api.github.com/users/sinhrks/following{/other_user}",
"gists_url": "https://api.github.com/users/sinhrks/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/sinhrks",
"id": 1696302,
"login": "sinhrks",
"node_id": "MDQ6VXNlcjE2OTYzMDI=",
"organizations_url": "https://api.github.com/users/sinhrks/orgs",
"received_events_url": "https://api.github.com/users/sinhrks/received_events",
"repos_url": "https://api.github.com/users/sinhrks/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/sinhrks/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sinhrks/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sinhrks"
} | [
{
"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": "AD7FA8",
"default": false,
"description": null,
"id": 35818298,
"name": "API Design",
"node_id": "MDU6TGFiZWwzNTgxODI5OA==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/API%20Design"
}
]
| closed | false | null | []
| {
"closed_at": "2016-05-05T00:34:40Z",
"closed_issues": 306,
"created_at": "2016-02-08T15:29:59Z",
"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": "after 0.18.0 of course!",
"due_on": "2016-05-04T07:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/38",
"id": 1570594,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/38/labels",
"node_id": "MDk6TWlsZXN0b25lMTU3MDU5NA==",
"number": 38,
"open_issues": 0,
"state": "closed",
"title": "0.18.1",
"updated_at": "2017-08-10T09:01:26Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/38"
} | 1 | 2016-04-10T08:25:40Z | 2016-04-10T14:22:50Z | 2016-04-10T14:22:42Z | MEMBER | null | - [x] closes #11082, closes #12695, closes #12696
- [x] tests added / passed
- [x] passes `git diff upstream/master | flake8 --diff`
- [x] whatsnew entry
Also includes some cleanup for #10723
CC: @AnkurDedania , @IamGianluca
| {
"+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/12846/reactions"
} | https://api.github.com/repos/pandas-dev/pandas/issues/12846/timeline | null | 0 | {
"diff_url": "https://github.com/pandas-dev/pandas/pull/12846.diff",
"html_url": "https://github.com/pandas-dev/pandas/pull/12846",
"merged_at": null,
"patch_url": "https://github.com/pandas-dev/pandas/pull/12846.patch",
"url": "https://api.github.com/repos/pandas-dev/pandas/pulls/12846"
} |
https://api.github.com/repos/pandas-dev/pandas/issues/12847 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/12847/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/12847/comments | https://api.github.com/repos/pandas-dev/pandas/issues/12847/events | https://github.com/pandas-dev/pandas/pull/12847 | 147,205,969 | MDExOlB1bGxSZXF1ZXN0NjU5MDQ2MDI= | 12,847 | ENH: Support CustomBusinessHour | {
"avatar_url": "https://avatars.githubusercontent.com/u/1696302?v=4",
"events_url": "https://api.github.com/users/sinhrks/events{/privacy}",
"followers_url": "https://api.github.com/users/sinhrks/followers",
"following_url": "https://api.github.com/users/sinhrks/following{/other_user}",
"gists_url": "https://api.github.com/users/sinhrks/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/sinhrks",
"id": 1696302,
"login": "sinhrks",
"node_id": "MDQ6VXNlcjE2OTYzMDI=",
"organizations_url": "https://api.github.com/users/sinhrks/orgs",
"received_events_url": "https://api.github.com/users/sinhrks/received_events",
"repos_url": "https://api.github.com/users/sinhrks/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/sinhrks/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sinhrks/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sinhrks"
} | [
{
"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": "0052cc",
"default": false,
"description": "DateOffsets",
"id": 53181044,
"name": "Frequency",
"node_id": "MDU6TGFiZWw1MzE4MTA0NA==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Frequency"
}
]
| closed | false | null | []
| {
"closed_at": "2016-05-05T00:34:40Z",
"closed_issues": 306,
"created_at": "2016-02-08T15:29:59Z",
"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": "after 0.18.0 of course!",
"due_on": "2016-05-04T07:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/38",
"id": 1570594,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/38/labels",
"node_id": "MDk6TWlsZXN0b25lMTU3MDU5NA==",
"number": 38,
"open_issues": 0,
"state": "closed",
"title": "0.18.1",
"updated_at": "2017-08-10T09:01:26Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/38"
} | 2 | 2016-04-10T08:32:24Z | 2016-04-10T22:12:08Z | 2016-04-10T22:12:08Z | MEMBER | null | - [x] closes #11514
- [x] tests added / passed
- [x] passes `git diff upstream/master | 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/12847/reactions"
} | https://api.github.com/repos/pandas-dev/pandas/issues/12847/timeline | null | 0 | {
"diff_url": "https://github.com/pandas-dev/pandas/pull/12847.diff",
"html_url": "https://github.com/pandas-dev/pandas/pull/12847",
"merged_at": null,
"patch_url": "https://github.com/pandas-dev/pandas/pull/12847.patch",
"url": "https://api.github.com/repos/pandas-dev/pandas/pulls/12847"
} |
https://api.github.com/repos/pandas-dev/pandas/issues/12848 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/12848/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/12848/comments | https://api.github.com/repos/pandas-dev/pandas/issues/12848/events | https://github.com/pandas-dev/pandas/pull/12848 | 147,219,330 | MDExOlB1bGxSZXF1ZXN0NjU5MDg2OTM= | 12,848 | TST: Add more Sparse indexing tests | {
"avatar_url": "https://avatars.githubusercontent.com/u/1696302?v=4",
"events_url": "https://api.github.com/users/sinhrks/events{/privacy}",
"followers_url": "https://api.github.com/users/sinhrks/followers",
"following_url": "https://api.github.com/users/sinhrks/following{/other_user}",
"gists_url": "https://api.github.com/users/sinhrks/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/sinhrks",
"id": 1696302,
"login": "sinhrks",
"node_id": "MDQ6VXNlcjE2OTYzMDI=",
"organizations_url": "https://api.github.com/users/sinhrks/orgs",
"received_events_url": "https://api.github.com/users/sinhrks/received_events",
"repos_url": "https://api.github.com/users/sinhrks/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/sinhrks/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sinhrks/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sinhrks"
} | [
{
"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": "009800",
"default": false,
"description": "Sparse Data Type",
"id": 49182326,
"name": "Sparse",
"node_id": "MDU6TGFiZWw0OTE4MjMyNg==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Sparse"
}
]
| closed | false | null | []
| {
"closed_at": "2016-05-05T00:34:40Z",
"closed_issues": 306,
"created_at": "2016-02-08T15:29:59Z",
"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": "after 0.18.0 of course!",
"due_on": "2016-05-04T07:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/38",
"id": 1570594,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/38/labels",
"node_id": "MDk6TWlsZXN0b25lMTU3MDU5NA==",
"number": 38,
"open_issues": 0,
"state": "closed",
"title": "0.18.1",
"updated_at": "2017-08-10T09:01:26Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/38"
} | 3 | 2016-04-10T12:09:47Z | 2016-04-11T12:47:31Z | 2016-04-11T12:47:31Z | MEMBER | null | - [x] closes #4400
- [x] tests added / passed
- [x] passes `git diff upstream/master | flake8 --diff`
| {
"+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/12848/reactions"
} | https://api.github.com/repos/pandas-dev/pandas/issues/12848/timeline | null | 0 | {
"diff_url": "https://github.com/pandas-dev/pandas/pull/12848.diff",
"html_url": "https://github.com/pandas-dev/pandas/pull/12848",
"merged_at": null,
"patch_url": "https://github.com/pandas-dev/pandas/pull/12848.patch",
"url": "https://api.github.com/repos/pandas-dev/pandas/pulls/12848"
} |
https://api.github.com/repos/pandas-dev/pandas/issues/12849 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/12849/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/12849/comments | https://api.github.com/repos/pandas-dev/pandas/issues/12849/events | https://github.com/pandas-dev/pandas/issues/12849 | 147,223,748 | MDU6SXNzdWUxNDcyMjM3NDg= | 12,849 | pd.get_dummies(s) with s being a logical test | {
"avatar_url": "https://avatars.githubusercontent.com/u/8282510?v=4",
"events_url": "https://api.github.com/users/randomgambit/events{/privacy}",
"followers_url": "https://api.github.com/users/randomgambit/followers",
"following_url": "https://api.github.com/users/randomgambit/following{/other_user}",
"gists_url": "https://api.github.com/users/randomgambit/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/randomgambit",
"id": 8282510,
"login": "randomgambit",
"node_id": "MDQ6VXNlcjgyODI1MTA=",
"organizations_url": "https://api.github.com/users/randomgambit/orgs",
"received_events_url": "https://api.github.com/users/randomgambit/received_events",
"repos_url": "https://api.github.com/users/randomgambit/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/randomgambit/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/randomgambit/subscriptions",
"type": "User",
"url": "https://api.github.com/users/randomgambit"
} | [
{
"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": "AD7FA8",
"default": false,
"description": null,
"id": 35818298,
"name": "API Design",
"node_id": "MDU6TGFiZWwzNTgxODI5OA==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/API%20Design"
}
]
| closed | false | null | []
| null | 14 | 2016-04-10T13:07:29Z | 2016-04-10T17:12:37Z | 2016-04-10T17:12:28Z | NONE | null | Hi,
I am using Pandas more and more for preparing my dataset before feeding it to other statistical software.
I believe something really useful and, somehow, missing from the current version of Pandas is a simple way to generate dummy variables based on a logical test.
Dummy variable coding (0-1) is everywhere in the academic literature (I have a phd in economics) and are a key component of many statistical tests.
Something like
`pd.get_dummies(df.A > df.C)` that would generate a dummy that is one if A>C and zero otherwise, allowing the user to
- include/exclude missing variables
- specify what happens when columns have mixed types (see (https://stackoverflow.com/questions/36373681/how-to-create-dummy-variables-in-pandas-when-columns-can-have-mixed-types)
Of course, we can always generate the dummies above manually, but the experience shows that this simply dummy variable creation can be, at times, tricky.
What do you think?
| {
"+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/12849/reactions"
} | https://api.github.com/repos/pandas-dev/pandas/issues/12849/timeline | null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/12850 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/12850/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/12850/comments | https://api.github.com/repos/pandas-dev/pandas/issues/12850/events | https://github.com/pandas-dev/pandas/issues/12850 | 147,236,911 | MDU6SXNzdWUxNDcyMzY5MTE= | 12,850 | TST/BUG: integer coercion bool with int on windows | {
"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"
} | [
{
"color": "e102d8",
"default": false,
"description": "Unexpected or buggy dtype conversions",
"id": 31404521,
"name": "Dtype Conversions",
"node_id": "MDU6TGFiZWwzMTQwNDUyMQ==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Dtype%20Conversions"
},
{
"color": "fbca04",
"default": false,
"description": "Windows OS",
"id": 57186974,
"name": "Windows",
"node_id": "MDU6TGFiZWw1NzE4Njk3NA==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Windows"
}
]
| closed | false | null | []
| {
"closed_at": "2016-05-05T00:34:40Z",
"closed_issues": 306,
"created_at": "2016-02-08T15:29:59Z",
"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": "after 0.18.0 of course!",
"due_on": "2016-05-04T07:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/38",
"id": 1570594,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/38/labels",
"node_id": "MDk6TWlsZXN0b25lMTU3MDU5NA==",
"number": 38,
"open_issues": 0,
"state": "closed",
"title": "0.18.1",
"updated_at": "2017-08-10T09:01:26Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/38"
} | 2 | 2016-04-10T16:05:55Z | 2016-04-10T19:09:46Z | 2016-04-10T19:09:46Z | CONTRIBUTOR | null | xref #12841
this is a test in `test_coercion.py, L361`
```
In [3]: import pandas as pd
In [4]: s = pd.Series([True, False, True, False])
In [5]: s.where(s,1)
Out[5]:
0 1
1 1
2 1
3 1
dtype: int32
```
on windows the scalar is not coerced to int64 (as it is on other platforms). IIRC `.where` already has quite complicated logic to do this. How simple is this to fix?
cc @sinhrks
| {
"+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/12850/reactions"
} | https://api.github.com/repos/pandas-dev/pandas/issues/12850/timeline | null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/12851 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/12851/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/12851/comments | https://api.github.com/repos/pandas-dev/pandas/issues/12851/events | https://github.com/pandas-dev/pandas/issues/12851 | 147,243,348 | MDU6SXNzdWUxNDcyNDMzNDg= | 12,851 | Support for inplace argument for str.replace | {
"avatar_url": "https://avatars.githubusercontent.com/u/1063143?v=4",
"events_url": "https://api.github.com/users/joonro/events{/privacy}",
"followers_url": "https://api.github.com/users/joonro/followers",
"following_url": "https://api.github.com/users/joonro/following{/other_user}",
"gists_url": "https://api.github.com/users/joonro/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/joonro",
"id": 1063143,
"login": "joonro",
"node_id": "MDQ6VXNlcjEwNjMxNDM=",
"organizations_url": "https://api.github.com/users/joonro/orgs",
"received_events_url": "https://api.github.com/users/joonro/received_events",
"repos_url": "https://api.github.com/users/joonro/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/joonro/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/joonro/subscriptions",
"type": "User",
"url": "https://api.github.com/users/joonro"
} | [
{
"color": "AD7FA8",
"default": false,
"description": null,
"id": 35818298,
"name": "API Design",
"node_id": "MDU6TGFiZWwzNTgxODI5OA==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/API%20Design"
},
{
"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 | []
| null | 2 | 2016-04-10T17:28:22Z | 2019-10-11T05:00:45Z | 2019-10-11T05:00:45Z | NONE | null | It would be great if there is a support for `inplace` argument for `str.replace`, so I can do
``` python
addresses.str.replace('\s+\d{5}', '', inplace=True)
```
instead of
``` python
addresses = addresses.str.replace('\s+\d{5}', '')
```
Thank you!
| {
"+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/12851/reactions"
} | https://api.github.com/repos/pandas-dev/pandas/issues/12851/timeline | null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/12852 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/12852/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/12852/comments | https://api.github.com/repos/pandas-dev/pandas/issues/12852/events | https://github.com/pandas-dev/pandas/pull/12852 | 147,248,385 | MDExOlB1bGxSZXF1ZXN0NjU5MTc5NTg= | 12,852 | BUG: ensure coercing scalars to when setting as numpy | {
"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"
} | [
{
"color": "e102d8",
"default": false,
"description": "Unexpected or buggy dtype conversions",
"id": 31404521,
"name": "Dtype Conversions",
"node_id": "MDU6TGFiZWwzMTQwNDUyMQ==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Dtype%20Conversions"
}
]
| closed | false | null | []
| {
"closed_at": "2016-05-05T00:34:40Z",
"closed_issues": 306,
"created_at": "2016-02-08T15:29:59Z",
"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": "after 0.18.0 of course!",
"due_on": "2016-05-04T07:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/38",
"id": 1570594,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/38/labels",
"node_id": "MDk6TWlsZXN0b25lMTU3MDU5NA==",
"number": 38,
"open_issues": 0,
"state": "closed",
"title": "0.18.1",
"updated_at": "2017-08-10T09:01:26Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/38"
} | 1 | 2016-04-10T18:13:02Z | 2016-04-10T19:09:46Z | 2016-04-10T19:09:46Z | CONTRIBUTOR | null | closes #12850
| {
"+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/12852/reactions"
} | https://api.github.com/repos/pandas-dev/pandas/issues/12852/timeline | null | 0 | {
"diff_url": "https://github.com/pandas-dev/pandas/pull/12852.diff",
"html_url": "https://github.com/pandas-dev/pandas/pull/12852",
"merged_at": null,
"patch_url": "https://github.com/pandas-dev/pandas/pull/12852.patch",
"url": "https://api.github.com/repos/pandas-dev/pandas/pulls/12852"
} |
https://api.github.com/repos/pandas-dev/pandas/issues/12853 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/12853/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/12853/comments | https://api.github.com/repos/pandas-dev/pandas/issues/12853/events | https://github.com/pandas-dev/pandas/pull/12853 | 147,263,249 | MDExOlB1bGxSZXF1ZXN0NjU5MjE3NTQ= | 12,853 | DOC: fix code-block ipython highlighting | {
"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"
} | [
{
"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": "2016-05-05T00:34:40Z",
"closed_issues": 306,
"created_at": "2016-02-08T15:29:59Z",
"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": "after 0.18.0 of course!",
"due_on": "2016-05-04T07:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/38",
"id": 1570594,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/38/labels",
"node_id": "MDk6TWlsZXN0b25lMTU3MDU5NA==",
"number": 38,
"open_issues": 0,
"state": "closed",
"title": "0.18.1",
"updated_at": "2017-08-10T09:01:26Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/38"
} | 3 | 2016-04-10T20:26:25Z | 2016-04-11T13:42:54Z | 2016-04-11T13:42:54Z | MEMBER | null | I noticed some warnings in the travis doc build log in the sense of "WARNING: Could not parse literal_block as "python". highlighting skipped."
This was because some of the `.. code-block:: python` directives contained code that could not be interpreted as python. And, additionally, these code blocks were also not highlighted correctly (the `In [1]` prompt were not recognized by the default python highlighter).
Therefore, I changed those `.. code-block:: python` directives containing IPython prompt to `.. code-block:: ipython`
| {
"+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/12853/reactions"
} | https://api.github.com/repos/pandas-dev/pandas/issues/12853/timeline | null | 0 | {
"diff_url": "https://github.com/pandas-dev/pandas/pull/12853.diff",
"html_url": "https://github.com/pandas-dev/pandas/pull/12853",
"merged_at": null,
"patch_url": "https://github.com/pandas-dev/pandas/pull/12853.patch",
"url": "https://api.github.com/repos/pandas-dev/pandas/pulls/12853"
} |
https://api.github.com/repos/pandas-dev/pandas/issues/12854 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/12854/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/12854/comments | https://api.github.com/repos/pandas-dev/pandas/issues/12854/events | https://github.com/pandas-dev/pandas/issues/12854 | 147,273,483 | MDU6SXNzdWUxNDcyNzM0ODM= | 12,854 | API: remove need for CustomBusiness freqs | {
"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"
} | [
{
"color": "AD7FA8",
"default": false,
"description": null,
"id": 35818298,
"name": "API Design",
"node_id": "MDU6TGFiZWwzNTgxODI5OA==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/API%20Design"
},
{
"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": "5319e7",
"default": false,
"description": "Functionality to remove in pandas",
"id": 87485152,
"name": "Deprecate",
"node_id": "MDU6TGFiZWw4NzQ4NTE1Mg==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Deprecate"
},
{
"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": 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"
} | 2 | 2016-04-10T22:15:38Z | 2020-09-20T23:26:57Z | 2020-09-20T23:26:56Z | CONTRIBUTOR | null | I think we can move the functionaility to the regular `Business` freqs but just accepting
the additional arguments from `CustomBusinesssDay`, IOW, expand `BusinessDay` with default args of `None` for `weekmask` and `holidays` (and just default them).
I think this can be done without any user changes at all. We can then deprecate `CustomBusiness*` in favor of simple `Business*` in 0.19.0.
| {
"+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/12854/reactions"
} | https://api.github.com/repos/pandas-dev/pandas/issues/12854/timeline | null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/12855 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/12855/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/12855/comments | https://api.github.com/repos/pandas-dev/pandas/issues/12855/events | https://github.com/pandas-dev/pandas/issues/12855 | 147,274,867 | MDU6SXNzdWUxNDcyNzQ4Njc= | 12,855 | API: Sparse Return Types | {
"avatar_url": "https://avatars.githubusercontent.com/u/9273653?v=4",
"events_url": "https://api.github.com/users/gfyoung/events{/privacy}",
"followers_url": "https://api.github.com/users/gfyoung/followers",
"following_url": "https://api.github.com/users/gfyoung/following{/other_user}",
"gists_url": "https://api.github.com/users/gfyoung/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/gfyoung",
"id": 9273653,
"login": "gfyoung",
"node_id": "MDQ6VXNlcjkyNzM2NTM=",
"organizations_url": "https://api.github.com/users/gfyoung/orgs",
"received_events_url": "https://api.github.com/users/gfyoung/received_events",
"repos_url": "https://api.github.com/users/gfyoung/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/gfyoung/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/gfyoung/subscriptions",
"type": "User",
"url": "https://api.github.com/users/gfyoung"
} | [
{
"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": "009800",
"default": false,
"description": "Sparse Data Type",
"id": 49182326,
"name": "Sparse",
"node_id": "MDU6TGFiZWw0OTE4MjMyNg==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Sparse"
}
]
| closed | false | null | []
| {
"closed_at": "2017-05-06T10:20:19Z",
"closed_issues": 987,
"created_at": "2016-02-08T15:30:21Z",
"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": "after 0.19.x series",
"due_on": "2017-05-12T07:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/39",
"id": 1570595,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/39/labels",
"node_id": "MDk6TWlsZXN0b25lMTU3MDU5NQ==",
"number": 39,
"open_issues": 0,
"state": "closed",
"title": "0.20.0",
"updated_at": "2018-10-28T08:18:42Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/39"
} | 17 | 2016-04-10T22:33:40Z | 2016-12-15T11:28:26Z | 2016-12-15T11:28:26Z | MEMBER | null | The documentation of `SparseArray.cumsum` says it returns a `Series`, but that is not the case:
``` python
>>> from pandas import SparseArray, np
>>> data = np.arange(10)
>>> s = SparseArray(data, fill_value=np.nan)
>>> type(s.cumsum())
<class 'pandas.sparse.array.SparseArray'>
>>>
>>> s = SparseArray(data, fill_value=2)
>>> type(s.cumsum())
<class 'numpy.ndarray'>
```
Given that `to_dense` now returns `self.values` and ignores `fill_value`, this current behaviour in `cumsum` seems illogical and should probably just return `SparseArray` regardless. At the very least though, I think a documentation fix is in order.
EDIT: there is a similar issue with `SparseSeries` that should also be addressed
| {
"+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/12855/reactions"
} | https://api.github.com/repos/pandas-dev/pandas/issues/12855/timeline | null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/12856 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/12856/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/12856/comments | https://api.github.com/repos/pandas-dev/pandas/issues/12856/events | https://github.com/pandas-dev/pandas/issues/12856 | 147,295,089 | MDU6SXNzdWUxNDcyOTUwODk= | 12,856 | unit test test_numpy_round fail in 3.5 numpy_dev build | {
"avatar_url": "https://avatars.githubusercontent.com/u/50109?v=4",
"events_url": "https://api.github.com/users/gliptak/events{/privacy}",
"followers_url": "https://api.github.com/users/gliptak/followers",
"following_url": "https://api.github.com/users/gliptak/following{/other_user}",
"gists_url": "https://api.github.com/users/gliptak/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/gliptak",
"id": 50109,
"login": "gliptak",
"node_id": "MDQ6VXNlcjUwMTA5",
"organizations_url": "https://api.github.com/users/gliptak/orgs",
"received_events_url": "https://api.github.com/users/gliptak/received_events",
"repos_url": "https://api.github.com/users/gliptak/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/gliptak/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/gliptak/subscriptions",
"type": "User",
"url": "https://api.github.com/users/gliptak"
} | []
| closed | false | null | []
| null | 1 | 2016-04-11T02:13:50Z | 2016-04-11T02:22:45Z | 2016-04-11T02:22:45Z | CONTRIBUTOR | null | And example
https://travis-ci.org/pydata/pandas/jobs/122091911
```
======================================================================
ERROR: test_numpy_round (pandas.tests.frame.test_analytics.TestDataFrameAnalytics)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/travis/miniconda/envs/pandas/lib/python3.5/site-packages/numpy/core/fromnumeric.py", line 57, in _wrapfunc
return getattr(obj, method)(*args, **kwds)
TypeError: round() got an unexpected keyword argument 'out'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/travis/build/pydata/pandas/pandas/tests/frame/test_analytics.py", line 1908, in test_numpy_round
np.round(df, decimals=0, out=df)
File "/home/travis/miniconda/envs/pandas/lib/python3.5/site-packages/numpy/core/fromnumeric.py", line 2775, in round_
return around(a, decimals=decimals, out=out)
File "/home/travis/miniconda/envs/pandas/lib/python3.5/site-packages/numpy/core/fromnumeric.py", line 2761, in around
return _wrapfunc(a, 'round', decimals=decimals, out=out)
File "/home/travis/miniconda/envs/pandas/lib/python3.5/site-packages/numpy/core/fromnumeric.py", line 67, in _wrapfunc
return _wrapit(obj, method, *args, **kwds)
File "/home/travis/miniconda/envs/pandas/lib/python3.5/site-packages/numpy/core/fromnumeric.py", line 47, in _wrapit
result = getattr(asarray(obj), method)(*args, **kwds)
TypeError: output must be an array
======================================================================
ERROR: test_numpy_round (pandas.tests.series.test_analytics.TestSeriesAnalytics)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/travis/miniconda/envs/pandas/lib/python3.5/site-packages/numpy/core/fromnumeric.py", line 57, in _wrapfunc
return getattr(obj, method)(*args, **kwds)
TypeError: round() got an unexpected keyword argument 'out'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/travis/build/pydata/pandas/pandas/tests/series/test_analytics.py", line 522, in test_numpy_round
np.round(s, decimals=0, out=s)
File "/home/travis/miniconda/envs/pandas/lib/python3.5/site-packages/numpy/core/fromnumeric.py", line 2775, in round_
return around(a, decimals=decimals, out=out)
File "/home/travis/miniconda/envs/pandas/lib/python3.5/site-packages/numpy/core/fromnumeric.py", line 2761, in around
return _wrapfunc(a, 'round', decimals=decimals, out=out)
File "/home/travis/miniconda/envs/pandas/lib/python3.5/site-packages/numpy/core/fromnumeric.py", line 67, in _wrapfunc
return _wrapit(obj, method, *args, **kwds)
File "/home/travis/miniconda/envs/pandas/lib/python3.5/site-packages/numpy/core/fromnumeric.py", line 47, in _wrapit
result = getattr(asarray(obj), method)(*args, **kwds)
TypeError: output must be an array
```
| {
"+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/12856/reactions"
} | https://api.github.com/repos/pandas-dev/pandas/issues/12856/timeline | null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/12857 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/12857/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/12857/comments | https://api.github.com/repos/pandas-dev/pandas/issues/12857/events | https://github.com/pandas-dev/pandas/issues/12857 | 147,305,713 | MDU6SXNzdWUxNDczMDU3MTM= | 12,857 | BUG: not properly converting S1 in astype ,on PY3 | {
"avatar_url": "https://avatars.githubusercontent.com/u/2927161?v=4",
"events_url": "https://api.github.com/users/cchrysostomou/events{/privacy}",
"followers_url": "https://api.github.com/users/cchrysostomou/followers",
"following_url": "https://api.github.com/users/cchrysostomou/following{/other_user}",
"gists_url": "https://api.github.com/users/cchrysostomou/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/cchrysostomou",
"id": 2927161,
"login": "cchrysostomou",
"node_id": "MDQ6VXNlcjI5MjcxNjE=",
"organizations_url": "https://api.github.com/users/cchrysostomou/orgs",
"received_events_url": "https://api.github.com/users/cchrysostomou/received_events",
"repos_url": "https://api.github.com/users/cchrysostomou/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/cchrysostomou/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/cchrysostomou/subscriptions",
"type": "User",
"url": "https://api.github.com/users/cchrysostomou"
} | [
{
"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": "e102d8",
"default": false,
"description": "Unexpected or buggy dtype conversions",
"id": 31404521,
"name": "Dtype Conversions",
"node_id": "MDU6TGFiZWwzMTQwNDUyMQ==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Dtype%20Conversions"
},
{
"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": "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 | null | []
| {
"closed_at": "2020-01-30T12:18:05Z",
"closed_issues": 2207,
"created_at": "2012-09-13T02:13:00Z",
"creator": {
"avatar_url": "https://avatars.githubusercontent.com/u/329591?v=4",
"events_url": "https://api.github.com/users/wesm/events{/privacy}",
"followers_url": "https://api.github.com/users/wesm/followers",
"following_url": "https://api.github.com/users/wesm/following{/other_user}",
"gists_url": "https://api.github.com/users/wesm/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/wesm",
"id": 329591,
"login": "wesm",
"node_id": "MDQ6VXNlcjMyOTU5MQ==",
"organizations_url": "https://api.github.com/users/wesm/orgs",
"received_events_url": "https://api.github.com/users/wesm/received_events",
"repos_url": "https://api.github.com/users/wesm/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/wesm/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/wesm/subscriptions",
"type": "User",
"url": "https://api.github.com/users/wesm"
},
"description": "on-merge: backport to 1.0.x",
"due_on": "2020-02-01T08:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/16",
"id": 174211,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/16/labels",
"node_id": "MDk6TWlsZXN0b25lMTc0MjEx",
"number": 16,
"open_issues": 0,
"state": "closed",
"title": "1.0.0",
"updated_at": "2020-01-30T12:18:05Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/16"
} | 12 | 2016-04-11T03:25:32Z | 2019-12-30T14:16:53Z | 2019-12-30T14:16:53Z | NONE | null | I am trying to create a dataframe where each cell is represented as a single characters rather than python objects. I am able to create and work with the dataframe when using .astype command. However, If i try to print out a larger portion of the table, then I get an error.
#### Code Sample, a copy-pastable example if possible
```
import random
import pandas as pd
lets = 'ACDEFGHIJKLMNOP'
slen = 50
nseqs = 1000
words = [[random.choice(lets) for x in range(slen)] for _ in range(nseqs)]
df = pd.DataFrame(words).astype('S1')
#this will print correctly:
print(df.iloc[:60, :])
#this will raise an error:
print(df.iloc[:61, :])
```
#### error raised
```
C:\Anaconda3\lib\site-packages\pandas\core\internals.py in _vstack(to_stack, dtype)
4248
4249 # work around NumPy 1.6 bug
-> 4250 if dtype == _NS_DTYPE or dtype == _TD_DTYPE:
4251 new_values = np.vstack([x.view('i8') for x in to_stack])
4252 return new_values.view(dtype)
TypeError: data type "bytes8" not understood
```
#### output of `pd.show_versions()`
commit: None
python: 3.4.4.final.0
python-bits: 64
OS: Windows
OS-release: 7
machine: AMD64
processor: Intel64 Family 6 Model 61 Stepping 4, GenuineIntel
byteorder: little
LC_ALL: None
LANG: None
pandas: 0.17.1
nose: None
pip: 8.1.1
setuptools: 20.3
Cython: 0.23.4
numpy: 1.10.4
scipy: 0.17.0
statsmodels: 0.6.1
IPython: 4.1.1
sphinx: 1.4b1
patsy: 0.4.0
dateutil: 2.4.2
pytz: 2015.7
blosc: None
bottleneck: 1.0.0
tables: 3.2.2
numexpr: 2.4.6
matplotlib: 1.5.1
openpyxl: 2.3.2
xlrd: 0.9.4
xlwt: 1.0.0
xlsxwriter: 0.8.4
lxml: 3.5.0
bs4: 4.4.1
html5lib: None
httplib2: None
apiclient: None
sqlalchemy: 1.0.11
pymysql: None
psycopg2: None
Jinja2: 2.8
| {
"+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/12857/reactions"
} | https://api.github.com/repos/pandas-dev/pandas/issues/12857/timeline | null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/12858 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/12858/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/12858/comments | https://api.github.com/repos/pandas-dev/pandas/issues/12858/events | https://github.com/pandas-dev/pandas/issues/12858 | 147,340,130 | MDU6SXNzdWUxNDczNDAxMzA= | 12,858 | Query function gives error if column names have front slash | {
"avatar_url": "https://avatars.githubusercontent.com/u/15170024?v=4",
"events_url": "https://api.github.com/users/swetabhpathak/events{/privacy}",
"followers_url": "https://api.github.com/users/swetabhpathak/followers",
"following_url": "https://api.github.com/users/swetabhpathak/following{/other_user}",
"gists_url": "https://api.github.com/users/swetabhpathak/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/swetabhpathak",
"id": 15170024,
"login": "swetabhpathak",
"node_id": "MDQ6VXNlcjE1MTcwMDI0",
"organizations_url": "https://api.github.com/users/swetabhpathak/orgs",
"received_events_url": "https://api.github.com/users/swetabhpathak/received_events",
"repos_url": "https://api.github.com/users/swetabhpathak/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/swetabhpathak/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/swetabhpathak/subscriptions",
"type": "User",
"url": "https://api.github.com/users/swetabhpathak"
} | [
{
"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 | []
| {
"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 | 2016-04-11T07:32:53Z | 2016-04-11T11:21:50Z | 2016-04-11T11:21:18Z | NONE | null | ```
import pandas
df = pandas.DataFrame({'ColName / WithFrontSlash': [1, 2]})
df['ColName / WithFrontSlash']
0 1
1 2
Name: ColName / WithFrontSlash, dtype: int64
#this output is what is exptected
```
```
df.query('ColName / WithFrontSlash > 1')
pandas.computation.ops.UndefinedVariableError: name 'ColName' is not defined
```
Pandas version is 0.17.1
| {
"+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/12858/reactions"
} | https://api.github.com/repos/pandas-dev/pandas/issues/12858/timeline | null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/12859 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/12859/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/12859/comments | https://api.github.com/repos/pandas-dev/pandas/issues/12859/events | https://github.com/pandas-dev/pandas/issues/12859 | 147,407,860 | MDU6SXNzdWUxNDc0MDc4NjA= | 12,859 | cross section coercion with output iterating | {
"avatar_url": "https://avatars.githubusercontent.com/u/16593552?v=4",
"events_url": "https://api.github.com/users/tsu-shiuan/events{/privacy}",
"followers_url": "https://api.github.com/users/tsu-shiuan/followers",
"following_url": "https://api.github.com/users/tsu-shiuan/following{/other_user}",
"gists_url": "https://api.github.com/users/tsu-shiuan/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/tsu-shiuan",
"id": 16593552,
"login": "tsu-shiuan",
"node_id": "MDQ6VXNlcjE2NTkzNTUy",
"organizations_url": "https://api.github.com/users/tsu-shiuan/orgs",
"received_events_url": "https://api.github.com/users/tsu-shiuan/received_events",
"repos_url": "https://api.github.com/users/tsu-shiuan/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/tsu-shiuan/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/tsu-shiuan/subscriptions",
"type": "User",
"url": "https://api.github.com/users/tsu-shiuan"
} | [
{
"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 | 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 | 2016-04-11T12:10:21Z | 2021-05-12T13:27:55Z | 2021-05-12T13:27:55Z | NONE | null | I'm am trying to call the to_dict function on the following DataFrame:
```
import pandas as pd
data = {"a": [1,2,3,4,5], "b": [90,80,40,60,30]}
df = pd.DataFrame(data)
```
```
df
a b
0 1 90
1 2 80
2 3 40
3 4 60
4 5 30
```
```
df.reset_index().to_dict("r")
[{'a': 1, 'b': 90, 'index': 0},
{'a': 2, 'b': 80, 'index': 1},
{'a': 3, 'b': 40, 'index': 2},
{'a': 4, 'b': 60, 'index': 3},
{'a': 5, 'b': 30, 'index': 4}]
```
However my problem occurs if I perform a float operation on the dataframe, which mutates the index into a float:
```
(df*1.0).reset_index().to_dict("r")
[{'a': 1.0, 'b': 90.0, 'index': 0.0},
{'a': 2.0, 'b': 80.0, 'index': 1.0},
{'a': 3.0, 'b': 40.0, 'index': 2.0},
{'a': 4.0, 'b': 60.0, 'index': 3.0},
{'a': 5.0, 'b': 30.0, 'index': 4.0}]
```
Can anyone explain the above behaviour or recommend a workaround, or verify whether or not this could be a pandas bug? None of the other outtypes in the to_dict method mutates the index as shown above.
I've replicated this on both pandas 0.14 and 0.18 (latest)
Many thanks!
link to stackoverflow: http://stackoverflow.com/questions/36548151/pandas-to-dict-changes-index-type-with-outtype-records
| {
"+1": 3,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 3,
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/12859/reactions"
} | https://api.github.com/repos/pandas-dev/pandas/issues/12859/timeline | null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/12860 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/12860/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/12860/comments | https://api.github.com/repos/pandas-dev/pandas/issues/12860/events | https://github.com/pandas-dev/pandas/issues/12860 | 147,453,993 | MDU6SXNzdWUxNDc0NTM5OTM= | 12,860 | ENH: support .astype('category') on DataFrame / aka co-factorization | {
"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"
} | [
{
"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": "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"
}
]
| closed | false | null | []
| {
"closed_at": "2018-05-16T03:09:58Z",
"closed_issues": 1645,
"created_at": "2017-10-20T10:17:09Z",
"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": "after 0.22",
"due_on": "2018-05-15T07:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/53",
"id": 2853937,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/53/labels",
"node_id": "MDk6TWlsZXN0b25lMjg1MzkzNw==",
"number": 53,
"open_issues": 0,
"state": "closed",
"title": "0.23.0",
"updated_at": "2018-08-20T06:48:57Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/53"
} | 6 | 2016-04-11T14:50:42Z | 2018-03-01T01:07:16Z | 2018-03-01T01:07:16Z | CONTRIBUTOR | null | xref to #10696, #8709
We don't allow an astype of a DataFrame to category directly
```
In [44]: df.astype('category')
NotImplementedError: > 1 ndim Categorical are not supported at this time
```
Instead you can apply the astype per-column.
```
In [35]: df = DataFrame({'A' : list('aabcda'), 'B' : list('bcdaae')})
In [36]: df
Out[36]:
A B
0 a b
1 a c
2 b d
3 c a
4 d a
5 a e
In [37]: df.apply(lambda x: x.astype('category'))
Out[37]:
A B
0 a b
1 a c
2 b d
3 c a
4 d a
5 a e
In [38]: df.apply(lambda x: x.astype('category')).B
Out[38]:
0 b
1 c
2 d
3 a
4 a
5 e
Name: B, dtype: category
Categories (5, object): [a, b, c, d, e]
In [39]: df.apply(lambda x: x.astype('category')).A
Out[39]:
0 a
1 a
2 b
3 c
4 d
5 a
Name: A, dtype: category
Categories (4, object): [a, b, c, d]
```
But if you have 'similar' cateogories then you would usually do this, automatically
astyping with the same uniques.
```
In [41]: uniques = np.sort(pd.unique(df.values.ravel()))
In [42]: df.apply(lambda x: x.astype('category', categories=uniques)).A
Out[42]:
0 a
1 a
2 b
3 c
4 d
5 a
Name: A, dtype: category
Categories (5, object): [a, b, c, d, e]
In [43]: df.apply(lambda x: x.astype('category', categories=uniques)).B
Out[43]:
0 b
1 c
2 d
3 a
4 a
5 e
Name: B, dtype: category
Categories (5, object): [a, b, c, d, e]
```
This is failry straightforward to actually implement, and I think is a nice easy way of coding, w/o having to actually support 2D categoricals internally (and we are moving away from internal 2-d structures anyhow).
| {
"+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/12860/reactions"
} | https://api.github.com/repos/pandas-dev/pandas/issues/12860/timeline | null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/12861 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/12861/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/12861/comments | https://api.github.com/repos/pandas-dev/pandas/issues/12861/events | https://github.com/pandas-dev/pandas/issues/12861 | 147,460,316 | MDU6SXNzdWUxNDc0NjAzMTY= | 12,861 | BUG: indexing with boolean array and categoricals | {
"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"
} | [
{
"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": "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"
} | 1 | 2016-04-11T15:11:43Z | 2019-10-21T19:34:17Z | null | CONTRIBUTOR | null | xref #12857
```
In [24]: df2 = df.apply(lambda x: x.astype('category',categories=(np.sort(pd.unique(df.values.ravel())))))
In [25]: df2
Out[25]:
A B
0 a b
1 a c
2 b d
3 c a
4 d a
5 a e
```
after #12564, the boolean array is ok
```
In [28]: df2=='d'
Out[28]:
A B
0 False False
1 False False
2 False True
3 False False
4 True False
5 False False
```
but indexing is broken
```
In [26]: df2[df2=='c']
ValueError: Wrong number of dimensions
```
| {
"+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/12861/reactions"
} | https://api.github.com/repos/pandas-dev/pandas/issues/12861/timeline | null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/12862 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/12862/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/12862/comments | https://api.github.com/repos/pandas-dev/pandas/issues/12862/events | https://github.com/pandas-dev/pandas/issues/12862 | 147,463,196 | MDU6SXNzdWUxNDc0NjMxOTY= | 12,862 | Series.__setitem__ with datetime64[ns, tz] dtype raises ValueError when setting a tz-aware timestamps | {
"avatar_url": "https://avatars.githubusercontent.com/u/2195834?v=4",
"events_url": "https://api.github.com/users/jluttine/events{/privacy}",
"followers_url": "https://api.github.com/users/jluttine/followers",
"following_url": "https://api.github.com/users/jluttine/following{/other_user}",
"gists_url": "https://api.github.com/users/jluttine/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jluttine",
"id": 2195834,
"login": "jluttine",
"node_id": "MDQ6VXNlcjIxOTU4MzQ=",
"organizations_url": "https://api.github.com/users/jluttine/orgs",
"received_events_url": "https://api.github.com/users/jluttine/received_events",
"repos_url": "https://api.github.com/users/jluttine/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jluttine/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jluttine/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jluttine"
} | [
{
"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": "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 | {
"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"
} | [
{
"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"
}
]
| {
"closed_at": "2019-07-19T00:34:29Z",
"closed_issues": 1289,
"created_at": "2018-10-23T02:34:15Z",
"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": "",
"due_on": "2019-07-01T07:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/61",
"id": 3759483,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/61/labels",
"node_id": "MDk6TWlsZXN0b25lMzc1OTQ4Mw==",
"number": 61,
"open_issues": 0,
"state": "closed",
"title": "0.25.0",
"updated_at": "2020-01-02T15:10:40Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/61"
} | 2 | 2016-04-11T15:23:43Z | 2019-07-11T16:39:34Z | 2019-07-11T16:39:34Z | NONE | null | I'm not able to construct a Series element by element if the elements are timezone localized datetimes. Any workarounds?
#### Code Sample, a copy-pastable example if possible
``` python
# This works
x = pd.Series()
x['foo'] = pd.to_datetime(42)
x['bar'] = pd.to_datetime(666)
# This doesn't
x = pd.Series()
x['foo'] = pd.to_datetime(42).tz_localize('UTC')
x['bar'] = pd.to_datetime(666).tz_localize('UTC')
```
```
ValueError Traceback (most recent call last)
<ipython-input-24-cc1ab78086e5> in <module>()
1 x = pd.Series()
2 x['foo'] = pd.to_datetime(42).tz_localize('UTC')
----> 3 x['bar'] = pd.to_datetime(666).tz_localize('UTC')
/usr/lib/python3.5/site-packages/pandas/core/series.py in __setitem__(self, key, value)
726 # do the setitem
727 cacher_needs_updating = self._check_is_chained_assignment_possible()
--> 728 setitem(key, value)
729 if cacher_needs_updating:
730 self._maybe_update_cacher()
/usr/lib/python3.5/site-packages/pandas/core/series.py in setitem(key, value)
722 pass
723
--> 724 self._set_with(key, value)
725
726 # do the setitem
/usr/lib/python3.5/site-packages/pandas/core/series.py in _set_with(self, key, value)
770 self._set_values(key.astype(np.bool_), value)
771 else:
--> 772 self._set_labels(key, value)
773
774 def _set_labels(self, key, value):
/usr/lib/python3.5/site-packages/pandas/core/series.py in _set_labels(self, key, value)
780 mask = indexer == -1
781 if mask.any():
--> 782 raise ValueError('%s not contained in the index' % str(key[mask]))
783 self._set_values(indexer, value)
784
ValueError: ['b' 'a' 'r'] not contained in the index
```
#### Expected Output
Shouldn't raise errors.
#### output of `pd.show_versions()`
```
INSTALLED VERSIONS
------------------
commit: None
python: 3.5.1.final.0
python-bits: 64
OS: Linux
OS-release: 4.4.6-gnu-1
machine: x86_64
processor:
byteorder: little
LC_ALL: None
LANG: en_DK.UTF-8
pandas: 0.18.0
nose: 1.3.7
pip: 8.1.1
setuptools: 18.2
Cython: 0.24
numpy: 1.11.0
scipy: 0.17.0
statsmodels: None
xarray: None
IPython: 4.1.2
sphinx: 1.4
patsy: None
dateutil: 2.5.2
pytz: 2016.3
blosc: None
bottleneck: None
tables: 3.2.2
numexpr: 2.5.2
matplotlib: 1.5.1
openpyxl: None
xlrd: 0.9.4
xlwt: None
xlsxwriter: None
lxml: None
bs4: 4.4.1
html5lib: None
httplib2: 0.9.2
apiclient: 1.5.0
sqlalchemy: 1.0.12
pymysql: None
psycopg2: 2.6.1 (dt dec pq3 ext lo64)
jinja2: 2.8
boto: None
```
| {
"+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/12862/reactions"
} | https://api.github.com/repos/pandas-dev/pandas/issues/12862/timeline | null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/12863 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/12863/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/12863/comments | https://api.github.com/repos/pandas-dev/pandas/issues/12863/events | https://github.com/pandas-dev/pandas/issues/12863 | 147,464,202 | MDU6SXNzdWUxNDc0NjQyMDI= | 12,863 | Series.any() and .all() don't return bool values if dtype=object | {
"avatar_url": "https://avatars.githubusercontent.com/u/1591339?v=4",
"events_url": "https://api.github.com/users/jdavies1618/events{/privacy}",
"followers_url": "https://api.github.com/users/jdavies1618/followers",
"following_url": "https://api.github.com/users/jdavies1618/following{/other_user}",
"gists_url": "https://api.github.com/users/jdavies1618/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jdavies1618",
"id": 1591339,
"login": "jdavies1618",
"node_id": "MDQ6VXNlcjE1OTEzMzk=",
"organizations_url": "https://api.github.com/users/jdavies1618/orgs",
"received_events_url": "https://api.github.com/users/jdavies1618/received_events",
"repos_url": "https://api.github.com/users/jdavies1618/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jdavies1618/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jdavies1618/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jdavies1618"
} | [
{
"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": "e102d8",
"default": false,
"description": "Unexpected or buggy dtype conversions",
"id": 31404521,
"name": "Dtype Conversions",
"node_id": "MDU6TGFiZWwzMTQwNDUyMQ==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Dtype%20Conversions"
},
{
"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": "547c03",
"default": false,
"description": "sum, mean, min, max, etc.",
"id": 2365504383,
"name": "Reduction Operations",
"node_id": "MDU6TGFiZWwyMzY1NTA0Mzgz",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Reduction%20Operations"
}
]
| 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"
} | 13 | 2016-04-11T15:26:44Z | 2021-05-06T01:35:18Z | 2021-05-06T01:35:18Z | NONE | null | #### Code Sample, a copy-pastable example if possible
```
s = pd.Series(index=range(5), data=['a', 'b', 'c', 'd', 'e'], dtype=object)
print [s.any(), s.all()]
```
#### Expected Output
`[True, True]`
#### Actual output
`['a', 'e']`
#### output of `pd.show_versions()`
```
INSTALLED VERSIONS
------------------
commit: None
python: 2.7.11.final.0
python-bits: 64
OS: Darwin
OS-release: 15.0.0
machine: x86_64
processor: i386
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8
pandas: None
nose: 1.3.7
pip: 8.1.1
setuptools: None
Cython: None
numpy: 1.10.1
scipy: 0.16.1
statsmodels: None
IPython: 4.0.0
sphinx: 1.3.3
patsy: None
dateutil: 2.4.2
pytz: 2015.7
blosc: None
bottleneck: None
tables: None
numexpr: None
matplotlib: 1.4.3
openpyxl: None
xlrd: None
xlwt: None
xlsxwriter: None
lxml: None
bs4: None
html5lib: None
httplib2: None
apiclient: None
sqlalchemy: 1.0.11
pymysql: None
psycopg2: None
Jinja2: None
```
| {
"+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/12863/reactions"
} | https://api.github.com/repos/pandas-dev/pandas/issues/12863/timeline | null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/12864 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/12864/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/12864/comments | https://api.github.com/repos/pandas-dev/pandas/issues/12864/events | https://github.com/pandas-dev/pandas/pull/12864 | 147,466,098 | MDExOlB1bGxSZXF1ZXN0NjYwMTM4NzE= | 12,864 | COMPAT: .query/.eval should work w/o numexpr being installed if possible | {
"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"
} | [
{
"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"
}
]
| closed | false | null | []
| {
"closed_at": "2016-05-05T00:34:40Z",
"closed_issues": 306,
"created_at": "2016-02-08T15:29:59Z",
"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": "after 0.18.0 of course!",
"due_on": "2016-05-04T07:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/38",
"id": 1570594,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/38/labels",
"node_id": "MDk6TWlsZXN0b25lMTU3MDU5NA==",
"number": 38,
"open_issues": 0,
"state": "closed",
"title": "0.18.1",
"updated_at": "2017-08-10T09:01:26Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/38"
} | 0 | 2016-04-11T15:32:11Z | 2016-04-11T23:57:05Z | 2016-04-11T23:57:05Z | CONTRIBUTOR | null | closes #12749
| {
"+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/12864/reactions"
} | https://api.github.com/repos/pandas-dev/pandas/issues/12864/timeline | null | 0 | {
"diff_url": "https://github.com/pandas-dev/pandas/pull/12864.diff",
"html_url": "https://github.com/pandas-dev/pandas/pull/12864",
"merged_at": null,
"patch_url": "https://github.com/pandas-dev/pandas/pull/12864.patch",
"url": "https://api.github.com/repos/pandas-dev/pandas/pulls/12864"
} |
https://api.github.com/repos/pandas-dev/pandas/issues/12865 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/12865/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/12865/comments | https://api.github.com/repos/pandas-dev/pandas/issues/12865/events | https://github.com/pandas-dev/pandas/issues/12865 | 147,480,645 | MDU6SXNzdWUxNDc0ODA2NDU= | 12,865 | MetaIssue: Pandas tries too hard to be smart | {
"avatar_url": "https://avatars.githubusercontent.com/u/150504?v=4",
"events_url": "https://api.github.com/users/DavidEscott/events{/privacy}",
"followers_url": "https://api.github.com/users/DavidEscott/followers",
"following_url": "https://api.github.com/users/DavidEscott/following{/other_user}",
"gists_url": "https://api.github.com/users/DavidEscott/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/DavidEscott",
"id": 150504,
"login": "DavidEscott",
"node_id": "MDQ6VXNlcjE1MDUwNA==",
"organizations_url": "https://api.github.com/users/DavidEscott/orgs",
"received_events_url": "https://api.github.com/users/DavidEscott/received_events",
"repos_url": "https://api.github.com/users/DavidEscott/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/DavidEscott/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/DavidEscott/subscriptions",
"type": "User",
"url": "https://api.github.com/users/DavidEscott"
} | [
{
"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 | 12 | 2016-04-11T16:19:32Z | 2021-02-04T03:52:35Z | 2016-04-11T16:55:16Z | NONE | null | ....and ends up doing things wrong.
I had the following task: Given a csv file A and a set of identically structured files X, Y, Z [which have keys in the first two columns, and values in subsequent columns]: I wanted to create a new file which has contents MAX(A.column_val, X.column_val + Y.column_val + Z.column_val).
I had previously written a pure python function to sort the individual columns, and then perform an merge-join on the columns. However conceptually this task is only a few lines of pandas code:
``` python
summed = pandas.concat([X, Y, Z]).groupby(["key_col1", "key_col2"]).sum()
output = pandas.concat([A, summed]).groupby(["key_col1", "key_col2"]).max()
output.to_csv("something.csv")
```
So surely switching to pandas would make the code easier to understand and maintain. Right? Nope!!!
All of the following were issues I had to work around:
1. The results of sum()/max() have heirarchical indexes and so I must liberally sprinkle `reset_index()` at particular points in my code.
2. Pandas tries to be smart and assumes that the empty string in my key_cols is a NULL string and converts it to NaN. This is annoying because now I have to add `na_rep=""` to my `to_csv` command.
3. More significantly though, pandas thinks that a NaN in a groupby column is reason to exclude the entire row... so now I have to add a bunch of lines to `fillna('')` (and that doesn't modify the frame you call it on, but rather returns a copy so you have to `fillna('', inplace=True)`
4. Because pandas doesn't support columns with integer values and NA values it has cast all my ints to floats and my output now looks like `1.0, 2.0`. instead of `1, 2`. So I have to add a `float_format` directive to the `to_csv`.
5. Pandas also likes to output a row number, so `index=False` has to get added to `to_csv.`
The end result is that I am not of the opinion that the resulting pandas implementation is any more legible or maintainable. In three weeks am I going to remember why I have set `index=False` or what the hell that means? Am I going to understand why the calls to `reset_index` are necessary, or what they do? Probably not, which makes me concerned about using this code in production.
| {
"+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/12865/reactions"
} | https://api.github.com/repos/pandas-dev/pandas/issues/12865/timeline | null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/12866 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/12866/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/12866/comments | https://api.github.com/repos/pandas-dev/pandas/issues/12866/events | https://github.com/pandas-dev/pandas/issues/12866 | 147,491,464 | MDU6SXNzdWUxNDc0OTE0NjQ= | 12,866 | read_json changes dtype (int => float) | {
"avatar_url": "https://avatars.githubusercontent.com/u/10356618?v=4",
"events_url": "https://api.github.com/users/stellasia/events{/privacy}",
"followers_url": "https://api.github.com/users/stellasia/followers",
"following_url": "https://api.github.com/users/stellasia/following{/other_user}",
"gists_url": "https://api.github.com/users/stellasia/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/stellasia",
"id": 10356618,
"login": "stellasia",
"node_id": "MDQ6VXNlcjEwMzU2NjE4",
"organizations_url": "https://api.github.com/users/stellasia/orgs",
"received_events_url": "https://api.github.com/users/stellasia/received_events",
"repos_url": "https://api.github.com/users/stellasia/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/stellasia/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/stellasia/subscriptions",
"type": "User",
"url": "https://api.github.com/users/stellasia"
} | [
{
"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": "e102d8",
"default": false,
"description": "Unexpected or buggy dtype conversions",
"id": 31404521,
"name": "Dtype Conversions",
"node_id": "MDU6TGFiZWwzMTQwNDUyMQ==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Dtype%20Conversions"
},
{
"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 | []
| {
"closed_at": "2016-05-05T00:34:40Z",
"closed_issues": 306,
"created_at": "2016-02-08T15:29:59Z",
"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": "after 0.18.0 of course!",
"due_on": "2016-05-04T07:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/38",
"id": 1570594,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/38/labels",
"node_id": "MDk6TWlsZXN0b25lMTU3MDU5NA==",
"number": 38,
"open_issues": 0,
"state": "closed",
"title": "0.18.1",
"updated_at": "2017-08-10T09:01:26Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/38"
} | 6 | 2016-04-11T17:03:37Z | 2016-04-18T17:22:25Z | 2016-04-18T17:22:25Z | NONE | null | Hi there!
This might be a well-known problem but could not find a track/explaination about it. When reading a json to create a pandas object (Series or DataFrame), the index dtype is changed from int to float.
The [doc](http://pandas.pydata.org/pandas-docs/stable/io.html#data-conversion) only mentions the inverse trans-typing:
> a column that was float data will be converted to integer if it can be done safely, e.g. a column of 1.
Is this behaviour expected as well? Is the only solution giving the `read_json` a `dtype` argument?
#### Code Sample, a copy-pastable example if possible
```
In [1]: import pandas as pd
In [2]: s = pd.Series([11, 12, 13])
In [3]: s
Out[3]:
0 11
1 12
2 13
dtype: int64
In [4]: s.to_json()
Out[4]: '{"0":11,"1":12,"2":13}'
In [5]: pd.read_json(s.to_json(), typ="serie")
Out[5]:
0.0 11
1.0 12
2.0 13
dtype: int64
In [6]: s.index.dtype
Out[6]: dtype('int64')
In [7]: pd.read_json(s.to_json(), typ="serie").index.dtype
Out[7]: dtype('float64')
```
#### Expected Output
I would like to recover the integer index for the new `Series` :
```
In [5]: pd.read_json(s.to_json(), typ="serie")
Out[5]:
0 11
1 12
2 13
dtype: int64
In [7]: pd.read_json(s.to_json(), typ="serie").index.dtype
Out[7]: dtype('int64')
```
#### Output of `pd.show_versions()`
```
INSTALLED VERSIONS
------------------
commit: None
python: 2.7.9.final.0
python-bits: 64
OS: Linux
OS-release: 3.16.0-44-generic
machine: x86_64
processor: x86_64
byteorder: little
LC_ALL: None
LANG: fr_FR.UTF-8
pandas: 0.18.0
nose: 1.3.4
pip: 1.5.6
setuptools: 12.2
Cython: None
numpy: 1.11.0
scipy: 0.14.1
statsmodels: 0.5.0
xarray: None
IPython: 4.0.0
sphinx: 1.2.3
patsy: 0.3.0
dateutil: 2.5.2
pytz: 2016.3
blosc: None
bottleneck: None
tables: 3.1.1
numexpr: 2.4
matplotlib: 1.3.1
openpyxl: 2.2.0-b1
xlrd: 0.9.2
xlwt: 0.7.5
xlsxwriter: None
lxml: 3.4.2
bs4: 4.3.2
html5lib: 0.999
httplib2: 0.9
apiclient: None
sqlalchemy: 1.0.0
pymysql: None
psycopg2: 2.6 (dt dec mx pq3 ext lo64)
jinja2: 2.8
boto: None
```
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/12866/reactions"
} | https://api.github.com/repos/pandas-dev/pandas/issues/12866/timeline | null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/12867 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/12867/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/12867/comments | https://api.github.com/repos/pandas-dev/pandas/issues/12867/events | https://github.com/pandas-dev/pandas/issues/12867 | 147,517,083 | MDU6SXNzdWUxNDc1MTcwODM= | 12,867 | COMPAT: show a PerformanceWarning if numexpr is not installed when using .query/.eval | {
"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"
} | [
{
"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": "f2f074",
"default": false,
"description": "Warnings that appear or should be added to pandas",
"id": 1628184320,
"name": "Warnings",
"node_id": "MDU6TGFiZWwxNjI4MTg0MzIw",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Warnings"
},
{
"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 | []
| {
"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"
} | 0 | 2016-04-11T18:45:24Z | 2020-04-10T03:32:59Z | null | CONTRIBUTOR | null | xref #12749
xref #12864
This is a tad non-trivial as the python engine handles string operations. So this would be for numeric/boolean ops.
| {
"+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/12867/reactions"
} | https://api.github.com/repos/pandas-dev/pandas/issues/12867/timeline | null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/12868 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/12868/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/12868/comments | https://api.github.com/repos/pandas-dev/pandas/issues/12868/events | https://github.com/pandas-dev/pandas/issues/12868 | 147,536,959 | MDU6SXNzdWUxNDc1MzY5NTk= | 12,868 | BUG: Resample on empty Period-Indexed Series returns Datetime-Indexed Series | {
"avatar_url": "https://avatars.githubusercontent.com/u/2293126?v=4",
"events_url": "https://api.github.com/users/jduncavage/events{/privacy}",
"followers_url": "https://api.github.com/users/jduncavage/followers",
"following_url": "https://api.github.com/users/jduncavage/following{/other_user}",
"gists_url": "https://api.github.com/users/jduncavage/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jduncavage",
"id": 2293126,
"login": "jduncavage",
"node_id": "MDQ6VXNlcjIyOTMxMjY=",
"organizations_url": "https://api.github.com/users/jduncavage/orgs",
"received_events_url": "https://api.github.com/users/jduncavage/received_events",
"repos_url": "https://api.github.com/users/jduncavage/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jduncavage/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jduncavage/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jduncavage"
} | [
{
"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": "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"
},
{
"color": "207de5",
"default": false,
"description": "resample method",
"id": 74975453,
"name": "Resample",
"node_id": "MDU6TGFiZWw3NDk3NTQ1Mw==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Resample"
}
]
| closed | false | null | []
| {
"closed_at": "2016-05-05T00:34:40Z",
"closed_issues": 306,
"created_at": "2016-02-08T15:29:59Z",
"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": "after 0.18.0 of course!",
"due_on": "2016-05-04T07:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/38",
"id": 1570594,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/38/labels",
"node_id": "MDk6TWlsZXN0b25lMTU3MDU5NA==",
"number": 38,
"open_issues": 0,
"state": "closed",
"title": "0.18.1",
"updated_at": "2017-08-10T09:01:26Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/38"
} | 5 | 2016-04-11T19:56:41Z | 2016-04-13T01:12:56Z | 2016-04-13T01:12:56Z | NONE | null | #### Code Sample, a copy-pastable example if possible
`
In [7]: pd.Series([], pd.period_range(start='2000', periods=0)).resample('W').mean().index
Out[7]: DatetimeIndex([], dtype='datetime64[ns]', freq='W-SUN')
`
#### Expected Output
`
PeriodIndex([], dtype='int64', freq='W-SUN')
`
On pandas: 0.18.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/12868/reactions"
} | https://api.github.com/repos/pandas-dev/pandas/issues/12868/timeline | null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/12869 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/12869/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/12869/comments | https://api.github.com/repos/pandas-dev/pandas/issues/12869/events | https://github.com/pandas-dev/pandas/issues/12869 | 147,556,621 | MDU6SXNzdWUxNDc1NTY2MjE= | 12,869 | duplicated() invoked on a data frame with an empty subset of columns | {
"avatar_url": "https://avatars.githubusercontent.com/u/12091011?v=4",
"events_url": "https://api.github.com/users/sebov/events{/privacy}",
"followers_url": "https://api.github.com/users/sebov/followers",
"following_url": "https://api.github.com/users/sebov/following{/other_user}",
"gists_url": "https://api.github.com/users/sebov/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/sebov",
"id": 12091011,
"login": "sebov",
"node_id": "MDQ6VXNlcjEyMDkxMDEx",
"organizations_url": "https://api.github.com/users/sebov/orgs",
"received_events_url": "https://api.github.com/users/sebov/received_events",
"repos_url": "https://api.github.com/users/sebov/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/sebov/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sebov/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sebov"
} | [
{
"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": "fc6feb",
"default": false,
"description": "duplicated, drop_duplicates",
"id": 1633019538,
"name": "duplicated",
"node_id": "MDU6TGFiZWwxNjMzMDE5NTM4",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/duplicated"
}
]
| 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 | 2016-04-11T21:13:09Z | 2019-10-28T17:44:13Z | null | NONE | null | Trying to investigate different subset of data frame's columns we get into trouble when 'duplicated' method is invoked for a data frame sliced to an empty subset of columns.
``` python
ValueError Traceback (most recent call last)
<ipython-input-672-9c619ea6d0ef> in <module>()
14 print data_frame[cols].sum()
15 print "---"
---> 16 print data_frame[cols].duplicated()
17
18
.../local/lib/python2.7/site-packages/pandas/util/decorators.pyc in wrapper(*args, **kwargs)
89 else:
90 kwargs[new_arg_name] = new_arg_value
---> 91 return func(*args, **kwargs)
92 return wrapper
93 return _deprecate_kwarg
.../local/lib/python2.7/site-packages/pandas/core/frame.pyc in duplicated(self, subset, keep)
3100
3101 vals = (self[col].values for col in subset)
-> 3102 labels, shape = map(list, zip(*map(f, vals)))
3103
3104 ids = get_group_index(labels, shape, sort=False, xnull=False)
ValueError: need more than 0 values to unpack
```
#### Code Sample, a copy-pastable example if possible
``` python
import pandas as pd
data_frame = pd.DataFrame({'a': [1]*5})
cols = ['a']
print data_frame[cols]
print "---"
print data_frame[cols].sum()
print "---"
print data_frame[cols].duplicated()
print "---"
cols = []
print data_frame[cols]
print "---"
print data_frame[cols].sum()
print "---"
print data_frame[cols].duplicated()
```
#### Expected Output
``` python
a
0 1
1 1
2 1
3 1
4 1
---
a 5
dtype: int64
---
0 False
1 True
2 True
3 True
4 True
dtype: bool
---
Empty DataFrame
Columns: []
Index: [0, 1, 2, 3, 4]
---
Series([], dtype: float64)
---
0 False
1 True
2 True
3 True
4 True
dtype: bool
```
#### output of `pd.show_versions()`
``` python
commit: None
python: 2.7.9.final.0
python-bits: 64
OS: Linux
OS-release: 3.19.0-58-generic
machine: x86_64
processor: x86_64
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8
pandas: 0.18.0
nose: 1.3.7
pip: 1.5.6
setuptools: 12.2
Cython: 0.23.4
numpy: 1.11.0
scipy: 0.16.1
statsmodels: None
xarray: None
IPython: 4.0.3
sphinx: None
patsy: 0.4.0
dateutil: 2.5.2
pytz: 2016.3
blosc: None
bottleneck: None
tables: None
numexpr: None
matplotlib: 1.5.1
openpyxl: None
xlrd: None
xlwt: None
xlsxwriter: 0.7.6
lxml: None
bs4: 4.3.2
html5lib: 0.999
httplib2: 0.9
apiclient: None
sqlalchemy: None
pymysql: 0.6.6.None
psycopg2: None
jinja2: 2.8
boto: None
```
| {
"+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/12869/reactions"
} | https://api.github.com/repos/pandas-dev/pandas/issues/12869/timeline | null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/12870 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/12870/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/12870/comments | https://api.github.com/repos/pandas-dev/pandas/issues/12870/events | https://github.com/pandas-dev/pandas/issues/12870 | 147,557,735 | MDU6SXNzdWUxNDc1NTc3MzU= | 12,870 | read_excel with names keyword argument not working | {
"avatar_url": "https://avatars.githubusercontent.com/u/3696566?v=4",
"events_url": "https://api.github.com/users/swkoh/events{/privacy}",
"followers_url": "https://api.github.com/users/swkoh/followers",
"following_url": "https://api.github.com/users/swkoh/following{/other_user}",
"gists_url": "https://api.github.com/users/swkoh/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/swkoh",
"id": 3696566,
"login": "swkoh",
"node_id": "MDQ6VXNlcjM2OTY1NjY=",
"organizations_url": "https://api.github.com/users/swkoh/orgs",
"received_events_url": "https://api.github.com/users/swkoh/received_events",
"repos_url": "https://api.github.com/users/swkoh/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/swkoh/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/swkoh/subscriptions",
"type": "User",
"url": "https://api.github.com/users/swkoh"
} | [
{
"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": "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": "2016-05-05T00:34:40Z",
"closed_issues": 306,
"created_at": "2016-02-08T15:29:59Z",
"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": "after 0.18.0 of course!",
"due_on": "2016-05-04T07:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/38",
"id": 1570594,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/38/labels",
"node_id": "MDk6TWlsZXN0b25lMTU3MDU5NA==",
"number": 38,
"open_issues": 0,
"state": "closed",
"title": "0.18.1",
"updated_at": "2017-08-10T09:01:26Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/38"
} | 2 | 2016-04-11T21:17:18Z | 2016-04-18T10:26:06Z | 2016-04-16T01:44:27Z | NONE | null | With pandas 0.18, pd.read_excel() with name keyworkd does not work anymore. (pandas 0.17 works fine.) pandas 0.18 has a change to add names as a keyword argument in excel.py at line 76.
#### Code Sample, a copy-pastable example if possible
filename = 'test.xlsx'
column_names = ['field1', 'field2']
df = pd.read_excel(filename, index_col=None, names=column_names)
#### Expected Output
column_names associated with keyword argument names is supposed to pass down to kwds at C:\Python27\Lib\site-packages\pandas\io\excel.py:177.
kwds is supposed to carry the arguments from application (in this case, column_names above) but it does not get passed.
#### output of `pd.show_versions()`
## INSTALLED VERSIONS
commit: None
python: 2.7.11.final.0
python-bits: 32
OS: Windows
OS-release: 7
machine: AMD64
processor: Intel64 Family 6 Model 60 Stepping 3, GenuineIntel
byteorder: little
LC_ALL: None
LANG: None
pandas: 0.18.0
nose: None
pip: 8.1.1
setuptools: 18.3.2
Cython: 0.23.5
numpy: 1.11.0
scipy: None
statsmodels: None
xarray: None
IPython: 4.0.0
sphinx: None
patsy: None
dateutil: 2.5.2
pytz: 2016.3
blosc: None
bottleneck: None
tables: None
numexpr: 2.5
matplotlib: 1.5.1
openpyxl: 2.2.2
xlrd: 0.9.3
xlwt: 1.0.0
xlsxwriter: 0.7.3
lxml: None
bs4: 4.3.2
html5lib: None
httplib2: None
apiclient: None
sqlalchemy: 1.0.12
pymysql: None
psycopg2: None
jinja2: 2.8
boto: None
| {
"+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/12870/reactions"
} | https://api.github.com/repos/pandas-dev/pandas/issues/12870/timeline | null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/12871 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/12871/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/12871/comments | https://api.github.com/repos/pandas-dev/pandas/issues/12871/events | https://github.com/pandas-dev/pandas/issues/12871 | 147,568,799 | MDU6SXNzdWUxNDc1Njg3OTk= | 12,871 | Period Resampling Master Issue | {
"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"
} | [
{
"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"
},
{
"color": "207de5",
"default": false,
"description": "resample method",
"id": 74975453,
"name": "Resample",
"node_id": "MDU6TGFiZWw3NDk3NTQ1Mw==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Resample"
}
]
| closed | false | null | []
| null | 11 | 2016-04-11T22:05:34Z | 2020-05-11T02:08:31Z | 2020-05-11T02:08:31Z | CONTRIBUTOR | null | Various issue surrounding resampling with a `PeriodIndex`
- [x] #12884 Return PeriodIndex if possible
- [x] #12770 recursion error on existing freq (#12874)
- [x] #12774 count (#12874)
- [x] #12868 empty PeriodIndex (#12874)
- [x] #13212 empty dataframe (#13079)
- [x] #11983 with Panels?
- [ ] #7744 convention issues
- [x] #12883 recursion with 'W' freq when upsampling (#12874)
- [x] #13083 ohlc resampling
- [x] #13224 with NaT
- [ ] #14008 MultiIndex with TimeGrouper
- [x] #14213 Verify ``loffset`` works.
- [ ] #15146 Timestamp freq -> Period | {
"+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/12871/reactions"
} | https://api.github.com/repos/pandas-dev/pandas/issues/12871/timeline | null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/12872 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/12872/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/12872/comments | https://api.github.com/repos/pandas-dev/pandas/issues/12872/events | https://github.com/pandas-dev/pandas/issues/12872 | 147,576,548 | MDU6SXNzdWUxNDc1NzY1NDg= | 12,872 | Large MultiIndex objects are not truncated when printing | {
"avatar_url": "https://avatars.githubusercontent.com/u/315810?v=4",
"events_url": "https://api.github.com/users/mwaskom/events{/privacy}",
"followers_url": "https://api.github.com/users/mwaskom/followers",
"following_url": "https://api.github.com/users/mwaskom/following{/other_user}",
"gists_url": "https://api.github.com/users/mwaskom/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/mwaskom",
"id": 315810,
"login": "mwaskom",
"node_id": "MDQ6VXNlcjMxNTgxMA==",
"organizations_url": "https://api.github.com/users/mwaskom/orgs",
"received_events_url": "https://api.github.com/users/mwaskom/received_events",
"repos_url": "https://api.github.com/users/mwaskom/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/mwaskom/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/mwaskom/subscriptions",
"type": "User",
"url": "https://api.github.com/users/mwaskom"
} | [
{
"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": "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": null,
"id": 71268330,
"name": "MultiIndex",
"node_id": "MDU6TGFiZWw3MTI2ODMzMA==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/MultiIndex"
}
]
| 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 | 2016-04-11T22:44:54Z | 2016-04-11T22:50:02Z | 2016-04-11T22:48:57Z | CONTRIBUTOR | null | Most Pandas objects have some truncation applied with they are printed in the REPL. For example:
``` python
In[3]: pd.Index(np.arange(200))
```
```
Out[3]: Int64Index([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
...
190, 191, 192, 193, 194, 195, 196, 197, 198, 199],
dtype='int64', length=200)
```
MultiIndex objects are an apparent exception:
``` python
In[4]: pd.MultiIndex.from_arrays([np.arange(200), np.arange(200)])
```
```
Out[4]: MultiIndex(levels=[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199]],
labels=[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199]])
```
Occasionally when working with very large MultiIndex objects (~20,000 rows), I have printed them to check how they look and ended up choking my IPython notebook session (I guess Chrome is what has trouble, but I'm not sure). It would be helpful if the MultiIndex `__repr__` applied some truncation to avoid this, as it can end up being a little disruptive.
#### output of `pd.show_versions()`
```
INSTALLED VERSIONS
------------------
commit: None
python: 2.7.11.final.0
python-bits: 64
OS: Darwin
OS-release: 13.4.0
machine: x86_64
processor: i386
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8
pandas: 0.17.1
nose: 1.3.7
pip: 8.1.1
setuptools: 18.3.1
Cython: 0.20.1
numpy: 1.10.4
scipy: 0.16.1
statsmodels: 0.6.1
IPython: 4.0.3
sphinx: 1.2.3
patsy: 0.4.0
dateutil: 2.4.2
pytz: 2015.7
blosc: None
bottleneck: None
tables: 3.1.1
numexpr: 2.3.1
matplotlib: 1.5.1
openpyxl: 1.8.5
xlrd: 0.9.3
xlwt: 0.7.5
xlsxwriter: 0.5.5
lxml: 3.3.5
bs4: 4.3.1
html5lib: 0.999
httplib2: None
apiclient: None
sqlalchemy: 0.9.4
pymysql: None
psycopg2: None
Jinja2: None
```
| {
"+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/12872/reactions"
} | https://api.github.com/repos/pandas-dev/pandas/issues/12872/timeline | null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/12873 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/12873/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/12873/comments | https://api.github.com/repos/pandas-dev/pandas/issues/12873/events | https://github.com/pandas-dev/pandas/issues/12873 | 147,581,730 | MDU6SXNzdWUxNDc1ODE3MzA= | 12,873 | items returned by itertuples do not act like namedtuples. | {
"avatar_url": "https://avatars.githubusercontent.com/u/295428?v=4",
"events_url": "https://api.github.com/users/cswarth/events{/privacy}",
"followers_url": "https://api.github.com/users/cswarth/followers",
"following_url": "https://api.github.com/users/cswarth/following{/other_user}",
"gists_url": "https://api.github.com/users/cswarth/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/cswarth",
"id": 295428,
"login": "cswarth",
"node_id": "MDQ6VXNlcjI5NTQyOA==",
"organizations_url": "https://api.github.com/users/cswarth/orgs",
"received_events_url": "https://api.github.com/users/cswarth/received_events",
"repos_url": "https://api.github.com/users/cswarth/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/cswarth/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/cswarth/subscriptions",
"type": "User",
"url": "https://api.github.com/users/cswarth"
} | [
{
"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": "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 | 4 | 2016-04-11T23:10:59Z | 2017-06-09T06:47:55Z | 2016-04-11T23:34:42Z | CONTRIBUTOR | null | I don't know if this is a doc bug, a code bug, or an expectation error on my part.
The documentation of [itertuples](http://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.itertuples.html) says this function will "Iterate over DataFrame rows as namedtuples", but the resulting items are not namedtuple and cannot be indexed by name like a namedtuple.
#### Code Sample, a copy-pastable example if possible
```
import pandas as pd
df = pd.DataFrame({'col1': [1, 2], 'col2': [0.1, 0.2]},
index=['a', 'b'])
for row in df.itertuples():
print(row)
print(row['col1'])
```
```
$ python pandasbug.py
Pandas(Index='a', col1=1, col2=0.10000000000000001)
Traceback (most recent call last):
File "pandasbug.py", line 8, in <module>
print(row['col1'])
TypeError: tuple indices must be integers, not str
```
#### Expected Output
```
$ python pandasbug.py
Pandas(Index='a', col1=1, col2=0.10000000000000001)
1
Pandas(Index='b', col1=2, col2=0.20000000000000001)
2
```
#### output of `pd.show_versions()`
```
$ python -c 'import pandas as pd; pd.show_versions()'
INSTALLED VERSIONS
------------------
commit: None
python: 2.7.6.final.0
python-bits: 64
OS: Linux
OS-release: 3.13.0-45-generic
machine: x86_64
processor: x86_64
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8
pandas: 0.18.0
nose: None
pip: 8.1.1
setuptools: 2.2
Cython: None
numpy: 1.11.0
scipy: None
statsmodels: None
xarray: None
IPython: None
sphinx: None
patsy: None
dateutil: 2.5.2
pytz: 2016.3
blosc: None
bottleneck: None
tables: None
numexpr: None
matplotlib: None
openpyxl: None
xlrd: 0.9.4
xlwt: None
xlsxwriter: None
lxml: None
bs4: None
html5lib: None
httplib2: None
apiclient: None
sqlalchemy: 1.0.12
pymysql: None
psycopg2: 2.6.1 (dt dec pq3 ext)
jinja2: None
boto: None
```
| {
"+1": 2,
"-1": 0,
"confused": 0,
"eyes": 0,
"heart": 0,
"hooray": 0,
"laugh": 0,
"rocket": 0,
"total_count": 2,
"url": "https://api.github.com/repos/pandas-dev/pandas/issues/12873/reactions"
} | https://api.github.com/repos/pandas-dev/pandas/issues/12873/timeline | null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/12874 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/12874/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/12874/comments | https://api.github.com/repos/pandas-dev/pandas/issues/12874/events | https://github.com/pandas-dev/pandas/pull/12874 | 147,600,984 | MDExOlB1bGxSZXF1ZXN0NjYwODYwMTc= | 12,874 | PeriodIndex count & size fix | {
"avatar_url": "https://avatars.githubusercontent.com/u/5635139?v=4",
"events_url": "https://api.github.com/users/max-sixty/events{/privacy}",
"followers_url": "https://api.github.com/users/max-sixty/followers",
"following_url": "https://api.github.com/users/max-sixty/following{/other_user}",
"gists_url": "https://api.github.com/users/max-sixty/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/max-sixty",
"id": 5635139,
"login": "max-sixty",
"node_id": "MDQ6VXNlcjU2MzUxMzk=",
"organizations_url": "https://api.github.com/users/max-sixty/orgs",
"received_events_url": "https://api.github.com/users/max-sixty/received_events",
"repos_url": "https://api.github.com/users/max-sixty/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/max-sixty/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/max-sixty/subscriptions",
"type": "User",
"url": "https://api.github.com/users/max-sixty"
} | [
{
"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": "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"
},
{
"color": "207de5",
"default": false,
"description": "resample method",
"id": 74975453,
"name": "Resample",
"node_id": "MDU6TGFiZWw3NDk3NTQ1Mw==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Resample"
}
]
| closed | false | null | []
| {
"closed_at": "2016-05-05T00:34:40Z",
"closed_issues": 306,
"created_at": "2016-02-08T15:29:59Z",
"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": "after 0.18.0 of course!",
"due_on": "2016-05-04T07:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/38",
"id": 1570594,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/38/labels",
"node_id": "MDk6TWlsZXN0b25lMTU3MDU5NA==",
"number": 38,
"open_issues": 0,
"state": "closed",
"title": "0.18.1",
"updated_at": "2017-08-10T09:01:26Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/38"
} | 9 | 2016-04-12T00:57:13Z | 2016-04-13T14:28:27Z | 2016-04-13T01:12:57Z | CONTRIBUTOR | null | closes #12774
closes #12868
closes #12770
- [x] tests added / passed
- [x] passes `git diff upstream/master | flake8 --diff`
- [x] whatsnew entry
Initial attempt at fixing some of the more urgent 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/12874/reactions"
} | https://api.github.com/repos/pandas-dev/pandas/issues/12874/timeline | null | 0 | {
"diff_url": "https://github.com/pandas-dev/pandas/pull/12874.diff",
"html_url": "https://github.com/pandas-dev/pandas/pull/12874",
"merged_at": null,
"patch_url": "https://github.com/pandas-dev/pandas/pull/12874.patch",
"url": "https://api.github.com/repos/pandas-dev/pandas/pulls/12874"
} |
https://api.github.com/repos/pandas-dev/pandas/issues/12875 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/12875/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/12875/comments | https://api.github.com/repos/pandas-dev/pandas/issues/12875/events | https://github.com/pandas-dev/pandas/pull/12875 | 147,618,165 | MDExOlB1bGxSZXF1ZXN0NjYwOTM4MDQ= | 12,875 | _get_new_index always returns index in PeriodIndexResampler | {
"avatar_url": "https://avatars.githubusercontent.com/u/5635139?v=4",
"events_url": "https://api.github.com/users/max-sixty/events{/privacy}",
"followers_url": "https://api.github.com/users/max-sixty/followers",
"following_url": "https://api.github.com/users/max-sixty/following{/other_user}",
"gists_url": "https://api.github.com/users/max-sixty/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/max-sixty",
"id": 5635139,
"login": "max-sixty",
"node_id": "MDQ6VXNlcjU2MzUxMzk=",
"organizations_url": "https://api.github.com/users/max-sixty/orgs",
"received_events_url": "https://api.github.com/users/max-sixty/received_events",
"repos_url": "https://api.github.com/users/max-sixty/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/max-sixty/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/max-sixty/subscriptions",
"type": "User",
"url": "https://api.github.com/users/max-sixty"
} | [
{
"color": "207de5",
"default": false,
"description": "resample method",
"id": 74975453,
"name": "Resample",
"node_id": "MDU6TGFiZWw3NDk3NTQ1Mw==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Resample"
}
]
| closed | false | null | []
| null | 5 | 2016-04-12T02:55:50Z | 2016-04-12T15:56:22Z | 2016-04-12T15:56:22Z | CONTRIBUTOR | null | - [ ] closes #xxxx
- [ ] tests added / passed
- [ ] passes `git diff upstream/master | flake8 --diff`
- [ ] whatsnew entry
Cleans up a method that returned different types depending on the length of the index
| {
"+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/12875/reactions"
} | https://api.github.com/repos/pandas-dev/pandas/issues/12875/timeline | null | 0 | {
"diff_url": "https://github.com/pandas-dev/pandas/pull/12875.diff",
"html_url": "https://github.com/pandas-dev/pandas/pull/12875",
"merged_at": null,
"patch_url": "https://github.com/pandas-dev/pandas/pull/12875.patch",
"url": "https://api.github.com/repos/pandas-dev/pandas/pulls/12875"
} |
https://api.github.com/repos/pandas-dev/pandas/issues/12876 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/12876/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/12876/comments | https://api.github.com/repos/pandas-dev/pandas/issues/12876/events | https://github.com/pandas-dev/pandas/issues/12876 | 147,697,196 | MDU6SXNzdWUxNDc2OTcxOTY= | 12,876 | Pandas IO to_sql extremely slow when checking for potentially case sensitivity issues | {
"avatar_url": "https://avatars.githubusercontent.com/u/3211163?v=4",
"events_url": "https://api.github.com/users/RogerThomas/events{/privacy}",
"followers_url": "https://api.github.com/users/RogerThomas/followers",
"following_url": "https://api.github.com/users/RogerThomas/following{/other_user}",
"gists_url": "https://api.github.com/users/RogerThomas/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/RogerThomas",
"id": 3211163,
"login": "RogerThomas",
"node_id": "MDQ6VXNlcjMyMTExNjM=",
"organizations_url": "https://api.github.com/users/RogerThomas/orgs",
"received_events_url": "https://api.github.com/users/RogerThomas/received_events",
"repos_url": "https://api.github.com/users/RogerThomas/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/RogerThomas/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/RogerThomas/subscriptions",
"type": "User",
"url": "https://api.github.com/users/RogerThomas"
} | [
{
"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": "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 | null | []
| {
"closed_at": "2016-05-05T00:34:40Z",
"closed_issues": 306,
"created_at": "2016-02-08T15:29:59Z",
"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": "after 0.18.0 of course!",
"due_on": "2016-05-04T07:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/38",
"id": 1570594,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/38/labels",
"node_id": "MDk6TWlsZXN0b25lMTU3MDU5NA==",
"number": 38,
"open_issues": 0,
"state": "closed",
"title": "0.18.1",
"updated_at": "2017-08-10T09:01:26Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/38"
} | 8 | 2016-04-12T09:55:44Z | 2016-04-13T01:20:58Z | 2016-04-13T01:20:58Z | NONE | null | This is related to #7815
Since this fix, when checking for case sensitivity issues for MySQL using InnoDB engine with large numbers of tables, Class SQLDatabase.to_sql can take a long time (I currently have ~30,000 tables and this call takes ~10 seconds).
This is due to the 'SHOW FULL TABLES' call coming from SQLAlchemy, from these lines of code specifically
``` python
engine = self.connectable.engine
with self.connectable.connect() as conn:
table_names = engine.table_names(
schema=schema or self.meta.schema,
connection=conn,
)
```
A suggested fix would be to add a parameter to the `to_sql` function.
The parameter might look something like, `case_check='warn'`
and the fix might be something like
``` python
if case_check == 'raise' and not name.islower():
raise Exception("table name must be lower case when case_check = 'raise'")
current_code()
if case_check == 'warn':
engine = self.connectable.engine
with self.connectable.connect() as conn:
table_names = engine.table_names(
schema=schema or self.meta.schema,
connection=conn,
)
```
Versions:
## INSTALLED VERSIONS
commit: None
python: 2.7.6.final.0
python-bits: 64
OS: Linux
OS-release: 3.13.0-83-generic
machine: x86_64
processor: x86_64
byteorder: little
LC_ALL: None
LANG: en_IE.UTF-8
pandas: 0.18.0
nose: 1.3.7
pip: 8.1.1
setuptools: 18.2
Cython: 0.23.4
numpy: 1.10.1
scipy: 0.16.1
statsmodels: None
xarray: None
IPython: None
sphinx: 1.3.1
patsy: None
dateutil: 2.4.2
pytz: 2015.7
blosc: None
bottleneck: None
tables: 3.2.0
numexpr: 2.4.6
matplotlib: 1.5.0
openpyxl: None
xlrd: None
xlwt: None
xlsxwriter: None
lxml: None
bs4: None
html5lib: None
httplib2: None
apiclient: None
sqlalchemy: 1.0.9
pymysql: None
psycopg2: None
jinja2: 2.8
boto: 2.38.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/12876/reactions"
} | https://api.github.com/repos/pandas-dev/pandas/issues/12876/timeline | null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/12877 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/12877/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/12877/comments | https://api.github.com/repos/pandas-dev/pandas/issues/12877/events | https://github.com/pandas-dev/pandas/issues/12877 | 147,700,653 | MDU6SXNzdWUxNDc3MDA2NTM= | 12,877 | DataFrame of datetimes with NaT Comparison always evaluates to True | {
"avatar_url": "https://avatars.githubusercontent.com/u/6304370?v=4",
"events_url": "https://api.github.com/users/antonymayi/events{/privacy}",
"followers_url": "https://api.github.com/users/antonymayi/followers",
"following_url": "https://api.github.com/users/antonymayi/following{/other_user}",
"gists_url": "https://api.github.com/users/antonymayi/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/antonymayi",
"id": 6304370,
"login": "antonymayi",
"node_id": "MDQ6VXNlcjYzMDQzNzA=",
"organizations_url": "https://api.github.com/users/antonymayi/orgs",
"received_events_url": "https://api.github.com/users/antonymayi/received_events",
"repos_url": "https://api.github.com/users/antonymayi/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/antonymayi/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/antonymayi/subscriptions",
"type": "User",
"url": "https://api.github.com/users/antonymayi"
} | [
{
"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": "e102d8",
"default": false,
"description": "Unexpected or buggy dtype conversions",
"id": 31404521,
"name": "Dtype Conversions",
"node_id": "MDU6TGFiZWwzMTQwNDUyMQ==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Dtype%20Conversions"
}
]
| closed | false | null | []
| {
"closed_at": "2016-05-05T00:34:40Z",
"closed_issues": 306,
"created_at": "2016-02-08T15:29:59Z",
"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": "after 0.18.0 of course!",
"due_on": "2016-05-04T07:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/38",
"id": 1570594,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/38/labels",
"node_id": "MDk6TWlsZXN0b25lMTU3MDU5NA==",
"number": 38,
"open_issues": 0,
"state": "closed",
"title": "0.18.1",
"updated_at": "2017-08-10T09:01:26Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/38"
} | 10 | 2016-04-12T10:11:34Z | 2016-04-12T13:04:16Z | 2016-04-12T12:43:33Z | NONE | null | #### Code Sample
```
>>> import pandas as pd
>>> from datetime import date
>>> df=pd.DataFrame({'a': pd.Series([date(2016,1,1)], index=[date(2016,1,1)]), 'b': pd.Series([date(2016,1,3)], index=[date(2016,1,3)])})
>>> df
a b
2016-01-01 2016-01-01 NaN
2016-01-03 NaN 2016-01-03
>>> df>date(2016,1,2)
a b
2016-01-01 True True
2016-01-03 True True
>>> df<date(2016,1,2)
a b
2016-01-01 True True
2016-01-03 True True
```
#### Expected Output
something more like with NaT:
```
>>> df.fillna(pd.NaT, inplace=True)
>>> df>date(2016,1,2)
a b
2016-01-01 False False
2016-01-03 False True
>>> df<date(2016,1,2)
a b
2016-01-01 True False
2016-01-03 False False
```
#### output of `pd.show_versions()`
## INSTALLED VERSIONS
commit: None
python: 2.7.10.final.0
python-bits: 64
OS: Linux
OS-release: 4.2.0-22-generic
machine: x86_64
processor: x86_64
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8
pandas: 0.18.0
nose: 1.3.6
pip: 1.5.6
setuptools: 18.4
Cython: None
numpy: 1.8.2
scipy: 0.14.1
statsmodels: 0.5.0
xarray: None
IPython: 2.3.0
sphinx: None
patsy: 0.4.0
dateutil: 2.2
pytz: 2014.10
blosc: None
bottleneck: None
tables: 3.2.2
numexpr: 2.4.3
matplotlib: 1.4.2
openpyxl: 2.3.0-b1
xlrd: 0.9.4
xlwt: 0.7.5
xlsxwriter: None
lxml: 3.4.4
bs4: 4.3.2
html5lib: 0.999
httplib2: 0.9
apiclient: None
sqlalchemy: None
pymysql: 0.6.2.None
psycopg2: None
jinja2: 2.8
boto: None
| {
"+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/12877/reactions"
} | https://api.github.com/repos/pandas-dev/pandas/issues/12877/timeline | null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/12878 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/12878/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/12878/comments | https://api.github.com/repos/pandas-dev/pandas/issues/12878/events | https://github.com/pandas-dev/pandas/pull/12878 | 147,723,209 | MDExOlB1bGxSZXF1ZXN0NjYxNDMzOTU= | 12,878 | BUG: json invoke default handler for unsupported numpy dtypes | {
"avatar_url": "https://avatars.githubusercontent.com/u/107748?v=4",
"events_url": "https://api.github.com/users/Komnomnomnom/events{/privacy}",
"followers_url": "https://api.github.com/users/Komnomnomnom/followers",
"following_url": "https://api.github.com/users/Komnomnomnom/following{/other_user}",
"gists_url": "https://api.github.com/users/Komnomnomnom/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/Komnomnomnom",
"id": 107748,
"login": "Komnomnomnom",
"node_id": "MDQ6VXNlcjEwNzc0OA==",
"organizations_url": "https://api.github.com/users/Komnomnomnom/orgs",
"received_events_url": "https://api.github.com/users/Komnomnomnom/received_events",
"repos_url": "https://api.github.com/users/Komnomnomnom/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/Komnomnomnom/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Komnomnomnom/subscriptions",
"type": "User",
"url": "https://api.github.com/users/Komnomnomnom"
} | [
{
"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": "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"
},
{
"color": "009800",
"default": false,
"description": "Complex Numbers",
"id": 172091424,
"name": "Complex",
"node_id": "MDU6TGFiZWwxNzIwOTE0MjQ=",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Complex"
}
]
| closed | false | null | []
| {
"closed_at": "2016-05-05T00:34:40Z",
"closed_issues": 306,
"created_at": "2016-02-08T15:29:59Z",
"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": "after 0.18.0 of course!",
"due_on": "2016-05-04T07:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/38",
"id": 1570594,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/38/labels",
"node_id": "MDk6TWlsZXN0b25lMTU3MDU5NA==",
"number": 38,
"open_issues": 0,
"state": "closed",
"title": "0.18.1",
"updated_at": "2017-08-10T09:01:26Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/38"
} | 6 | 2016-04-12T11:45:25Z | 2016-04-27T14:29:01Z | 2016-04-27T14:28:37Z | CONTRIBUTOR | null | - [x] closes #12554
- [x] tests added / passed
- [x] passes `git diff upstream/master | flake8 --diff`
- [x] whatsnew entry
- [x] valgrind clean
- [ ] windows tests ok
- [x] vbench ok
Recommend to merge after #12802 has been accepted. (valgrind should be clean then)
| {
"+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/12878/reactions"
} | https://api.github.com/repos/pandas-dev/pandas/issues/12878/timeline | null | 0 | {
"diff_url": "https://github.com/pandas-dev/pandas/pull/12878.diff",
"html_url": "https://github.com/pandas-dev/pandas/pull/12878",
"merged_at": null,
"patch_url": "https://github.com/pandas-dev/pandas/pull/12878.patch",
"url": "https://api.github.com/repos/pandas-dev/pandas/pulls/12878"
} |
https://api.github.com/repos/pandas-dev/pandas/issues/12879 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/12879/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/12879/comments | https://api.github.com/repos/pandas-dev/pandas/issues/12879/events | https://github.com/pandas-dev/pandas/issues/12879 | 147,732,110 | MDU6SXNzdWUxNDc3MzIxMTA= | 12,879 | DOC: OrderedDict example in groupby aggregation | {
"avatar_url": "https://avatars.githubusercontent.com/u/8282510?v=4",
"events_url": "https://api.github.com/users/randomgambit/events{/privacy}",
"followers_url": "https://api.github.com/users/randomgambit/followers",
"following_url": "https://api.github.com/users/randomgambit/following{/other_user}",
"gists_url": "https://api.github.com/users/randomgambit/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/randomgambit",
"id": 8282510,
"login": "randomgambit",
"node_id": "MDQ6VXNlcjgyODI1MTA=",
"organizations_url": "https://api.github.com/users/randomgambit/orgs",
"received_events_url": "https://api.github.com/users/randomgambit/received_events",
"repos_url": "https://api.github.com/users/randomgambit/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/randomgambit/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/randomgambit/subscriptions",
"type": "User",
"url": "https://api.github.com/users/randomgambit"
} | [
{
"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": "729FCF",
"default": false,
"description": null,
"id": 233160,
"name": "Groupby",
"node_id": "MDU6TGFiZWwyMzMxNjA=",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Groupby"
},
{
"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 | []
| {
"closed_at": "2016-10-03T08:52:13Z",
"closed_issues": 733,
"created_at": "2016-03-11T21:24:45Z",
"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": "",
"due_on": "2016-09-30T07:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/40",
"id": 1639795,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/40/labels",
"node_id": "MDk6TWlsZXN0b25lMTYzOTc5NQ==",
"number": 40,
"open_issues": 0,
"state": "closed",
"title": "0.19.0",
"updated_at": "2017-11-06T02:01:14Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/40"
} | 4 | 2016-04-12T12:12:41Z | 2016-08-08T16:10:54Z | 2016-08-08T16:10:54Z | NONE | null | Hello,
It's me, again. ;-) I would like to submit to your attention another possible improvement your could implement.
Let me start by saying that 90% of the time, data processing in my field involves some form of groupby at the time frequency, panel frequency, etc.
So aggregating data efficiently is definitely something important and very useful.
I clearly prefer pandas' `groupby` over stata `collapse` (or others) because it is so much faster.
However, a key functionality seems to be missing in Pandas. Usually, people want to apply functions to several columns, and be able to rename the output. In stata, you would write something like
`collapse (firstnm) jreback=pandas, by(time)`
to create a variable named `jreback`, that contains the first non missing value of the column `pandas` for every group in `time`.
In Pandas, a similar process seem unnecessarily complex.
I can only use the syntax `group=df.groupby('group').agg({'A':'mean', 'B':['mean','sum']})`
which has a **major disadvantage**
- **no predictability over the sorting order of the columns**. That is, there is no guarantee that in group, the first column will be A and the second one will be B. I need to `group.column.tolist()` manually to understand which column corresponds to what. That is clearly not efficient (or maybe I am missing something here)
It would be therefore useful to add an option `column_names` that allows the user to chose columns names at the `agg` level, with the guarantee that the first name correspond to the first column and so on. For instance, in the example above I could specify `col_names=['mean_A','mean_B','this is a sum']`
What do you think?
| {
"+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/12879/reactions"
} | https://api.github.com/repos/pandas-dev/pandas/issues/12879/timeline | null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/12880 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/12880/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/12880/comments | https://api.github.com/repos/pandas-dev/pandas/issues/12880/events | https://github.com/pandas-dev/pandas/pull/12880 | 147,755,786 | MDExOlB1bGxSZXF1ZXN0NjYxNTk2NjM= | 12,880 | PERF: Only do case sensitive check when not lower case | {
"avatar_url": "https://avatars.githubusercontent.com/u/3211163?v=4",
"events_url": "https://api.github.com/users/RogerThomas/events{/privacy}",
"followers_url": "https://api.github.com/users/RogerThomas/followers",
"following_url": "https://api.github.com/users/RogerThomas/following{/other_user}",
"gists_url": "https://api.github.com/users/RogerThomas/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/RogerThomas",
"id": 3211163,
"login": "RogerThomas",
"node_id": "MDQ6VXNlcjMyMTExNjM=",
"organizations_url": "https://api.github.com/users/RogerThomas/orgs",
"received_events_url": "https://api.github.com/users/RogerThomas/received_events",
"repos_url": "https://api.github.com/users/RogerThomas/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/RogerThomas/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/RogerThomas/subscriptions",
"type": "User",
"url": "https://api.github.com/users/RogerThomas"
} | [
{
"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": "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 | null | []
| {
"closed_at": "2016-05-05T00:34:40Z",
"closed_issues": 306,
"created_at": "2016-02-08T15:29:59Z",
"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": "after 0.18.0 of course!",
"due_on": "2016-05-04T07:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/38",
"id": 1570594,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/38/labels",
"node_id": "MDk6TWlsZXN0b25lMTU3MDU5NA==",
"number": 38,
"open_issues": 0,
"state": "closed",
"title": "0.18.1",
"updated_at": "2017-08-10T09:01:26Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/38"
} | 1 | 2016-04-12T13:44:36Z | 2016-04-13T01:21:02Z | 2016-04-13T01:20:58Z | NONE | null | - [x] closes #12876
- [ ] tests added / passed
- [x] passes `git diff upstream/master | 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/12880/reactions"
} | https://api.github.com/repos/pandas-dev/pandas/issues/12880/timeline | null | 0 | {
"diff_url": "https://github.com/pandas-dev/pandas/pull/12880.diff",
"html_url": "https://github.com/pandas-dev/pandas/pull/12880",
"merged_at": null,
"patch_url": "https://github.com/pandas-dev/pandas/pull/12880.patch",
"url": "https://api.github.com/repos/pandas-dev/pandas/pulls/12880"
} |
https://api.github.com/repos/pandas-dev/pandas/issues/12881 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/12881/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/12881/comments | https://api.github.com/repos/pandas-dev/pandas/issues/12881/events | https://github.com/pandas-dev/pandas/issues/12881 | 147,759,297 | MDU6SXNzdWUxNDc3NTkyOTc= | 12,881 | BUG: .astype of Float64Index | {
"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"
} | [
{
"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": "e102d8",
"default": false,
"description": "Unexpected or buggy dtype conversions",
"id": 31404521,
"name": "Dtype Conversions",
"node_id": "MDU6TGFiZWwzMTQwNDUyMQ==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Dtype%20Conversions"
}
]
| closed | false | null | []
| {
"closed_at": "2016-05-05T00:34:40Z",
"closed_issues": 306,
"created_at": "2016-02-08T15:29:59Z",
"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": "after 0.18.0 of course!",
"due_on": "2016-05-04T07:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/38",
"id": 1570594,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/38/labels",
"node_id": "MDk6TWlsZXN0b25lMTU3MDU5NA==",
"number": 38,
"open_issues": 0,
"state": "closed",
"title": "0.18.1",
"updated_at": "2017-08-10T09:01:26Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/38"
} | 1 | 2016-04-12T13:56:13Z | 2016-04-18T17:22:25Z | 2016-04-18T17:22:25Z | CONTRIBUTOR | null | xref #12866
```
data = Index([u'0', u'1', u'2'], dtype='object')
data.astype('float64').astype('int64')
TypeError: Setting <class 'pandas.indexes.numeric.Float64Index'> dtype to anything other than float64 or object is not supported
```
this should work
| {
"+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/12881/reactions"
} | https://api.github.com/repos/pandas-dev/pandas/issues/12881/timeline | null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/12882 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/12882/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/12882/comments | https://api.github.com/repos/pandas-dev/pandas/issues/12882/events | https://github.com/pandas-dev/pandas/pull/12882 | 147,786,050 | MDExOlB1bGxSZXF1ZXN0NjYxNzcxNDE= | 12,882 | BUG, DEP, DOC: Patch and Align Categorical's Sorting API | {
"avatar_url": "https://avatars.githubusercontent.com/u/9273653?v=4",
"events_url": "https://api.github.com/users/gfyoung/events{/privacy}",
"followers_url": "https://api.github.com/users/gfyoung/followers",
"following_url": "https://api.github.com/users/gfyoung/following{/other_user}",
"gists_url": "https://api.github.com/users/gfyoung/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/gfyoung",
"id": 9273653,
"login": "gfyoung",
"node_id": "MDQ6VXNlcjkyNzM2NTM=",
"organizations_url": "https://api.github.com/users/gfyoung/orgs",
"received_events_url": "https://api.github.com/users/gfyoung/received_events",
"repos_url": "https://api.github.com/users/gfyoung/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/gfyoung/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/gfyoung/subscriptions",
"type": "User",
"url": "https://api.github.com/users/gfyoung"
} | [
{
"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": "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"
}
]
| closed | false | null | []
| {
"closed_at": "2016-05-05T00:34:40Z",
"closed_issues": 306,
"created_at": "2016-02-08T15:29:59Z",
"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": "after 0.18.0 of course!",
"due_on": "2016-05-04T07:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/38",
"id": 1570594,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/38/labels",
"node_id": "MDk6TWlsZXN0b25lMTU3MDU5NA==",
"number": 38,
"open_issues": 0,
"state": "closed",
"title": "0.18.1",
"updated_at": "2017-08-10T09:01:26Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/38"
} | 15 | 2016-04-12T15:24:01Z | 2016-04-14T01:18:13Z | 2016-04-14T01:17:55Z | MEMBER | null | Clarifies the meaning of 'sort' in the context of `Categorical` to mean 'organization' rather than 'order',
as it is possible to call this method (as well as `sort_values`) when the `Categorical` is unordered.
Also patches a bug in `Categorical.sort_values` in which `na_position` was not being respected when
`ascending` was set to `True`. This commit aligns the behaviour with that of `Series`.
Finally, deprecates `sort` in favor of `sort_values`, which is in alignment with what was done with `Series` back in #10726.
Closes #12785.
| {
"+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/12882/reactions"
} | https://api.github.com/repos/pandas-dev/pandas/issues/12882/timeline | null | 0 | {
"diff_url": "https://github.com/pandas-dev/pandas/pull/12882.diff",
"html_url": "https://github.com/pandas-dev/pandas/pull/12882",
"merged_at": null,
"patch_url": "https://github.com/pandas-dev/pandas/pull/12882.patch",
"url": "https://api.github.com/repos/pandas-dev/pandas/pulls/12882"
} |
https://api.github.com/repos/pandas-dev/pandas/issues/12883 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/12883/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/12883/comments | https://api.github.com/repos/pandas-dev/pandas/issues/12883/events | https://github.com/pandas-dev/pandas/issues/12883 | 147,874,014 | MDU6SXNzdWUxNDc4NzQwMTQ= | 12,883 | BUG: resample on PeriodIndex with 'W' causes recursion | {
"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"
} | [
{
"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": "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"
},
{
"color": "207de5",
"default": false,
"description": "resample method",
"id": 74975453,
"name": "Resample",
"node_id": "MDU6TGFiZWw3NDk3NTQ1Mw==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Resample"
}
]
| closed | 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"
} | 3 | 2016-04-12T21:12:18Z | 2016-04-12T21:34:45Z | 2016-04-12T21:34:44Z | CONTRIBUTOR | null | ```
In [32]: s = pd.Series(range(2), pd.period_range('1/1/1990', periods=2, freq='M'))
In [33]: s
Out[33]:
1990-01 0
1990-02 1
Freq: M, dtype: int64
In [34]: s.resample('W').asfreq()
```
| {
"+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/12883/reactions"
} | https://api.github.com/repos/pandas-dev/pandas/issues/12883/timeline | null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/12884 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/12884/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/12884/comments | https://api.github.com/repos/pandas-dev/pandas/issues/12884/events | https://github.com/pandas-dev/pandas/issues/12884 | 147,896,758 | MDU6SXNzdWUxNDc4OTY3NTg= | 12,884 | ENH: PeriodIndex resampling redux | {
"avatar_url": "https://avatars.githubusercontent.com/u/5635139?v=4",
"events_url": "https://api.github.com/users/max-sixty/events{/privacy}",
"followers_url": "https://api.github.com/users/max-sixty/followers",
"following_url": "https://api.github.com/users/max-sixty/following{/other_user}",
"gists_url": "https://api.github.com/users/max-sixty/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/max-sixty",
"id": 5635139,
"login": "max-sixty",
"node_id": "MDQ6VXNlcjU2MzUxMzk=",
"organizations_url": "https://api.github.com/users/max-sixty/orgs",
"received_events_url": "https://api.github.com/users/max-sixty/received_events",
"repos_url": "https://api.github.com/users/max-sixty/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/max-sixty/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/max-sixty/subscriptions",
"type": "User",
"url": "https://api.github.com/users/max-sixty"
} | [
{
"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": "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"
},
{
"color": "207de5",
"default": false,
"description": "resample method",
"id": 74975453,
"name": "Resample",
"node_id": "MDU6TGFiZWw3NDk3NTQ1Mw==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Resample"
}
]
| 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"
} | 1 | 2016-04-12T22:56:01Z | 2021-04-23T05:04:34Z | null | CONTRIBUTOR | null | As discussed here: https://github.com/pydata/pandas/pull/12874, some ideas:
- ~Only return `PeriodIndex`s when resampling `PeriodIndex`~ (#16153)
- Don't use `convention` when doing simple upsampling & downsampling ('simple' meaning a one to many relationship between subperiods and superperiods)
- Define how to handle 'complicated' resampling (meaning a many to many relationship between subperiods & superperiods, such as Week->Month)
ref: https://github.com/pydata/pandas/issues/7744, https://github.com/pydata/pandas/issues/12871, https://github.com/pydata/pandas/pull/8707, https://github.com/pandas-dev/pandas/issues/15944
EDIT: strikethrough above after completion | {
"+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/12884/reactions"
} | https://api.github.com/repos/pandas-dev/pandas/issues/12884/timeline | null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/12885 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/12885/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/12885/comments | https://api.github.com/repos/pandas-dev/pandas/issues/12885/events | https://github.com/pandas-dev/pandas/issues/12885 | 147,910,118 | MDU6SXNzdWUxNDc5MTAxMTg= | 12,885 | improving the speed of to_csv | {
"avatar_url": "https://avatars.githubusercontent.com/u/8282510?v=4",
"events_url": "https://api.github.com/users/randomgambit/events{/privacy}",
"followers_url": "https://api.github.com/users/randomgambit/followers",
"following_url": "https://api.github.com/users/randomgambit/following{/other_user}",
"gists_url": "https://api.github.com/users/randomgambit/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/randomgambit",
"id": 8282510,
"login": "randomgambit",
"node_id": "MDQ6VXNlcjgyODI1MTA=",
"organizations_url": "https://api.github.com/users/randomgambit/orgs",
"received_events_url": "https://api.github.com/users/randomgambit/received_events",
"repos_url": "https://api.github.com/users/randomgambit/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/randomgambit/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/randomgambit/subscriptions",
"type": "User",
"url": "https://api.github.com/users/randomgambit"
} | [
{
"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": "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 | []
| null | 16 | 2016-04-13T00:17:59Z | 2019-08-05T22:28:02Z | 2016-04-13T00:41:45Z | NONE | null | Hello,
I dont know if that is possible, but it would great to find a way to speed up the `to_csv` method in Pandas.
In my admittedly large dataframe with 20 million observations and 50 variables, it takes **literally hours** to export the data to a csv file.
Reading the `csv` in Pandas is much faster though. I wonder what is the bottleneck here and what can be done to improve the data transfer.
Csv files are ubiquitous, and a great way to share data (without being too nerdy with `hdf5`and other subtleties). What do you think?
| {
"+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/12885/reactions"
} | https://api.github.com/repos/pandas-dev/pandas/issues/12885/timeline | null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/12886 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/12886/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/12886/comments | https://api.github.com/repos/pandas-dev/pandas/issues/12886/events | https://github.com/pandas-dev/pandas/issues/12886 | 147,916,209 | MDU6SXNzdWUxNDc5MTYyMDk= | 12,886 | BUG: resample with empty DatetimeIndex/TimedeltaIndex buggy | {
"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"
} | [
{
"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": "207de5",
"default": false,
"description": "resample method",
"id": 74975453,
"name": "Resample",
"node_id": "MDU6TGFiZWw3NDk3NTQ1Mw==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Resample"
}
]
| closed | false | null | []
| {
"closed_at": "2016-10-03T08:52:13Z",
"closed_issues": 733,
"created_at": "2016-03-11T21:24:45Z",
"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": "",
"due_on": "2016-09-30T07:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/40",
"id": 1639795,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/40/labels",
"node_id": "MDk6TWlsZXN0b25lMTYzOTc5NQ==",
"number": 40,
"open_issues": 0,
"state": "closed",
"title": "0.19.0",
"updated_at": "2017-11-06T02:01:14Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/40"
} | 1 | 2016-04-13T01:06:53Z | 2016-05-21T15:24:43Z | 2016-05-21T15:24:43Z | CONTRIBUTOR | null | xref `PeriodIndex` addressed in #12874
[here](https://github.com/pydata/pandas/commit/2ba977a917ac5c092378a2f172f59d53b14de968) is the reverted commit. Note this should be rolled in the `test_resample_empty` test itself
| {
"+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/12886/reactions"
} | https://api.github.com/repos/pandas-dev/pandas/issues/12886/timeline | null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/12887 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/12887/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/12887/comments | https://api.github.com/repos/pandas-dev/pandas/issues/12887/events | https://github.com/pandas-dev/pandas/issues/12887 | 147,928,290 | MDU6SXNzdWUxNDc5MjgyOTA= | 12,887 | COMPAT: 0.18.0 scipy dev changes causing interpolation failures | {
"avatar_url": "https://avatars.githubusercontent.com/u/7530947?v=4",
"events_url": "https://api.github.com/users/jmwoloso/events{/privacy}",
"followers_url": "https://api.github.com/users/jmwoloso/followers",
"following_url": "https://api.github.com/users/jmwoloso/following{/other_user}",
"gists_url": "https://api.github.com/users/jmwoloso/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jmwoloso",
"id": 7530947,
"login": "jmwoloso",
"node_id": "MDQ6VXNlcjc1MzA5NDc=",
"organizations_url": "https://api.github.com/users/jmwoloso/orgs",
"received_events_url": "https://api.github.com/users/jmwoloso/received_events",
"repos_url": "https://api.github.com/users/jmwoloso/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jmwoloso/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jmwoloso/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jmwoloso"
} | [
{
"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": "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"
}
]
| closed | false | null | []
| {
"closed_at": "2016-05-05T00:34:40Z",
"closed_issues": 306,
"created_at": "2016-02-08T15:29:59Z",
"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": "after 0.18.0 of course!",
"due_on": "2016-05-04T07:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/38",
"id": 1570594,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/38/labels",
"node_id": "MDk6TWlsZXN0b25lMTU3MDU5NA==",
"number": 38,
"open_issues": 0,
"state": "closed",
"title": "0.18.1",
"updated_at": "2017-08-10T09:01:26Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/38"
} | 26 | 2016-04-13T02:21:20Z | 2016-05-03T01:08:47Z | 2016-05-03T01:08:47Z | NONE | null | #### Code Sample, a copy-pastable example if possible
python -c 'import pandas;pandas.test()'
#### Expected Output
No errors/failures
#### output of `pd.show_versions()`
```
INSTALLED VERSIONS
------------------
commit: None
python: 3.4.3.final.0
python-bits: 64
OS: Linux
OS-release: 3.19.0-32-generic
machine: x86_64
processor: x86_64
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8
pandas: 0.18.0
nose: 1.3.7
pip: 8.1.1
setuptools: 20.7.0
Cython: 0.23.4
numpy: 1.12.0.dev0+47b6c2b
scipy: 0.18.0.dev0+609facc
statsmodels: None
xarray: None
IPython: 4.1.1
sphinx: 1.3.5
patsy: 0.4.0
dateutil: 2.4.2
pytz: 2015.7
blosc: 1.2.8
bottleneck: 1.0.0
tables: None
numexpr: 2.5.2
matplotlib: 1.5.1
openpyxl: 2.3.5
xlrd: 0.9.4
xlwt: 1.0.0
xlsxwriter: 0.7.7
lxml: 3.4.4
bs4: 4.4.1
html5lib: 0.9999999
httplib2: 0.9.2
apiclient: 1.4.2
sqlalchemy: 1.0.9
pymysql: 0.6.7.None
psycopg2: None
jinja2: 2.8
boto: 2.39.0
```
Hello All,
Can anyone provide any insight into these errors and failures (see attachment)
[pandas_test.txt](https://github.com/pydata/pandas/files/216306/pandas_test.txt)
| {
"+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/12887/reactions"
} | https://api.github.com/repos/pandas-dev/pandas/issues/12887/timeline | null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/12888 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/12888/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/12888/comments | https://api.github.com/repos/pandas-dev/pandas/issues/12888/events | https://github.com/pandas-dev/pandas/issues/12888 | 148,001,297 | MDU6SXNzdWUxNDgwMDEyOTc= | 12,888 | Pandas plot method in connection with plt.fill_between causes Python to crash | {
"avatar_url": "https://avatars.githubusercontent.com/u/832380?v=4",
"events_url": "https://api.github.com/users/bjonen/events{/privacy}",
"followers_url": "https://api.github.com/users/bjonen/followers",
"following_url": "https://api.github.com/users/bjonen/following{/other_user}",
"gists_url": "https://api.github.com/users/bjonen/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/bjonen",
"id": 832380,
"login": "bjonen",
"node_id": "MDQ6VXNlcjgzMjM4MA==",
"organizations_url": "https://api.github.com/users/bjonen/orgs",
"received_events_url": "https://api.github.com/users/bjonen/received_events",
"repos_url": "https://api.github.com/users/bjonen/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/bjonen/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/bjonen/subscriptions",
"type": "User",
"url": "https://api.github.com/users/bjonen"
} | [
{
"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": "8AE234",
"default": false,
"description": null,
"id": 2413328,
"name": "Visualization",
"node_id": "MDU6TGFiZWwyNDEzMzI4",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Visualization"
}
]
| 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"
} | 2 | 2016-04-13T09:28:07Z | 2021-04-23T05:05:13Z | null | CONTRIBUTOR | null | When creating a plot with two y-axis, I run into the following problem. When plotting using the pd.Series.plot() method on the first y-axis and then applying ax.fill_between() Python crashes. If I use fill_between on the primary y-axis also the problem disappears.
#### Code Sample, a copy-pastable example if possible
```
npers = 100
index = pd.date_range(start='2000', freq='BM', periods=npers)
rel = pd.Series(index=index, data=np.random.randn(npers))
dd = pd.Series(index=index, data=np.random.randn(npers))
# this works
(w, h) = plt.figaspect(0.6)
fig = plt.figure(figsize=(w, h))
ax = fig.add_subplot(111)
# Not using pd.Series.plot()
ax.plot(rel.index, rel.values)
ax2 = ax.twinx()
ax2.fill_between(dd.index, dd.values)
# this crashes Python
(w, h) = plt.figaspect(0.6)
fig = plt.figure(figsize=(w, h))
ax = fig.add_subplot(111)
# Using pd.Series.plot()
ax = rel.plot(ax=ax)
ax2 = ax.twinx()
ax2.fill_between(dd.index, dd.values)
```
#### Expected Output

#### output of `pd.show_versions()`
## INSTALLED VERSIONS
commit: None
python: 2.7.11.final.0
python-bits: 64
OS: Windows
OS-release: 8.1
machine: AMD64
processor: Intel64 Family 6 Model 69 Stepping 1, GenuineIntel
byteorder: little
LC_ALL: None
LANG: None
pandas: 0.18.0
nose: 1.3.7
pip: 8.1.1
setuptools: 20.6.7
Cython: None
numpy: 1.11.0
scipy: 0.17.0
statsmodels: 0.6.1
xarray: None
IPython: 4.0.0
sphinx: 1.3.1
patsy: 0.3.0
dateutil: 2.5.2
pytz: 2016.3
blosc: None
bottleneck: None
tables: 3.1.1
numexpr: 2.3.1
matplotlib: 1.5.1
openpyxl: 1.8.5
xlrd: 0.9.3
xlwt: 1.0.0
xlsxwriter: None
lxml: 3.5.0
bs4: None
html5lib: None
httplib2: None
apiclient: None
sqlalchemy: 0.7.9
pymysql: None
psycopg2: None
jinja2: 2.8
boto: 2.9.4
| {
"+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/12888/reactions"
} | https://api.github.com/repos/pandas-dev/pandas/issues/12888/timeline | null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/12889 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/12889/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/12889/comments | https://api.github.com/repos/pandas-dev/pandas/issues/12889/events | https://github.com/pandas-dev/pandas/issues/12889 | 148,003,157 | MDU6SXNzdWUxNDgwMDMxNTc= | 12,889 | pd.PeriodIndex is a lot slower since version 0.15.2 | {
"avatar_url": "https://avatars.githubusercontent.com/u/4407787?v=4",
"events_url": "https://api.github.com/users/rs2/events{/privacy}",
"followers_url": "https://api.github.com/users/rs2/followers",
"following_url": "https://api.github.com/users/rs2/following{/other_user}",
"gists_url": "https://api.github.com/users/rs2/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/rs2",
"id": 4407787,
"login": "rs2",
"node_id": "MDQ6VXNlcjQ0MDc3ODc=",
"organizations_url": "https://api.github.com/users/rs2/orgs",
"received_events_url": "https://api.github.com/users/rs2/received_events",
"repos_url": "https://api.github.com/users/rs2/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/rs2/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/rs2/subscriptions",
"type": "User",
"url": "https://api.github.com/users/rs2"
} | [
{
"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": "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 | []
| null | 4 | 2016-04-13T09:35:10Z | 2016-04-14T14:06:25Z | 2016-04-13T11:29:13Z | CONTRIBUTOR | null | `PeriodIndex` is one of the key methods used for time series analysis. Its performance has deteriorated significantly since `pandas` version 0.15.2. The code snippet below is easy to profile.
```
python --version & python -c "import pandas as pd; print('Pandas version', pd.__version__)" & python -m timeit "import pandas as pd; pd.PeriodIndex(pd.date_range('2015-1-1', '2016-1-1', freq='D').to_pydatetime(), freq='D')"
Python 3.4.4
Pandas version 0.15.2
10 loops, best of 3: 3.27 msec per loop
Python 3.4.4
Pandas version 0.16.2
10 loops, best of 3: 94.8 msec per loop
Python 3.4.3 :: Continuum Analytics, Inc.
Pandas version 0.17.0
10 loops, best of 3: 221 msec per loop
Python 3.5.1 :: Anaconda 4.0.0 (32-bit)
Pandas version 0.18.0
10 loops, best of 3: 220 msec per loop
```
| {
"+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/12889/reactions"
} | https://api.github.com/repos/pandas-dev/pandas/issues/12889/timeline | null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/12890 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/12890/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/12890/comments | https://api.github.com/repos/pandas-dev/pandas/issues/12890/events | https://github.com/pandas-dev/pandas/issues/12890 | 148,058,844 | MDU6SXNzdWUxNDgwNTg4NDQ= | 12,890 | The API to retrieve serie elements presents some inconsistencies | {
"avatar_url": "https://avatars.githubusercontent.com/u/2077159?v=4",
"events_url": "https://api.github.com/users/sylvaticus/events{/privacy}",
"followers_url": "https://api.github.com/users/sylvaticus/followers",
"following_url": "https://api.github.com/users/sylvaticus/following{/other_user}",
"gists_url": "https://api.github.com/users/sylvaticus/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/sylvaticus",
"id": 2077159,
"login": "sylvaticus",
"node_id": "MDQ6VXNlcjIwNzcxNTk=",
"organizations_url": "https://api.github.com/users/sylvaticus/orgs",
"received_events_url": "https://api.github.com/users/sylvaticus/received_events",
"repos_url": "https://api.github.com/users/sylvaticus/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/sylvaticus/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sylvaticus/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sylvaticus"
} | [
{
"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"
}
]
| closed | false | null | []
| null | 3 | 2016-04-13T13:18:01Z | 2016-04-13T15:34:39Z | 2016-04-13T15:34:39Z | NONE | null | Hello, I personally feel there is a bit of mess in the way to select elements in a Series :-)
The general idea is that .iloc and .loc have consistent behaviour for respectively demanding a position-based or a index(label)-based value, but are a bit slower than .ix and using directly [] which behaviour is not always consistent.
But I found these methods a bit inconsistent, also in terms of what to return if the labels are not found or the required position are out or range in the looked-up Series.
I compiled the following tables, that summarises the behaviour of these 4 methods of lookup depending (a) if the Series to look-up has an integer or a string index (I do not consider for the moment the date index), (b) if the required data is a single element, a slice index or a list (yes, the behaviour change!) and (c) if the index is found or not in the data.
The following tables works with pandas 0.17.1, NumPy 1.10.4, Python 3.4.3.
### Case 1: Series with Integer index
```
s = pd.Series(np.arange(100,105), index=np.arange(10,15))
s
10 100
11 101
12 102
13 103
14 104
```
```
** Single element ** ** Slice ** ** Tuple **
s[0] -> LAB -> KeyError s[0:2] -> POS -> {10:100, 11:101} s[[1,3]] -> LAB -> {1:NaN, 3:Nan}
s[13] -> LAB -> 103 s[10:12] -> POS -> empty Series s[[12,14]] -> LAB -> {12:102, 14:104}
--- --- ---
s.ix[0] -> LAB -> KeyError s.ix[0:2] -> LAB -> empty Series s.ix[[1,3]] -> LAB -> {1:NaN, 3:Nan}
s.ix[13] -> LAB -> 103 s.ix[10:12] -> LAB -> {10:100, 11:101, 12:102} s.ix[[12,14]] -> LAB -> {12:102, 14:104}
--- --- ---
s.iloc[0] -> POS -> 100 s.iloc[0:2] -> POS -> {10:100, 11:101} s.iloc[[1,3]] -> POS -> {11:101, 13:103}
s.iloc[13] -> POS -> IndexError s.iloc[10:12] -> POS -> empty Series s.iloc[[12,14]] -> POS -> IndexError
--- --- ---
s.loc[0] -> LAB -> KeyError s.loc[0:2] -> LAB -> empty Series s.loc[[1,3]] -> LAB -> KeyError
s.loc[13] -> LAB -> 103 s.loc[10:12] -> LAB -> {10:100, 11:101, 12:102} s.loc[[12,14]] -> LAB -> {12:102, 14:104}
```
### Case 2: Series with string index
```
s = pd.Series(np.arange(100,105), index=['a','b','c','d','e'])
s
a 100
b 101
c 102
d 103
e 104
```
```
** Single element ** ** Slice ** ** Tuple **
s[0] -> POS -> 100 s[0:2] -> POS -> {'a':100,'b':101} s[[0,2]] -> POS -> {'a':100,'c':102}
s[10] -> LAB, POS -> KeyError, IndexError s[10:12] -> POS -> Empty Series s[[10,12]] -> POS -> IndexError
s['a'] -> LAB -> 100 s['a':'c'] -> LAB -> {'a':100,'b':101, 'c':102} s[['a','c']] -> LAB -> {'a':100,'b':101, 'c':102}
s['g'] -> POS,LAB -> TypeError, KeyError s['f':'h'] -> LAB -> Empty Series s[['f','h']] -> LAB -> {'f':NaN, 'h':NaN}
--- --- ---
s.ix[0] -> POS -> 100 s.ix[0:2] -> POS -> {'a':100,'b':101} s.ix[[0,2]] -> POS -> {'a':100,'c':102}
s.ix[10] -> POS -> IndexError s.ix[10:12] -> POS -> Empty Series s.ix[[10,12]] -> POS -> IndexError
s.ix['a'] -> LAB -> 100 s.ix['a':'c'] -> LAB -> {'a':100,'b':101, 'c':102} s.ix[['a','c']] -> LAB -> {'a':100,'b':101, 'c':102}
s.ix['g'] -> POS, LAB -> TypeError, KeyError s.ix['f':'h'] -> LAB -> Empty Series s.ix[['f','h']] -> LAB -> {'f':NaN, 'h':NaN}
--- --- ---
s.iloc[0] -> POS -> 100 s.iloc[0:2] -> POS -> {'a':100,'b':101} s.iloc[[0,2]] -> POS -> {'a':100,'c':102}
s.iloc[10] -> POS -> IndexError s.iloc[10:12] -> POS -> Empty Series s.iloc[[10,12]] -> POS -> IndexError
s.iloc['a'] -> LAB -> TypeError s.iloc['a':'c'] -> POS -> ValueError s.iloc[['a','c']] -> POS -> TypeError
s.iloc['g'] -> LAB -> TypeError s.iloc['f':'h'] -> POS -> ValueError s.iloc[['f','h']] -> POS -> TypeError
--- --- ---
s.loc[0] -> LAB -> KeyError s.loc[0:2] -> LAB -> TypeError s.loc[[0,2]] -> LAB -> KeyError
s.loc[10] -> LAB -> KeyError s.loc[10:12] -> LAB -> TypeError s.loc[[10,12]] -> LAB -> KeyError
s.loc['a'] -> LAB-> 100 s.loc['a':'c'] -> LAB -> {'a':100,'b':101, 'c':102} s.loc[['a','c']] -> LAB -> {'a':100,'c':102}
s.loc['g'] -> LAB -> KeyError s.loc['f':'h'] -> LAB -> Empty Series s.loc[['f','h']] -> LAB -> KeyError
```
As you can see there are several inconsistencies, some of them even using .iloc and .loc.
1) The event of not founding the elements/indexing out of range is managed in three different ways: an exception is thrown, a null Series is returned or a Series with the demanded keys associated to NaN values is returned. For example s.loc['f':'h'] returns an Empty Series when s.loc[['f','h']] returns instead a KeyError. There should be a single way to handle missing elements, and eventually an optional parameter should say what to do when missing elements are encountered.
2) When using slicers, if the lookup is by position, the end element is excluded, but when the lookup is by label the final element is included!
3) .ix is redundant. There should be .iloc[] and .loc[] to have a guaranteed query by position and label respectively, and a faster way with a more complicated logic (but still well documented) when performance is a priority. s[] is just quicker to type than s.ix[], so for me the latter method is redundant.
| {
"+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/12890/reactions"
} | https://api.github.com/repos/pandas-dev/pandas/issues/12890/timeline | null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/12891 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/12891/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/12891/comments | https://api.github.com/repos/pandas-dev/pandas/issues/12891/events | https://github.com/pandas-dev/pandas/issues/12891 | 148,093,732 | MDU6SXNzdWUxNDgwOTM3MzI= | 12,891 | API proposal: shoudn't the "index" property (and parameter) of a df renamed "rows" ? | {
"avatar_url": "https://avatars.githubusercontent.com/u/2077159?v=4",
"events_url": "https://api.github.com/users/sylvaticus/events{/privacy}",
"followers_url": "https://api.github.com/users/sylvaticus/followers",
"following_url": "https://api.github.com/users/sylvaticus/following{/other_user}",
"gists_url": "https://api.github.com/users/sylvaticus/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/sylvaticus",
"id": 2077159,
"login": "sylvaticus",
"node_id": "MDQ6VXNlcjIwNzcxNTk=",
"organizations_url": "https://api.github.com/users/sylvaticus/orgs",
"received_events_url": "https://api.github.com/users/sylvaticus/received_events",
"repos_url": "https://api.github.com/users/sylvaticus/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/sylvaticus/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sylvaticus/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sylvaticus"
} | [
{
"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": "AD7FA8",
"default": false,
"description": null,
"id": 35818298,
"name": "API Design",
"node_id": "MDU6TGFiZWwzNTgxODI5OA==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/API%20Design"
}
]
| closed | false | null | []
| null | 3 | 2016-04-13T15:13:55Z | 2016-04-14T09:54:10Z | 2016-04-13T15:36:36Z | NONE | null | Sorry to open a issue for such a minor thing..
in a DataFrame object, both the `columns` and `index` properties are actually `Index` objects.
Wouldn't be cleaner to rename `index` as `rows` ?
As you are working with n-dimensional panels, `rows` and `columns` could then be just convenient aliases for something like `axis0` and `axis1` respectively (in a df), while further dimensional container could use `axis2`, `axis3` and so on (the current axis names `labels`, `items`, `major_axis` and `minor_axis` do not suggest any particular order).
| {
"+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/12891/reactions"
} | https://api.github.com/repos/pandas-dev/pandas/issues/12891/timeline | null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/12892 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/12892/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/12892/comments | https://api.github.com/repos/pandas-dev/pandas/issues/12892/events | https://github.com/pandas-dev/pandas/issues/12892 | 148,112,512 | MDU6SXNzdWUxNDgxMTI1MTI= | 12,892 | Floor division by zero result differs if index unaligned | {
"avatar_url": "https://avatars.githubusercontent.com/u/2783717?v=4",
"events_url": "https://api.github.com/users/jcrist/events{/privacy}",
"followers_url": "https://api.github.com/users/jcrist/followers",
"following_url": "https://api.github.com/users/jcrist/following{/other_user}",
"gists_url": "https://api.github.com/users/jcrist/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/jcrist",
"id": 2783717,
"login": "jcrist",
"node_id": "MDQ6VXNlcjI3ODM3MTc=",
"organizations_url": "https://api.github.com/users/jcrist/orgs",
"received_events_url": "https://api.github.com/users/jcrist/received_events",
"repos_url": "https://api.github.com/users/jcrist/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/jcrist/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jcrist/subscriptions",
"type": "User",
"url": "https://api.github.com/users/jcrist"
} | [
{
"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": "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 | 4 | 2016-04-13T16:21:41Z | 2016-04-13T18:19:48Z | 2016-04-13T16:26:00Z | CONTRIBUTOR | null | Depending on if the indices of two series/dataframes are aligned, floor division by zero can result in either `NaN` or `inf`:
``` python
In [68]: import pandas as pd
In [69]: l = pd.Series([1, 2, 3], index=[1, 2, 3])
In [70]: r = pd.Series([1, 1, 0], index=[0, 2, 3])
In [71]: l // r # Unaligned indices
Out[71]:
0 NaN
1 NaN
2 2.0
3 NaN
dtype: float64
In [72]: l.iloc[1:] // r.iloc[1:] # Aligned indices
Out[72]:
2 2.000000
3 inf
dtype: float64
In [73]: pd.__version__
Out[73]: u'0.18.0'
```
I would expect the result for index 3 to be the same in either case. In pandas 0.17.1, both result in `inf`.
| {
"+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/12892/reactions"
} | https://api.github.com/repos/pandas-dev/pandas/issues/12892/timeline | null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/12893 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/12893/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/12893/comments | https://api.github.com/repos/pandas-dev/pandas/issues/12893/events | https://github.com/pandas-dev/pandas/issues/12893 | 148,122,496 | MDU6SXNzdWUxNDgxMjI0OTY= | 12,893 | Related TypeErrors in multi-indexed DataFrame | {
"avatar_url": "https://avatars.githubusercontent.com/u/319411?v=4",
"events_url": "https://api.github.com/users/mcwitt/events{/privacy}",
"followers_url": "https://api.github.com/users/mcwitt/followers",
"following_url": "https://api.github.com/users/mcwitt/following{/other_user}",
"gists_url": "https://api.github.com/users/mcwitt/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/mcwitt",
"id": 319411,
"login": "mcwitt",
"node_id": "MDQ6VXNlcjMxOTQxMQ==",
"organizations_url": "https://api.github.com/users/mcwitt/orgs",
"received_events_url": "https://api.github.com/users/mcwitt/received_events",
"repos_url": "https://api.github.com/users/mcwitt/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/mcwitt/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/mcwitt/subscriptions",
"type": "User",
"url": "https://api.github.com/users/mcwitt"
} | [
{
"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": null,
"id": 71268330,
"name": "MultiIndex",
"node_id": "MDU6TGFiZWw3MTI2ODMzMA==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/MultiIndex"
},
{
"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"
}
]
| closed | false | null | []
| {
"closed_at": "2016-05-05T00:34:40Z",
"closed_issues": 306,
"created_at": "2016-02-08T15:29:59Z",
"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": "after 0.18.0 of course!",
"due_on": "2016-05-04T07:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/38",
"id": 1570594,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/38/labels",
"node_id": "MDk6TWlsZXN0b25lMTU3MDU5NA==",
"number": 38,
"open_issues": 0,
"state": "closed",
"title": "0.18.1",
"updated_at": "2017-08-10T09:01:26Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/38"
} | 1 | 2016-04-13T17:01:02Z | 2016-04-20T01:00:30Z | 2016-04-20T01:00:30Z | CONTRIBUTOR | null | ## Code sample
``` python
import pandas as pd
import numpy as np
foo = pd.DataFrame(np.arange(100).reshape((10,10)))
bar = pd.DataFrame(np.arange(100).reshape((10,10)))
df = pd.concat({
'foo': foo.stack(),
'bar': bar.stack()
}, axis=1)
df.index.names = ['fizz','buzz']
```
## Output
``` python
> df
TypeError: data type "fizz" not understood
> df_ = df.set_index('foo', append=True) # shouldn't call __repr__
TypeError: data type "fizz" not understood
> df[:61]
TypeError: data type "fizz" not understood
> df[:60]
bar foo
fizz buzz
0 0 0 0
1 1 1
2 2 2
...
```
## show_versions() output
```
> pd.show_versions()
INSTALLED VERSIONS
------------------
commit: 2ba977a917ac5c092378a2f172f59d53b14de968
python: 3.5.1.final.0
python-bits: 64
OS: Darwin
OS-release: 15.3.0
machine: x86_64
processor: i386
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8
pandas: 0.18.0+111.g2ba977a
nose: None
pip: 8.1.1
setuptools: 20.6.7
Cython: 0.24
numpy: 1.11.0
scipy: 0.17.0
statsmodels: None
xarray: None
IPython: 4.1.2
sphinx: None
patsy: None
dateutil: 2.5.2
pytz: 2016.3
blosc: None
bottleneck: None
tables: None
numexpr: None
matplotlib: 1.5.1
openpyxl: None
xlrd: None
xlwt: None
xlsxwriter: None
lxml: None
bs4: None
html5lib: None
httplib2: 0.9.2
apiclient: 1.5.0
sqlalchemy: None
pymysql: None
psycopg2: 2.6.1 (dt dec pq3 ext lo64)
jinja2: 2.8
boto: None
pandas_datareader: None
```
| {
"+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/12893/reactions"
} | https://api.github.com/repos/pandas-dev/pandas/issues/12893/timeline | null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/12894 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/12894/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/12894/comments | https://api.github.com/repos/pandas-dev/pandas/issues/12894/events | https://github.com/pandas-dev/pandas/issues/12894 | 148,131,366 | MDU6SXNzdWUxNDgxMzEzNjY= | 12,894 | matching False to 0 in .ix | {
"avatar_url": "https://avatars.githubusercontent.com/u/586542?v=4",
"events_url": "https://api.github.com/users/afotoglidis/events{/privacy}",
"followers_url": "https://api.github.com/users/afotoglidis/followers",
"following_url": "https://api.github.com/users/afotoglidis/following{/other_user}",
"gists_url": "https://api.github.com/users/afotoglidis/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/afotoglidis",
"id": 586542,
"login": "afotoglidis",
"node_id": "MDQ6VXNlcjU4NjU0Mg==",
"organizations_url": "https://api.github.com/users/afotoglidis/orgs",
"received_events_url": "https://api.github.com/users/afotoglidis/received_events",
"repos_url": "https://api.github.com/users/afotoglidis/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/afotoglidis/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/afotoglidis/subscriptions",
"type": "User",
"url": "https://api.github.com/users/afotoglidis"
} | [
{
"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 | 4 | 2016-04-13T17:41:30Z | 2016-04-17T18:54:05Z | 2016-04-13T17:49:18Z | NONE | null | #### To reproduce follow steps below
``` python
In [226]: df_test = pd.DataFrame(np.random.randn(5,5), columns=list('ABCDE'))
In [227]: df_test
Out[227]:
A B C D E
0 0.609775 0.205708 -0.015081 2.096414 0.121245
1 1.223234 -1.299398 1.238649 0.216846 -0.789828
2 0.446873 1.734404 -0.675568 -1.203400 0.053905
3 0.286693 -0.080294 -0.115739 -0.195039 0.400201
4 0.519230 1.939370 -0.424466 0.102137 -0.724420
In [228]: df_test.iloc[0,1] = False
In [229]: df_test.iloc[1,1] = '0'
In [230]: df_test.iloc[2,1] = 0
In [231]: df_test.iloc[3,1] = '2'
In [232]: df_test.B == False
Out[232]:
0 True
1 False
2 True
3 False
4 False
Name: B, dtype: bool
```
#### Expected Output
``` python
>>> df_test.B == False
0 True
1 False
2 False
3 False
4 False
Name: B, dtype: bool
```
#### output of `pd.show_versions()`
``` python
pd.show_versions()
INSTALLED VERSIONS
------------------
commit: None
python: 3.5.1.final.0
python-bits: 64
OS: Darwin
OS-release: 15.4.0
machine: x86_64
processor: i386
byteorder: little
LC_ALL: None
LANG: el_GR.UTF-8
pandas: 0.18.0
nose: 1.3.7
pip: 8.1.1
setuptools: 20.3
Cython: 0.23.4
numpy: 1.10.4
scipy: 0.17.0
statsmodels: 0.6.1
xarray: None
IPython: 4.1.2
sphinx: 1.3.5
patsy: 0.4.0
dateutil: 2.5.1
pytz: 2016.2
blosc: None
bottleneck: 1.0.0
tables: 3.2.2
numexpr: 2.5
matplotlib: 1.5.1
openpyxl: 2.3.2
xlrd: 0.9.4
xlwt: 1.0.0
xlsxwriter: 0.8.4
lxml: 3.6.0
bs4: 4.4.1
html5lib: None
httplib2: None
apiclient: None
sqlalchemy: 1.0.12
pymysql: None
psycopg2: None
jinja2: 2.8
boto: 2.39.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/12894/reactions"
} | https://api.github.com/repos/pandas-dev/pandas/issues/12894/timeline | null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/12895 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/12895/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/12895/comments | https://api.github.com/repos/pandas-dev/pandas/issues/12895/events | https://github.com/pandas-dev/pandas/pull/12895 | 148,187,314 | MDExOlB1bGxSZXF1ZXN0NjYzOTQzNDA= | 12,895 | BUG: add names parameter to read_excel | {
"avatar_url": "https://avatars.githubusercontent.com/u/8815664?v=4",
"events_url": "https://api.github.com/users/OXPHOS/events{/privacy}",
"followers_url": "https://api.github.com/users/OXPHOS/followers",
"following_url": "https://api.github.com/users/OXPHOS/following{/other_user}",
"gists_url": "https://api.github.com/users/OXPHOS/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/OXPHOS",
"id": 8815664,
"login": "OXPHOS",
"node_id": "MDQ6VXNlcjg4MTU2NjQ=",
"organizations_url": "https://api.github.com/users/OXPHOS/orgs",
"received_events_url": "https://api.github.com/users/OXPHOS/received_events",
"repos_url": "https://api.github.com/users/OXPHOS/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/OXPHOS/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/OXPHOS/subscriptions",
"type": "User",
"url": "https://api.github.com/users/OXPHOS"
} | [
{
"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": "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": "2016-05-05T00:34:40Z",
"closed_issues": 306,
"created_at": "2016-02-08T15:29:59Z",
"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": "after 0.18.0 of course!",
"due_on": "2016-05-04T07:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/38",
"id": 1570594,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/38/labels",
"node_id": "MDk6TWlsZXN0b25lMTU3MDU5NA==",
"number": 38,
"open_issues": 0,
"state": "closed",
"title": "0.18.1",
"updated_at": "2017-08-10T09:01:26Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/38"
} | 5 | 2016-04-13T21:25:53Z | 2016-04-16T01:44:35Z | 2016-04-16T01:44:27Z | CONTRIBUTOR | null | - [x] closes #12870, xref #11874
- [x] tests added / passed
- [x] passes `git diff upstream/master | 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/12895/reactions"
} | https://api.github.com/repos/pandas-dev/pandas/issues/12895/timeline | null | 0 | {
"diff_url": "https://github.com/pandas-dev/pandas/pull/12895.diff",
"html_url": "https://github.com/pandas-dev/pandas/pull/12895",
"merged_at": null,
"patch_url": "https://github.com/pandas-dev/pandas/pull/12895.patch",
"url": "https://api.github.com/repos/pandas-dev/pandas/pulls/12895"
} |
https://api.github.com/repos/pandas-dev/pandas/issues/12896 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/12896/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/12896/comments | https://api.github.com/repos/pandas-dev/pandas/issues/12896/events | https://github.com/pandas-dev/pandas/issues/12896 | 148,228,431 | MDU6SXNzdWUxNDgyMjg0MzE= | 12,896 | Multiindex slicing df.loc[idx[dim1,dim2,dim3],:] not working right in some cases | {
"avatar_url": "https://avatars.githubusercontent.com/u/4257257?v=4",
"events_url": "https://api.github.com/users/tntdynamight/events{/privacy}",
"followers_url": "https://api.github.com/users/tntdynamight/followers",
"following_url": "https://api.github.com/users/tntdynamight/following{/other_user}",
"gists_url": "https://api.github.com/users/tntdynamight/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/tntdynamight",
"id": 4257257,
"login": "tntdynamight",
"node_id": "MDQ6VXNlcjQyNTcyNTc=",
"organizations_url": "https://api.github.com/users/tntdynamight/orgs",
"received_events_url": "https://api.github.com/users/tntdynamight/received_events",
"repos_url": "https://api.github.com/users/tntdynamight/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/tntdynamight/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/tntdynamight/subscriptions",
"type": "User",
"url": "https://api.github.com/users/tntdynamight"
} | [
{
"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": "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": "2016-10-03T08:52:13Z",
"closed_issues": 733,
"created_at": "2016-03-11T21:24:45Z",
"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": "",
"due_on": "2016-09-30T07:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/40",
"id": 1639795,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/40/labels",
"node_id": "MDk6TWlsZXN0b25lMTYzOTc5NQ==",
"number": 40,
"open_issues": 0,
"state": "closed",
"title": "0.19.0",
"updated_at": "2017-11-06T02:01:14Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/40"
} | 8 | 2016-04-14T01:53:33Z | 2016-05-14T12:04:34Z | 2016-05-14T12:04:34Z | NONE | null | #### Code Sample, a copy-pastable example if possible
```
import pandas as pd
import numpy as np
np.random.seed(0)
idx = pd.IndexSlice
midx = pd.MultiIndex.from_product([['CS'], range(20), range(-1100, 6000)])
df = pd.DataFrame(np.random.randn(7100*20, 3), columns=['dat1', 'dat2', 'dat3'], index=midx)
```
#### Output
```
> df.loc[idx['CS', :, -1000:-950], :].head()
dat1 dat2 dat3
CS 0 -1000 -1.306527 1.658131 -0.118164
-999 -0.680178 0.666383 -0.460720
-998 -1.334258 -1.346718 0.693773
-997 -0.159573 -0.133702 1.077744
-996 -1.126826 -0.730678 -0.384880
```
```
> df.loc[idx['CS', :, -1000:-50], :].head()
dat1 dat2 dat3
CS 0 -1100 1.764052 0.400157 0.978738 # <<< Index Level 2 should start at -1000
-1099 2.240893 1.867558 -0.977278
-1098 0.950088 -0.151357 -0.103219
-1097 0.410599 0.144044 1.454274
-1096 0.761038 0.121675 0.443863
```
#### output of `pd.show_versions()`
## INSTALLED VERSIONS
commit: None
python: 3.5.1.final.0
python-bits: 64
OS: Linux
OS-release: 3.16.0-59-generic
machine: x86_64
processor: x86_64
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8
pandas: 0.18.0
nose: 1.3.7
pip: 8.1.1
setuptools: 20.2.2
Cython: 0.23.4
numpy: 1.10.4
scipy: 0.17.0
statsmodels: 0.6.1
xarray: None
IPython: 4.0.3
sphinx: 1.3.5
patsy: 0.4.0
dateutil: 2.4.2
pytz: 2015.7
blosc: None
bottleneck: 1.0.0
tables: 3.2.2
numexpr: 2.4.6
matplotlib: 1.5.1
openpyxl: 2.3.2
xlrd: 0.9.4
xlwt: 1.0.0
xlsxwriter: 0.8.4
lxml: 3.5.0
bs4: 4.4.1
html5lib: None
httplib2: None
apiclient: None
sqlalchemy: 1.0.11
pymysql: None
psycopg2: None
jinja2: 2.8
boto: 2.39.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/12896/reactions"
} | https://api.github.com/repos/pandas-dev/pandas/issues/12896/timeline | null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/12897 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/12897/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/12897/comments | https://api.github.com/repos/pandas-dev/pandas/issues/12897/events | https://github.com/pandas-dev/pandas/issues/12897 | 148,237,645 | MDU6SXNzdWUxNDgyMzc2NDU= | 12,897 | TST: remove ResourceWarnings | {
"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"
} | [
{
"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": "06909A",
"default": false,
"description": "IO issues that don't fit into a more specific label",
"id": 2301354,
"name": "IO Data",
"node_id": "MDU6TGFiZWwyMzAxMzU0",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/IO%20Data"
},
{
"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": 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"
} | 2 | 2016-04-14T03:02:53Z | 2016-08-20T17:09:00Z | 2016-08-20T17:09:00Z | CONTRIBUTOR | null | So just enabled `ResourceWarnings` to show up (these are only on PY3), see a sample run [here](https://travis-ci.org/pydata/pandas/jobs/122942984); they are only enabled on the 3.5-dev build (you can manually enable by setting `PANDAS_TESTING_MODE="deprecate"`
These are unclosed filehandles mostly in the `read_csv` tests.
So there are 2 cases here which need to be dealt with:
- when we uncompress things, we create a wrapper around the decompressor, these need to be closed, ONLY if the original handle was a string (IOW a pth), and NOT a filehandle itself (which we need to leave open)
- when we have a `utf-16` encoding we create a `UTFReader` object which needs to be closed (but same as above, you can't close it if the original handle was open to begin with)
So I added some `.close()` methods to the readers, but they are not explicity called anywhere. We need to figure out when to do this.
This might be a bit non-trivial!
| {
"+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/12897/reactions"
} | https://api.github.com/repos/pandas-dev/pandas/issues/12897/timeline | null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/12898 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/12898/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/12898/comments | https://api.github.com/repos/pandas-dev/pandas/issues/12898/events | https://github.com/pandas-dev/pandas/issues/12898 | 148,296,232 | MDU6SXNzdWUxNDgyOTYyMzI= | 12,898 | bugs when groupby/aggregate on columns with datetime64[ns, timezone] | {
"avatar_url": "https://avatars.githubusercontent.com/u/1304950?v=4",
"events_url": "https://api.github.com/users/sdementen/events{/privacy}",
"followers_url": "https://api.github.com/users/sdementen/followers",
"following_url": "https://api.github.com/users/sdementen/following{/other_user}",
"gists_url": "https://api.github.com/users/sdementen/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/sdementen",
"id": 1304950,
"login": "sdementen",
"node_id": "MDQ6VXNlcjEzMDQ5NTA=",
"organizations_url": "https://api.github.com/users/sdementen/orgs",
"received_events_url": "https://api.github.com/users/sdementen/received_events",
"repos_url": "https://api.github.com/users/sdementen/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/sdementen/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sdementen/subscriptions",
"type": "User",
"url": "https://api.github.com/users/sdementen"
} | [
{
"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": "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": "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": 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"
} | 4 | 2016-04-14T09:00:28Z | 2016-09-20T12:34:24Z | 2016-09-20T12:34:24Z | CONTRIBUTOR | null | When aggregating a column with dtype datetime64[ns, timezone], pandas does not handle properly tz information. It looks like as if pandas was dropping the timezone info (ie doing its calculation on the UTC values) and then localizing the date to the original timezone,i.e. doing something like
`column_with_UTC_dates_in_naive_format.tz_localize(timezone)`
instead of
`column_with_UTC_dates_in_naive_format.tz_localize("UTC").tz_convert(timezone)`
This buggy behavior is even more striking when running the sample with
`idx = pandas.date_range("2016-03-27", "2016-03-29", freq="H", closed="left", tz="Europe/Brussels")` (cover the DST change) as the naive UTC date "2016-03-27 03:00" cannot be localized to the timezone as it is not recognized. In this case, the dtype of the column is not anymore datetime64[ns, timezone] but just int64.
#### Code Sample, a copy-pastable example if possible
```
# create a DataFrame with a "time" column filled with localized datetime64 on hourly basis
idx = pandas.date_range("2016-01-01", "2016-01-03", freq="H", closed="left",tz="Europe/Brussels")
df = pandas.Series(idx, index=idx, name="time").to_frame()
# calculate some min and max of "time" column per hour of the day
df_agg = df.groupby(idx.hour).aggregate(["min","max"])
df_agg.info()
print df_agg
```
#### Expected Output
```
<class 'pandas.core.frame.DataFrame'>
DatetimeIndex: 48 entries, 2016-01-01 00:00:00+01:00 to 2016-01-02 23:00:00+01:00
Freq: H
Data columns (total 1 columns):
time 48 non-null datetime64[ns, Europe/Brussels]
dtypes: datetime64[ns, Europe/Brussels](1)
memory usage: 768.0 bytes
<class 'pandas.core.frame.DataFrame'>
Int64Index: 24 entries, 0 to 23
Data columns (total 2 columns):
(time, min) 24 non-null datetime64[ns, Europe/Brussels]
(time, max) 24 non-null datetime64[ns, Europe/Brussels]
dtypes: datetime64[ns, Europe/Brussels](2)
memory usage: 576.0 bytes
time
min max
0 2015-12-31 23:00:00+01:00 2016-01-01 23:00:00+01:00
1 2016-01-01 00:00:00+01:00 2016-01-02 00:00:00+01:00
2 2016-01-01 01:00:00+01:00 2016-01-02 01:00:00+01:00
3 2016-01-01 02:00:00+01:00 2016-01-02 02:00:00+01:00
4 2016-01-01 03:00:00+01:00 2016-01-02 03:00:00+01:00
5 2016-01-01 04:00:00+01:00 2016-01-02 04:00:00+01:00
6 2016-01-01 05:00:00+01:00 2016-01-02 05:00:00+01:00
7 2016-01-01 06:00:00+01:00 2016-01-02 06:00:00+01:00
8 2016-01-01 07:00:00+01:00 2016-01-02 07:00:00+01:00
9 2016-01-01 08:00:00+01:00 2016-01-02 08:00:00+01:00
10 2016-01-01 09:00:00+01:00 2016-01-02 09:00:00+01:00
11 2016-01-01 10:00:00+01:00 2016-01-02 10:00:00+01:00
12 2016-01-01 11:00:00+01:00 2016-01-02 11:00:00+01:00
13 2016-01-01 12:00:00+01:00 2016-01-02 12:00:00+01:00
14 2016-01-01 13:00:00+01:00 2016-01-02 13:00:00+01:00
15 2016-01-01 14:00:00+01:00 2016-01-02 14:00:00+01:00
16 2016-01-01 15:00:00+01:00 2016-01-02 15:00:00+01:00
17 2016-01-01 16:00:00+01:00 2016-01-02 16:00:00+01:00
18 2016-01-01 17:00:00+01:00 2016-01-02 17:00:00+01:00
19 2016-01-01 18:00:00+01:00 2016-01-02 18:00:00+01:00
20 2016-01-01 19:00:00+01:00 2016-01-02 19:00:00+01:00
21 2016-01-01 20:00:00+01:00 2016-01-02 20:00:00+01:00
22 2016-01-01 21:00:00+01:00 2016-01-02 21:00:00+01:00
23 2016-01-01 22:00:00+01:00 2016-01-02 22:00:00+01:00
```
#### output of `pd.show_versions()`
## INSTALLED VERSIONS
commit: None
python: 2.7.11.final.0
python-bits: 32
OS: Windows
OS-release: 7
machine: AMD64
processor: Intel64 Family 6 Model 61 Stepping 4, GenuineIntel
byteorder: little
LC_ALL: None
LANG: None
pandas: 0.18.0
nose: 1.3.7
pip: 8.1.1
setuptools: 20.6.7
Cython: None
numpy: 1.10.4
scipy: 0.17.0
statsmodels: 0.6.1
xarray: None
IPython: None
sphinx: None
patsy: 0.4.0
dateutil: 2.5.0
pytz: 2016.1
blosc: None
bottleneck: None
tables: 3.2.2
numexpr: 2.4.6
matplotlib: 1.5.1
openpyxl: 2.3.2
xlrd: 0.9.4
xlwt: None
xlsxwriter: None
lxml: None
bs4: None
html5lib: None
httplib2: None
apiclient: None
sqlalchemy: 1.0.12
pymysql: None
psycopg2: None
jinja2: 2.8
boto: None
None
| {
"+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/12898/reactions"
} | https://api.github.com/repos/pandas-dev/pandas/issues/12898/timeline | null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/12899 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/12899/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/12899/comments | https://api.github.com/repos/pandas-dev/pandas/issues/12899/events | https://github.com/pandas-dev/pandas/pull/12899 | 148,348,985 | MDExOlB1bGxSZXF1ZXN0NjY0Nzc0NDc= | 12,899 | BUG: .astype() of a Float64Index to a Int64Index | {
"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"
} | [
{
"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": "e102d8",
"default": false,
"description": "Unexpected or buggy dtype conversions",
"id": 31404521,
"name": "Dtype Conversions",
"node_id": "MDU6TGFiZWwzMTQwNDUyMQ==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Dtype%20Conversions"
},
{
"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"
}
]
| closed | false | null | []
| {
"closed_at": "2016-05-05T00:34:40Z",
"closed_issues": 306,
"created_at": "2016-02-08T15:29:59Z",
"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": "after 0.18.0 of course!",
"due_on": "2016-05-04T07:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/38",
"id": 1570594,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/38/labels",
"node_id": "MDk6TWlsZXN0b25lMTU3MDU5NA==",
"number": 38,
"open_issues": 0,
"state": "closed",
"title": "0.18.1",
"updated_at": "2017-08-10T09:01:26Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/38"
} | 4 | 2016-04-14T12:43:33Z | 2016-04-18T17:22:25Z | 2016-04-18T17:22:25Z | CONTRIBUTOR | null | closes #12881
closes #12866
xref #12309
| {
"+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/12899/reactions"
} | https://api.github.com/repos/pandas-dev/pandas/issues/12899/timeline | null | 0 | {
"diff_url": "https://github.com/pandas-dev/pandas/pull/12899.diff",
"html_url": "https://github.com/pandas-dev/pandas/pull/12899",
"merged_at": null,
"patch_url": "https://github.com/pandas-dev/pandas/pull/12899.patch",
"url": "https://api.github.com/repos/pandas-dev/pandas/pulls/12899"
} |
https://api.github.com/repos/pandas-dev/pandas/issues/12900 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/12900/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/12900/comments | https://api.github.com/repos/pandas-dev/pandas/issues/12900/events | https://github.com/pandas-dev/pandas/pull/12900 | 148,437,365 | MDExOlB1bGxSZXF1ZXN0NjY1MjY3MzU= | 12,900 | Allow parsing in skipped row for C engine | {
"avatar_url": "https://avatars.githubusercontent.com/u/9273653?v=4",
"events_url": "https://api.github.com/users/gfyoung/events{/privacy}",
"followers_url": "https://api.github.com/users/gfyoung/followers",
"following_url": "https://api.github.com/users/gfyoung/following{/other_user}",
"gists_url": "https://api.github.com/users/gfyoung/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/gfyoung",
"id": 9273653,
"login": "gfyoung",
"node_id": "MDQ6VXNlcjkyNzM2NTM=",
"organizations_url": "https://api.github.com/users/gfyoung/orgs",
"received_events_url": "https://api.github.com/users/gfyoung/received_events",
"repos_url": "https://api.github.com/users/gfyoung/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/gfyoung/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/gfyoung/subscriptions",
"type": "User",
"url": "https://api.github.com/users/gfyoung"
} | [
{
"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": "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": "2016-05-05T00:34:40Z",
"closed_issues": 306,
"created_at": "2016-02-08T15:29:59Z",
"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": "after 0.18.0 of course!",
"due_on": "2016-05-04T07:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/38",
"id": 1570594,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/38/labels",
"node_id": "MDk6TWlsZXN0b25lMTU3MDU5NA==",
"number": 38,
"open_issues": 0,
"state": "closed",
"title": "0.18.1",
"updated_at": "2017-08-10T09:01:26Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/38"
} | 28 | 2016-04-14T17:55:52Z | 2016-04-22T15:24:41Z | 2016-04-22T15:20:13Z | MEMBER | null | Changes behaviour of C engine parser so that parsing is done on skipped rows so that they
are properly skipped.
Closes #10911.
Closes #12775.
| {
"+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/12900/reactions"
} | https://api.github.com/repos/pandas-dev/pandas/issues/12900/timeline | null | 0 | {
"diff_url": "https://github.com/pandas-dev/pandas/pull/12900.diff",
"html_url": "https://github.com/pandas-dev/pandas/pull/12900",
"merged_at": null,
"patch_url": "https://github.com/pandas-dev/pandas/pull/12900.patch",
"url": "https://api.github.com/repos/pandas-dev/pandas/pulls/12900"
} |
https://api.github.com/repos/pandas-dev/pandas/issues/12901 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/12901/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/12901/comments | https://api.github.com/repos/pandas-dev/pandas/issues/12901/events | https://github.com/pandas-dev/pandas/pull/12901 | 148,474,474 | MDExOlB1bGxSZXF1ZXN0NjY1NDkxNjE= | 12,901 | Fix ndarray allany | {
"avatar_url": "https://avatars.githubusercontent.com/u/17328330?v=4",
"events_url": "https://api.github.com/users/artheist/events{/privacy}",
"followers_url": "https://api.github.com/users/artheist/followers",
"following_url": "https://api.github.com/users/artheist/following{/other_user}",
"gists_url": "https://api.github.com/users/artheist/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/artheist",
"id": 17328330,
"login": "artheist",
"node_id": "MDQ6VXNlcjE3MzI4MzMw",
"organizations_url": "https://api.github.com/users/artheist/orgs",
"received_events_url": "https://api.github.com/users/artheist/received_events",
"repos_url": "https://api.github.com/users/artheist/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/artheist/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/artheist/subscriptions",
"type": "User",
"url": "https://api.github.com/users/artheist"
} | [
{
"color": "e102d8",
"default": false,
"description": "Unexpected or buggy dtype conversions",
"id": 31404521,
"name": "Dtype Conversions",
"node_id": "MDU6TGFiZWwzMTQwNDUyMQ==",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Dtype%20Conversions"
},
{
"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"
}
]
| closed | false | null | []
| null | 7 | 2016-04-14T20:33:43Z | 2016-12-26T21:49:37Z | 2016-12-26T21:49:37Z | NONE | null | - [x] closes #12863
- [ ] tests added / passed
- [x] passes `git diff upstream/master | 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/12901/reactions"
} | https://api.github.com/repos/pandas-dev/pandas/issues/12901/timeline | null | 0 | {
"diff_url": "https://github.com/pandas-dev/pandas/pull/12901.diff",
"html_url": "https://github.com/pandas-dev/pandas/pull/12901",
"merged_at": null,
"patch_url": "https://github.com/pandas-dev/pandas/pull/12901.patch",
"url": "https://api.github.com/repos/pandas-dev/pandas/pulls/12901"
} |
https://api.github.com/repos/pandas-dev/pandas/issues/12902 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/12902/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/12902/comments | https://api.github.com/repos/pandas-dev/pandas/issues/12902/events | https://github.com/pandas-dev/pandas/issues/12902 | 148,499,193 | MDU6SXNzdWUxNDg0OTkxOTM= | 12,902 | BUG: Complex types are coerced to float when summing along level of MultiIndex | {
"avatar_url": "https://avatars.githubusercontent.com/u/1251492?v=4",
"events_url": "https://api.github.com/users/elinoreroebber/events{/privacy}",
"followers_url": "https://api.github.com/users/elinoreroebber/followers",
"following_url": "https://api.github.com/users/elinoreroebber/following{/other_user}",
"gists_url": "https://api.github.com/users/elinoreroebber/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/elinoreroebber",
"id": 1251492,
"login": "elinoreroebber",
"node_id": "MDQ6VXNlcjEyNTE0OTI=",
"organizations_url": "https://api.github.com/users/elinoreroebber/orgs",
"received_events_url": "https://api.github.com/users/elinoreroebber/received_events",
"repos_url": "https://api.github.com/users/elinoreroebber/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/elinoreroebber/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/elinoreroebber/subscriptions",
"type": "User",
"url": "https://api.github.com/users/elinoreroebber"
} | [
{
"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": "009800",
"default": false,
"description": "Complex Numbers",
"id": 172091424,
"name": "Complex",
"node_id": "MDU6TGFiZWwxNzIwOTE0MjQ=",
"url": "https://api.github.com/repos/pandas-dev/pandas/labels/Complex"
}
]
| closed | false | null | []
| {
"closed_at": "2016-05-05T00:34:40Z",
"closed_issues": 306,
"created_at": "2016-02-08T15:29:59Z",
"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": "after 0.18.0 of course!",
"due_on": "2016-05-04T07:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/38",
"id": 1570594,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/38/labels",
"node_id": "MDk6TWlsZXN0b25lMTU3MDU5NA==",
"number": 38,
"open_issues": 0,
"state": "closed",
"title": "0.18.1",
"updated_at": "2017-08-10T09:01:26Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/38"
} | 2 | 2016-04-14T22:21:21Z | 2016-04-18T17:10:08Z | 2016-04-18T17:10:08Z | NONE | null | When trying to sum complex numbers along one level of a MultiIndex, I get a `ComplexWarning` and the resulting datatypes are `float64` with imaginary components discarded. Summing without specifying the level or by unstacking the MultiIndex works as expected.
Based on the error message, I assume that groupby is being called internally, and that the bug is actually there. I'm using pandas version 17.1.
#### Code Sample
```
In [1]: df = pd.DataFrame(data=np.arange(4)*(1+2j), index=pd.MultiIndex.from_product(([0,1], [0,1]), names=['a','b']))
In [2]: print df
0
a b
0 0 0j
1 (1+2j)
1 0 (2+4j)
1 (3+6j)
In [3]: df.sum(level='a')
/Users/elinore/Library/Python/2.7/lib/python/site-packages/pandas/core/groupby.py:1629: ComplexWarning: Casting complex values to real discards the imaginary part
values = _algos.ensure_float64(values)
Out[3]:
0
a
0 1
1 5
```
#### Expected Output
```
Out[3]:
0
a
0 (1+2j)
1 (5+10j)
```
#### output of `pd.show_versions()`
## INSTALLED VERSIONS
commit: None
python: 2.7.11.final.0
python-bits: 64
OS: Darwin
OS-release: 14.5.0
machine: x86_64
processor: i386
byteorder: little
LC_ALL: None
LANG: en_CA.UTF-8
pandas: 0.17.1
nose: 1.3.7
pip: 7.1.2
setuptools: 19.2
Cython: 0.23.5
numpy: 1.10.4
scipy: 0.17.0
statsmodels: None
IPython: 4.1.2
sphinx: 1.4
patsy: None
dateutil: 2.5.1
pytz: 2016.3
blosc: None
bottleneck: 1.0.0
tables: 3.2.2
numexpr: 2.5.1
matplotlib: 1.5.1
openpyxl: None
xlrd: None
xlwt: None
xlsxwriter: None
lxml: None
bs4: None
html5lib: None
httplib2: None
apiclient: None
sqlalchemy: None
pymysql: None
psycopg2: None
Jinja2: None
| {
"+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/12902/reactions"
} | https://api.github.com/repos/pandas-dev/pandas/issues/12902/timeline | null | null | null |
https://api.github.com/repos/pandas-dev/pandas/issues/12903 | https://api.github.com/repos/pandas-dev/pandas | https://api.github.com/repos/pandas-dev/pandas/issues/12903/labels{/name} | https://api.github.com/repos/pandas-dev/pandas/issues/12903/comments | https://api.github.com/repos/pandas-dev/pandas/issues/12903/events | https://github.com/pandas-dev/pandas/issues/12903 | 148,635,980 | MDU6SXNzdWUxNDg2MzU5ODA= | 12,903 | Import statements in period.pyx significantly impact performance | {
"avatar_url": "https://avatars.githubusercontent.com/u/4407787?v=4",
"events_url": "https://api.github.com/users/rs2/events{/privacy}",
"followers_url": "https://api.github.com/users/rs2/followers",
"following_url": "https://api.github.com/users/rs2/following{/other_user}",
"gists_url": "https://api.github.com/users/rs2/gists{/gist_id}",
"gravatar_id": "",
"html_url": "https://github.com/rs2",
"id": 4407787,
"login": "rs2",
"node_id": "MDQ6VXNlcjQ0MDc3ODc=",
"organizations_url": "https://api.github.com/users/rs2/orgs",
"received_events_url": "https://api.github.com/users/rs2/received_events",
"repos_url": "https://api.github.com/users/rs2/repos",
"site_admin": false,
"starred_url": "https://api.github.com/users/rs2/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/rs2/subscriptions",
"type": "User",
"url": "https://api.github.com/users/rs2"
} | [
{
"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": "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": "2016-05-05T00:34:40Z",
"closed_issues": 306,
"created_at": "2016-02-08T15:29:59Z",
"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": "after 0.18.0 of course!",
"due_on": "2016-05-04T07:00:00Z",
"html_url": "https://github.com/pandas-dev/pandas/milestone/38",
"id": 1570594,
"labels_url": "https://api.github.com/repos/pandas-dev/pandas/milestones/38/labels",
"node_id": "MDk6TWlsZXN0b25lMTU3MDU5NA==",
"number": 38,
"open_issues": 0,
"state": "closed",
"title": "0.18.1",
"updated_at": "2017-08-10T09:01:26Z",
"url": "https://api.github.com/repos/pandas-dev/pandas/milestones/38"
} | 4 | 2016-04-15T11:34:14Z | 2016-04-26T19:21:19Z | 2016-04-26T19:21:19Z | CONTRIBUTOR | null | The following imports in pandas/src/period.pyx significantly impact performance when dealing with multiple Period objects. A quick win, guys.
``` cython
def __init__(self, value=None, freq=None, ordinal=None,
year=None, month=1, quarter=None, day=1,
hour=0, minute=0, second=0):
from pandas.tseries import frequencies
from pandas.tseries.frequencies import get_freq_code as _gfc
# freq points to a tuple (base, mult); base is one of the defined
# periods such as A, Q, etc. Every five minutes would be, e.g.,
# ('T', 5) but may be passed in as a string like '5T'
```
Just profile the code below and observe the number of times `_find_and_load` gets called:
``` python
import pandas as pd
for _ in range(1000):
pd.Period('2015-04-26')
```
https://github.com/pydata/pandas/commit/bfa80660c67076b0f5457056d1d857fc3204a620 is the commit that has introduced the problem.
I will submit a pull request that rectifies the incorrect fix to the circular dependency.
| {
"+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/12903/reactions"
} | https://api.github.com/repos/pandas-dev/pandas/issues/12903/timeline | null | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.