How to compare category variable with a string?

How can I compare categorical variable with a string to know how many examples of each class we have in training and validation data sets?

Using str(var)?

1 Like

Thank you very much! I did not know that it is such simple :slightly_smiling_face:
I am new to Python.