-
Notifications
You must be signed in to change notification settings - Fork 569
Closed
Description
The above example gives an error:
gg = ggplot(_df, aes(x="np.log(c_ratio_in)", y="np.log(ppy_ratio_in)")) + geom_point()
gg
File "<string>", line 1
data.get('np')data.get('log')(data.get('ppy_ratio_in'))
^
SyntaxError: invalid syntax
-> There should be a better way to detect if something is a column or not -> Check if the potential column name is really in data.columns
and only then surround it with the data.get(...)
This should also help against non existing columns:
_df.get("NotExisting")
-> No Error! -> The final plt simple shows nothing :-(
If there is an error in the eval, the error message is not helpfull:
gg = ggplot(_df, aes(x="log(c_ratio_in)", y="log(ppy_ratio_in)")) + geom_point()
gg
[...]
c:\data\external\ggplot\ggplot\ggplot.pyc in _build_df_from_transforms(data, aes)
481 item = "data.get('%s')" % item
482 lambda_column += item
--> 483 data[name] = eval(lambda_column)
484 return data
c:\data\external\ggplot\ggplot\ggplot.pyc in <module>()
TypeError: 'NoneType' object is not callable
-> At least the resulting eval line should be printed and then the exception reraised.
Metadata
Metadata
Assignees
Labels
No labels