Call julia from Python: which package?

2021-12-17 Thread Albert-Jan Roskam
Hi, I have a Python program that uses Tkinter for its GUI. It's rather slow so I hope to replace many or all of the non-GUI parts by Julia code. Has anybody experience with this? Any packages you can recommend? I found three alternatives: * https://pyjulia.readthedocs.io/en/latest/usage.html#

Re: Call julia from Python: which package?

2021-12-17 Thread Dan Stromberg
On Fri, Dec 17, 2021 at 7:02 AM Albert-Jan Roskam wrote: > Hi, > > I have a Python program that uses Tkinter for its GUI. It's rather slow so > I hope to replace many or all of the non-GUI parts by Julia code. Has > anybody experience with this? Any packages you can recommend? I found three > alt

Problem Installing Pipenv

2021-12-17 Thread Stephen P. Molnar
I have Python 3.9 installed in Windows 10 on my Laptop and have installed pipenv v-2021.11.5. When I invoke the python shell command, it fails with thee following errors: C:\Users\SPM\Apps\Spyder-5.2.1>pipenv shell Traceback (most recent call last): File "C:\Python39\lib\runpy.py", line

Re: Call julia from Python: which package?

2021-12-17 Thread Lars Liedtke
Additionally I'd like to ask, if you e.g. used pandas and numpy before you make the effort of rewriting everything. Yes python is slower than compiled languages, but especially with numpy you can make use of compiled code underneath. Of course this could mean rewriting some existing code but stay

A problem with itertools.groupby

2021-12-17 Thread ast
Python 3.9.9 Hello I have some troubles with groupby from itertools from itertools import groupby for k, grp in groupby("aahfffddnnb"): print(k, list(grp)) print(k, list(grp)) a ['a', 'a'] a [] h ['h'] h [] f ['f', 'f', 'f'] f [] d ['d', 'd'] d [] s ['s', 's', 's', 's'] s [] n ['n

Re: A problem with itertools.groupby

2021-12-17 Thread Antoon Pardon
but: li = [grp for k, grp in groupby("aahfffddnnb")] list(li[0]) [] list(li[1]) [] It seems empty ... I don't understand why, this is the first read of an iterator, it should provide its data. The group-iterators are connected. Each group-iterator is a wrapper around the original it

Re: A problem with itertools.groupby

2021-12-17 Thread Chris Angelico
On Sat, Dec 18, 2021 at 2:32 AM ast wrote: > > Python 3.9.9 > > Hello > > I have some troubles with groupby from itertools > > from itertools import groupby > > li = [grp for k, grp in groupby("aahfffddnnb")] > list(li[0]) > > [] > > list(li[1]) > > [] > > It seems empty ... I don't understand

Re: A problem with itertools.groupby

2021-12-17 Thread Peter Pearson
On Fri, 17 Dec 2021 09:25:03 +0100, ast wrote: [snip] > > but: > > li = [grp for k, grp in groupby("aahfffddnnb")] > list(li[0]) > > [] > > list(li[1]) > > [] > > It seems empty ... I don't understand why, this is > the first read of an iterator, it should provide its > data. Baffling. Here'

Re: Call julia from Python: which package?

2021-12-17 Thread Oscar Benjamin
On Fri, 17 Dec 2021 at 15:04, Albert-Jan Roskam wrote: > > Hi, > > I have a Python program that uses Tkinter for its GUI. It's rather slow so I > hope to replace many or all of the non-GUI parts by Julia code. Has anybody > experience with this? Any packages you can recommend? I found three > a

Re: Call julia from Python: which package?

2021-12-17 Thread Chris Angelico
On Sat, Dec 18, 2021 at 9:24 AM Oscar Benjamin wrote: > When I timed the result in Julia and in Python I found that the Julia > code was slower than the Python code. Of course I don't know how to > optimise Julia code so I asked one of my colleagues who does (and who > likes to proselytise about J

Re: Call julia from Python: which package?

2021-12-17 Thread Oscar Benjamin
On Fri, 17 Dec 2021 at 22:40, Chris Angelico wrote: > > On Sat, Dec 18, 2021 at 9:24 AM Oscar Benjamin > wrote: > > When I timed the result in Julia and in Python I found that the Julia > > code was slower than the Python code. Of course I don't know how to > > optimise Julia code so I asked one

Re: Call julia from Python: which package?

2021-12-17 Thread Chris Angelico
On Sat, Dec 18, 2021 at 10:01 AM Oscar Benjamin wrote: > > On Fri, 17 Dec 2021 at 22:40, Chris Angelico wrote: > > > > On Sat, Dec 18, 2021 at 9:24 AM Oscar Benjamin > > wrote: > > > When I timed the result in Julia and in Python I found that the Julia > > > code was slower than the Python code.

Re: Call julia from Python: which package?

2021-12-17 Thread Oscar Benjamin
On Fri, 17 Dec 2021 at 23:11, Chris Angelico wrote: > > On Sat, Dec 18, 2021 at 10:01 AM Oscar Benjamin > wrote: > > > > On Fri, 17 Dec 2021 at 22:40, Chris Angelico wrote: > > > > > > On Sat, Dec 18, 2021 at 9:24 AM Oscar Benjamin > > > wrote: > > > > When I timed the result in Julia and in Py