-
-
Notifications
You must be signed in to change notification settings - Fork 11.6k
Closed
Description
Per #7370 (comment), we could specify dtype as part of ndarray types (including type inference) by using NumPy's scalar types, e.g., np.ndarray[Any, np.float64] or np.ndarray[np.float64, Any] (where Any indicates the shape).
Is this a good way to indicate dtypes? How would we handle dtypes that don't have a well specified scalar type? For example:
datetime64andtimedelta64do not have precision as part of the typenp.voidis used for all arbitrary structured dtypes, but doesn't indicate the field names or subtypes (side note:np.structwould be a much better name)- string dtypes have their size as part of the type
One simple answer is to not worry about more detailed type information for now, and worry about more precise specification for scalar types later, when support in the typing module becomes available (e.g., for integer types or custom struct-like data structures like TypedDict).
schneiderfelipe