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

only length-1 arrays can be converted to Python scalars #4

Open
zawmoetun opened this issue Dec 31, 2017 · 0 comments
Open

only length-1 arrays can be converted to Python scalars #4

zawmoetun opened this issue Dec 31, 2017 · 0 comments

Comments

@zawmoetun
Copy link

Dear Sir,
Very appreciate your efforts.
When I am running "2017-06-04-predicting-football-results-with-statistical-modelling", I get below errors. I used Anaconda framework. Even I run at command prompt, I still get this error. Python version 3.6.4 64 bit and it is running on Mac. Can you pls. help to me. I an very new to Python.
Best Regards,
Zaw


TypeError Traceback (most recent call last)
in ()
12 sun_away_pois = [poisson.pmf(i,np.sum(np.multiply(sun_home.values.T,sun_home.index.T),axis=1)[0]) for i in range(8)]
13
---> 14 ax1.bar(chel_home.index-0.4,chel_home.values,width=0.4,color="#034694",label="Chelsea")
15 ax1.bar(sun_home.index,sun_home.values,width=0.4,color="#EB172B",label="Sunderland")
16 pois1, = ax1.plot([i for i in range(8)], chel_home_pois,

~/anaconda3/lib/python3.6/site-packages/matplotlib/init.py in inner(ax, *args, **kwargs)
1708 warnings.warn(msg % (label_namer, func.name),
1709 RuntimeWarning, stacklevel=2)
-> 1710 return func(ax, *args, **kwargs)
1711 pre_doc = inner.doc
1712 if pre_doc is None:

~/anaconda3/lib/python3.6/site-packages/matplotlib/axes/_axes.py in bar(self, *args, **kwargs)
2146 edgecolor=e,
2147 linewidth=lw,
-> 2148 label='nolegend',
2149 )
2150 r.update(kwargs)

~/anaconda3/lib/python3.6/site-packages/matplotlib/patches.py in init(self, xy, width, height, angle, **kwargs)
687 """
688
--> 689 Patch.init(self, **kwargs)
690
691 self._x = xy[0]

~/anaconda3/lib/python3.6/site-packages/matplotlib/patches.py in init(self, edgecolor, facecolor, color, linewidth, linestyle, antialiased, hatch, fill, capstyle, joinstyle, **kwargs)
131 self.set_fill(fill)
132 self.set_linestyle(linestyle)
--> 133 self.set_linewidth(linewidth)
134 self.set_antialiased(antialiased)
135 self.set_hatch(hatch)

~/anaconda3/lib/python3.6/site-packages/matplotlib/patches.py in set_linewidth(self, w)
379 w = mpl.rcParams['axes.linewidth']
380
--> 381 self._linewidth = float(w)
382 # scale the dash pattern by the linewidth
383 offset, ls = self._us_dashes

TypeError: only length-1 arrays can be converted to Python scalars

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

1 participant