[Tutor] Using the Nimblenet Library in Python 3.6

2018-04-04 Thread Evapcoop, Evapcoop
Hello,
I am running into some trouble when trying to import certain modules; I wanted 
to know if it is possible to use Nimblenet and all it's associated packages 
with Python3.6. From what I have read, that library is compatible with 
Python2.7.

Some how I was able to successfully import Nimblenet on through the Conda 
prompt. But when I try to import some associated packages, it errors out. Here 
is an example:

from nimblenet.activation_functions import tanh_function
from nimblenet.learning_algorithms  import scaled_conjugate_gradient
from nimblenet.cost_functions  import sum_squared_error
from nimblenet.data_structures import Instance
from nimblenet.neuralnet import NeuralNet
import numpy as np
import time
import cPickle as pickle
import logging
from tabulate import tabulate
import database_operations as dbo

---
ModuleNotFoundError   Traceback (most recent call last)
 in ()
  3 from __future__ import print_function
  4 from nimblenet.activation_functions import tanh_function
> 5 from nimblenet.learning_algorithms  import scaled_conjugate_gradient
  6 from nimblenet.cost_functions  import sum_squared_error
  7 from nimblenet.data_structures import Instance

C:\Anaconda3\lib\site-packages\nimblenet\learning_algorithms\__init__.py in 
()
  1 #from generalized_hebbian import *
> 2 from scaled_conjugate_gradient import scaled_conjugate_gradient
  3 from resilient_backpropagation import resilient_backpropagation
  4 from scipyoptimize import scipyoptimize
  5

ModuleNotFoundError: No module named 'scaled_conjugate_gradient'




I would appreciate any help I can get!


Thank you,
Christine




This e-mail, and any attachments, is intended solely for use by the 
addressee(s) named above. It may contain the confidential or proprietary 
information of Dana Incorporated, its subsidiaries, affiliates or business 
partners. If you are not the intended recipient of this e-mail or are an 
unauthorized recipient of the information, you are hereby notified that any 
dissemination, distribution or copying of this e-mail or any attachments, is 
strictly prohibited. If you have received this e-mail in error, please 
immediately notify the sender by reply e-mail and permanently delete the 
original and any copies or printouts.

Computer viruses can be transmitted via email. The recipient should check this 
e-mail and any attachments for the presence of viruses. Dana Incorporated 
accepts no liability for any damage caused by any virus transmitted by this 
e-mail.

English, Fran?ais, Espa?ol, Deutsch, Italiano, Portugu?s:
http://www.dana.com/corporate-pages/Email

___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] pythonic

2018-04-04 Thread Albert-Jan Roskam

Op 2 apr. 2018 15:31 schreef Steven D'Aprano :
>
> On Mon, Apr 02, 2018 at 06:49:52AM -0600, Mats Wichmann wrote:
> > On 04/02/2018 02:56 AM, Alan Gauld via Tutor wrote:
> > > On 02/04/18 04:19, Steven D'Aprano wrote:
> > >> On Sun, Apr 01, 2018 at 10:58:51PM +0100, Alan Gauld via Tutor wrote:
> > >>> On01/04/18 20:20, Albert-Jan Roskam wrote:
> >  fmt="%Y-%m-%d %H:%M\n"
> >  f.write(now.strftime(fmt))
> >  Lately I've been using format(), which uses __format__, because I find 
> >  it slightly more readable:
> >  format(datetime.now(), "%Y-%m-%d %H:%M")
> > >>> Interesting,
> > >>> I didn't know that format() recognised the datetime format codes.
> > >> It doesn't. It is the datetime object that recognises them. format()
> > >> merely passes the format string to the datetime.__format__ method, which
> > >> is what recognises the codes. It doesn't care what it is.
> > > Aha! That makes sense. I've never really used format() so have never
> > > bothered to find out how it works. To the point that until this thread I
> > > hadn't realized we even had a __format__() operator.
> > >
> > > As I said, I need to do some reading. Obviously a gap in my python
> > > education.
> > >
> >
> > so since we're all learning things here, how would this play out with
> > the new f-strings?
>
> I don't think f-strings are even a bit Pythonic.

"There should be one-- and preferably only one --obvious way to do it.":
1-str.format
2-% interpolation
3-string.Template
4-f strings
-...

I think that at least a few of these methods should become deprecated. Maybe 2 
and 3? (though I use 2 all the time!). Not sure about 4. A proper templating 
language like Jinja might be more desirable to have in the standard library, 
addition to a simple string substitution mechanism
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Using the Nimblenet Library in Python 3.6

2018-04-04 Thread Alan Gauld via Tutor
On 04/04/18 16:10, Evapcoop, Evapcoop wrote:
> I wanted to know if it is possible to use Nimblenet and all it's 
> associated packages with Python3.6.> From what I have read, that library is 
> compatible with Python2.7.

I think you just answered your own question. If the package is
designed for v2.7 its extremely unlikely to work in 3.6 even if
you did succeed in importing it. The differences between 2.7
and 3.6 are significant.

But this forum is the wrong place to ask. We are focused on the
Python language and standard library. For detailed info you
really need to ask the nimblenet developers/support fora.

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos


___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Using the Nimblenet Library in Python 3.6

2018-04-04 Thread Mats Wichmann
On 04/04/2018 05:07 PM, Alan Gauld via Tutor wrote:
> On 04/04/18 16:10, Evapcoop, Evapcoop wrote:
>> I wanted to know if it is possible to use Nimblenet and all it's 
>> associated packages with Python3.6.> From what I have read, that library is 
>> compatible with Python2.7.
> 
> I think you just answered your own question. If the package is
> designed for v2.7 its extremely unlikely to work in 3.6 even if
> you did succeed in importing it. The differences between 2.7
> and 3.6 are significant.
> 
> But this forum is the wrong place to ask. We are focused on the
> Python language and standard library. For detailed info you
> really need to ask the nimblenet developers/support fora.

Having no idea what nimblenet is I do see from a lightning search that
it's tied into numpy somehow.  So you may get some joy from asking in
the Anaconda forums as well - the whole reason for existence of the
Anaconda distribution is to make it reasonable to install things to do
with Numerical and Scientific Python without some of the headaches
sometimes associated with doing so from scratch - you seem to be trying
the conda route, so maybe someone has blazed the trail before you?

Also this is more supposition, but the fact that the line

  3 from __future__ import print_function

appears in the traceback means it's at least _possible_ Python 3
compatibility of the package has been considered - that's one of the
most obvious and visible changes, that print becomes a function instead
of a statement, and that was added to the future module somewhere along
the line in the Py2 series.

Best of luck in your searches!



___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Using the Nimblenet Library in Python 3.6

2018-04-04 Thread Mark Lawrence

On 05/04/18 00:07, Alan Gauld via Tutor wrote:

On 04/04/18 16:10, Evapcoop, Evapcoop wrote:

I wanted to know if it is possible to use Nimblenet and all it's
associated packages with Python3.6.> From what I have read, that library is 
compatible with Python2.7.


I think you just answered your own question. If the package is
designed for v2.7 its extremely unlikely to work in 3.6 even if
you did succeed in importing it. The differences between 2.7
and 3.6 are significant.



Python 3.6 has more functionality than 2.7 by definition, but your 
comment implies, at least to me, that 2.7 and 3.6 are chalk and cheese. 
Nothing could be further from the truth and has regrettably been one of 
the reasons for the dreadfully slow uptake of Python 3.


--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence

___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor