-
-
Notifications
You must be signed in to change notification settings - Fork 18.9k
Open
Labels
Description
Is your feature request related to a problem?
Pandas query strings are very useful, however when using a variable to pass in the query, e.g.
df.query(my_query)
There is no null or empty my_query
that will return all rows. An empty string returns a ValueError. Any non-string argument returns an error.
Describe the solution you'd like
An empty string or None or some keyword argument (even with an empty expr
to .query() should return all rows.
Additional context
Without the ability to pass something to .query
that returns all rows you end up with something like this, when _query
may or may not set. It'd be nice to be able to avoid this conditional by having something to pass to query that returns all rows.
if _query:
dfs = [f(x).query(_query) for x in the_list]
else:
dfs = [f(x) for x in list]
rraadd88 and cm-halfspace