From 4b1fd8759bef5c26043c46103b05af71ea4967d9 Mon Sep 17 00:00:00 2001 From: Tom Augspurger Date: Thu, 3 Jan 2019 15:28:55 -0600 Subject: [PATCH 01/10] added arrays --- doc/source/api/arrays.rst | 402 +++++++++++++++++++++++++++++++++++++ doc/source/api/index.rst | 2 +- doc/source/api/scalars.rst | 204 ------------------- doc/source/api/series.rst | 88 -------- doc/source/basics.rst | 2 +- 5 files changed, 404 insertions(+), 294 deletions(-) create mode 100644 doc/source/api/arrays.rst diff --git a/doc/source/api/arrays.rst b/doc/source/api/arrays.rst new file mode 100644 index 0000000000000..4bf9b7e3acb17 --- /dev/null +++ b/doc/source/api/arrays.rst @@ -0,0 +1,402 @@ +{{ header }} + +.. _api: + +Pandas extends NumPy's type system in several places. + +=================== ========================= ================== ====================== +Kind of Data Data Type Scalar Array +=================== ========================= ================== ====================== +tz-aware datetime :class:`DatetimeTZDtype` :class:`Timestamp` :ref:`api.datetime` +timedetlas (none) :class:`Timedelta` :ref:`api.timedelta` +period (time spans) :class:`PeriodDtype` :class:`Period` :ref:`api.period` +intervals :class:`IntervalDtype` :class:`Interval` :ref:`api.interval` +nullable integer :class:`Int64Dtype`, ... (none) :ref:`api.integer_na` +Categorical :class:`CategoricalDtype` (none) :ref:`api.categorical` +sparse :class:`SparseDtype` (none) :ref:`api.sparse` +=================== ========================= ================== ====================== + +.. _api.datetime: + +============= +Datetime Data +============= + +NumPy cannot natively represent timezone-aware datetimes. Pandas supports this +with the :class:`DatetimeArray` extension type, which can hold timezone-naive +or timezone-aware values. + +:class:`Timestamp` is the scalar type for datetime data. + +.. autosummary:: + :toctree: generated/ + + Timestamp + +Properties +~~~~~~~~~~ +.. autosummary:: + :toctree: generated/ + + Timestamp.asm8 + Timestamp.day + Timestamp.dayofweek + Timestamp.dayofyear + Timestamp.days_in_month + Timestamp.daysinmonth + Timestamp.fold + Timestamp.hour + Timestamp.is_leap_year + Timestamp.is_month_end + Timestamp.is_month_start + Timestamp.is_quarter_end + Timestamp.is_quarter_start + Timestamp.is_year_end + Timestamp.is_year_start + Timestamp.max + Timestamp.microsecond + Timestamp.min + Timestamp.minute + Timestamp.month + Timestamp.nanosecond + Timestamp.quarter + Timestamp.resolution + Timestamp.second + Timestamp.tz + Timestamp.tzinfo + Timestamp.value + Timestamp.week + Timestamp.weekofyear + Timestamp.year + +Methods +~~~~~~~ +.. autosummary:: + :toctree: generated/ + + Timestamp.astimezone + Timestamp.ceil + Timestamp.combine + Timestamp.ctime + Timestamp.date + Timestamp.day_name + Timestamp.dst + Timestamp.floor + Timestamp.freq + Timestamp.freqstr + Timestamp.fromordinal + Timestamp.fromtimestamp + Timestamp.isocalendar + Timestamp.isoformat + Timestamp.isoweekday + Timestamp.month_name + Timestamp.normalize + Timestamp.now + Timestamp.replace + Timestamp.round + Timestamp.strftime + Timestamp.strptime + Timestamp.time + Timestamp.timestamp + Timestamp.timetuple + Timestamp.timetz + Timestamp.to_datetime64 + Timestamp.to_julian_date + Timestamp.to_period + Timestamp.to_pydatetime + Timestamp.today + Timestamp.toordinal + Timestamp.tz_convert + Timestamp.tz_localize + Timestamp.tzname + Timestamp.utcfromtimestamp + Timestamp.utcnow + Timestamp.utcoffset + Timestamp.utctimetuple + Timestamp.weekday + +A collection of timestamps may be stored in an :class:`IntervalArray`. +:class:`DatetimeTZDtype` is the ``ExtensionDtype`` for timezone-aware data. +Timezone-naive data uses ``np.dtype("datetime64[ns]")`` for the array dtype. +If the data are tz-aware, then every value must have the same timezone. + +.. autosummary:: + :toctree: generated/ + + arrays.DatetimeArray + DatetimeTZDtype + +.. _api.timedelta: + +============== +Timedelta Data +============== + +NumPy can natively represent timedeltas. Pandas provides :class:`Timedelta` +for symmetry with :class:`Timestamp`. + +.. autosummary:: + :toctree: generated/ + + Timedelta + +Properties +~~~~~~~~~~ +.. autosummary:: + :toctree: generated/ + + Timedelta.asm8 + Timedelta.components + Timedelta.days + Timedelta.delta + Timedelta.freq + Timedelta.is_populated + Timedelta.max + Timedelta.microseconds + Timedelta.min + Timedelta.nanoseconds + Timedelta.resolution + Timedelta.seconds + Timedelta.value + Timedelta.view + +Methods +~~~~~~~ +.. autosummary:: + :toctree: generated/ + + Timedelta.ceil + Timedelta.floor + Timedelta.isoformat + Timedelta.round + Timedelta.to_pytimedelta + Timedelta.to_timedelta64 + Timedelta.total_seconds + +A collection of timedeltas may be stored in a :class:`TimedeltaArray`. + +.. autosumarry:: + :toctree: generated/ + + arrays.TimedeltaArray + +.. _api.period: + +============= +Timespan Data +============= + +Pandas represents spans of times as :class:`Period` objects. + +Period +------ +.. autosummary:: + :toctree: generated/ + + Period + +Properties +~~~~~~~~~~ +.. autosummary:: + :toctree: generated/ + + Period.day + Period.dayofweek + Period.dayofyear + Period.days_in_month + Period.daysinmonth + Period.end_time + Period.freq + Period.freqstr + Period.hour + Period.is_leap_year + Period.minute + Period.month + Period.ordinal + Period.quarter + Period.qyear + Period.second + Period.start_time + Period.week + Period.weekday + Period.weekofyear + Period.year + +Methods +~~~~~~~ +.. autosummary:: + :toctree: generated/ + + Period.asfreq + Period.now + Period.strftime + Period.to_timestamp + +:class:`arrays.PeriodArray` is the array type for scalar :class:`Period` objects + +.. autosummary:: + :toctree: generated/ + + arrays.DatetimeArray + PeriodDtype + +.. _api.interval: + +============= +Interval Data +============= + +Arbitrary intervals can be represented as :class:`Interval` objects. + +.. autosummary:: + :toctree: generated/ + + Interval + +Properties +~~~~~~~~~~ +.. autosummary:: + :toctree: generated/ + + Interval.closed + Interval.closed_left + Interval.closed_right + Interval.left + Interval.length + Interval.mid + Interval.open_left + Interval.open_right + Interval.overlaps + Interval.right + +A collection of intervals may be stored in an :class:`IntervalArray`. + +.. autosummary:: + :toctree: generated/ + + IntervalArray + IntervalDtype + +.. _api.integer_na: + +================ +Nullable Integer +================ + +:class:`numpy.ndarray` cannot natively represent integer-data with missing values. +Pandas provides this through :class:`arrays.IntegerArray`. + +.. autosummary:: + :toctree: generated/ + + arrays.IntegerArray + Int8Dtype + Int16Dtype + Int32Dtype + Int64Dtype + UInt8Dtype + UInt16Dtype + UInt32Dtype + UInt64Dtype + +.. _api.categorical: + +================ +Categorical Data +================ + +Pandas defines a custom data type for representing data that can take only a +limited, fixed set of values. The dtype of a ``Categorical`` can be described by +a :class:`pandas.api.types.CategoricalDtype`. + +.. autosummary:: + :toctree: generated/ + :template: autosummary/class_without_autosummary.rst + + api.types.CategoricalDtype + +.. autosummary:: + :toctree: generated/ + + api.types.CategoricalDtype.categories + api.types.CategoricalDtype.ordered + +Categorical data can be stored in a :class:`pandas.Categorical` + +.. autosummary:: + :toctree: generated/ + :template: autosummary/class_without_autosummary.rst + + Categorical + +The alternative :meth:`Categorical.from_codes` constructor can be used when you +have the categories and integer codes already: + +.. autosummary:: + :toctree: generated/ + + Categorical.from_codes + +The dtype information is available on the ``Categorical`` + +.. autosummary:: + :toctree: generated/ + + Categorical.dtype + Categorical.categories + Categorical.ordered + Categorical.codes + +``np.asarray(categorical)`` works by implementing the array interface. Be aware, that this converts +the Categorical back to a NumPy array, so categories and order information is not preserved! + +.. autosummary:: + :toctree: generated/ + + Categorical.__array__ + +A ``Categorical`` can be stored in a ``Series`` or ``DataFrame``. +To create a Series of dtype ``category``, use ``cat = s.astype(dtype)`` or +``Series(..., dtype=dtype)`` where ``dtype`` is either + +* the string ``'category'`` +* an instance of :class:`~pandas.api.types.CategoricalDtype`. + +If the Series is of dtype ``CategoricalDtype``, ``Series.cat`` can be used to change the categorical +data. This accessor is similar to the ``Series.dt`` or ``Series.str`` and has the +following usable methods and properties: + +.. autosummary:: + :toctree: generated/ + :template: autosummary/accessor_attribute.rst + + Series.cat.categories + Series.cat.ordered + Series.cat.codes + +.. autosummary:: + :toctree: generated/ + :template: autosummary/accessor_method.rst + + Series.cat.rename_categories + Series.cat.reorder_categories + Series.cat.add_categories + Series.cat.remove_categories + Series.cat.remove_unused_categories + Series.cat.set_categories + Series.cat.as_ordered + Series.cat.as_unordered + +.. _api.sparse: + +=========== +Sparse Data +=========== + +Data where a single value is repeated many times (e.g. ``0`` or ``NaN``) may +be stored efficiently as a :class:`SparseArray`. + +.. autosummary:: + :toctree: generated/ + + SparseArray diff --git a/doc/source/api/index.rst b/doc/source/api/index.rst index 0bd89fc826a21..e4d118e278128 100644 --- a/doc/source/api/index.rst +++ b/doc/source/api/index.rst @@ -26,9 +26,9 @@ public functions related to data types in pandas. general_functions series frame + arrays panel indexing - scalars offset_frequency window groupby diff --git a/doc/source/api/scalars.rst b/doc/source/api/scalars.rst index 662a4d5a8fcfe..e69de29bb2d1d 100644 --- a/doc/source/api/scalars.rst +++ b/doc/source/api/scalars.rst @@ -1,204 +0,0 @@ -{{ header }} - -.. _api.scalars: - -======= -Scalars -======= -.. currentmodule:: pandas - -Period ------- -.. autosummary:: - :toctree: generated/ - - Period - -Properties -~~~~~~~~~~ -.. autosummary:: - :toctree: generated/ - - Period.day - Period.dayofweek - Period.dayofyear - Period.days_in_month - Period.daysinmonth - Period.end_time - Period.freq - Period.freqstr - Period.hour - Period.is_leap_year - Period.minute - Period.month - Period.ordinal - Period.quarter - Period.qyear - Period.second - Period.start_time - Period.week - Period.weekday - Period.weekofyear - Period.year - -Methods -~~~~~~~ -.. autosummary:: - :toctree: generated/ - - Period.asfreq - Period.now - Period.strftime - Period.to_timestamp - -Timestamp ---------- -.. autosummary:: - :toctree: generated/ - - Timestamp - -Properties -~~~~~~~~~~ -.. autosummary:: - :toctree: generated/ - - Timestamp.asm8 - Timestamp.day - Timestamp.dayofweek - Timestamp.dayofyear - Timestamp.days_in_month - Timestamp.daysinmonth - Timestamp.fold - Timestamp.hour - Timestamp.is_leap_year - Timestamp.is_month_end - Timestamp.is_month_start - Timestamp.is_quarter_end - Timestamp.is_quarter_start - Timestamp.is_year_end - Timestamp.is_year_start - Timestamp.max - Timestamp.microsecond - Timestamp.min - Timestamp.minute - Timestamp.month - Timestamp.nanosecond - Timestamp.quarter - Timestamp.resolution - Timestamp.second - Timestamp.tz - Timestamp.tzinfo - Timestamp.value - Timestamp.week - Timestamp.weekofyear - Timestamp.year - -Methods -~~~~~~~ -.. autosummary:: - :toctree: generated/ - - Timestamp.astimezone - Timestamp.ceil - Timestamp.combine - Timestamp.ctime - Timestamp.date - Timestamp.day_name - Timestamp.dst - Timestamp.floor - Timestamp.freq - Timestamp.freqstr - Timestamp.fromordinal - Timestamp.fromtimestamp - Timestamp.isocalendar - Timestamp.isoformat - Timestamp.isoweekday - Timestamp.month_name - Timestamp.normalize - Timestamp.now - Timestamp.replace - Timestamp.round - Timestamp.strftime - Timestamp.strptime - Timestamp.time - Timestamp.timestamp - Timestamp.timetuple - Timestamp.timetz - Timestamp.to_datetime64 - Timestamp.to_julian_date - Timestamp.to_period - Timestamp.to_pydatetime - Timestamp.today - Timestamp.toordinal - Timestamp.tz_convert - Timestamp.tz_localize - Timestamp.tzname - Timestamp.utcfromtimestamp - Timestamp.utcnow - Timestamp.utcoffset - Timestamp.utctimetuple - Timestamp.weekday - -Interval --------- -.. autosummary:: - :toctree: generated/ - - Interval - -Properties -~~~~~~~~~~ -.. autosummary:: - :toctree: generated/ - - Interval.closed - Interval.closed_left - Interval.closed_right - Interval.left - Interval.length - Interval.mid - Interval.open_left - Interval.open_right - Interval.overlaps - Interval.right - -Timedelta ---------- -.. autosummary:: - :toctree: generated/ - - Timedelta - -Properties -~~~~~~~~~~ -.. autosummary:: - :toctree: generated/ - - Timedelta.asm8 - Timedelta.components - Timedelta.days - Timedelta.delta - Timedelta.freq - Timedelta.is_populated - Timedelta.max - Timedelta.microseconds - Timedelta.min - Timedelta.nanoseconds - Timedelta.resolution - Timedelta.seconds - Timedelta.value - Timedelta.view - -Methods -~~~~~~~ -.. autosummary:: - :toctree: generated/ - - Timedelta.ceil - Timedelta.floor - Timedelta.isoformat - Timedelta.round - Timedelta.to_pytimedelta - Timedelta.to_timedelta64 - Timedelta.total_seconds diff --git a/doc/source/api/series.rst b/doc/source/api/series.rst index 7d5e6037b012a..56634c700041e 100644 --- a/doc/source/api/series.rst +++ b/doc/source/api/series.rst @@ -456,92 +456,6 @@ Pandas and third-party libraries can extend NumPy's type system (see :ref:`exten array -.. _api.categorical: - -Categorical -~~~~~~~~~~~ - -Pandas defines a custom data type for representing data that can take only a -limited, fixed set of values. The dtype of a ``Categorical`` can be described by -a :class:`pandas.api.types.CategoricalDtype`. - -.. autosummary:: - :toctree: generated/ - :template: autosummary/class_without_autosummary.rst - - api.types.CategoricalDtype - -.. autosummary:: - :toctree: generated/ - - api.types.CategoricalDtype.categories - api.types.CategoricalDtype.ordered - -Categorical data can be stored in a :class:`pandas.Categorical` - -.. autosummary:: - :toctree: generated/ - :template: autosummary/class_without_autosummary.rst - - Categorical - -The alternative :meth:`Categorical.from_codes` constructor can be used when you -have the categories and integer codes already: - -.. autosummary:: - :toctree: generated/ - - Categorical.from_codes - -The dtype information is available on the ``Categorical`` - -.. autosummary:: - :toctree: generated/ - - Categorical.dtype - Categorical.categories - Categorical.ordered - Categorical.codes - -``np.asarray(categorical)`` works by implementing the array interface. Be aware, that this converts -the Categorical back to a NumPy array, so categories and order information is not preserved! - -.. autosummary:: - :toctree: generated/ - - Categorical.__array__ - -A ``Categorical`` can be stored in a ``Series`` or ``DataFrame``. -To create a Series of dtype ``category``, use ``cat = s.astype(dtype)`` or -``Series(..., dtype=dtype)`` where ``dtype`` is either - -* the string ``'category'`` -* an instance of :class:`~pandas.api.types.CategoricalDtype`. - -If the Series is of dtype ``CategoricalDtype``, ``Series.cat`` can be used to change the categorical -data. This accessor is similar to the ``Series.dt`` or ``Series.str`` and has the -following usable methods and properties: - -.. autosummary:: - :toctree: generated/ - :template: autosummary/accessor_attribute.rst - - Series.cat.categories - Series.cat.ordered - Series.cat.codes - -.. autosummary:: - :toctree: generated/ - :template: autosummary/accessor_method.rst - - Series.cat.rename_categories - Series.cat.reorder_categories - Series.cat.add_categories - Series.cat.remove_categories - Series.cat.remove_unused_categories - Series.cat.set_categories - Series.cat.as_ordered - Series.cat.as_unordered Plotting -------- @@ -594,8 +508,6 @@ Serialization / IO / Conversion Series.to_clipboard Series.to_latex -Sparse ------- .. autosummary:: :toctree: generated/ diff --git a/doc/source/basics.rst b/doc/source/basics.rst index 8dca000dfa969..48093ab84b2f3 100644 --- a/doc/source/basics.rst +++ b/doc/source/basics.rst @@ -1968,7 +1968,7 @@ documentation sections for more on each type. =================== ========================= ================== ============================= ============================= Kind of Data Data Type Scalar Array Documentation =================== ========================= ================== ============================= ============================= -tz-aware datetime :class:`DatetimeArray` :class:`Timestamp` :class:`arrays.DatetimeArray` :ref:`timeseries.timezone` +tz-aware datetime :class:`DatetimeTZDtype` :class:`Timestamp` :class:`arrays.DatetimeArray` :ref:`timeseries.timezone` Categorical :class:`CategoricalDtype` (none) :class:`Categorical` :ref:`categorical` period (time spans) :class:`PeriodDtype` :class:`Period` :class:`arrays.PeriodArray` :ref:`timeseries.periods` sparse :class:`SparseDtype` (none) :class:`arrays.SparseArray` :ref:`sparse` From f724d710e1fc1df4011da43d31e978e34267a2f8 Mon Sep 17 00:00:00 2001 From: Tom Augspurger Date: Fri, 4 Jan 2019 15:01:25 -0600 Subject: [PATCH 02/10] fixups --- doc/source/api/arrays.rst | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/doc/source/api/arrays.rst b/doc/source/api/arrays.rst index 4bf9b7e3acb17..bba5a5677218d 100644 --- a/doc/source/api/arrays.rst +++ b/doc/source/api/arrays.rst @@ -5,7 +5,7 @@ Pandas extends NumPy's type system in several places. =================== ========================= ================== ====================== -Kind of Data Data Type Scalar Array +Kind of Data Pandas Data Type Scalar Array =================== ========================= ================== ====================== tz-aware datetime :class:`DatetimeTZDtype` :class:`Timestamp` :ref:`api.datetime` timedetlas (none) :class:`Timedelta` :ref:`api.timedelta` @@ -16,6 +16,9 @@ Categorical :class:`CategoricalDtype` (none) :ref:`api.categ sparse :class:`SparseDtype` (none) :ref:`api.sparse` =================== ========================= ================== ====================== +Each of these arrays may be stored in a :class:`Index`, :class:`Series`, or as +a column in a :class:`DataFrame`. + .. _api.datetime: ============= @@ -23,7 +26,7 @@ Datetime Data ============= NumPy cannot natively represent timezone-aware datetimes. Pandas supports this -with the :class:`DatetimeArray` extension type, which can hold timezone-naive +with the :class:`arrays.DatetimeArray` extension array, which can hold timezone-naive or timezone-aware values. :class:`Timestamp` is the scalar type for datetime data. @@ -115,9 +118,11 @@ Methods Timestamp.utctimetuple Timestamp.weekday -A collection of timestamps may be stored in an :class:`IntervalArray`. -:class:`DatetimeTZDtype` is the ``ExtensionDtype`` for timezone-aware data. -Timezone-naive data uses ``np.dtype("datetime64[ns]")`` for the array dtype. +A collection of timestamps may be stored in a :class:`arrays.DatetimeArray`. +For timezone-aware data, the ``.dtype`` of a ``DatetimeArray`` is a +:class:`DatetimeTZDtype`. For timezone-naive data, ``np.dtype("datetime64[ns]")`` +is used. + If the data are tz-aware, then every value must have the same timezone. .. autosummary:: @@ -232,7 +237,8 @@ Methods Period.strftime Period.to_timestamp -:class:`arrays.PeriodArray` is the array type for scalar :class:`Period` objects +A collection of timedeltas may be stored in a :class:`arrays.PeriodArray`. +Every period in a ``PeriodArray`` must have the same ``freq``. .. autosummary:: :toctree: generated/ @@ -400,3 +406,4 @@ be stored efficiently as a :class:`SparseArray`. :toctree: generated/ SparseArray + SparseDtype From 4b624b1ac451fcc2b9adb38cadceccee0af863b3 Mon Sep 17 00:00:00 2001 From: Tom Augspurger Date: Fri, 4 Jan 2019 15:08:12 -0600 Subject: [PATCH 03/10] cleanups --- doc/source/api/arrays.rst | 52 +++++++++++++++++++++++---------------- 1 file changed, 31 insertions(+), 21 deletions(-) diff --git a/doc/source/api/arrays.rst b/doc/source/api/arrays.rst index bba5a5677218d..7c578f91e7039 100644 --- a/doc/source/api/arrays.rst +++ b/doc/source/api/arrays.rst @@ -1,19 +1,29 @@ {{ header }} -.. _api: +.. _api.arrays: -Pandas extends NumPy's type system in several places. +============= +Pandas Arrays +============= + +.. currentmodule:: pandas + +For most data types, pandas uses NumPy arrays as the concrete +objects contained with a :class:`Index`, :class:`Series`, or +:class:`DataFrame`. + +For some data types, pandas extends NumPy's type system. =================== ========================= ================== ====================== Kind of Data Pandas Data Type Scalar Array =================== ========================= ================== ====================== -tz-aware datetime :class:`DatetimeTZDtype` :class:`Timestamp` :ref:`api.datetime` -timedetlas (none) :class:`Timedelta` :ref:`api.timedelta` -period (time spans) :class:`PeriodDtype` :class:`Period` :ref:`api.period` -intervals :class:`IntervalDtype` :class:`Interval` :ref:`api.interval` -nullable integer :class:`Int64Dtype`, ... (none) :ref:`api.integer_na` +TZ-aware datetime :class:`DatetimeTZDtype` :class:`Timestamp` :ref:`api.datetime` +Timedeltas (none) :class:`Timedelta` :ref:`api.timedelta` +Period (time spans) :class:`PeriodDtype` :class:`Period` :ref:`api.period` +Intervals :class:`IntervalDtype` :class:`Interval` :ref:`api.interval` +Nullable Integer :class:`Int64Dtype`, ... (none) :ref:`api.integer_na` Categorical :class:`CategoricalDtype` (none) :ref:`api.categorical` -sparse :class:`SparseDtype` (none) :ref:`api.sparse` +Sparse :class:`SparseDtype` (none) :ref:`api.sparse` =================== ========================= ================== ====================== Each of these arrays may be stored in a :class:`Index`, :class:`Series`, or as @@ -255,25 +265,25 @@ Interval Data Arbitrary intervals can be represented as :class:`Interval` objects. .. autosummary:: - :toctree: generated/ + :toctree: generated/ Interval Properties ~~~~~~~~~~ .. autosummary:: - :toctree: generated/ - - Interval.closed - Interval.closed_left - Interval.closed_right - Interval.left - Interval.length - Interval.mid - Interval.open_left - Interval.open_right - Interval.overlaps - Interval.right + :toctree: generated/ + + Interval.closed + Interval.closed_left + Interval.closed_right + Interval.left + Interval.length + Interval.mid + Interval.open_left + Interval.open_right + Interval.overlaps + Interval.right A collection of intervals may be stored in an :class:`IntervalArray`. From f0e3c8edcec4156dfe9640cc5be8e4bf740205c3 Mon Sep 17 00:00:00 2001 From: Tom Augspurger Date: Fri, 4 Jan 2019 15:11:52 -0600 Subject: [PATCH 04/10] Fixup --- doc/source/api/series.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/source/api/series.rst b/doc/source/api/series.rst index 56634c700041e..2b9194acde42e 100644 --- a/doc/source/api/series.rst +++ b/doc/source/api/series.rst @@ -508,6 +508,10 @@ Serialization / IO / Conversion Series.to_clipboard Series.to_latex + +Sparse +------ + .. autosummary:: :toctree: generated/ From 75d299c67f42bdc298938a1f0686d1494392a13d Mon Sep 17 00:00:00 2001 From: Tom Augspurger Date: Fri, 4 Jan 2019 15:27:55 -0600 Subject: [PATCH 05/10] more --- doc/source/api/arrays.rst | 43 +++++++-------- doc/source/api/series.rst | 108 +++++++++++++++++++++++++++++--------- 2 files changed, 100 insertions(+), 51 deletions(-) diff --git a/doc/source/api/arrays.rst b/doc/source/api/arrays.rst index 7c578f91e7039..8787288b70ab1 100644 --- a/doc/source/api/arrays.rst +++ b/doc/source/api/arrays.rst @@ -26,8 +26,19 @@ Categorical :class:`CategoricalDtype` (none) :ref:`api.categ Sparse :class:`SparseDtype` (none) :ref:`api.sparse` =================== ========================= ================== ====================== -Each of these arrays may be stored in a :class:`Index`, :class:`Series`, or as -a column in a :class:`DataFrame`. +.. _api.arrays: + +Arrays +------ + +Pandas and third-party libraries can extend NumPy's type system (see :ref:`extending.extension-types`). +The top-level :meth:`array` method can be used to create a new array, which may be +stored in a :class:`Series`, :class:`Index`, or as a column in a :class:`DataFrame`. + +.. autosummary:: + :toctree: generated/ + + array .. _api.datetime: @@ -379,29 +390,7 @@ To create a Series of dtype ``category``, use ``cat = s.astype(dtype)`` or * an instance of :class:`~pandas.api.types.CategoricalDtype`. If the Series is of dtype ``CategoricalDtype``, ``Series.cat`` can be used to change the categorical -data. This accessor is similar to the ``Series.dt`` or ``Series.str`` and has the -following usable methods and properties: - -.. autosummary:: - :toctree: generated/ - :template: autosummary/accessor_attribute.rst - - Series.cat.categories - Series.cat.ordered - Series.cat.codes - -.. autosummary:: - :toctree: generated/ - :template: autosummary/accessor_method.rst - - Series.cat.rename_categories - Series.cat.reorder_categories - Series.cat.add_categories - Series.cat.remove_categories - Series.cat.remove_unused_categories - Series.cat.set_categories - Series.cat.as_ordered - Series.cat.as_unordered +data. See :ref:`api.series.cat` for more. .. _api.sparse: @@ -417,3 +406,7 @@ be stored efficiently as a :class:`SparseArray`. SparseArray SparseDtype + +The ``Series.sparse`` accessor may be used to access sparse-specific attributes +and methods if the :class:`Series` contains sparse values. See +:ref:`api.series.sparse` for more. diff --git a/doc/source/api/series.rst b/doc/source/api/series.rst index 2b9194acde42e..f1238e9d3f2c3 100644 --- a/doc/source/api/series.rst +++ b/doc/source/api/series.rst @@ -278,14 +278,34 @@ Time series-related Series.tshift Series.slice_shift +Accessors +--------- + +Pandas provides dtype-specific methods under various accessors. +These are separate namespaces within :class:`Series` that only apply +to specific data types. + +=========================== ================================= +Data Type Accessor +=========================== ================================= +Datetime, Timedelta, Period :ref:`dt ` +String :ref:`str ` +Categorical :ref:`cat ` +Sparse :ref:`sparse ` +=========================== ================================= + +.. _api.series.dt: + Datetimelike Properties ------------------------ +~~~~~~~~~~~~~~~~~~~~~~~ + ``Series.dt`` can be used to access the values of the series as datetimelike and return several properties. These can be accessed like ``Series.dt.``. Datetime Properties -~~~~~~~~~~~~~~~~~~~ +^^^^^^^^^^^^^^^^^^^ + .. autosummary:: :toctree: generated/ :template: autosummary/accessor_attribute.rst @@ -320,7 +340,8 @@ Datetime Properties Series.dt.freq Datetime Methods -~~~~~~~~~~~~~~~~ +^^^^^^^^^^^^^^^^ + .. autosummary:: :toctree: generated/ :template: autosummary/accessor_method.rst @@ -338,7 +359,8 @@ Datetime Methods Series.dt.day_name Period Properties -~~~~~~~~~~~~~~~~~ +^^^^^^^^^^^^^^^^^ + .. autosummary:: :toctree: generated/ :template: autosummary/accessor_attribute.rst @@ -348,7 +370,8 @@ Period Properties Series.dt.end_time Timedelta Properties -~~~~~~~~~~~~~~~~~~~~ +^^^^^^^^^^^^^^^^^^^^ + .. autosummary:: :toctree: generated/ :template: autosummary/accessor_attribute.rst @@ -360,7 +383,8 @@ Timedelta Properties Series.dt.components Timedelta Methods -~~~~~~~~~~~~~~~~~ +^^^^^^^^^^^^^^^^^ + .. autosummary:: :toctree: generated/ :template: autosummary/accessor_method.rst @@ -368,8 +392,12 @@ Timedelta Methods Series.dt.to_pytimedelta Series.dt.total_seconds + +.. _api.series.str: + String handling ---------------- +~~~~~~~~~~~~~~~ + ``Series.str`` can be used to access the values of the series as strings and apply several methods to it. These can be accessed like ``Series.str.``. @@ -445,16 +473,58 @@ strings and apply several methods to it. These can be accessed like Series.dt Index.str -.. _api.arrays: +.. _api.series.cat: + +Categorical Accessor +~~~~~~~~~~~~~~~~~~~~ + +Categorical-dtype specific methods and attributes are available under +the ``Series.cat`` accessor. + +.. autosummary:: + :toctree: generated/ + :template: autosummary/accessor_attribute.rst + + Series.cat.categories + Series.cat.ordered + Series.cat.codes + +.. autosummary:: + :toctree: generated/ + :template: autosummary/accessor_method.rst + + Series.cat.rename_categories + Series.cat.reorder_categories + Series.cat.add_categories + Series.cat.remove_categories + Series.cat.remove_unused_categories + Series.cat.set_categories + Series.cat.as_ordered + Series.cat.as_unordered -Arrays ------- -Pandas and third-party libraries can extend NumPy's type system (see :ref:`extending.extension-types`). + +.. _api.series.sparse: + +Sparse Accessor +~~~~~~~~~~~~~~~ + +Sparse-dtype specific methods and attributes are provided under the +``Series.sparse`` accessor. + +.. autosummary:: + :toctree: generated/ + :template: autosummary/accessor_attribute.rst + + Series.sparse.npoints + Series.sparse.density + Series.sparse.fill_value + Series.sparse.sp_values .. autosummary:: :toctree: generated/ - array + Series.sparse.from_coo + Series.sparse.to_coo Plotting @@ -518,17 +588,3 @@ Sparse SparseSeries.to_coo SparseSeries.from_coo -.. autosummary:: - :toctree: generated/ - :template: autosummary/accessor_attribute.rst - - Series.sparse.npoints - Series.sparse.density - Series.sparse.fill_value - Series.sparse.sp_values - -.. autosummary:: - :toctree: generated/ - - Series.sparse.from_coo - Series.sparse.to_coo From 48b42cf5aac556047abd92ed8978780f23244d10 Mon Sep 17 00:00:00 2001 From: Tom Augspurger Date: Fri, 4 Jan 2019 15:38:58 -0600 Subject: [PATCH 06/10] fixup sparse table --- pandas/core/arrays/sparse.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/pandas/core/arrays/sparse.py b/pandas/core/arrays/sparse.py index 7c8f58c9a3203..1c6c9e71dd896 100644 --- a/pandas/core/arrays/sparse.py +++ b/pandas/core/arrays/sparse.py @@ -60,15 +60,15 @@ class SparseDtype(ExtensionDtype): The scalar value not stored in the SparseArray. By default, this depends on `dtype`. - ========== ========== - dtype na_value - ========== ========== - float ``np.nan`` - int ``0`` - bool ``False`` - datetime64 ``pd.NaT`` + =========== ========== + dtype na_value + =========== ========== + float ``np.nan`` + int ``0`` + bool ``False`` + datetime64 ``pd.NaT`` timedelta64 ``pd.NaT`` - ========== ========== + =========== ========== The default value may be overridden by specifying a `fill_value`. """ From b5f95f1fe822e74a99ab401db066b6d432dfe9f6 Mon Sep 17 00:00:00 2001 From: Tom Augspurger Date: Fri, 4 Jan 2019 15:50:17 -0600 Subject: [PATCH 07/10] Warning fixups --- pandas/core/arrays/array_.py | 14 +++++++------- pandas/core/frame.py | 2 +- pandas/core/generic.py | 5 ++--- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/pandas/core/arrays/array_.py b/pandas/core/arrays/array_.py index 9b2240eb62906..32c08e40b8033 100644 --- a/pandas/core/arrays/array_.py +++ b/pandas/core/arrays/array_.py @@ -47,13 +47,13 @@ def array(data, # type: Sequence[object] Currently, pandas will infer an extension dtype for sequences of ============================== ===================================== - scalar type Array Type - ============================= ===================================== - * :class:`pandas.Interval` :class:`pandas.IntervalArray` - * :class:`pandas.Period` :class:`pandas.arrays.PeriodArray` - * :class:`datetime.datetime` :class:`pandas.arrays.DatetimeArray` - * :class:`datetime.timedelta` :class:`pandas.arrays.TimedeltaArray` - ============================= ===================================== + Scalar Type Array Type + ============================== ===================================== + :class:`pandas.Interval` :class:`pandas.IntervalArray` + :class:`pandas.Period` :class:`pandas.arrays.PeriodArray` + :class:`datetime.datetime` :class:`pandas.arrays.DatetimeArray` + :class:`datetime.timedelta` :class:`pandas.arrays.TimedeltaArray` + ============================== ===================================== For all other cases, NumPy's usual inference rules will be used. diff --git a/pandas/core/frame.py b/pandas/core/frame.py index a50def7357826..778a679457926 100644 --- a/pandas/core/frame.py +++ b/pandas/core/frame.py @@ -6978,7 +6978,7 @@ def corr(self, method='pearson', min_periods=1): cats 0.3 1.0 See Also - ------- + -------- DataFrame.corrwith Series.corr """ diff --git a/pandas/core/generic.py b/pandas/core/generic.py index d0555bd2e44b1..5c10ecf2556a8 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -9250,10 +9250,9 @@ def tz_localize(self, tz, axis=0, level=None, copy=True, - 'NaT' will return NaT where there are ambiguous times - 'raise' will raise an AmbiguousTimeError if there are ambiguous times - nonexistent : 'shift_forward', 'shift_backward, 'NaT', timedelta, - default 'raise' + nonexistent : str, default 'raise' A nonexistent time does not exist in a particular timezone - where clocks moved forward due to DST. + where clocks moved forward due to DST. Valid valuse are: - 'shift_forward' will shift the nonexistent time forward to the closest existing time From 46f79877327ae0b43ee005e347ea76a0931f011b Mon Sep 17 00:00:00 2001 From: Tom Augspurger Date: Fri, 4 Jan 2019 15:57:21 -0600 Subject: [PATCH 08/10] update tz_localize description --- pandas/core/generic.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pandas/core/generic.py b/pandas/core/generic.py index 5c10ecf2556a8..b3c14bac91f17 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -9223,7 +9223,10 @@ def _tz_convert(ax, tz): def tz_localize(self, tz, axis=0, level=None, copy=True, ambiguous='raise', nonexistent='raise'): """ - Localize tz-naive TimeSeries to target time zone. + Localize tz-naive index of a Series or DataFrame to target time zone. + + This operation localizes the Index. To localize the values in a + timezone-naive Series, use :meth:`Series.dt.tz_localize`. Parameters ---------- @@ -9267,6 +9270,8 @@ def tz_localize(self, tz, axis=0, level=None, copy=True, Returns ------- + Series or DataFrame + Same type as the input. Raises ------ From a5ac93d995a7928eaa800dbd28203d14b2545530 Mon Sep 17 00:00:00 2001 From: Tom Augspurger Date: Fri, 4 Jan 2019 15:57:31 -0600 Subject: [PATCH 09/10] update refs --- doc/source/10min.rst | 2 +- doc/source/api/arrays.rst | 36 +++++++++++++++----------------- doc/source/categorical.rst | 2 +- doc/source/comparison_with_r.rst | 2 +- doc/source/groupby.rst | 2 +- doc/source/whatsnew/v0.15.0.rst | 4 ++-- 6 files changed, 23 insertions(+), 25 deletions(-) diff --git a/doc/source/10min.rst b/doc/source/10min.rst index a7557e6e1d1c2..972b562cfebba 100644 --- a/doc/source/10min.rst +++ b/doc/source/10min.rst @@ -657,7 +657,7 @@ Categoricals ------------ pandas can include categorical data in a ``DataFrame``. For full docs, see the -:ref:`categorical introduction ` and the :ref:`API documentation `. +:ref:`categorical introduction ` and the :ref:`API documentation `. .. ipython:: python diff --git a/doc/source/api/arrays.rst b/doc/source/api/arrays.rst index 8787288b70ab1..14320df81fce5 100644 --- a/doc/source/api/arrays.rst +++ b/doc/source/api/arrays.rst @@ -14,19 +14,17 @@ objects contained with a :class:`Index`, :class:`Series`, or For some data types, pandas extends NumPy's type system. -=================== ========================= ================== ====================== +=================== ========================= ================== ============================= Kind of Data Pandas Data Type Scalar Array -=================== ========================= ================== ====================== -TZ-aware datetime :class:`DatetimeTZDtype` :class:`Timestamp` :ref:`api.datetime` -Timedeltas (none) :class:`Timedelta` :ref:`api.timedelta` -Period (time spans) :class:`PeriodDtype` :class:`Period` :ref:`api.period` -Intervals :class:`IntervalDtype` :class:`Interval` :ref:`api.interval` -Nullable Integer :class:`Int64Dtype`, ... (none) :ref:`api.integer_na` -Categorical :class:`CategoricalDtype` (none) :ref:`api.categorical` -Sparse :class:`SparseDtype` (none) :ref:`api.sparse` -=================== ========================= ================== ====================== - -.. _api.arrays: +=================== ========================= ================== ============================= +TZ-aware datetime :class:`DatetimeTZDtype` :class:`Timestamp` :ref:`api.arrays.datetime` +Timedeltas (none) :class:`Timedelta` :ref:`api.arrays.timedelta` +Period (time spans) :class:`PeriodDtype` :class:`Period` :ref:`api.arrays.period` +Intervals :class:`IntervalDtype` :class:`Interval` :ref:`api.arrays.interval` +Nullable Integer :class:`Int64Dtype`, ... (none) :ref:`api.arrays.integer_na` +Categorical :class:`CategoricalDtype` (none) :ref:`api.arrays.categorical` +Sparse :class:`SparseDtype` (none) :ref:`api.arrays.sparse` +=================== ========================= ================== ============================= Arrays ------ @@ -40,7 +38,7 @@ stored in a :class:`Series`, :class:`Index`, or as a column in a :class:`DataFra array -.. _api.datetime: +.. _api.arrays.datetime: ============= Datetime Data @@ -152,7 +150,7 @@ If the data are tz-aware, then every value must have the same timezone. arrays.DatetimeArray DatetimeTZDtype -.. _api.timedelta: +.. _api.arrays.timedelta: ============== Timedelta Data @@ -206,7 +204,7 @@ A collection of timedeltas may be stored in a :class:`TimedeltaArray`. arrays.TimedeltaArray -.. _api.period: +.. _api.arrays.period: ============= Timespan Data @@ -267,7 +265,7 @@ Every period in a ``PeriodArray`` must have the same ``freq``. arrays.DatetimeArray PeriodDtype -.. _api.interval: +.. _api.arrays.interval: ============= Interval Data @@ -304,7 +302,7 @@ A collection of intervals may be stored in an :class:`IntervalArray`. IntervalArray IntervalDtype -.. _api.integer_na: +.. _api.arrays.integer_na: ================ Nullable Integer @@ -326,7 +324,7 @@ Pandas provides this through :class:`arrays.IntegerArray`. UInt32Dtype UInt64Dtype -.. _api.categorical: +.. _api.arrays.categorical: ================ Categorical Data @@ -392,7 +390,7 @@ To create a Series of dtype ``category``, use ``cat = s.astype(dtype)`` or If the Series is of dtype ``CategoricalDtype``, ``Series.cat`` can be used to change the categorical data. See :ref:`api.series.cat` for more. -.. _api.sparse: +.. _api.arrays.sparse: =========== Sparse Data diff --git a/doc/source/categorical.rst b/doc/source/categorical.rst index 68e39e68220a7..a6315c548b382 100644 --- a/doc/source/categorical.rst +++ b/doc/source/categorical.rst @@ -34,7 +34,7 @@ The categorical data type is useful in the following cases: * As a signal to other Python libraries that this column should be treated as a categorical variable (e.g. to use suitable statistical methods or plot types). -See also the :ref:`API docs on categoricals`. +See also the :ref:`API docs on categoricals`. .. _categorical.objectcreation: diff --git a/doc/source/comparison_with_r.rst b/doc/source/comparison_with_r.rst index a0143d717105c..dfd388125708e 100644 --- a/doc/source/comparison_with_r.rst +++ b/doc/source/comparison_with_r.rst @@ -512,7 +512,7 @@ In pandas this is accomplished with ``pd.cut`` and ``astype("category")``: pd.Series([1, 2, 3, 2, 2, 3]).astype("category") For more details and examples see :ref:`categorical introduction ` and the -:ref:`API documentation `. There is also a documentation regarding the +:ref:`API documentation `. There is also a documentation regarding the :ref:`differences to R's factor `. diff --git a/doc/source/groupby.rst b/doc/source/groupby.rst index a37aa2644a805..953f40d1afebe 100644 --- a/doc/source/groupby.rst +++ b/doc/source/groupby.rst @@ -1351,7 +1351,7 @@ important than their content, or as input to an algorithm which only accepts the integer encoding. (For more information about support in pandas for full categorical data, see the :ref:`Categorical introduction ` and the -:ref:`API documentation `.) +:ref:`API documentation `.) .. ipython:: python diff --git a/doc/source/whatsnew/v0.15.0.rst b/doc/source/whatsnew/v0.15.0.rst index 6f74f0393d123..420125afd29a4 100644 --- a/doc/source/whatsnew/v0.15.0.rst +++ b/doc/source/whatsnew/v0.15.0.rst @@ -72,7 +72,7 @@ methods to manipulate. Thanks to Jan Schulz for much of this API/implementation. :issue:`8075`, :issue:`8076`, :issue:`8143`, :issue:`8453`, :issue:`8518`). For full docs, see the :ref:`categorical introduction ` and the -:ref:`API documentation `. +:ref:`API documentation `. .. ipython:: python :okwarning: @@ -101,7 +101,7 @@ For full docs, see the :ref:`categorical introduction ` and the - The ``Categorical.labels`` attribute was renamed to ``Categorical.codes`` and is read only. If you want to manipulate codes, please use one of the - :ref:`API methods on Categoricals `. + :ref:`API methods on Categoricals `. - The ``Categorical.levels`` attribute is renamed to ``Categorical.categories``. From d650fa1856212703fd74d2c5f83ba41a111272cc Mon Sep 17 00:00:00 2001 From: Tom Augspurger Date: Fri, 4 Jan 2019 21:29:10 -0600 Subject: [PATCH 10/10] lint fixup --- doc/source/api/arrays.rst | 29 ++++++++++------------------- pandas/core/arrays/sparse.py | 2 +- pandas/core/frame.py | 10 +++++----- 3 files changed, 16 insertions(+), 25 deletions(-) diff --git a/doc/source/api/arrays.rst b/doc/source/api/arrays.rst index 14320df81fce5..d8ce2ab7bf73e 100644 --- a/doc/source/api/arrays.rst +++ b/doc/source/api/arrays.rst @@ -26,9 +26,6 @@ Categorical :class:`CategoricalDtype` (none) :ref:`api.array Sparse :class:`SparseDtype` (none) :ref:`api.arrays.sparse` =================== ========================= ================== ============================= -Arrays ------- - Pandas and third-party libraries can extend NumPy's type system (see :ref:`extending.extension-types`). The top-level :meth:`array` method can be used to create a new array, which may be stored in a :class:`Series`, :class:`Index`, or as a column in a :class:`DataFrame`. @@ -40,15 +37,15 @@ stored in a :class:`Series`, :class:`Index`, or as a column in a :class:`DataFra .. _api.arrays.datetime: -============= Datetime Data -============= +------------- NumPy cannot natively represent timezone-aware datetimes. Pandas supports this with the :class:`arrays.DatetimeArray` extension array, which can hold timezone-naive or timezone-aware values. -:class:`Timestamp` is the scalar type for datetime data. +:class:`Timestamp`, a subclass of :class:`datetime.datetime`, is pandas' +scalar type for timezone-naive or timezone-aware datetime data. .. autosummary:: :toctree: generated/ @@ -142,7 +139,7 @@ For timezone-aware data, the ``.dtype`` of a ``DatetimeArray`` is a :class:`DatetimeTZDtype`. For timezone-naive data, ``np.dtype("datetime64[ns]")`` is used. -If the data are tz-aware, then every value must have the same timezone. +If the data are tz-aware, then every value in the array must have the same timezone. .. autosummary:: :toctree: generated/ @@ -152,9 +149,8 @@ If the data are tz-aware, then every value must have the same timezone. .. _api.arrays.timedelta: -============== Timedelta Data -============== +-------------- NumPy can natively represent timedeltas. Pandas provides :class:`Timedelta` for symmetry with :class:`Timestamp`. @@ -206,9 +202,8 @@ A collection of timedeltas may be stored in a :class:`TimedeltaArray`. .. _api.arrays.period: -============= Timespan Data -============= +------------- Pandas represents spans of times as :class:`Period` objects. @@ -267,9 +262,8 @@ Every period in a ``PeriodArray`` must have the same ``freq``. .. _api.arrays.interval: -============= Interval Data -============= +------------- Arbitrary intervals can be represented as :class:`Interval` objects. @@ -304,9 +298,8 @@ A collection of intervals may be stored in an :class:`IntervalArray`. .. _api.arrays.integer_na: -================ Nullable Integer -================ +---------------- :class:`numpy.ndarray` cannot natively represent integer-data with missing values. Pandas provides this through :class:`arrays.IntegerArray`. @@ -326,9 +319,8 @@ Pandas provides this through :class:`arrays.IntegerArray`. .. _api.arrays.categorical: -================ Categorical Data -================ +---------------- Pandas defines a custom data type for representing data that can take only a limited, fixed set of values. The dtype of a ``Categorical`` can be described by @@ -392,9 +384,8 @@ data. See :ref:`api.series.cat` for more. .. _api.arrays.sparse: -=========== Sparse Data -=========== +----------- Data where a single value is repeated many times (e.g. ``0`` or ``NaN``) may be stored efficiently as a :class:`SparseArray`. diff --git a/pandas/core/arrays/sparse.py b/pandas/core/arrays/sparse.py index 1c6c9e71dd896..6114e578dc90f 100644 --- a/pandas/core/arrays/sparse.py +++ b/pandas/core/arrays/sparse.py @@ -56,7 +56,7 @@ class SparseDtype(ExtensionDtype): ---------- dtype : str, ExtensionDtype, numpy.dtype, type, default numpy.float64 The dtype of the underlying array storing the non-fill value values. - fill_value : scalar, optional. + fill_value : scalar, optional The scalar value not stored in the SparseArray. By default, this depends on `dtype`. diff --git a/pandas/core/frame.py b/pandas/core/frame.py index 778a679457926..7659f0696008b 100644 --- a/pandas/core/frame.py +++ b/pandas/core/frame.py @@ -6966,6 +6966,11 @@ def corr(self, method='pearson', min_periods=1): ------- y : DataFrame + See Also + -------- + DataFrame.corrwith + Series.corr + Examples -------- >>> histogram_intersection = lambda a, b: np.minimum(a, b @@ -6976,11 +6981,6 @@ def corr(self, method='pearson', min_periods=1): dogs cats dogs 1.0 0.3 cats 0.3 1.0 - - See Also - -------- - DataFrame.corrwith - Series.corr """ numeric_df = self._get_numeric_data() cols = numeric_df.columns