8000 run my code failed after i Import pylab failed, python version is 3.6.6 · Issue #12499 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content
run my code failed after i Import pylab failed, python version is 3.6.6 #12499
Closed
@shangxww

Description

@shangxww

Bug report

Bug summary
Installed [ylab in python 3.6.6 and then import it

Code for reproduction
import pylab as pl
File "C:\ProgramData\Anaconda2n\envs\py36\lib\site-packages\pylab.py", line 1, in
from matplotlib.pylab import *
File "C:\ProgramData\Anaconda2n\envs\py36\lib\site-packages\matplotlib_init_.py", line 351
print(s, file=self.fileo)
^
SyntaxError: invalid syntax

import pylab as pl
import pymc as mc

G_obs = [1.]
N = len(G_obs)

R = mc.Categorical('R', [.2,.8], value=[1,0])

p_S = mc.Lambda('p_S', lambda R=R: pl.where(R, .01, .4),
                doc='Pr[S|R]')
S = mc.Categorical('S', p_S, value=pl.ones(N))

p_G = mc.Lambda('p_G', lambda S=S, R=R:
                pl.where(S, pl.where(R, .99, .9), pl.where(R, .8, 0.)),
                doc='Pr[G|S,R]')
G = mc.Categorical('G', p_G, value=G_obs, observed=True)

M=mc.MCMC(set([R,S,G]))
M.use_step_method(mc.Metropolis, R, proposal_sd=1., proposal_distribution='Normal')
M.sample(1e4)

**Matplotlib version**
matplotlib-3.0.0.dist-info
  

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0