@@ -91,6 +91,15 @@ extension array for IP Address data, this might be ``ipaddress.IPv4Address``.
91
91
92
92
See the `extension dtype source `_ for interface definition.
93
93
94
+ .. versionadded :: 0.24.0
95
+
96
+ :class: `pandas.api.extension.ExtensionDtype ` can be registered to pandas to allow creation via a string dtype name.
97
+ This allows one to instantiate ``Series `` and ``.astype() `` with a registered string name, for
98
+ example ``'category' `` is a registered string accessor for the ``CategoricalDtype ``.
99
+
100
+ See the `extension dtype dtypes `_ for more on how to register dtypes.
101
+
102
+
94
103
:class: `~pandas.api.extension.ExtensionArray `
95
104
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
96
105
@@ -131,6 +140,7 @@ To use a test, subclass it:
131
140
See https://github.com/pandas-dev/pandas/blob/master/pandas/tests/extension/base/__init__.py
132
141
for a list of all the tests available.
133
142
143
+ .. _extension dtype dtypes : https://github.com/pandas-dev/pandas/blob/master/pandas/core/dtypes/dtypes.py
134
144
.. _extension dtype source : https://github.com/pandas-dev/pandas/blob/master/pandas/core/dtypes/base.py
135
145
.. _extension array source : https://github.com/pandas-dev/pandas/blob/master/pandas/core/arrays/base.py
136
146
@@ -174,11 +184,11 @@ There are 3 constructor properties to be defined:
174
184
Following table shows how ``pandas `` data structures define constructor properties by default.
175
185
176
186
=========================== ======================= =============
177
- Property Attributes ``Series `` ``DataFrame ``
187
+ Property Attributes ``Series `` ``DataFrame ``
178
188
=========================== ======================= =============
179
- ``_constructor `` ``Series `` ``DataFrame ``
180
- ``_constructor_sliced `` ``NotImplementedError `` ``Series ``
181
- ``_constructor_expanddim `` ``DataFrame `` ``Panel ``
189
+ ``_constructor `` ``Series `` ``DataFrame ``
190
+ ``_constructor_sliced `` ``NotImplementedError `` ``Series ``
191
+ ``_constructor_expanddim `` ``DataFrame `` ``Panel ``
182
192
=========================== ======================= =============
183
193
184
194
Below example shows how to define ``SubclassedSeries `` and ``SubclassedDataFrame `` overriding constructor properties.
0 commit comments