"setdiff" operation getting reversed when using "categories" - Why??
显示 更早的评论
I have a table named "data" with one of the variables (categorical) being "Country". I am trying to merge all the categories that are not missing ("N/A") and after executing
land = setdiff(data.Country,"N/A")
in the workspace, "land" is a 9 x 1 categorical variable. This is perfect BUT when I execute
cats = categories(land)
"cats" becomes a 10 x 1 cell which includes the "N/A" that I got rid of using "setdiff" earlier.
WHY??
I want to use the "cats" in "mergecats(data.Country, cats, "Land")". Pls help.
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Categorical Arrays 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!