I don't understand pandas DataFrame filter.
Setup
import pandas as pd
df = pd.DataFrame(
[
['Hello', 'World'],
['Just', 'Wanted'],
['To', 'Say'],
['I\'m', 'Tired']
]
)
Problem
df.filter([0], regex=r'(Hel|Just)', axis=0)
I'd expect the [0] to specify the 1st column as the one to look at and axis=0 to specify filtering rows. What I get is this:
0 1
0 Hello World
I was expecting
0 1
0 Hello World
1 Just Wanted
Question
- What would have gotten me what I expected?