Re: numpy array question
Il giorno giovedì 2 aprile 2020 06:30:22 UTC+2, jagmit sandhu ha scritto: > python newbie. I can't understand the following about numpy arrays: > > x = np.array([[0, 1],[2,3],[4,5],[6,7]]) > x > array([[0, 1], >[2, 3], >[4, 5], >[6, 7]]) > x.shape > (4, 2) > y = x[:,0] > y > array([0, 2, 4, 6]) > y.shape > (4,) > > Why is the shape for y reported as (4,) ? I expected it to be a (4,1) array. > thanks in advance Because is not Matlab where everything is at least a 2d array. If you fix a dimension that dimension disappear. It is the same behaviour as that of Fortran. Personally I think that the Python behaviour is more natural and obvious. As always it is a choice of who has written the library what will happen with a slice. -- https://mail.python.org/mailman/listinfo/python-list
Re: how to specify trusted hosts in windows config file
This is the ideal thing a hacker would do. Reports say that codes are a hacker's sweet spot. Because most of the time a random person would visit the code and copy and paste it because he has to get the job done in a limited time. Nothing could actually be 100% trusted in the internet. Because websites that might seem legitimate might be not. And true websites could be copied easily. On Tue, Mar 31, 2020, 11:44 PM Chris Angelico wrote: > On Wed, Apr 1, 2020 at 3:31 AM wrote: > > > > I don't have control over this, Chris. This is at my office. I'm not > the resource who manages network or other settings. And we have various > anti-spyware in place, that at leasts mitigates the risk. > > > > Then talk to the person who does. Ask if s/he is okay with you > downloading untrusted code from the internet and running it with your > full permissions. Then ask if it would be better to be able to trust > that code's origin. > > > What I'm doing isn't unprecedented. People get false positives all the > time on the web, and ask for this type of assistance. Maybe my results > were real evidence of something funky, but either way I have to get work > done. > > > > Yes, you have to get work done, so you ran random code from the > internet, downloaded on an unsecured connection, when the evidence > clearly showed that you were NOT getting it from the official source. > > > Thanks for trying to help, anyway. I'll do a compare of the refreshed > PIP files on the office PC, to a copy of pip elsewhere that I know is legit. > > > > Good luck. Chances are you won't know you've been hit with any spyware > or anything, so you'll feel confident. > > ChrisA > -- > https://mail.python.org/mailman/listinfo/python-list > -- https://mail.python.org/mailman/listinfo/python-list
Re: Identifying tkinter version [ANSWERED]
On Thu, 2 Apr 2020, Terry Reedy wrote: Or run IDLE, select Help > About IDLE and the patchlevel is displayed. Terry, Interesting. I use emacs but I'll keep this in mind. Regards, Rich -- https://mail.python.org/mailman/listinfo/python-list
Widget common to multiple views: import from commonDlg?
This application has 8 data entry/edit view modules of tkinter widgets and
an additional module called commonDlg which is imported into each of the
others.
Each view module has a comments tk.Text widget:
self.inputs['Notes'] = cd.LabelInput(
taxoninfo, "notes",
input_class = Tk.Text,
input_args = {'width': 75, 'height': 10, 'wrap': 'word'}
)
self.inputs['Notes'].grid(sticky = 'w', row=3, column= 0)
# vertical scrollbar
scroll_y = tk.Scrollbar(self, orient="vertical", command=notes.yview)
scroll_y.grid(row=3, sticky='nsw')
notes.configure(yscrollcommand=scroll_y.set)
# horizontal scrollbar
scroll_x = tk.Scrollbar(self, orient="horizontal", command=notes.xview)
scroll_x.grid(row=3, sticky='wen')
notes.configure(xscrollcommand=scroll_x.set)
(I'm not confident I have the scrollbars correctly written.)
Now, when I edit this data entry widge I do so in each of the eight data
entry/edit modules. My question is whether I can put this one widget in the
commonDlgs module and have it called in each module where it belongs. If so,
what is the proper syntax?
Rich
--
https://mail.python.org/mailman/listinfo/python-list
Re: numpy array question
jagmit sandhu wrote: > python newbie. I can't understand the following about numpy arrays: > > x = np.array([[0, 1],[2,3],[4,5],[6,7]]) > x > array([[0, 1], >[2, 3], >[4, 5], >[6, 7]]) > x.shape > (4, 2) > y = x[:,0] > y > array([0, 2, 4, 6]) > y.shape > (4,) > > Why is the shape for y reported as (4,) ? I expected it to be a (4,1) > array. thanks in advance Why do you expect every array to be a 2D matrix? Why not 3D or 4D? In the shape of y the 4 could be followed by an infinite amount of ones (4, 1, 1, 1, 1, 1,...) Instead numpy uses as many dimensions as you provide: >>> import numpy as np >>> np.array(42).shape () >>> np.array([42]).shape (1,) >>> np.array([[42]]).shape (1, 1) >>> np.array([[[42]]]).shape (1, 1, 1) I think this is a reasonable approach. Dont you? -- https://mail.python.org/mailman/listinfo/python-list
EuroPython 2020: CFP for the Online Event
Since we had started the CFP under the assumption of running an in-person conference and are now switching EuroPython 2020 to an online event, we will extend the CFP for another two weeks until April 12, to give everyone who would like to participate in this new format, a chance to submit a session proposal. * EuroPython 2020 Online - Call for Proposal * https://ep2020.europython.eu/call-for-proposals/ The online event will have this layout: - July 23 - 24 (Thursday, Friday): conference days - July 25 - 26 (Saturday, Sunday): sprint days Presenting at EuroPython For the conference days, we are looking for the following session types: - Talks of 35- or 45-minute duration (including 3-5 minutes for Q&A) - Posters - Help desks / Panels / Interactive sessions We will give out free tickets to the event for all selected speakers. For posters, we are planning to collect them on a gallery page, together with PDF versions to read during the event. The speaker will then be available during the poster session to answer questions and present more details using screen sharing. Help desks, panels and interactive sessions will be run using virtual rooms we’ll make available during the conference days. We will also have lightning talks for the online event, but those will be collected closer to the event using a separate form or Google sheet - similar to how we run this at the in-person conference. For submitting sprints, please check our sprints page. Note that unlike the conference days, the sprints day won’t require buying a ticket. https://ep2020.europython.eu/events/sprints/ Let’s make this an engaging event for everyone -- Even though we’re running an online event, our aim is to make the online event as engaging as possible, so we will provide ways for direct interaction with the speakers after their talk in separate virtual rooms and additionally a chat system for asynchronous interaction. The conference system will also allow live polls and text or audio/video based Q&A sessions, so please consider this when preparing your sessions and add any polls you’d like to run in the submission notes section (“Additional information for talk reviewers”). The conference will be held between 09:00 CEST and 20:00 CEST on the two conference days. We will try to schedule talks based on location and timezone of the speaker. Please indicate your timezone in submission notes. Help spread the word Please help us spread this message by sharing it on your social networks as widely as possible. Thank you ! Link to the blog post: https://blog.europython.eu/post/614296142774173696/europython-2020-cfp-for-the-online-event Tweet: https://twitter.com/europython/status/1245723386329870339 Thanks, -- EuroPython 2020 Team https://ep2020.europython.eu/ https://www.europython-society.org/ -- https://mail.python.org/mailman/listinfo/python-list
Python error
Hi, I have the version of python installed: Python 3.7.6 and Python 3.8.1 If I type: python Python 3.7.6 (default, Jan 8 2020, 19:59:22) [GCC 7.3.0] :: Anaconda, Inc. on linux Type "help", "copyright", "credits" or "license" for more information. >>> import numpy it is Ok, no error, but if I did: python3.8 Python 3.8.1 (default, Jan 31 2020, 15:49:05) [GCC 4.4.7 20120313 (Red Hat 4.4.7-23)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import numpy Traceback (most recent call last): File "", line 1, in ModuleNotFoundError: No module named 'numpy' Please, I would like to know why in the python3.8 version I have this error. Thanks, Conrado -- https://mail.python.org/mailman/listinfo/python-list
Re: Python error
Am 02.04.2020 um 20:09 schrieb J Conrado: > Hi, > > I have the version of python installed: > Python 3.7.6 and Python 3.8.1 > If I type: > python > Python 3.7.6 (default, Jan 8 2020, 19:59:22) > [GCC 7.3.0] :: Anaconda, Inc. on linux > Type "help", "copyright", "credits" or "license" for more information. import numpy > > it is Ok, no error, but if I did: > > python3.8 > > Python 3.8.1 (default, Jan 31 2020, 15:49:05) > [GCC 4.4.7 20120313 (Red Hat 4.4.7-23)] on linux > Type "help", "copyright", "credits" or "license" for more information. import numpy > > Traceback (most recent call last): > File "", line 1, in > ModuleNotFoundError: No module named 'numpy' > > Please, > I would like to know why in the python3.8 version I have this error. Because you installed numpy only for 3.7.6. All Python installations have their own module paths, so you need to install numpy for 3.8.1 too. Do it with: python3.8 -m pip install numpy -- https://mail.python.org/mailman/listinfo/python-list
Re: Python error
On 2020-04-02 19:09, J Conrado wrote: Hi, I have the version of python installed: Python 3.7.6 and Python 3.8.1 If I type: python Python 3.7.6 (default, Jan 8 2020, 19:59:22) [GCC 7.3.0] :: Anaconda, Inc. on linux Type "help", "copyright", "credits" or "license" for more information. >>> import numpy it is Ok, no error, but if I did: python3.8 Python 3.8.1 (default, Jan 31 2020, 15:49:05) [GCC 4.4.7 20120313 (Red Hat 4.4.7-23)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import numpy Traceback (most recent call last): File "", line 1, in ModuleNotFoundError: No module named 'numpy' Please, I would like to know why in the python3.8 version I have this error. Thanks, It looks like you have the Anaconda distribution for Python 3.7 and the standard distribution for Python 3.8. The standard distribution comes with only the standard library. The Anaconda distribution comes with a lot of extra stuff, which includes numpy. -- https://mail.python.org/mailman/listinfo/python-list
Re: Fwd: Problemas para ejecutar Python en windows 7
On 2/04/20 7:24 PM, Honori R. Camacho wrote: Gracias por atender esta solicitud. Si, no explique que antes se ejecutaba correctamente, pero ocurio que por error se desinstalo un *frameworks* y desde ahi consideramos, empezaron los problemas. Se reinstalo el Python 3.5.4 desde los repositorios de Python.org y se puede ejecutar utilizando Geany, pero si queremos ejecutarlo desde el escritorio, mediante un acceso directo no lo permite. De echo en windows 7 en "Ejecutar como". No nos permite colocar Python, ni PythonW y antes se podia y se ejecutaba desde alli. gracias. Please respond to the Discussion List email address - others may be able to help (more quickly)! If the earlier reference to documentation in Spanish did not help, are you able to use https://docs.python.org/3/using/windows.html#python-launcher-for-windows ? Is there an Accessories > 'DOS box' or 'Command Line' option in the Start Menu? Please would someone else help? (I don't use Microsoft products) Am hoping this is one of those perennial questions. The issue (if I have understood it correctly) is that Python was damaged when a framework or library was removed. So, Python was re-installed from the official repository. However, whilst it will now start from Geany (editor) there is no (longer) a Windows-Desktop short-cut (which may mean, entry on the Start Menu or a 'box' in the Win-10 opening-screen Start Menu replacement-thingy). I'm not clear whether the "short-cut" is to access Python at the command-line, or if it is to start an application under Python. -- Regards =dn -- https://mail.python.org/mailman/listinfo/python-list
jupyter notebook permission denied
I have installed anaconda on windows 10, and when launching jupyter notebook from the anaconda navigator, it works fine. However, I am bound to work on files within the folder c:\Users\username\... If I launch jupyter notebook from a windows 10 cmd prompt, I can cd to my project directory. However, a permission denied issue prevents loading/updating the *ipynb files. Any idea why? Same happens if I do it as Administrator. -- Regards, Joseph Pareti - Artificial Intelligence consultant Joseph Pareti's AI Consulting Services https://www.joepareti54-ai.com/ cell +49 1520 1600 209 cell +39 339 797 0644 -- https://mail.python.org/mailman/listinfo/python-list
Re: Fwd: Problemas para ejecutar Python en windows 7
If you can read English. The same problem occurred with me some times ago. The cause of it was that windows thought that my .py files where trojans and I had to delete them permanently which solved the problem. Try this once. Something is better than nothing. Thank you. If you cannot read English. El mismo problema ocurrió conmigo algunas veces. La causa de esto fue que Windows pensó que mis archivos .py eran troyanos y tuve que eliminarlos permanentemente, lo que resolvió el problema. Intenta esto una vez. Algo es mejor que nada. Gracias. On Fri, Apr 3, 2020, 1:12 AM DL Neil via Python-list wrote: > On 2/04/20 7:24 PM, Honori R. Camacho wrote: > > Gracias por atender esta solicitud. Si, no explique que antes se > > ejecutaba correctamente, pero ocurio que por error se desinstalo un > > *frameworks* y desde ahi consideramos, empezaron los problemas. Se > > reinstalo el Python 3.5.4 desde los repositorios de Python.org y se > > puede ejecutar utilizando Geany, pero si queremos ejecutarlo desde el > > escritorio, mediante un acceso directo no lo permite. De echo en windows > > 7 en "Ejecutar como". No nos permite colocar Python, ni PythonW y antes > > se podia y se ejecutaba desde alli. gracias. > > Please respond to the Discussion List email address - others may be able > to help (more quickly)! > > If the earlier reference to documentation in Spanish did not help, are > you able to use > https://docs.python.org/3/using/windows.html#python-launcher-for-windows ? > > Is there an Accessories > 'DOS box' or 'Command Line' option in the > Start Menu? > > > Please would someone else help? > (I don't use Microsoft products) > > Am hoping this is one of those perennial questions. > > The issue (if I have understood it correctly) is that Python was damaged > when a framework or library was removed. So, Python was re-installed > from the official repository. However, whilst it will now start from > Geany (editor) there is no (longer) a Windows-Desktop short-cut (which > may mean, entry on the Start Menu or a 'box' in the Win-10 > opening-screen Start Menu replacement-thingy). > > I'm not clear whether the "short-cut" is to access Python at the > command-line, or if it is to start an application under Python. > > -- > Regards =dn > -- > https://mail.python.org/mailman/listinfo/python-list > -- https://mail.python.org/mailman/listinfo/python-list
