benmiroglio / pymatch

MIT License
276 stars 129 forks source link

builtin error in ast.py #7

Open dylanking42 opened 6 years ago

dylanking42 commented 6 years ago

when attemtping:

m = Matcher(test, control, yvar="loan_status", exclude=[])

from the example @ https://github.com/benmiroglio/pymatch/blob/master/Example.ipynb

I ran into a syntax error in the python built in ast.py

The error was that my variable column names contained white space.

I resolved this error by simply

df.columns = df.columns.str.replace(' ', '_')

and then the ast.py did not throw a syntax error.

Not sure if this is something you would want to put a check in for or not, but it really threw me for a loop getting a syntax error in a base python package.