Filtering Pandas Dataframe Results without saving to a variable first
If you want to filter Pandas Series "on the fly", you can use .loc[] indexer in conjunction with the callable method (for example using lambda function).

Demo:

In [8]: df.var()
Out[8]:
A    2.5
B    0.0
dtype: float64

In [9]: df.var().loc[lambda ser: ser!=0]
Out[9]:
A    2.5
dtype: float64

In [10]: df.var().loc[lambda ser: ser&gt;3]
Out[10]: Series([], dtype: float64)


If you want to filter a DataFrame, then you can use DF.query(...) method:

In [11]: df
Out[11]:
   A  B
0  1  0
1  2  0
2  3  0
3  4  0
4  5  0

In [12]: df.query("A &gt;= 3")
Out[12]:
   A  B
2  3  0
3  4  0
4  5  0