Old python version on dataquest?c

On Data Cleaning Basics 12/14 I tried using:

laptops[“weight”] = laptops[“weight”].str.replace("[kgs]", “”, regex=True)

To clean both “kg” and “kgs” in one command, it worked on Spyder py3.7, but didn’t work on Dataquest, I got this error: TypeError: replace() got an unexpected keyword argument ‘regex’

What version of python or pandas is being used on Dataquest? Using two commands when a simple regex works seems like a waste imo… Also, this is just a very minor incovenience, but I thought I’d post it anyway.

Pandas version 0.22.0 is used here.

Sahil’s post here mentions that.

1 Like