{"action":"closed","issue":{"url":"https://api.github.com/repos/pydata/pandas/issues/8845","labels_url":"https://api.github.com/repos/pydata/pandas/issues/8845/labels{/name}","comments_url":"https://api.github.com/repos/pydata/pandas/issues/8845/comments","events_url":"https://api.github.com/repos/pydata/pandas/issues/8845/events","html_url":"https://github.com/pydata/pandas/issues/8845","id":49180263,"number":8845,"title":"API: Index.get_nearest method","user":{"login":"shoyer","id":1217238,"avatar_url":"https://avatars.githubusercontent.com/u/1217238?v=3","gravatar_id":"","url":"https://api.github.com/users/shoyer","html_url":"https://github.com/shoyer","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}","starred_url":"https://api.github.com/users/shoyer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shoyer/subscriptions","organizations_url":"https://api.github.com/users/shoyer/orgs","repos_url":"https://api.github.com/users/shoyer/repos","events_url":"https://api.github.com/users/shoyer/events{/privacy}","received_events_url":"https://api.github.com/users/shoyer/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/pydata/pandas/labels/API%20Design","name":"API Design","color":"AD7FA8"},{"url":"https://api.github.com/repos/pydata/pandas/labels/Timeseries","name":"Timeseries","color":"AFEEEE"}],"state":"closed","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/pydata/pandas/milestones/25","labels_url":"https://api.github.com/repos/pydata/pandas/milestones/25/labels","id":569113,"number":25,"title":"0.16.0","description":"after 0.15 of course!","creator":{"login":"jreback","id":953992,"avatar_url":"https://avatars.githubusercontent.com/u/953992?v=3","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},"open_issues":807,"closed_issues":294,"state":"open","created_at":"2014-02-14T03:31:22Z","updated_at":"2015-02-23T18:30:41Z","due_on":"2015-02-28T08:00:00Z","closed_at":null},"comments":9,"created_at":"2014-11-18T04:41:29Z","updated_at":"2015-02-23T18:30:41Z","closed_at":"2015-02-23T18:30:41Z","body":"xref #3004\r\nxref #841\r\nxref #7873 \r\nxref #7223\r\nxref #8815\r\n\r\nBuilding on @immerrr's excellent refactor in #8753, I would like to propose adding a `get_nearest` method to pandas.Index that does nearest neighbor lookups. The idea is that nearest neighbor lookups are usually the desirable/sane thing to do when using inexact indexes. Eventually, we might want to add an alternative \"wrapper index\" (like IntervalIndex), e.g., `NearestNeighborIndex` which switches the default behavior; this would be an intermediate step in that direction.\r\n\r\nThe implementation would be a simple wrapper that calls `Index.get_slice_bound` twice, once to the left and once to the right. Ideally, this would this would even work for array-like arguments, though perhaps there should be separate `get_nearest_loc` and `get_nearest_indexer` methods."}}