Skip to content

Commit 744acb2

Browse files
cpcloudNo-Stream
authored andcommitted
DOC: Column indexes should use the same metadata as columns (pandas-dev#17795)
* DOC: Column indexes should use the same metadata as columns * Fix metadata field name * Remove column_index_names
1 parent db0d19b commit 744acb2

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

doc/source/developer.rst

+11-8
Original file line numberDiff line numberDiff line change
@@ -45,20 +45,19 @@ So that a ``pandas.DataFrame`` can be faithfully reconstructed, we store a
4545
.. code-block:: text
4646
4747
{'index_columns': ['__index_level_0__', '__index_level_1__', ...],
48-
'column_index_names': [<column index level name 0>, <column index level name 1>, ...],
49-
'column_index_dtypes': [<dtype 0>, <dtype 1>, ..., <dtype N>]
48+
'column_indexes': [<ci0>, <ci1>, ..., <ciN>],
5049
'columns': [<c0>, <c1>, ...],
5150
'pandas_version': $VERSION}
5251
53-
Here, ``<c0>`` and so forth are dictionaries containing the metadata for each
54-
column. This has JSON form:
52+
Here, ``<c0>``/``<ci0>`` and so forth are dictionaries containing the metadata
53+
for each column. This has JSON form:
5554

5655
.. code-block:: text
5756
5857
{'name': column_name,
5958
'pandas_type': pandas_type,
6059
'numpy_type': numpy_type,
61-
'metadata': type_metadata}
60+
'metadata': metadata}
6261
6362
``pandas_type`` is the logical type of the column, and is one of:
6463

@@ -75,7 +74,7 @@ result of ``str(dtype)`` for the underlying NumPy array that holds the data. So
7574
for ``datetimetz`` this is ``datetime64[ns]`` and for categorical, it may be
7675
any of the supported integer categorical types.
7776

78-
The ``type_metadata`` is ``None`` except for:
77+
The ``metadata`` field is ``None`` except for:
7978

8079
* ``datetimetz``: ``{'timezone': zone, 'unit': 'ns'}``, e.g. ``{'timezone',
8180
'America/New_York', 'unit': 'ns'}``. The ``'unit'`` is optional, and if
@@ -108,8 +107,12 @@ As an example of fully-formed metadata:
108107
.. code-block:: text
109108
110109
{'index_columns': ['__index_level_0__'],
111-
'column_index_names': [None],
112-
'column_index_dtypes': ['object'],
110+
'column_indexes': [
111+
{'name': None,
112+
'pandas_type': 'string',
113+
'numpy_type': 'object',
114+
'metadata': None}
115+
],
113116
'columns': [
114117
{'name': 'c0',
115118
'pandas_type': 'int8',

0 commit comments

Comments
 (0)