Return the values as a NumPy array.
Users should not call this directly. Rather, it is invoked by numpy.array()
and numpy.asarray()
.
The dtype to use for the resulting NumPy array. By default, the dtype is inferred from the data.
See numpy.asarray()
.
The values in the series converted to a numpy.ndarray
with the specified dtype.
Examples
>>> ser = pd.Series([1, 2, 3]) >>> np.asarray(ser) array([1, 2, 3])
For timezone-aware data, the timezones may be retained with dtype='object'
>>> tzser = pd.Series(pd.date_range('2000', periods=2, tz="CET")) >>> np.asarray(tzser, dtype="object") array([Timestamp('2000-01-01 00:00:00+0100', tz='CET'), Timestamp('2000-01-02 00:00:00+0100', tz='CET')], dtype=object)
Or the values may be localized to UTC and the tzinfo discarded with dtype='datetime64[ns]'
>>> np.asarray(tzser, dtype="datetime64[ns]") array(['1999-12-31T23:00:00.000000000', ...], dtype='datetime64[ns]')
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4