Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make shorthand definition possible #18

Open
harrylojames opened this issue Jun 7, 2023 · 1 comment
Open

Make shorthand definition possible #18

harrylojames opened this issue Jun 7, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@harrylojames
Copy link
Contributor

Hi,

In line with having a syntax as close as possible to javascript it would nice to be able to use the shorthand syntax as seen here.

import pandas as pd
from pyobsplot import Plot

df = pd.DataFrame({'Date': {0: '1880-01-01', 1: '1880-02-01'}, 'Anomaly': {0: -0.3, 1: -0.21}})
Plot.lineY(df, {"x": "Date", "y": "Anomaly"}).plot()
AttributeError                            Traceback (most recent call last)
Cell In[15], line 5
      2 from pyobsplot import Plot
      4 df = pd.DataFrame({'Date': {0: '1880-01-01', 1: '1880-02-01'}, 'Anomaly': {0: -0.3, 1: -0.21}})
----> 5 Plot.lineY(df, {"x": "Date", "y": "Anomaly"}).plot()

AttributeError: 'dict' object has no attribute 'plot'

Not sure how feasible this is and not a dealbreaker for me but thought it was worth noting in case it wasn't on the radar.

Many thanks,

Harry

@juba juba added the enhancement New feature or request label Jun 8, 2023
@juba
Copy link
Owner

juba commented Jun 8, 2023

I'm not sure I would be able to implement this given the way python Plot methods are automatically generated, but this is indeed a very valid suggestion.

I keep this open, thanks for the idea !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants