redbaron icon indicating copy to clipboard operation
redbaron copied to clipboard

Failure on Pandas DataFrame.set_index()

Open zgoda-mobica opened this issue 6 years ago • 1 comments

Code:

df = DataFrame.from_dict(raw_results, orient='index')
df.set_index([[*range(len(df))]], inplace=True)

And result:

 232     df = DataFrame.from_dict(raw_results, orient='index')
 233     df.set_index([[*<---- here

The token STAR should be one of those: BACKQUOTE, BINARY, BINARY_RAW_STRING, BINARY_STRING, COMPLEX, FLOAT, FLOAT_EXPONANT, FLOAT_EXPONANT_COMPLEX, HEXA, INT, LAMBDA, LEFT_BRACKET, LEFT_PARENTHESIS, LEFT_SQUARE_BRACKET, LONG, MINUS, NAME, NOT, OCTA, PLUS, RAW_STRING, RIGHT_SQUARE_BRACKET, STRING, TILDE, UNICODE_RAW_STRING, UNICODE_STRING

It is not normal that you see this error, it means that Baron has failed to parse valid Python code. It would be kind if you can extract the snippet of your code that makes Baron fail and open a bug here: https://github.com/Psycojoker/baron/issues

Sorry for the inconvenience.

zgoda-mobica avatar Jul 27 '18 15:07 zgoda-mobica

Thanks for reporting. This is due to the used of a currently unsupported python3 grammar (the "*" in a [] or more exactly on an atom). This will end up being solved at some point.

Psycojoker avatar Aug 04 '18 16:08 Psycojoker