MCPcopy Index your code
hub / github.com/pydata/xarray / _parse_array_of_cftime_strings

Function _parse_array_of_cftime_strings

xarray/coding/cftimeindex.py:793–812  ·  view source on GitHub ↗

Create a numpy array from an array of strings. For use in generating dates from strings for use with interp. Assumes the array is either 0-dimensional or 1-dimensional. Parameters ---------- strings : array of strings Strings to convert to dates date_type : cftime.

(strings, date_type)

Source from the content-addressed store, hash-verified

791
792
793def _parse_array_of_cftime_strings(strings, date_type):
794 """Create a numpy array from an array of strings.
795
796 For use in generating dates from strings for use with interp. Assumes the
797 array is either 0-dimensional or 1-dimensional.
798
799 Parameters
800 ----------
801 strings : array of strings
802 Strings to convert to dates
803 date_type : cftime.datetime type
804 Calendar type to use for dates
805
806 Returns
807 -------
808 np.array
809 """
810 return np.array([_parse_iso8601(date_type, s)[0] for s in strings.ravel()]).reshape(
811 strings.shape
812 )
813
814
815def _contains_datetime_timedeltas(array):

Callers 4

_validate_indexersMethod · 0.90

Calls 1

_parse_iso8601Function · 0.90

Tested by 3

Used in the wild real call sites across dependent graphs

searching dependent graphs…