You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If a column name matches a defined type it does not seem to be possible to include the column in a .query() string. For instance, df.query("Timestamp < 10") throws a TypeError: '<' not supported between instances of 'type' and 'int' for a dataframe where df[df.Timestamp < 10] yields the expected result.
Describe the solution you'd like
Ideally, a query string should prioritize the the column or row index values for the dataframe whose .query method is called. This the natural scope of a query on a dataframe and we already have special operators (e.g. @) to indicate that objects that exist outside the dataframe "namespace". The current behavior to automatically search outside the dataframe is almost a bug.
Describe alternatives you've considered
Alternative 1: Perhaps the backtick escaping for column names with spaces could be extended to prefer matching dataframe column names over classes in the local scope. It does not make as much sense namespace-wise but it is less breaking than the proposed solution.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem?
If a column name matches a defined type it does not seem to be possible to include the column in a .query() string. For instance,
df.query("Timestamp < 10")
throws aTypeError: '<' not supported between instances of 'type' and 'int'
for a dataframe wheredf[df.Timestamp < 10]
yields the expected result.Describe the solution you'd like
Ideally, a query string should prioritize the the column or row index values for the dataframe whose .query method is called. This the natural scope of a query on a dataframe and we already have special operators (e.g.
@
) to indicate that objects that exist outside the dataframe "namespace". The current behavior to automatically search outside the dataframe is almost a bug.Describe alternatives you've considered
Alternative 1: Perhaps the backtick escaping for column names with spaces could be extended to prefer matching dataframe column names over classes in the local scope. It does not make as much sense namespace-wise but it is less breaking than the proposed solution.
The text was updated successfully, but these errors were encountered: