{ "info": { "author": "Robin Fishbein", "author_email": "robinfishbein@yahoo.com", "bugtrack_url": null, "classifiers": [], "description": "## merge_closest\n### Merge column(s) into DataFrame using closest-without-going-over lookup.\n\nThe `merge_closest` function mimics Excel's VLOOKUP function in approximate\nmatch (range lookup) mode, with added benefits of ensuring the lookup table is\nsorted and merging any subset of columns from the lookup table. It's\nsimilar to a left join based on the `lookup_field` value that is closest to\nthe `data_field` value without going over. Only the first matching row from\n`lookup` is merged; if `lookup_field` contains duplicates, it's up to the user\nto drop duplicates in advance as appropriate. For any row in `data` whose\n`data_field` value is less than all values in `lookup_field`, `lookup` values\nin `result` will be missing.\n\nBy default, all columns in `lookup` other than `lookup_field` will be merged\nwith `data`. A specific list of columns from `lookup` to include or exclude\ncan be passed. If both `include_cols` and `exclude_cols` are provided,\n`exclude_cols` is ignored. To include `lookup_field` in `result`, `lookup_field`\nmust be passed in `include_cols`, perhaps as `include_cols=lookup.columns`.\n\n### This is my first Python package and first GitHub repo...\n\n...and any comments or suggestions are most welcome.\n\n### Use\n\n from merge_closest import merge_closest\n \n merge_closest(data, lookup, data_field, lookup_field,\n include_cols=None, exclude_cols=None,\n presorted=False)\n\n### Parameters\n\n**`data`** : pandas DataFrame\n\n**`lookup`** : pandas DataFrame\n\n**`data_field`** : name of column in `data`\n\n**`lookup_field`** : name of column in `lookup`\n\n**`include_cols`** : list, pandas Index, or single value; columns from\n `lookup` to include in `result`.\n If neither `include_cols` nor `exclude_cols` is provided, all columns\n from `lookup` except `lookup_field` are included in `result`.\n\n**`exclude_cols`** : list, pandas Index, or single value; columns from\n `lookup` to exclude from `result`.\n By default, `lookup_field` will be excluded even if not in `exclude_cols`.\n To include `lookup_field`, pass it in `include_cols`.\n If both `include_cols` and `exclude_cols` are provided, `exclude_cols` is\n ignored.\n\n**`presorted`** : boolean; unless set to True, `lookup` will be sorted\n ascending on `lookup_field` prior to merging.\n\n### Returns\n\n**`result`** : pandas DataFrame", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/RobinFiveWords/merge_closest", "keywords": "pandas merge join closest approximate", "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "merge_closest", "package_url": "https://pypi.org/project/merge_closest/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/merge_closest/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/RobinFiveWords/merge_closest" }, "release_url": "https://pypi.org/project/merge_closest/0.1b160919-3/", "requires_dist": null, "requires_python": null, "summary": "Merge two pandas DataFrames using closest match", "version": "0.1b160919-3" }, "last_serial": 2357558, "releases": { "0.1b160919-3": [ { "comment_text": "", "digests": { "md5": "ad86b714878210a4b68150974afa7291", "sha256": "c2f373ff425d5a4c4df726b4e2d8a15ef92f7d91f49cca4fc27be631404256e8" }, "downloads": -1, "filename": "merge_closest-0.1b160919-3.tar.gz", "has_sig": false, "md5_digest": "ad86b714878210a4b68150974afa7291", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3074, "upload_time": "2016-09-20T05:53:34", "url": "https://files.pythonhosted.org/packages/a7/05/43c1639e11fed24a65148c726f8f41cbf893782d1506721c69b906bf3a8a/merge_closest-0.1b160919-3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "ad86b714878210a4b68150974afa7291", "sha256": "c2f373ff425d5a4c4df726b4e2d8a15ef92f7d91f49cca4fc27be631404256e8" }, "downloads": -1, "filename": "merge_closest-0.1b160919-3.tar.gz", "has_sig": false, "md5_digest": "ad86b714878210a4b68150974afa7291", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3074, "upload_time": "2016-09-20T05:53:34", "url": "https://files.pythonhosted.org/packages/a7/05/43c1639e11fed24a65148c726f8f41cbf893782d1506721c69b906bf3a8a/merge_closest-0.1b160919-3.tar.gz" } ] }