{"action":"created","issue":{"url":"https://api.github.com/repos/pandas-dev/pandas/issues/20770","repository_url":"https://api.github.com/repos/pandas-dev/pandas","labels_url":"https://api.github.com/repos/pandas-dev/pandas/issues/20770/labels{/name}","comments_url":"https://api.github.com/repos/pandas-dev/pandas/issues/20770/comments","events_url":"https://api.github.com/repos/pandas-dev/pandas/issues/20770/events","html_url":"https://github.com/pandas-dev/pandas/pull/20770","id":316364303,"number":20770,"title":"Emit warning for missing labeles in Multiindex.loc[[...]] (and more)","user":{"login":"toobaz","id":1224492,"avatar_url":"https://avatars1.githubusercontent.com/u/1224492?v=4","gravatar_id":"","url":"https://api.github.com/users/toobaz","html_url":"https://github.com/toobaz","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}","starred_url":"https://api.github.com/users/toobaz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/toobaz/subscriptions","organizations_url":"https://api.github.com/users/toobaz/orgs","repos_url":"https://api.github.com/users/toobaz/repos","events_url":"https://api.github.com/users/toobaz/events{/privacy}","received_events_url":"https://api.github.com/users/toobaz/received_events","type":"User","site_admin":false},"labels":[{"id":76811,"url":"https://api.github.com/repos/pandas-dev/pandas/labels/Bug","name":"Bug","color":"e10c02","default":false},{"id":76865106,"url":"https://api.github.com/repos/pandas-dev/pandas/labels/Compat","name":"Compat","color":"0052cc","default":false},{"id":2822098,"url":"https://api.github.com/repos/pandas-dev/pandas/labels/Indexing","name":"Indexing","color":"0b02e1","default":false},{"id":71268330,"url":"https://api.github.com/repos/pandas-dev/pandas/labels/MultiIndex","name":"MultiIndex","color":"207de5","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":13,"created_at":"2018-04-20T18:16:11Z","updated_at":"2018-04-27T11:58:24Z","closed_at":null,"author_association":"MEMBER","pull_request":{"url":"https://api.github.com/repos/pandas-dev/pandas/pulls/20770","html_url":"https://github.com/pandas-dev/pandas/pull/20770","diff_url":"https://github.com/pandas-dev/pandas/pull/20770.diff","patch_url":"https://github.com/pandas-dev/pandas/pull/20770.patch"},"body":"- [x] closes #17758\r\n- [x] closes #20748\r\n- [x] closes #20753\r\n- [x] tests added / passed\r\n- [x] passes `git diff upstream/master -u -- \"*.py\" | flake8 --diff`\r\n- [x] whatsnew entry\r\n\r\nMain changes:\r\n- the presence of at least one key (and of all of them, for the temporary warning) is now checked _after_ building the indexer, using the indexer itself, in a unique place\r\n- for this to be possible, ``obj.reindex`` was replaced with ``obj._reindex_with_indexers``\r\n- ``_multi_take`` is uglier than before... but it's ugly anyway, and must be removed in a future refactoring (in which first indexers are built in all possible code paths, _then_ values are extracted)\r\n- ``_has_valid_type`` was mostly used in \"assertion mode\" (without looking at its return value), so I changed it to ``_validate_key`` and now it is _only_ used in \"assertion mode\"\r\n\r\nAsv (``--bench indexing``) give\r\n```\r\n       before           after         ratio\r\n     [3a2e9e6c]       [25711d3d]\r\n+       162±0.2ms          273±5ms     1.68  indexing.NumericSeriesIndexing.time_getitem_array(<class 'pandas.core.indexes.numeric.Float64Index'>)\r\n+         162±1ms        269±0.7ms     1.66  indexing.NumericSeriesIndexing.time_loc_array(<class 'pandas.core.indexes.numeric.Float64Index'>)\r\n+       162±0.6ms          267±1ms     1.65  indexing.NumericSeriesIndexing.time_ix_list_like(<class 'pandas.core.indexes.numeric.Float64Index'>)\r\n+         164±2ms          270±1ms     1.64  indexing.NumericSeriesIndexing.time_ix_array(<class 'pandas.core.indexes.numeric.Float64Index'>)\r\n+       166±0.6ms        273±0.6ms     1.64  indexing.NumericSeriesIndexing.time_getitem_lists(<class 'pandas.core.indexes.numeric.Float64Index'>)\r\n+       163±0.5ms        267±0.8ms     1.64  indexing.NumericSeriesIndexing.time_getitem_list_like(<class 'pandas.core.indexes.numeric.Float64Index'>)\r\n+         163±3ms        267±0.4ms     1.64  indexing.NumericSeriesIndexing.time_loc_list_like(<class 'pandas.core.indexes.numeric.Float64Index'>)\r\n+         412±3μs          664±4μs     1.61  indexing.NumericSeriesIndexing.time_ix_list_like(<class 'pandas.core.indexes.numeric.Int64Index'>)\r\n+        1.08±0ms      1.42±0.05ms     1.32  indexing.NumericSeriesIndexing.time_ix_array(<class 'pandas.core.indexes.numeric.Int64Index'>)\r\n+     1.14±0.01ms      1.31±0.02ms     1.15  indexing.PanelIndexing.time_subset\r\n-       133±0.2ms        121±0.4ms     0.91  frame_methods.Iteration.time_iteritems_indexing\r\n-         442±2ns          399±2ns     0.90  indexing.MethodLookup.time_lookup_iloc\r\n-       145±0.8μs        130±0.8μs     0.90  indexing.IntervalIndexing.time_getitem_list\r\n-         151±2μs          134±1μs     0.89  indexing.AssignTimeseriesIndex.time_frame_assign_timeseries_index\r\n-      48.5±0.8μs       41.2±0.1μs     0.85  indexing.IntervalIndexing.time_getitem_scalar\r\n-        44.3±1μs       35.6±0.1μs     0.80  indexing.NumericSeriesIndexing.time_iloc_list_like(<class 'pandas.core.indexes.numeric.Float64Index'>)\r\n-     3.81±0.02ms      2.06±0.02ms     0.54  indexing.DataFrameNumericIndexing.time_loc_dups\r\n\r\nSOME BENCHMARKS HAVE CHANGED SIGNIFICANTLY.\r\n\r\n```\r\n\r\nnotice that ``FloatIndex`` was _not_ being checked at all (i.e. #17758 applied to it too), now it is.\r\n\r\nIn any case, as I wrote above, there are several improvements still to be made, but I want to go gradually because the complexity of this PR is already pretty high for me."},"comment":{"url":"https://api.github.com/repos/pandas-dev/pandas/issues/comments/384949242","html_url":"https://github.com/pandas-dev/pandas/pull/20770#issuecomment-384949242","issue_url":"https://api.github.com/repos/pandas-dev/pandas/issues/20770","id":384949242,"user":{"login":"jreback","id":953992,"avatar_url":"https://avatars2.githubusercontent.com/u/953992?v=4","gravatar_id":"","url":"https://api.github.com/users/jreback","html_url":"https://github.com/jreback","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}","starred_url":"https://api.github.com/users/jreback/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jreback/subscriptions","organizations_url":"https://api.github.com/users/jreback/orgs","repos_url":"https://api.github.com/users/jreback/repos","events_url":"https://api.github.com/users/jreback/events{/privacy}","received_events_url":"https://api.github.com/users/jreback/received_events","type":"User","site_admin":false},"created_at":"2018-04-27T11:58:24Z","updated_at":"2018-04-27T11:58:24Z","author_association":"CONTRIBUTOR","body":"@toobaz you argument is not logical. master is passing, this branch is not. if you want to do a smaller PR to show the warning and not do a refactoring ok, otherwise, this PR will be held up.\r\n"}}
{"actor":{"display_login":"jreback"}}