Python loop filter data

clipboard.png
set
events = set()-sharp
clipboard.png
is still a beginner, so many don"t understand. My own train of thought is probably like this

for rows in tr: -sharplist(tr)
   for i in events:
     if (tr[rows[0]] == event[i]): -sharp tr[rows[0]]set
             -sharp

I don"t know how to realize it. I"d like to ask thank you

.
Mar.13,2021

it is much easier to read and filter data using the pandas library. Here is an example of ipython

In [1]: import pandas as pd

In [2]: pd.read_csv('a.csv')
Out[2]: 
     a  b
0  one  1
1  two  2
2  one  3

In [3]: df = _

In [4]: df[df.a.eq('one')]
Out[4]: 
     a  b
0  one  1
2  one  3
< H2 > reference < / H2 >

pandas, https://pandas.pydata.org/

Menu