136, Data Cleaning Walkthrough

my problem is
*I wrote that code in the slide number 14 and I tried to submit the answer but there is message says “your code does not pass our checks” *
import re
def get_long(Location):
coordinates = re.findall("(.+)", Location)
return long

data[“hs_directory”][“long”] = data[“hs_directory”][“Location 1”].apply(get_long)

data[“hs_directory”][“lat”]=pd.to_numeric(data[“hs_directory”][“lat”], errors = “coerce”)

data[“hs_directory”][“long”]=pd.to_numeric(data[“hs_directory”][“long”], errors = “coerce”)


###the link is

Not sure if this is the issue, but it might have a problem with the column being named 'long' instead of 'lon' for error-checking.

1 Like