Open Almenon opened 3 years ago
Just doing a normal exec works 🤔 why does my exec fail?
code = """
import pandas as pd
cafes = pd.DataFrame({
'zip': [30324,],
'poc': ['jared', ]
})
# this works
print(cafes['zip'])
print('------')
print(cafes['poc'])
# this doesn't
print(cafes[['zip', 'poc']])
"""
exec(code)
Using runcontext also works:
locals = {}
import contextvars
run_context = contextvars.Context()
run_context.run(exec, code, locals)
The pandas code works in AREPL if python version 3.7 or above. This is still an issue with 3.6 but at least it has a workaround.
Describe the bug Pandas does not work when printing multiple columns of dataframes
To Reproduce Steps to reproduce the behavior:
Expected behavior Pandas prints without error as it does when running in the terminal
Other Information (please complete the following information):
Additional context It's weird because usually errors happen the second or third run, but this error happens immediately. So it's not related to the module or jsonpickle logic.
Error: