The pandas.DataFrame.query()
method is of great usage for (pre/post)-filtering data when loading or plotting. It comes particularly handy for method chaining.
Why not convert from Series to DataFrame, do the querying, and then convert back.
df["Points"] = df["Points"].to_frame().query('Points > 100')["Points"]
Here, .to_frame()
converts to DataFrame, while the trailing ["Points"]
converts to Series.
The method .query()
can then be used consistently whether or not the Pandas object has 1 or more columns.