We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Current dataframe row selection by columns is wordy , 'rowsl()' method is need to make it looks simple.
def _rowsl(df, selection_str): #syntax sugar to simplify column selection:
#not_implement_yet #rst = parsing_and_ filtering return rst
DataFrame.rowsl = _rowsl
The text was updated successfully, but these errors were encountered:
Note you can simplify the syntax by using attribute column access: df[(df.col_1 > 0.5) & (df.col_2 < 40)]
Sorry, something went wrong.
accept, but df['col_1 > 0.5 & col_2 < 40'] might looks simple
I think the currently-pending query syntax addresses this issue:
query
>>> df = pd.DataFrame({"col_1": [0.1, 0.2, 0.7, 0.8], "col_2": [10, 50, 20, 60]}) >>> df col_1 col_2 0 0.1 10 1 0.2 50 2 0.7 20 3 0.8 60 [4 rows x 2 columns] >>> df.query("col_1 > 0.5 & col_2 < 40") col_1 col_2 2 0.7 20 [1 rows x 2 columns]
closed by #4164
No branches or pull requests
Current dataframe row selection by columns is wordy , 'rowsl()' method is need to make it looks simple.
def _rowsl(df, selection_str):
#syntax sugar to simplify column selection:
df.rowsl('col_1>0.5 & col_2<40') act as
df[(df['col_1']>0.5) & (df['col_2']<40)]
DataFrame.rowsl = _rowsl
The text was updated successfully, but these errors were encountered: