Search code examples
pythonarrayspandasnumpytypes

What is type <U12?


I was using pandas and numpy to process some data until I got two similar output of arrays:

array(['french', 'mexican', 'cajun_creole', ..., 'southern_us', 'italian',
       'thai'], dtype='<U12')

array(['french', 'mexican', 'cajun_creole', ..., 'jamaican', 'italian',
   'thai'], dtype=object)

I don't see the difference, what is <U12?


Solution

  • <U12 That is a numpy type:

    < Little Endian

    U Unicode

    12 12 characters:

    (Source)