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

Fix rick.charts.line_chart's baseline param #16

Closed
chmnata opened this issue Nov 4, 2019 · 0 comments
Closed

Fix rick.charts.line_chart's baseline param #16

chmnata opened this issue Nov 4, 2019 · 0 comments

Comments

@chmnata
Copy link

chmnata commented Nov 4, 2019

Got this error when trying to follow rick's rick's chart [sample ] (https://cityoftoronto.github.io/bdit_python_utilities/auto_examples/plot_line.html#sphx-glr-auto-examples-plot-line-py) using the baseline param

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-13-840157d7e7c5> in <module>
     24 total2=pandasql.read_sql(query, con)
     25 total2
---> 26 fig, ax, props = rick.charts.line_chart(total['count'], 'Trips', 'Time', baseline = total2['count'])

/etc/jupyterhub/.venv/src/rick/charts/rick.py in line_chart(data, ylab, xlab, **kwargs)
    276         fig, ax =plt.subplots()
    277         ax.plot(data ,linewidth=3, color = colour.purple)
--> 278         if baseline:
    279             ax.plot(baseline ,linewidth=3, color = colour.grey)
    280 

/etc/jupyterhub/.venv/lib/python3.5/site-packages/pandas/core/generic.py in __nonzero__(self)
   1476         raise ValueError("The truth value of a {0} is ambiguous. "
   1477                          "Use a.empty, a.bool(), a.item(), a.any() or a.all()."
-> 1478                          .format(self.__class__.__name__))
   1479 
   1480     __bool__ = __nonzero__

ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().
radumas added a commit that referenced this issue Nov 4, 2019
@radumas radumas closed this as completed Nov 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants