{
"info": {
"author": "Coursera Inc.",
"author_email": "pandas-ply@coursera.org",
"bugtrack_url": null,
"classifiers": [],
"description": "**pandas-ply**: functional data manipulation for pandas\n=======================================================\n\n**pandas-ply** is a thin layer which makes it easier to manipulate data with `pandas `_. In particular, it provides elegant, functional, chainable syntax in cases where **pandas** would require mutation, saved intermediate values, or other awkward constructions. In this way, it aims to move **pandas** closer to the \"grammar of data manipulation\" provided by the `dplyr `_ package for R.\n\nFor example, take the **dplyr** code below:\n\n.. code:: r\n\n flights %>%\n group_by(year, month, day) %>%\n summarise(\n arr = mean(arr_delay, na.rm = TRUE),\n dep = mean(dep_delay, na.rm = TRUE)\n ) %>%\n filter(arr > 30 & dep > 30)\n\nThe most common way to express this in **pandas** is probably:\n\n.. code:: python\n\n grouped_flights = flights.groupby(['year', 'month', 'day'])\n output = pd.DataFrame()\n output['arr'] = grouped_flights.arr_delay.mean()\n output['dep'] = grouped_flights.dep_delay.mean()\n filtered_output = output[(output.arr > 30) & (output.dep > 30)]\n\n**pandas-ply** lets you instead write:\n\n.. code:: python\n\n (flights\n .groupby(['year', 'month', 'day'])\n .ply_select(\n arr = X.arr_delay.mean(),\n dep = X.dep_delay.mean())\n .ply_where(X.arr > 30, X.dep > 30))\n\nIn our opinion, this **pandas-ply** code is cleaner, more expressive, more readable, more concise, and less error-prone than the original **pandas** code.\n\nExplanatory notes on the **pandas-ply** code sample above:\n\n* **pandas-ply**'s methods (like ``ply_select`` and ``ply_where`` above) are attached directly to **pandas** objects and can be used immediately, without any wrapping or redirection. They start with a ``ply_`` prefix to distinguish them from built-in **pandas** methods.\n* **pandas-ply**'s methods are named for (and modelled after) SQL's operators. (But keep in mind that these operators will not always appear in the same order as they do in a SQL statement: ``SELECT a FROM b WHERE c GROUP BY d`` probably maps to ``b.ply_where(c).groupby(d).ply_select(a)``.)\n* **pandas-ply** includes a simple system for building \"symbolic expressions\" to provide as arguments to its methods. ``X`` above is an instance of ``ply.symbolic.Symbol``. Operations on this symbol produce larger compound symbolic expressions. When ``pandas-ply`` receives a symbolic expression as an argument, it converts it into a function. So, for instance, ``X.arr > 30`` in the above code could have instead been provided as ``lambda x: x.arr > 30``. Use of symbolic expressions allows the ``lambda x:`` to be left off, resulting in less cluttered code.\n\nWarning\n-------\n\n**pandas-ply** is new, and in an experimental stage of its development. The API is not yet stable. Expect the unexpected.\n\n(Pull requests are welcome. Feel free to contact us at pandas-ply@coursera.org.)\n\nUsing **pandas-ply**\n--------------------\n\nInstall **pandas-ply** with:\n\n::\n\n $ pip install pandas-ply\n\n\nTypical use of **pandas-ply** starts with:\n\n.. code:: python\n\n import pandas as pd\n from pandas_ply import install_ply, X, sym_call\n\n install_ply(pd)\n\nAfter calling ``install_ply``, all **pandas** objects have **pandas-ply**'s methods attached.\n\nAPI reference\n-------------\n\nFull API reference is available at ``_.\n\nPossible TODOs\n--------------\n\n* Extend ``pandas``' native ``groupby`` to support symbolic expressions?\n* Extend ``pandas``' native ``apply`` to support symbolic expressions?\n* Add ``.ply_call`` to ``pandas`` objects to extend chainability?\n* Version of ``ply_select`` which supports later computed columns relying on earlier computed columns?\n* Version of ``ply_select`` which supports careful column ordering?\n* Better handling of indices?\n\nLicense\n-------\n\nCopyright 2015 Coursera Inc.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.",
"description_content_type": null,
"docs_url": "https://pythonhosted.org/pandas-ply/",
"download_url": "UNKNOWN",
"downloads": {
"last_day": -1,
"last_month": -1,
"last_week": -1
},
"home_page": "https://github.com/coursera/pandas-ply",
"keywords": null,
"license": "Apache License 2.0",
"maintainer": null,
"maintainer_email": null,
"name": "pandas-ply",
"package_url": "https://pypi.org/project/pandas-ply/",
"platform": "UNKNOWN",
"project_url": "https://pypi.org/project/pandas-ply/",
"project_urls": {
"Download": "UNKNOWN",
"Homepage": "https://github.com/coursera/pandas-ply"
},
"release_url": "https://pypi.org/project/pandas-ply/0.2.1/",
"requires_dist": null,
"requires_python": null,
"summary": "functional data manipulation for pandas",
"version": "0.2.1"
},
"last_serial": 1695973,
"releases": {
"0.1.0": [
{
"comment_text": "",
"digests": {
"md5": "8bc48fbfedf8c5eaed62bf324731490e",
"sha256": "77e0e168767503d36af8e129e20f9a5297b5bc54ff67659500b688e7f41424f9"
},
"downloads": -1,
"filename": "pandas-ply-0.1.0.tar.gz",
"has_sig": false,
"md5_digest": "8bc48fbfedf8c5eaed62bf324731490e",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 6654,
"upload_time": "2014-11-26T00:22:27",
"url": "https://files.pythonhosted.org/packages/ce/bb/7cc2077ce0b28ef3c718c8acc4d41bbab750a9de4755c7d57834fa44e7cd/pandas-ply-0.1.0.tar.gz"
}
],
"0.1.1": [
{
"comment_text": "",
"digests": {
"md5": "d01fb800c7533f778bd90da45ec90525",
"sha256": "3c5c0eefdc6c31d5d04e19b02844d4896c332e3c25678591eb17a4880f984794"
},
"downloads": -1,
"filename": "pandas-ply-0.1.1.tar.gz",
"has_sig": false,
"md5_digest": "d01fb800c7533f778bd90da45ec90525",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 7161,
"upload_time": "2014-12-02T02:59:57",
"url": "https://files.pythonhosted.org/packages/c2/0b/f5ef437df95f009899a612ecbc4d321b5c57dc9c075b2ed99daf2ca740db/pandas-ply-0.1.1.tar.gz"
}
],
"0.1.2": [
{
"comment_text": "",
"digests": {
"md5": "e7269b4de63e1144070267b3c1188cb1",
"sha256": "50f8d863a6f904adebdf3065c516221fbb1c9ce2bc4f6ca0bb09984dc8ef86a4"
},
"downloads": -1,
"filename": "pandas-ply-0.1.2.tar.gz",
"has_sig": false,
"md5_digest": "e7269b4de63e1144070267b3c1188cb1",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 15439,
"upload_time": "2014-12-02T03:02:05",
"url": "https://files.pythonhosted.org/packages/5a/18/afb8b564efe37821836ebc7338ee530c90abf760484e66fba035f894967e/pandas-ply-0.1.2.tar.gz"
}
],
"0.2.0": [],
"0.2.1": [
{
"comment_text": "",
"digests": {
"md5": "ce354dabb0353863c08b324f9ac9193f",
"sha256": "7af7f868edea3969f9bf7b10b7de5034f65f3174fb350ba9bdcf15541ec5722d"
},
"downloads": -1,
"filename": "pandas-ply-0.2.1.tar.gz",
"has_sig": false,
"md5_digest": "ce354dabb0353863c08b324f9ac9193f",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 14325,
"upload_time": "2015-08-27T08:23:00",
"url": "https://files.pythonhosted.org/packages/8d/6b/434ef2f9c96e10ba6f75a1f82a85cf46ac98199f581627c9e732504a62f3/pandas-ply-0.2.1.tar.gz"
}
]
},
"urls": [
{
"comment_text": "",
"digests": {
"md5": "ce354dabb0353863c08b324f9ac9193f",
"sha256": "7af7f868edea3969f9bf7b10b7de5034f65f3174fb350ba9bdcf15541ec5722d"
},
"downloads": -1,
"filename": "pandas-ply-0.2.1.tar.gz",
"has_sig": false,
"md5_digest": "ce354dabb0353863c08b324f9ac9193f",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 14325,
"upload_time": "2015-08-27T08:23:00",
"url": "https://files.pythonhosted.org/packages/8d/6b/434ef2f9c96e10ba6f75a1f82a85cf46ac98199f581627c9e732504a62f3/pandas-ply-0.2.1.tar.gz"
}
]
}