Skip to content
This repository has been archived by the owner on Nov 1, 2023. It is now read-only.

Duplicated entries in catalog #94

Open
skwskwskwskw opened this issue Sep 26, 2023 · 1 comment
Open

Duplicated entries in catalog #94

skwskwskwskw opened this issue Sep 26, 2023 · 1 comment

Comments

@skwskwskwskw
Copy link

I think within the catalog, there might be duplicated entries, how can I extract table with such issue?

only one table can be loaded at once (tables found: other_transport_injuries__both_sexes__70plus_years, transport_injuries__both_sexes__70plus_years)

@Marigold
Copy link
Collaborator

Hey @similang. catalog.find returns a DataFrame where each row is a table. If you get back more than one rows, just select the one that you're interested in and call .load() on it.

For instance

from owid import catalog
# cat is a dataframe with two rows
cat = catalog.find(table='transport_injuries__both_sexes__70plus_years', dataset='gbd_cause')
# we select only the row matching `transport_injuries__both_sexes__70plus_years`
# calling `load` loads the actual data
t = cat[cat.table == 'transport_injuries__both_sexes__70plus_years'].load()
t.head()

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants