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)
| 791 | |
| 792 | |
| 793 | def _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 | |
| 815 | def _contains_datetime_timedeltas(array): |
searching dependent graphs…