How to check if a dataframw column is categorical?
│ Row │ A │ B │
│ │ Cat… │ String │
├─────┼──────┼────────┤
│ 1 │ A │ X │
│ 2 │ B │ X │
│ 3 │ C │ X │
│ 4 │ D │ Y │
│ 5 │ D │ Y │
│ 6 │ A │ Y │
lets say in the above dataframe the column A is categorical.
Now if I do eltype(df[!, A]) the its returns me
categoricalValue{string, UInt8}
But the eltype can also return categoricalValue{Int}
What would be the best possible way to put a check to see if a column is categorical or not.
This works. All this time I was confused about how to check the “CategoricalValue” type. But checking if it’s a categorical array is indeed the straightforward approach.