0

I have a data frame:

>df_idbank.dtypes

DATASET                   object
IDBANK                    object
KEY                       object
FREQ                      object
INDICATEUR                object
CORRECTION_label_en       object

Etc.

I have another data frame:

>df_INDICATORS
    Label                                               IDBANK
0   Summary indicator of overall economic situatio...   1586891
1   Business climate summary indicator - SA series      1586890
2   Trend of expected activity - Overall - SA series    1586916
3   Trend of expected activity - Building structur...   1586885
4   Trend of expected activity - Finishings - SA s...   1586886

This would give a set of values pertaining to only values matching IDBANK =="001586891" from df_idbank data frame.

df_idbank = df_idbank.loc[(df_idbank.FREQ == "M") & (df_idbank.CORRECTION_label_en == "Seasonal adjusted") & (df_idbank.IDBANK =="001586891") ]

How do I select all the values matching IDBANK column in df_INDICATORS?

0

1 Answer 1

1

You can use .isin():

df_idbank = df_idbank.loc[
    (df_idbank.FREQ == "M") & 
    (df_idbank.CORRECTION_label_en == "Seasonal adjusted") & 
    (df_idbank.IDBANK.isin(df_INDICATORS.IDBANK)) ]
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.