Re: Simple question - end a raw string with a single backslash ?

2020-10-18 Thread Chris Angelico
On Mon, Oct 19, 2020 at 5:26 PM Mladen Gogala via Python-list wrote: > bless \$ref will make the given reference a reference to the class. And > classes is Perl > are called "modules". However, Perl classes are not the classes in the real > sense. There > is no inheritance. You can have a simil

Re: Simple question - end a raw string with a single backslash ?

2020-10-18 Thread Mladen Gogala via Python-list
On Mon, 19 Oct 2020 02:44:25 +, Stefan Ram wrote: > Mladen Gogala writes: >>In Perl, there are no classes. > > If there are no classes in Perl, then what does > > bless REF,CLASSNAME > > do? bless \$ref will make the given reference a reference to the class. And classes is Perl are

Re: Covariance matrix syntax

2020-10-18 Thread Christian Gollwitzer
Am 19.10.20 um 07:23 schrieb Meghna Karkera: I am unable to find the *formula for covariance* used in np.cov syntax in PYTHON given in link https://numpy.org/doc/stable/reference/generated/numpy.cov.html. Could you please help me out. As said, you should click on the link [source] just at the

Re: Covariance matrix syntax

2020-10-18 Thread Meghna Karkera
Dear Sir I am unable to find the *formula for covariance* used in np.cov syntax in PYTHON given in link https://numpy.org/doc/stable/reference/generated/numpy.cov.html. Could you please help me out. Thanks Meghna On Tue, Oct 13, 2020 at 11:46 AM Christian Gollwitzer wrote: > Am 13.10.20 um 06

Re: Simple question - end a raw string with a single backslash ?

2020-10-18 Thread Michael Torrie
On 10/18/20 5:37 PM, Mladen Gogala via Python-list wrote: > On Sun, 18 Oct 2020 12:19:18 -0600, Michael Torrie wrote: > >> Python certainly is procedural. A script starts at the top and executes >> through to the bottom and ends, barring any flow control in the middle. >> Like Perl you can use i

Re: How to expand and flatten a nested of list of dictionaries of varied lengths?

2020-10-18 Thread dn via Python-list
If I may, a couple of items of list-etiquette (polite behavior), as I understand them: 1 please reply to the list (cf only myself) because @Mats (who responded earlier) and others on this list are much smarter than me, and might be able to help you more quickly 2 top-posting seems to take the fo

Re: Simple question - end a raw string with a single backslash ?

2020-10-18 Thread Mladen Gogala via Python-list
On Sun, 18 Oct 2020 12:19:18 -0600, Michael Torrie wrote: > Python certainly is procedural. A script starts at the top and executes > through to the bottom and ends, barring any flow control in the middle. > Like Perl you can use it in many different ways and paradigms including > OO if you desi

Re: How to expand and flatten a nested of list of dictionaries of varied lengths?

