lux-org / lux

Automatically visualize your pandas dataframe via a single print! 📊 💡
Apache License 2.0
5.15k stars 365 forks source link

[BUG] Matplotlib code missing computed data for BarChart, LineChart and ScatterChart #362

Open caitlynachen opened 3 years ago

caitlynachen commented 3 years ago

Describe the bug Without self.code += f”df = pd.DataFrame({str(self.data.to_dict())})\n”, exported BarChart, LineChart and ScatterChart that contain computed data throw an error.

To Reproduce

df = pd.read_csv('https://github.com/lux-org/lux-datasets/blob/master/data/hpi.csv?raw=true')
df
vis = df.recommendation["Occurrence"][0]
vis
print (vis.to_code("matplotlib"))

Expected behavior Should render single BarChart

Screenshots

Screen Shot 2021-04-15 at 11 22 25 AM

Expected:

Screen Shot 2021-04-15 at 11 22 51 AM