I understand that pandas dataframe type has an ability to test the logic of it's value.
here's the code:
import pandas as pd
data = pd.DataFrame(columns=['a', 'b', 'c'])
data = data.append({'a': 'I have data', 'b': 'no more complexe', 'c': 024204}, ignore_index=True)
data = data.append({'a': 'audoausd', 'b': '2048rafaf', 'c': 29313}, ignore_index=True)
data = data.append({'a': 'koplak ente gan', 'b': 'ente g bisa koplak', 'c': 29313}, ignore_index=True)
now we have the following dataframe:
a b c
0 I have data no more complexe 10372
1 audoausd 2048rafaf 29313
2 koplak ente gan ente g bisa koplak 29313
test the logic value for column c and save it to a variable
c = data.c > 20000
will set c to the following value
0 False
1 True
2 True
Name: c, dtype: bool
test the logic value for column b and save it to a variable
b = data.b.str.contains('koplak')
b value
0 False
1 False
2 True
Name: b, dtype: bool
and also for column a
a = data.a.str.contains('koplak')
a value
0 False
1 False
2 True
Name: b, dtype: bool
when i compare all of this values by doing a & b & c will return:
0 False
1 False
2 True
dtype: bool
it's not well fashioned to hard code in case there are many columns involve, so i try to make a list containing all columns logic
logic = [a, b, c]
how do i compare all the items automatically to get a & b & c result?