Re: A random word from one of two lists

2021-01-03 Thread Mats Wichmann
On 1/3/21 11:34 AM, Richard Damon wrote: It depends on what distribution of results you want. Since the example had two equal length list is doesn't matter, but if, say, there were many more animals then fruit, your method would produce an animal more often than a fruit, but the two level method

Re: Copying column values up based on other column values

2021-01-03 Thread Codeliner
On Sunday, January 3, 2021 at 8:17:16 PM UTC+2, Codeliner wrote: > On Sunday, January 3, 2021 at 7:08:49 PM UTC+2, Jason Friedman wrote: > > > > > > import numpy as np > > > import pandas as pd > > > from numpy.random import randn > > > df=pd.DataFrame(randn(5,4),['A','B','C','D','E'],['W','X'

Re: A random word from one of two lists

2021-01-03 Thread Richard Damon
On 1/3/21 12:38 PM, Mats Wichmann wrote: > On 1/3/21 5:30 AM, Bischoop wrote: >> On 2021-01-02, Stefan Ram wrote: >>> Bischoop writes: On 2021-01-02, Stefan Ram wrote: > Otherweise, I'd go this way without a dictionary. > import random > animal = ['koala', 'kangaroo'] > frui

Re: Copying column values up based on other column values

2021-01-03 Thread Codeliner
On Sunday, January 3, 2021 at 7:08:49 PM UTC+2, Jason Friedman wrote: > > > > import numpy as np > > import pandas as pd > > from numpy.random import randn > > df=pd.DataFrame(randn(5,4),['A','B','C','D','E'],['W','X','Y','Z']) > > > > W X Y Z > > A -0.183141 -0.398652 0.909746 0.332105 > >

Re: A random word from one of two lists

2021-01-03 Thread Mats Wichmann
On 1/3/21 5:30 AM, Bischoop wrote: On 2021-01-02, Stefan Ram wrote: Bischoop writes: On 2021-01-02, Stefan Ram wrote: Otherweise, I'd go this way without a dictionary. import random animal = ['koala', 'kangaroo'] fruit = ['banana', 'apple'] kinds = [animal,fruit] kind = random.choice( kinds

Re: Copying column values up based on other column values

2021-01-03 Thread Jason Friedman
> > import numpy as np > import pandas as pd > from numpy.random import randn > df=pd.DataFrame(randn(5,4),['A','B','C','D','E'],['W','X','Y','Z']) > > W X Y Z > A -0.183141 -0.398652 0.909746 0.332105 > B -0.587611 -2.046930 1.446886 0.167606 > C 1.142661 -0.861617 -0.180631 1.650463 > D 1.174805

Re: NumPy: build script not finding correct python version [UPDATE]

2021-01-03 Thread Rich Shepard
On Sun, 3 Jan 2021, Rich Shepard wrote: I'm trying to rebuild numpy-1.18.2 using the newly installed Python-3.9.1. The script fails when running setup.py: Traceback (most recent call last): File "setup.py", line 32, in raise RuntimeError("Python version >= 3.5 required.") RuntimeError: Pyth

Copying column values up based on other column values

2021-01-03 Thread Codeliner
Hello, I have this dataframe import numpy as np import pandas as pd from numpy.random import randn df=pd.DataFrame(randn(5,4),['A','B','C','D','E'],['W','X','Y','Z']) W X Y Z A -0.183141 -0.398652 0.909746 0.332105 B -0.587611 -2.046930 1.446886 0.167606 C 1.142661 -0.861617 -0.180631 1.650463

Re: Does windows edit .py file shebangs?

2021-01-03 Thread Barry Scott
> On 3 Jan 2021, at 15:13, Eryk Sun wrote: > > On 1/3/21, Barry Scott wrote: >> >> I've been doing some more investigation and found that the change happened >> at 01/01/2021 16:16. The shebang is pointing to a 0 length PYTHON3.EXE. > > The files in "%LocalAppData%\Microsoft\WindowsApps" ar

Re: Does windows edit .py file shebangs?

2021-01-03 Thread Eryk Sun
On 1/3/21, Barry Scott wrote: > > I've been doing some more investigation and found that the change happened > at 01/01/2021 16:16. The shebang is pointing to a 0 length PYTHON3.EXE. The files in "%LocalAppData%\Microsoft\WindowsApps" are AppExec reparse points. NT filesystem reparse points are a

NumPy: build script not finding correct python version

2021-01-03 Thread Rich Shepard
I'm trying to rebuild numpy-1.18.2 using the newly installed Python-3.9.1. The script fails when running setup.py: Traceback (most recent call last): File "setup.py", line 32, in raise RuntimeError("Python version >= 3.5 required.") RuntimeError: Python version >= 3.5 required. When I invo

Re: Python Mauritius Usergroup - End of Year report 2020

2021-01-03 Thread Alex Kaye
Super report, need more like it from others ! A.K. On Sun, Jan 3, 2021 at 2:06 AM Abdur-Rahmaan Janhangeer < arj.pyt...@gmail.com> wrote: > Greetings, > > ^^ Thanks! > > Kind Regards, > > Abdur-Rahmaan Janhangeer > about | blog >

Re: Does windows edit .py file shebangs?

2021-01-03 Thread Barry Scott
> On 1 Jan 2021, at 17:03, Eryk Sun wrote: > > On 1/1/21, Barry Scott wrote: >> I found python scripts have had their shebang lines edited behind my back. >> >> The shebang line I'm seeing is: >> >>#!C:\Users\barry\AppData\Local\Microsoft\WindowsApps\python3.EXE >> >> Is this Microsoft

Re: A random word from one of two lists

2021-01-03 Thread Bischoop
On 2021-01-02, Stefan Ram wrote: > Bischoop writes: >>On 2021-01-02, Stefan Ram wrote: >>>Otherweise, I'd go this way without a dictionary. >>>import random >>>animal = ['koala', 'kangaroo'] >>>fruit = ['banana', 'apple'] >>>kinds = [animal,fruit] >>>kind = random.choice( kinds ) >>>result = ran

Re: Python Mauritius Usergroup - End of Year report 2020

2021-01-03 Thread Abdur-Rahmaan Janhangeer
Greetings, ^^ Thanks! Kind Regards, Abdur-Rahmaan Janhangeer about | blog github Mauritius On Sun, Jan 3, 2021 at 8:12 AM dn via Python-list wrote: > On 1/3/21 5:01 PM, Abdur-Rahmaan Janh