@@ -1937,21 +1937,36 @@ See :ref:`extending.extension-types` for how to write your own extension that
1937
1937
works with pandas. See :ref: `ecosystem.extensions ` for a list of third-party
1938
1938
libraries that have implemented an extension.
1939
1939
1940
- The following table lists all of pandas extension types. See the respective
1940
+ The following table lists all of pandas extension types. For methods requiring ``dtype ``
1941
+ arguments, strings can be specified as indicated. See the respective
1941
1942
documentation sections for more on each type.
1942
1943
1943
- =================== ========================= ================== ============================= =============================
1944
- Kind of Data Data Type Scalar Array Documentation
1945
- =================== ========================= ================== ============================= =============================
1946
- tz-aware datetime :class: `DatetimeTZDtype ` :class: `Timestamp ` :class: `arrays.DatetimeArray ` :ref: `timeseries.timezone `
1947
- Categorical :class: `CategoricalDtype ` (none) :class: `Categorical ` :ref: `categorical `
1948
- period (time spans) :class: `PeriodDtype ` :class: `Period ` :class: `arrays.PeriodArray ` :ref: `timeseries.periods `
1949
- sparse :class: `SparseDtype ` (none) :class: `arrays.SparseArray ` :ref: `sparse `
1950
- intervals :class: `IntervalDtype ` :class: `Interval ` :class: `arrays.IntervalArray ` :ref: `advanced.intervalindex `
1951
- nullable integer :class: `Int64Dtype `, ... (none) :class: `arrays.IntegerArray ` :ref: `integer_na `
1952
- Strings :class: `StringDtype ` :class: `str ` :class: `arrays.StringArray ` :ref: `text `
1953
- Boolean (with NA) :class: `BooleanDtype ` :class: `bool ` :class: `arrays.BooleanArray ` :ref: `api.arrays.bool `
1954
- =================== ========================= ================== ============================= =============================
1944
+ +-------------------+---------------------------+--------------------+-------------------------------+-----------------------------------------+-------------------------------+
1945
+ | Kind of Data | Data Type | Scalar | Array | String Aliases | Documentation |
1946
+ +===================+===========================+====================+===============================+=========================================+===============================+
1947
+ | tz-aware datetime | :class: `DatetimeTZDtype ` | :class: `Timestamp ` | :class: `arrays.DatetimeArray ` | ``'datetime64[ns, <tz>]' `` | :ref: `timeseries.timezone ` |
1948
+ +-------------------+---------------------------+--------------------+-------------------------------+-----------------------------------------+-------------------------------+
1949
+ | Categorical | :class: `CategoricalDtype ` | (none) | :class: `Categorical ` | ``'category' `` | :ref: `categorical ` |
1950
+ +-------------------+---------------------------+--------------------+-------------------------------+-----------------------------------------+-------------------------------+
1951
+ | period | :class: `PeriodDtype ` | :class: `Period ` | :class: `arrays.PeriodArray ` | ``'period[<freq>]' ``, | :ref: `timeseries.periods ` |
1952
+ | (time spans) | | | | ``'Period[<freq>]' `` | |
1953
+ +-------------------+---------------------------+--------------------+-------------------------------+-----------------------------------------+-------------------------------+
1954
+ | sparse | :class: `SparseDtype ` | (none) | :class: `SparseArray ` | ``'Sparse' ``, ``'Sparse[int]' ``, | :ref: `sparse ` |
1955
+ | | | | | ``'Sparse[float]' `` | |
1956
+ +-------------------+---------------------------+--------------------+-------------------------------+-----------------------------------------+-------------------------------+
1957
+ | intervals | :class: `IntervalDtype ` | :class: `Interval ` | :class: `arrays.IntervalArray ` | ``'interval' ``, ``'Interval' ``, | :ref: `advanced.intervalindex ` |
1958
+ | | | | | ``'Interval[<numpy_dtype>]' ``, | |
1959
+ | | | | | ``'Interval[datetime64[ns, <tz>]]' ``, | |
1960
+ | | | | | ``'Interval[timedelta64[<freq>]]' `` | |
1961
+ +-------------------+---------------------------+--------------------+-------------------------------+-----------------------------------------+-------------------------------+
1962
+ | nullable integer + :class: `Int64Dtype `, ... | (none) | :class: `arrays.IntegerArray ` | ``'Int8' ``, ``'Int16' ``, ``'Int32' ``, | :ref: `integer_na ` |
1963
+ | | | | | ``'Int64' ``, ``'UInt8' ``, ``'UInt16' ``, | |
1964
+ | | | | | ``'UInt32' ``, ``'UInt64' `` | |
1965
+ +-------------------+---------------------------+--------------------+-------------------------------+-----------------------------------------+-------------------------------+
1966
+ | Strings | :class: `StringDtype ` | :class: `str ` | :class: `arrays.StringArray ` | ``'string' `` | :ref: `text ` |
1967
+ +-------------------+---------------------------+--------------------+-------------------------------+-----------------------------------------+-------------------------------+
1968
+ | Boolean (with NA) | :class: `BooleanDtype ` | :class: `bool ` | :class: `arrays.BooleanArray ` | ``'boolean' `` | :ref: `api.arrays.bool ` |
1969
+ +-------------------+---------------------------+--------------------+-------------------------------+-----------------------------------------+-------------------------------+
1955
1970
1956
1971
Pandas has two ways to store strings.
1957
1972
0 commit comments