Series.to_numpy

Series.to_numpy() None[source]

Not implemented.

In pandas this returns a Numpy representation of the Series. This would involve scan/scrolling the entire index.

If this is required, call oml.opensearch_to_pandas(oml_series).values, but beware this will scan/scroll the entire OpenSearch index(s) into memory.

See Also

:pandas_api_docs:`pandas.DataFrame.to_numpy` opensearch_to_pandas

Examples

>>> from tests import OPENSEARCH_TEST_CLIENT
>>> oml_s = oml.Series(OPENSEARCH_TEST_CLIENT, 'flights', name='Carrier').head(5)
>>> pd_s = oml.opensearch_to_pandas(oml_s)
>>> print(f"type(oml_s)={type(oml_s)}\ntype(pd_s)={type(pd_s)}")
type(oml_s)=<class 'opensearch_py_ml.series.Series'>
type(pd_s)=<class 'pandas.core.series.Series'>
>>> oml_s
0     Kibana Airlines
1    Logstash Airways
2    Logstash Airways
3     Kibana Airlines
4     Kibana Airlines
Name: Carrier, dtype: object
>>> pd_s.to_numpy()
array(['Kibana Airlines', 'Logstash Airways', 'Logstash Airways',
       'Kibana Airlines', 'Kibana Airlines'], dtype=object)