From bbdf2beb649e66fccca3e4be0ad361435dec9b7a Mon Sep 17 00:00:00 2001 From: Ritika Munjal Date: Sat, 17 Aug 2019 11:42:11 -0500 Subject: [PATCH 1/6] added names, fastpath parameters explaination to pandas.Series in file series.py --- Untitled.ipynb | 59 +++++++++++++++++++++++++++++++++++++++++++ pandas/core/series.py | 6 ++++- 2 files changed, 64 insertions(+), 1 deletion(-) create mode 100644 Untitled.ipynb diff --git a/Untitled.ipynb b/Untitled.ipynb new file mode 100644 index 0000000000000..f825e9726d68f --- /dev/null +++ b/Untitled.ipynb @@ -0,0 +1,59 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [ + { + "ename": "ImportError", + "evalue": "C extension: No module named 'pandas._config' not built. If you want to import pandas from the source directory, you may need to run 'python setup.py build_ext --inplace --force' to build the C extensions first.", + "output_type": "error", + "traceback": [ + "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[1;31mModuleNotFoundError\u001b[0m Traceback (most recent call last)", + "\u001b[1;32m~\\Documents\\Hackathon_pandas\\pandas-rmunjal29\\pandas\\__init__.py\u001b[0m in \u001b[0;36m\u001b[1;34m\u001b[0m\n\u001b[0;32m 25\u001b[0m \u001b[1;32mtry\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m---> 26\u001b[1;33m from pandas._libs import (hashtable as _hashtable,\n\u001b[0m\u001b[0;32m 27\u001b[0m \u001b[0mlib\u001b[0m \u001b[1;32mas\u001b[0m \u001b[0m_lib\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", + "\u001b[1;32m~\\Documents\\Hackathon_pandas\\pandas-rmunjal29\\pandas\\_libs\\__init__.py\u001b[0m in \u001b[0;36m\u001b[1;34m\u001b[0m\n\u001b[0;32m 3\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 4\u001b[1;33m \u001b[1;32mfrom\u001b[0m \u001b[1;33m.\u001b[0m\u001b[0mtslib\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0miNaT\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mNaT\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mTimestamp\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mTimedelta\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mOutOfBoundsDatetime\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 5\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n", + "\u001b[1;32mpandas\\_libs\\tslibs\\c_timestamp.pxd\u001b[0m in \u001b[0;36minit pandas._libs.tslib\u001b[1;34m()\u001b[0m\n", + "\u001b[1;32mpandas\\_libs\\tslibs\\c_timestamp.pyx\u001b[0m in \u001b[0;36minit pandas._libs.tslibs.c_timestamp\u001b[1;34m()\u001b[0m\n", + "\u001b[1;32mpandas\\_libs\\tslibs\\tzconversion.pyx\u001b[0m in \u001b[0;36minit pandas._libs.tslibs.tzconversion\u001b[1;34m()\u001b[0m\n", + "\u001b[1;32m~\\Documents\\Hackathon_pandas\\pandas-rmunjal29\\pandas\\_libs\\tslibs\\timedeltas.pyx\u001b[0m in \u001b[0;36minit pandas._libs.tslibs.timedeltas\u001b[1;34m()\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[1;31m# -*- coding: utf-8 -*-\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 2\u001b[0m \u001b[1;31m# cython: profile=False\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 3\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0mcollections\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", + "\u001b[1;32m~\\Documents\\Hackathon_pandas\\pandas-rmunjal29\\pandas\\_libs\\tslibs\\conversion.pxd\u001b[0m in \u001b[0;36minit pandas._libs.tslibs.offsets\u001b[1;34m()\u001b[0m\n\u001b[0;32m 9\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m---> 10\u001b[1;33m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 11\u001b[0m \u001b[0mcdef\u001b[0m \u001b[1;32mclass\u001b[0m \u001b[0m_TSObject\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", + "\u001b[1;32m~\\Documents\\Hackathon_pandas\\pandas-rmunjal29\\pandas\\_libs\\tslibs\\conversion.pyx\u001b[0m in \u001b[0;36minit pandas._libs.tslibs.conversion\u001b[1;34m()\u001b[0m\n\u001b[0;32m 33\u001b[0m is_integer_object, is_float_object, is_array)\n\u001b[1;32m---> 34\u001b[1;33m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 35\u001b[0m \u001b[1;32mfrom\u001b[0m \u001b[0mtimedeltas\u001b[0m \u001b[0mcimport\u001b[0m \u001b[0mcast_from_unit\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", + "\u001b[1;32m~\\Documents\\Hackathon_pandas\\pandas-rmunjal29\\pandas\\_libs\\tslibs\\parsing.pyx\u001b[0m in \u001b[0;36minit pandas._libs.tslibs.parsing\u001b[1;34m()\u001b[0m\n\u001b[0;32m 33\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m---> 34\u001b[1;33m \u001b[1;31m# dateutil compat\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 35\u001b[0m from dateutil.tz import (tzoffset,\n", + "\u001b[1;31mModuleNotFoundError\u001b[0m: No module named 'pandas._config'", + "\nDuring handling of the above exception, another exception occurred:\n", + "\u001b[1;31mImportError\u001b[0m Traceback (most recent call last)", + "\u001b[1;32m\u001b[0m in \u001b[0;36m\u001b[1;34m\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[1;32mimport\u001b[0m \u001b[0mpandas\u001b[0m \u001b[1;32mas\u001b[0m \u001b[0mpd\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m", + "\u001b[1;32m~\\Documents\\Hackathon_pandas\\pandas-rmunjal29\\pandas\\__init__.py\u001b[0m in \u001b[0;36m\u001b[1;34m\u001b[0m\n\u001b[0;32m 33\u001b[0m \u001b[1;34m\"pandas from the source directory, you may need to run \"\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 34\u001b[0m \u001b[1;34m\"'python setup.py build_ext --inplace --force' to build \"\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m---> 35\u001b[1;33m \"the C extensions first.\".format(module))\n\u001b[0m\u001b[0;32m 36\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 37\u001b[0m \u001b[1;32mfrom\u001b[0m \u001b[0mdatetime\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0mdatetime\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", + "\u001b[1;31mImportError\u001b[0m: C extension: No module named 'pandas._config' not built. If you want to import pandas from the source directory, you may need to run 'python setup.py build_ext --inplace --force' to build the C extensions first." + ] + } + ], + "source": [ + "import pandas as pd" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.7.3" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/pandas/core/series.py b/pandas/core/series.py index 3f04970ee4e58..b67d139aa400a 100644 --- a/pandas/core/series.py +++ b/pandas/core/series.py @@ -172,8 +172,12 @@ class Series(base.IndexOpsMixin, generic.NDFrame): See the :ref:`user guide ` for more usages. copy : bool, default False Copy input data. + name : str, optional + The name argument allows to give name to a Series object, i.e. to the column. + If name isn't given, it will be named automatically. + fastpath : optional + Will be deprecated soon """ - _metadata = ["name"] _accessors = {"dt", "cat", "str", "sparse"} # tolist is not actually deprecated, just suppressed in the __dir__ From be16f411842c63eb1da571ba4192344c85f75ef4 Mon Sep 17 00:00:00 2001 From: Ritika Munjal Date: Sat, 17 Aug 2019 11:53:51 -0500 Subject: [PATCH 2/6] added names, fastpath parameters explaination to pandas.Series --- pandas/core/series.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pandas/core/series.py b/pandas/core/series.py index b67d139aa400a..cdf94cb35f2ac 100644 --- a/pandas/core/series.py +++ b/pandas/core/series.py @@ -170,13 +170,13 @@ class Series(base.IndexOpsMixin, generic.NDFrame): Data type for the output Series. If not specified, this will be inferred from `data`. See the :ref:`user guide ` for more usages. - copy : bool, default False - Copy input data. name : str, optional The name argument allows to give name to a Series object, i.e. to the column. If name isn't given, it will be named automatically. - fastpath : optional - Will be deprecated soon + copy : bool, default False + Copy input data. + fastpath : str, optional + Will be deprecated soon. """ _metadata = ["name"] _accessors = {"dt", "cat", "str", "sparse"} From baab4cd0810d18cf619ec71bfaa08dc4e14b1453 Mon Sep 17 00:00:00 2001 From: Ritika Munjal Date: Sat, 17 Aug 2019 12:43:33 -0500 Subject: [PATCH 3/6] linting errors --- pandas/core/series.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pandas/core/series.py b/pandas/core/series.py index cdf94cb35f2ac..4325eb45cbb0f 100644 --- a/pandas/core/series.py +++ b/pandas/core/series.py @@ -177,6 +177,7 @@ class Series(base.IndexOpsMixin, generic.NDFrame): Copy input data. fastpath : str, optional Will be deprecated soon. + """ _metadata = ["name"] _accessors = {"dt", "cat", "str", "sparse"} From fcc66ca20a5b83c92cd8a9a39a856a284afc28b1 Mon Sep 17 00:00:00 2001 From: Ritika Munjal Date: Sat, 17 Aug 2019 12:54:23 -0500 Subject: [PATCH 4/6] linting resolved --- pandas/core/series.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/core/series.py b/pandas/core/series.py index 4325eb45cbb0f..0980b075934fe 100644 --- a/pandas/core/series.py +++ b/pandas/core/series.py @@ -177,8 +177,8 @@ class Series(base.IndexOpsMixin, generic.NDFrame): Copy input data. fastpath : str, optional Will be deprecated soon. - """ + _metadata = ["name"] _accessors = {"dt", "cat", "str", "sparse"} # tolist is not actually deprecated, just suppressed in the __dir__ From af44a7f6e2f621c67642864fe8f3b1818754537c Mon Sep 17 00:00:00 2001 From: William Ayd Date: Fri, 25 Oct 2019 10:25:25 -0700 Subject: [PATCH 5/6] Delete Untitled.ipynb --- Untitled.ipynb | 59 -------------------------------------------------- 1 file changed, 59 deletions(-) delete mode 100644 Untitled.ipynb diff --git a/Untitled.ipynb b/Untitled.ipynb deleted file mode 100644 index f825e9726d68f..0000000000000 --- a/Untitled.ipynb +++ /dev/null @@ -1,59 +0,0 @@ -{ - "cells": [ - { - "cell_type": "code", - "execution_count": 1, - "metadata": {}, - "outputs": [ - { - "ename": "ImportError", - "evalue": "C extension: No module named 'pandas._config' not built. If you want to import pandas from the source directory, you may need to run 'python setup.py build_ext --inplace --force' to build the C extensions first.", - "output_type": "error", - "traceback": [ - "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", - "\u001b[1;31mModuleNotFoundError\u001b[0m Traceback (most recent call last)", - "\u001b[1;32m~\\Documents\\Hackathon_pandas\\pandas-rmunjal29\\pandas\\__init__.py\u001b[0m in \u001b[0;36m\u001b[1;34m\u001b[0m\n\u001b[0;32m 25\u001b[0m \u001b[1;32mtry\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m---> 26\u001b[1;33m from pandas._libs import (hashtable as _hashtable,\n\u001b[0m\u001b[0;32m 27\u001b[0m \u001b[0mlib\u001b[0m \u001b[1;32mas\u001b[0m \u001b[0m_lib\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", - "\u001b[1;32m~\\Documents\\Hackathon_pandas\\pandas-rmunjal29\\pandas\\_libs\\__init__.py\u001b[0m in \u001b[0;36m\u001b[1;34m\u001b[0m\n\u001b[0;32m 3\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 4\u001b[1;33m \u001b[1;32mfrom\u001b[0m \u001b[1;33m.\u001b[0m\u001b[0mtslib\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0miNaT\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mNaT\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mTimestamp\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mTimedelta\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mOutOfBoundsDatetime\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 5\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n", - "\u001b[1;32mpandas\\_libs\\tslibs\\c_timestamp.pxd\u001b[0m in \u001b[0;36minit pandas._libs.tslib\u001b[1;34m()\u001b[0m\n", - "\u001b[1;32mpandas\\_libs\\tslibs\\c_timestamp.pyx\u001b[0m in \u001b[0;36minit pandas._libs.tslibs.c_timestamp\u001b[1;34m()\u001b[0m\n", - "\u001b[1;32mpandas\\_libs\\tslibs\\tzconversion.pyx\u001b[0m in \u001b[0;36minit pandas._libs.tslibs.tzconversion\u001b[1;34m()\u001b[0m\n", - "\u001b[1;32m~\\Documents\\Hackathon_pandas\\pandas-rmunjal29\\pandas\\_libs\\tslibs\\timedeltas.pyx\u001b[0m in \u001b[0;36minit pandas._libs.tslibs.timedeltas\u001b[1;34m()\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[1;31m# -*- coding: utf-8 -*-\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 2\u001b[0m \u001b[1;31m# cython: profile=False\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 3\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0mcollections\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", - "\u001b[1;32m~\\Documents\\Hackathon_pandas\\pandas-rmunjal29\\pandas\\_libs\\tslibs\\conversion.pxd\u001b[0m in \u001b[0;36minit pandas._libs.tslibs.offsets\u001b[1;34m()\u001b[0m\n\u001b[0;32m 9\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m---> 10\u001b[1;33m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 11\u001b[0m \u001b[0mcdef\u001b[0m \u001b[1;32mclass\u001b[0m \u001b[0m_TSObject\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", - "\u001b[1;32m~\\Documents\\Hackathon_pandas\\pandas-rmunjal29\\pandas\\_libs\\tslibs\\conversion.pyx\u001b[0m in \u001b[0;36minit pandas._libs.tslibs.conversion\u001b[1;34m()\u001b[0m\n\u001b[0;32m 33\u001b[0m is_integer_object, is_float_object, is_array)\n\u001b[1;32m---> 34\u001b[1;33m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 35\u001b[0m \u001b[1;32mfrom\u001b[0m \u001b[0mtimedeltas\u001b[0m \u001b[0mcimport\u001b[0m \u001b[0mcast_from_unit\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", - "\u001b[1;32m~\\Documents\\Hackathon_pandas\\pandas-rmunjal29\\pandas\\_libs\\tslibs\\parsing.pyx\u001b[0m in \u001b[0;36minit pandas._libs.tslibs.parsing\u001b[1;34m()\u001b[0m\n\u001b[0;32m 33\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m---> 34\u001b[1;33m \u001b[1;31m# dateutil compat\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 35\u001b[0m from dateutil.tz import (tzoffset,\n", - "\u001b[1;31mModuleNotFoundError\u001b[0m: No module named 'pandas._config'", - "\nDuring handling of the above exception, another exception occurred:\n", - "\u001b[1;31mImportError\u001b[0m Traceback (most recent call last)", - "\u001b[1;32m\u001b[0m in \u001b[0;36m\u001b[1;34m\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[1;32mimport\u001b[0m \u001b[0mpandas\u001b[0m \u001b[1;32mas\u001b[0m \u001b[0mpd\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m", - "\u001b[1;32m~\\Documents\\Hackathon_pandas\\pandas-rmunjal29\\pandas\\__init__.py\u001b[0m in \u001b[0;36m\u001b[1;34m\u001b[0m\n\u001b[0;32m 33\u001b[0m \u001b[1;34m\"pandas from the source directory, you may need to run \"\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 34\u001b[0m \u001b[1;34m\"'python setup.py build_ext --inplace --force' to build \"\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m---> 35\u001b[1;33m \"the C extensions first.\".format(module))\n\u001b[0m\u001b[0;32m 36\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 37\u001b[0m \u001b[1;32mfrom\u001b[0m \u001b[0mdatetime\u001b[0m \u001b[1;32mimport\u001b[0m \u001b[0mdatetime\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", - "\u001b[1;31mImportError\u001b[0m: C extension: No module named 'pandas._config' not built. If you want to import pandas from the source directory, you may need to run 'python setup.py build_ext --inplace --force' to build the C extensions first." - ] - } - ], - "source": [ - "import pandas as pd" - ] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.7.3" - } - }, - "nbformat": 4, - "nbformat_minor": 2 -} From 6c7a2b921b3c67dde2a87d7e7c3a6cd2be2d9904 Mon Sep 17 00:00:00 2001 From: William Ayd Date: Thu, 7 Nov 2019 16:20:45 -0800 Subject: [PATCH 6/6] Update series.py --- pandas/core/series.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/pandas/core/series.py b/pandas/core/series.py index 0980b075934fe..b6fc9ae82048b 100644 --- a/pandas/core/series.py +++ b/pandas/core/series.py @@ -171,12 +171,9 @@ class Series(base.IndexOpsMixin, generic.NDFrame): inferred from `data`. See the :ref:`user guide ` for more usages. name : str, optional - The name argument allows to give name to a Series object, i.e. to the column. - If name isn't given, it will be named automatically. + The name to give to the Series. copy : bool, default False Copy input data. - fastpath : str, optional - Will be deprecated soon. """ _metadata = ["name"]