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
https://github.com/pandas-dev/pandas/blob/master/doc/cheatsheet/Pandas_Cheat_Sheet.pdf
In Pandas_Cheat_Sheet/ Subset Variables (Columns)/ regex (Regular Expressions) Examples
The second ' in regex is unnecessary.
execute sucessfully
# features = data_df.filter(regex=''^(?!SalePrice$).*')
File "", line 5 features = data_df.filter(regex=''^(?!SalePrice$).*') ^ SyntaxError: invalid syntax
# features = data_df.filter(regex='^(?!SalePrice$).*')
The text was updated successfully, but these errors were encountered:
Good catch!
cc @TomAugspurger @Dr-Irv
xref #20366
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
Problem description
https://github.com/pandas-dev/pandas/blob/master/doc/cheatsheet/Pandas_Cheat_Sheet.pdf
In Pandas_Cheat_Sheet/ Subset Variables (Columns)/ regex (Regular Expressions) Examples
''^(?!Species$).*' Matches strings except the string 'Species'
The second ' in regex is unnecessary.
Expected Output
execute sucessfully
Actual result:
# features = data_df.filter(regex=''^(?!SalePrice$).*')
File "", line 5
features = data_df.filter(regex=''^(?!SalePrice$).*')
^
SyntaxError: invalid syntax
should be:
# features = data_df.filter(regex='^(?!SalePrice$).*')
The text was updated successfully, but these errors were encountered: