I am working on a project linking psychological battery exams to the chances patients will abuse prescription drugs. My original dataset looked like this:
ID Age Sex Neuro Aggro Agree Impulse Cocaine Crack ... Legal MJ
1 25 M 9 4 1 5 CL1 CL2 ... CL1 CL3
2 28 F 4 5 5 8 CL0 CL1 ... CL3 CL3
I figured it would be nice to just get rid of the CL's and just have the numbers, so I ran
df=df.replace('CL0', 0, regex= True)
So my dataset looked more like
ID Age Sex Neuro Aggro Agree Impulse Cocaine Crack ... Legal MJ
1 25 M 9 4 1 5 1 2 ... 1 3
2 28 F 4 5 5 8 0 1 ... 3 3
However, when I run df.describe(), it would only show the columns I didn't change. I checked for strings in my altered columns, but there weren't any. The values are all integers for each edited column. I then tried df.describe(include = 'all') as per Pandas df.describe doesn't work after adding new column, and the values for edited columns are there for count, unique, top, and freq, but all of the mathematical descriptors are null, such as average, Std Dev, etc.
What am I missing? How can I replace the values in the above columns with integers that the df.describe() will be able to perform the necessary math on?
Thanks in advance.