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

SyntaxError: Multiple notebooks #59

Open
thedatalass opened this issue Jul 13, 2019 · 2 comments
Open

SyntaxError: Multiple notebooks #59

thedatalass opened this issue Jul 13, 2019 · 2 comments
Assignees

Comments

@thedatalass
Copy link

thedatalass commented Jul 13, 2019

sparse_scipy_optim

def poiss_loglike(x, data, a):
    print x
    return -np.sum(data*np.log(x)-x)*a


params = sc.fmin(poiss_loglike, 0, args=(data ,1))
print params
File "<ipython-input-11-adb8f934fbcb>", line 2
    print x
          ^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(x)?

Sparse Categorical Bottleneck

File "<ipython-input-1-09b63899e645>", line 23
    print index                                                                    #the most intense part of the algorithm
              ^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(index                                                                    #the most intense part of the algorithm)?

Sparse Categorical Speed

File "<ipython-input-6-a5621e230dc1>", line 3
    print np.allclose(spcategorical1(o).toarray(), spcategorical2(o).toarray())
           ^
SyntaxError: invalid syntax

NYC_Bike_Example

os.chdir('/Users/toshan/dev/pysal/pysal/contrib/spint')
from gravity import Gravity, Production, Attraction, Doubly

model = Gravity(flows, o_vars, d_vars, cost, 'exp')
print model.params
print model.deviance
  File "<ipython-input-2-72a7a70c129d>", line 5
    print model.params
              ^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(model.params)
@thedatalass thedatalass changed the title Notebooks - Sparse Scipy Optim - syntax errors Notebooks - Sparse Scipy Optim & Categorical Bottleneck - syntax errors Jul 13, 2019
@thedatalass thedatalass changed the title Notebooks - Sparse Scipy Optim & Categorical Bottleneck - syntax errors SyntaxError: Sparse Scipy Optim & Categorical Bottleneck notebooks Jul 13, 2019
@thedatalass thedatalass changed the title SyntaxError: Sparse Scipy Optim & Categorical Bottleneck notebooks SyntaxError: Multiple notebooks Jul 13, 2019
@ljwolf
Copy link
Member

ljwolf commented Jul 13, 2019

These are all 2to3 errors, so not technically errors?

@darribas, maybe run 2to3 on these notebooks as part of the buildscript, or we just fix these once & move on.

@darribas
Copy link
Member

yeah I could add that script run on the build process. Do you have any pointers on where to find it/how to run it?

More generally, shouldn't notebooks be Python-3 first in all projects in the federation by now? If so, I'm happy to issue a fix upstream on the notebooks.

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

4 participants