Series.index

Series.index

Return opensearch_py_ml index referencing OpenSearch field to index a DataFrame/Series

Returns

opensearch_py_ml.Index:

Note opensearch_py_ml.Index has a very limited API compared to pandas.Index

See Also

:pandas_api_docs:`pandas.DataFrame.index` :pandas_api_docs:`pandas.Series.index`

Examples

>>> from tests import OPENSEARCH_TEST_CLIENT
>>> df = oml.DataFrame(OPENSEARCH_TEST_CLIENT, 'flights')
>>> assert isinstance(df.index, oml.Index)
>>> df.index.os_index_field
'_id'
>>> s = df['Carrier']
>>> assert isinstance(s.index, oml.Index)
>>> s.index.os_index_field
'_id'