✊🏿 Black Lives Matter. Please consider donating to Black Girls Code today.
🐇 Announcing Dash VTK for 3d simulation graphics. Check out the March webinar.

Is it possible to convert a dataframe type from "object" to "string?"

I’m plotting pie charts from a dataframe and am trying to filter the frame based on a column value of “Off Class 3”, which is an “object” type

Screen Shot 2020-04-04 at 7.53.51 PM

I’m running this line below to return a boolean value dataframe of each row item in the column “Off Class 3” contains any of the strings “S”, “L”, “T”, “E”

education_conditions = df['Off Class 3'].isin([['S', 'L', 'T','E']])

the resulting dataframe though is all FALSE because of a type mismatch, ‘Off Class 3’ is all “object” and the condition I’m passing is a list of “string”. I can’t for the life of me figure our how to get the types to match