I'm subscribed to two datasets and one geography on Carto Data Observatory. How can I join them to each other using Python?

I have converted both datasets and geography into pandas dataframe, then I used the DataFrame.merge function but I am still unable to do the join.

Datasets and Geographies are related to each other by geoid field.


If df1 is the dataframe with geometry, you can do something like this:

df = df1.merge(df2, on='geoid', how='left')

If you are using CARTO, another solution could be using JOINs as explained here.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.