0

I have one series of 8 TRUE and FALSE values:

boolean_massiv = pd.Series(np.concatenate([[False]*5,[True]*3]))

ALso I have another array of 8 different string values:

values_inside = pd.Series(['day', 'time', 'temperature', 'R.H.[%]', 'w.s.[m/s]', 'СС_down','СС_upper', 'precipitation'])

I want to get values with False indixies of First massiv:

'day', 'time', 'temperature', 'R.H.[%]', 'w.s.[m/s]'

How should I solve my problem?

1 Answers1

1

You could try simulanous loop.

Here is the code:

import pandas as pd
import numpy as np

boolean_massiv = pd.Series(np.concatenate([[False]*5,[True]*3]))

values_inside = pd.Series(['day', 'time', 'temperature', 'R.H.[%]', 'w.s.[m/s]', 'СС_down','СС_upper', 'precipitation'])

false_values = []

for i, j in zip(boolean_massiv, values_inside):
    if i == False:
        false_values.append(j)

false_Series = pd.Series(false_values)

This creates false_Series that contains the names from values_inside that correspond to value False in boolean_massiv.

pawmasz
  • 93
  • 1
  • 10