I have a column in a csv file with 100 records as Status with values as ['Active', 'Cancelled', 'Cancelled - Gap in Status']. I want to get unique values of this column. My code is as below:
df=pd.read_pickle(data_frame.pickle')
status = df['Status']
print(pd.unique(status))
print(len(pd.unique(status)))
Output:
['Active', 'Cancelled']
2
What am I missing here?
Sample Data: +--------------------+--------+--------------+-------+---------------------------+ | Stage | ID | Name | State | Status | +--------------------+--------+--------------+-------+---------------------------+ | 123456Peter Grunt | 123456 | Peter Grunt | DE | Active | | 123456Peter Grunt | 123456 | Peter Grunt | NY | Cancelled | | 123456Peter Grunt | 123456 | Peter Grunt | CA | Cancelled | | 123456Peter Grunt | 123456 | Peter Grunt | IA | Cancelled | | 123456Peter Grunt | 123456 | Peter Grunt | WA | Cancelled | | 123456Peter Grunt | 123456 | Peter Grunt | DE | Cancelled | | 123456Peter Grunt | 123456 | Peter Grunt | NC | Active | | 123457William Bert | 123457 | William Bert | NY | Active | | 123457William Bert | 123457 | William Bert | SD | Active | | 123457William Bert | 123457 | William Bert | WA | Cancelled - Gap in Status | | 123457William Bert | 123457 | William Bert | CA | Active | | 123457William Bert | 123457 | William Bert | IA | Active | | 123457William Bert | 123457 | William Bert | WA | Active | | 123457William Bert | 123457 | William Bert | DE | Active | | 123458John Grand | 123458 | John Grand | AL | Active | | 123458John Grand | 123458 | John Grand | AK | Cancelled | | 123458John Grand | 123458 | John Grand | MD | Cancelled | | 123458John Grand | 123458 | John Grand | MA | Cancelled | | 123458John Grand | 123458 | John Grand | AK | Cancelled | | 123458John Grand | 123458 | John Grand | NY | Cancelled - Gap in Status | | 123458John Grand | 123458 | John Grand | LA | Cancelled | | 123458John Grand | 123458 | John Grand | SD | Cancelled | | 123458John Grand | 123458 | John Grand | WA | Cancelled | | 123458John Grand | 123458 | John Grand | CA | Cancelled | | 123458John Grand | 123458 | John Grand | IA | Active | | 123458John Grand | 123458 | John Grand | WA | Active | | 123458John Grand | 123458 | John Grand | DE | Active | | 123458John Grand | 123458 | John Grand | AL | Active | +--------------------+--------+--------------+-------+---------------------------+