[Python] How to give dataframe inside isin()

Discussão em 'Python' iniciado por Stack, Julho 9, 2025.

  1. Stack

    Stack Membro Participativo

    I want convert a sql query like

    SELECT * FROM df WHERE id IN (SELECT id FROM an_df)


    into dask equivalent. So, I am trying this:

    d=df[df['id'].isin(an_df['id'])]


    But it is thorwing NotImplementedError: passing a 'dask.datframe.core.DataFrame' to'isin'

    Then I converted this an_df['id'] to list like

    d=df[df['id'].isin(list(an_df['id']))] or d=df[df['id'].isin(an_df['id'].compute())]


    but this is very time consuming.

    I want a solution that works as fast as dask. df has approximately 100 million rows.

    Continue reading...

Compartilhe esta Página