datetime64[ns] is a general dtype, while
<M8[ns] is a specific dtype. General dtypes map to specific dtypes, but may be different from one installation of NumPy to the next.
On a machine whose byte order is little endian, there is no difference between
In : np.dtype('datetime64[ns]') == np.dtype('<M8[ns]')
However, on a big endian machine,
np.dtype('datetime64[ns]') would equal
datetime64[ns] maps to either
>M8[ns] depending on the endian-ness of the machine.
There are many other similar examples of general dtypes mapping to specific dtypes:
int64 maps to
>i8 , and
int maps to either
int64 depending on the bit architecture of the OS and how NumPy was compiled.
Difference between data type ‘datetime64[ns]’ and ‘<M8[ns]’? - Stack Overflow