MATLAB: Unique is giving the same expression twice

unique

Hi,
(data is attached)
[Country,~,ix] = unique(A);
tally = accumarray(ix, 1);
Q2= table(Country, tally);
Q2 contains the same expression twice for the unique values of 'Audit and assurance, and tax services'. what could be the reason? and how to overcome it? is it a bug?

Best Answer

I didn't notice the data attached for this case -- the same exercise as above shows:
>> sort(categories(A))
ans =
29×1 cell array
{'Agriculture and fishing' }
{'Audit and assurance, and tax services' }
{'Audit and assurance, and tax services' }
{'Banking and capital markets' }
{'Civil Societies/NGOs' }
{'Civil society/NGOs' }
{'Construction' }
{'Consulting services' }
{'Education and academia' }
{'Electronics' }
{'Energy, utilities and resources' }
{'Financial services' }
{'Food Services' }
{'Government and public services' }
{'Health and healthcare services' }
{'Hospitality' }
{'IT and telecommunications' }
{'Manufacturing' }
{'Mining and Quarrying' }
{'Oil and gas' }
{'Other' }
{'Other business services' }
{'Other business services, please specify: ____________'}
{'Petrochemicals' }
{'Real Estate' }
{'Tourism' }
{'Transportation and logistics' }
{'Wholesale and retail trade' }
{'org03' }
>> tmp=ans(2:3)
tmp =
2×1 cell array
{'Audit and assurance, and tax services'}
{'Audit and assurance, and tax services'}
>>
There's an extended character (=160) in the second where there's an ordinary space in the first:
>> find(tmp{1}~=tmp{2})
ans =
25
>> [double(tmp{1}(25));double(tmp{2}(25))]
ans =
32
160
>>
Besides that, there are other anomolous entries as well just as were pointed out in the other categorical array in the previous Q?
...
{'Civil Societies/NGOs' }
{'Civil society/NGOs' }
...
{'Other business services' }
{'Other business services, please specify: ____________'}
...
that need to be cleaned up or one will never be able to match all elements of what are obviously intended to be the same categories but are not.
The data need a throrough cleaning before being ready for prime time.