import numpy as np
import pandas as pd
pd.unique(pd.Series([2, 1, 1, 3, 4, 4,]))
pd.unique(pd.Series([3] + [2] * 5))
pd.unique(pd.Series([pd.Timestamp('20190101'),
pd.Timestamp('20190101')]))
pd.unique(pd.Series([pd.Timestamp('20190101', tz='US/Eastern'),
pd.Timestamp('20190101', tz='US/Eastern')]))
pd.unique(pd.Index([pd.Timestamp('20190101', tz='US/Eastern'),
pd.Timestamp('20190101', tz='US/Eastern')]))
pd.unique(list('qppqr'))
An unordered Categorical will return categories in the order of appearance.
pd.unique(pd.Series(pd.Categorical(list('qppqr'))))
pd.unique(pd.Series(pd.Categorical(list('qppqr'),
categories=list('pqr'))))
An ordered Categorical preserves the category ordering.
pd.unique(pd.Series(pd.Categorical(list('qppqr'),
categories=list('pqr'),
ordered=True)))
An array of tuples
pd.unique([('p', 'q'), ('q', 'p'), ('p', 'r'), ('q', 'p')])