<jupyter_start><jupyter_text>Basic query<jupyter_code>df = pd.read_sql("""
    select 
        e.nom_ent,
        m.nom_mun,
        m.cve_ent,
        m.cve_mun,
        d.year,
        d.fosas,
        d.cuerpos,
        d.cuerpos_identificados,
        d.restos,
        d.restos_identificados
    from mapasdata d 
    join areas_geoestadisticas_municipales m
        on d.cve_ent = m.cve_ent
        and d.cve_mun = m.cve_mun
    join areas_geoestadisticas_estatales e
        on d.cve_ent = e.cve_ent
""", con)
df.head()
grouped = df.groupby(['nom_ent', 'nom_mun', 'year']).sum()
grouped.to_dict(orient='index')
grouped.to_dict(orient="index")
grouped.to_dict(orient="index")<jupyter_output><empty_output>
StarcoderdataJupyterStructuredCleanDedup