2020-10-18 Thread Mats Wichmann
On 10/18/20 2:09 PM, Shaozhong SHI wrote: > Even worse is that, in some cases, an addition called serviceRatings as a > key occur with new data unexpectedly. > > How to produce a robust Python/Panda script to coping with all these? > > Regards, > > David > > u'historicRatings': [{u'overall': {u

Re: How to expand and flatten a nested of list of dictionaries of varied lengths?

2020-10-18 Thread dn via Python-list
On 19/10/2020 09:09, Shaozhong SHI wrote: Even worse is that, in some cases, an addition called serviceRatings as a key occur with new data unexpectedly. "Even worse" than what? Do you need to keep a list of acceptable/applicable/available keys? (and reject or deal with others in some alternat

How to expand and flatten a nested of list of dictionaries of varied lengths?

2020-10-18 Thread Shaozhong SHI
Even worse is that, in some cases, an addition called serviceRatings as a key occur with new data unexpectedly. How to produce a robust Python/Panda script to coping with all these? Regards, David u'historicRatings': [{u'overall': {u'keyQuestionRatings': [{u'name': u'Safe', u'rating': u'Require

Re: File Name issue

2020-10-18 Thread dn via Python-list
On 19/10/2020 05:58, Mladen Gogala via Python-list wrote: On Sun, 18 Oct 2020 21:00:18 +1300, dn wrote: On 18/10/2020 12:58, Mladen Gogala via Python-list wrote: On Sat, 17 Oct 2020 22:51:11 +, Mladen Gogala wrote: BTW, I used this cp /var/log/syslog ./in-file.log #!/usr/bin/env python3 imp

Re: Simple question - end a raw string with a single backslash ?

2020-10-18 Thread Michael Torrie
On 10/18/20 11:07 AM, Mladen Gogala via Python-list wrote: > The fundamental > difference between the two languages is that Perl is procedural while > Python is a fully OO language. Discussion of Perl vs Python necessarily > devolves into the discussion of procedural vs OO paradigms. Python cert

Re: Simple question - end a raw string with a single backslash ?

2020-10-18 Thread Mladen Gogala via Python-list
On Sun, 18 Oct 2020 16:13:16 +0200, Peter J. Holzer wrote: > > Ah, I see, that the sillyness of Perl's grammar-altering modules (which > let you write Perl in Latin (with proper declensions and conjugations, > of course) or Chinese) has found its way to Python > To tell the truth, I only instal

Re: File Name issue

2020-10-18 Thread Mladen Gogala via Python-list
On Sun, 18 Oct 2020 21:00:18 +1300, dn wrote: > On 18/10/2020 12:58, Mladen Gogala via Python-list wrote: >> On Sat, 17 Oct 2020 22:51:11 +, Mladen Gogala wrote: >>> On Sat, 17 Oct 2020 18:12:16 -0400, Steve wrote: >>> with open("HOURLYLOG.txt", 'r') as infile: works but, when I rena

Re: Simple question - end a raw string with a single backslash ?

2020-10-18 Thread Peter J. Holzer
On 2020-10-17 21:03:26 -, Mladen Gogala via Python-list wrote: > On Thu, 15 Oct 2020 21:30:15 +, Stefan Ram wrote: > > Tony Flury writes: > >> >>> a = r'end' + chr(92) > > > > Or maybe, > > > > a = r''' > > end\ > > '''[ 1: -1 ] > > > > ? The first and the last line are messy, but i

Re: File Name issue

2020-10-18 Thread Chris Angelico
On Sun, Oct 18, 2020 at 10:32 PM D'Arcy Cain wrote: > > On 10/18/20 5:55 AM, Steve wrote: > > I am not sure if what I did to repair it but the problem is gone. > > A copy/paste/rename was performed on the original code file and now I do not > > get the error. No need for "r" or "\"... > > > > WTH?

EuroPython 2020: Edited videos are online

2020-10-18 Thread M.-A. Lemburg
We’re happy to announce that all edited videos of this year’s conference are now available on our YouTube channel: * EuroPython 2020 Playlist * https://www.youtube.com/watch?v=CvbQArKEFes&list=PL8uoeex94UhHgMD9GOCbEHWku7pEPx9fW We have 131 videos available in total, coveri

Re: MERGE SQL in cx_Oracle executemany

2020-10-18 Thread Peter J. Holzer
On 2020-10-18 06:35:03 -, Mladen Gogala via Python-list wrote: > On Sat, 17 Oct 2020 21:23:40 -0600, Jason Friedman wrote: > >> I'm looking to insert values into an oracle table (my_table) using the > >> query below. The insert query works when the PROJECT is not NULL/empty > >> (""). However w

Re: Are there Python ways to execute queries on PostgreSQL without getting data over?

2020-10-18 Thread Mats Wichmann
On 10/18/20 5:53 AM, Shaozhong SHI wrote: > Are there Python ways to execute queries on PostgreSQL without getting data > over? > > Are there ways just to fire off PostgreSQL queries and not get data into > Python? > > Regards, > > David > When you "execute" the query, you don't get back the d

Are there Python ways to execute queries on PostgreSQL without getting data over?

2020-10-18 Thread Shaozhong SHI
Are there Python ways to execute queries on PostgreSQL without getting data over? Are there ways just to fire off PostgreSQL queries and not get data into Python? Regards, David -- https://mail.python.org/mailman/listinfo/python-list

Re: File Name issue

2020-10-18 Thread D'Arcy Cain
On 10/18/20 5:55 AM, Steve wrote: I am not sure if what I did to repair it but the problem is gone. A copy/paste/rename was performed on the original code file and now I do not get the error. No need for "r" or "\"... WTH? I hate it when that happens. Could that original hyphen have been a uni

RE: File Name issue

2020-10-18 Thread Steve
I am not sure if what I did to repair it but the problem is gone. A copy/paste/rename was performed on the original code file and now I do not get the error. No need for "r" or "\"... WTH? I hate it when that happens. Steve Footnote: "What rhymes with orange?" "No it doesn't.." -Original M

Re: File Name issue

2020-10-18 Thread dn via Python-list
On 18/10/2020 12:58, Mladen Gogala via Python-list wrote: On Sat, 17 Oct 2020 22:51:11 +, Mladen Gogala wrote: On Sat, 17 Oct 2020 18:12:16 -0400, Steve wrote: with open("HOURLYLOG.txt", 'r') as infile: works but, when I rename the file, the line: with open("HOURLY-LOG.txt", 'r') as infile