Re: Progress on the Gilectomy (Posting On Python-List Prohibited)

2017-06-23 Thread Gregory Ewing

Lawrence D’Oliveiro wrote:

what WOULD you consider to be so “representative”?


I don't claim any of them to be representative. Different GC
strategies have different characteristics.

--
Greg
--
https://mail.python.org/mailman/listinfo/python-list


Re: Progress on the Gilectomy (Posting On Python-List Prohibited)

2017-06-23 Thread Marko Rauhamaa
Gregory Ewing :

> Lawrence D’Oliveiro wrote:
>> what WOULD you consider to be so “representative”?
>
> I don't claim any of them to be representative. Different GC
> strategies have different characteristics.

My experiences with Hotspot were a bit disheartening. GC is a winning
concept provided that you don't have to strategize too much. In
practice, it seems tweaking the GC parameters is a frequent necessity.

On the other hand, I believe much of the trouble comes from storing too
much information in the heap. Applications shouldn't have semipersistent
multigigabyte lookup structures kept in RAM, at least not in numerous
small objects.


Marko
-- 
https://mail.python.org/mailman/listinfo/python-list


PyData EuroPython 2017

2017-06-23 Thread M.-A. Lemburg
We are excited to announce a complete PyData track at EuroPython 2017
in Rimini, Italy from the 9th to 16th July.


  * PyData EuroPython 2017 *

https://ep2017.europython.eu/en/events/pydata/


The PyData track will be part of EuroPython 2017, so you won’t need to
buy an extra ticket to attend. Mostly talks and trainings are
scheduled for Wednesday, Thursday and Friday (July 12-14), with a few
on other days as well.

We will have over 40 talks, 5 trainings, and 2 keynotes dedicated to
PyData. If you’d like to attend PyData EuroPython 2017, please
register for EuroPython 2017 soon:

https://ep2017.europython.eu/en/registration/


Enjoy,
--
EuroPython 2017 Team
http://ep2017.europython.eu/
http://www.europython-society.org/

PS: Please forward or retweet to help us reach all interested parties:
https://twitter.com/europython/status/878198420573483008
Thanks.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Progress on the Gilectomy

2017-06-23 Thread Ethan Furman

On 06/22/2017 10:26 PM, Rustom Mody wrote:


Lawrence d'Oliveiro was banned on 30th Sept 2016 till end-of-year
https://mail.python.org/pipermail/python-list/2016-September/714725.html

Is there still a ban?


My apologies to Lawrence, I completely forgot.

The ban is now lifted.

--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list


Re: how to write add frequency in particular file by reading a csv file and then making a new file of multiple csv file by adding frequency

2017-06-23 Thread Peter Otten
Dennis Lee Bieber wrote:

> On Fri, 23 Jun 2017 09:49:06 +0300, Jussi Piitulainen
>  declaimed the following:
> 
>>I just like those character translation methods, and I didn't like it
>>when you first took the time to call a simple regex "line noise" and
>>then proceeded to post something that looked much more noisy yourself.
>>
> 
> Tediously long (and likely slow running), but I'd think each .replace()
> would have been self-explanatory.
> 
>>I'm not sure I like the splitting of look-alike (I'm not sure that I
>>like not splitting it either) but note that the regex does that for
>>free.
>>
>>The \b in the original regex matches the empty string at a position
>>where there is a "word character" on only one side. It recognizes a
>>boundary at the beginning of a line and at whitespace, but also at all
>>the punctuation marks.
>>
>>You guess right about the length limits. I wouldn't use them, and then
>>there's no need for the boundary markers any more: my \w+ matches
>>maximal sequences of word characters (even in foreign languages like
>>Finnish or French, and even in upper case, also digits).
>>
>>To also match "people's" and "didn't", use \w+'\w+, and to match with
>>and without the ' make the trailing part optional \w+('\w+)? except the
>>notation really does start to become noisy because one must prevent the
>>parentheses from "capturing" the group:
>>
>>import re
>>wordy = re.compile(r'''  \w+  (?: ' \w+ )? ''', re.VERBOSE)
>>text = '''
>>Oliver N'Goma, dit Noli, né le 23 mars 1959 à Mayumba et mort le 7 juin
>>2010, est un chanteur et guitariste gabonais d'Afro-zouk.
>>'''
>>
>>print(wordy.findall(text))
>>
>># ['Oliver', "N'Goma", 'dit', 'Noli', 'né', 'le', '23', 'mars', '1959',
>># 'à', 'Mayumba', 'et', 'mort', 'le', '7', 'juin', '2010', 'est', 'un',
>># 'chanteur', 'et', 'guitariste', 'gabonais', "d'Afro", 'zouk']
>>
>>Not too bad?
> 
> Above content saved (in a write-only file? I don't recall the times
> I've searched my post archives) for potential future use. I should plug it
> into my demo and see how much speed improvement I get.

Most of the potential speedup can be gained from using collections.Counter() 
instead of the database. If necessary write the counter's contents into the 
database in a second step.

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: matplotlib change?

2017-06-23 Thread bill . janssen
On Thursday, June 22, 2017 at 11:24:53 AM UTC-7, Michael F. Stemper wrote:
> On 2017-06-22 12:56, bill.jans...@gmail.com wrote:
> > On Thursday, June 22, 2017 at 10:14:21 AM UTC-7, Michael F. Stemper wrote:
> >> On 2017-06-22 09:50, breamore...@gmail.com wrote:
> >>> On Thursday, June 22, 2017 at 3:33:36 PM UTC+1, Michael F. Stemper wrote:
> >
> 
>  Is it likely that the difference in plots due to something that
>  changed in matplotlib between 2.7.12 and 2.7.13? If so, is there
>  some argument that I could specify in one of the functions to
>  prevent this padding/margin/waste? Is there a separate function
>  to call?
> 
>  If the difference isn't due to a change in matplotlib, would it be
>  something OS-dependent? How can I track it down?
> >>
> >>> Id check to see which matplotlib versions you have rather than the Python 
> >>> version.  Either:-
> >>
> >> Okay, that was easy enough:
> 
> >>   >>> import matplotlib
> >>   >>> matplotlib.__version__
> >> '2.0.0'
> >>   >>>
> >>
> >> What's my next step?
> 
> > There were a number of changes to line-drawing in the bump from 1 to 2 -- I 
> > found that some of them were not listed in the change notes.  It's worth 
> > reviewing 
> > https://matplotlib.org/users/dflt_style_changes.html#plotting-functions.
> 
> That nailed it! This section:
> 
> addressed my exact problem.
> 
> (Unfortunately, the parameters are not back-compatible, but at least
> I'll be ready when they upgrade the box where I usually work.)
> 
> Thanks for your help.
> 
> BTW, your name is familiar. Were you ever at PARC?
> 
> -- 
> Michael F. Stemper
> This post contains greater than 95% post-consumer bytes by weight.

Still am.

Bill
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Best way to ensure user calls methods in correct order?

2017-06-23 Thread Neil Cerutti
On 2017-06-23, Gregory Ewing  wrote:
> Steve D'Aprano wrote:
>> There are a very few exceptions to this rule of thumb, such as
>> opening connections to databases or files or similar.
>
> Another way to handle that is to have the connection method
> return another object that has the methods that should only be
> called for active connections. That way it's not possible to do
> things out of sequence.

It's like a bidirectional iterator in C++, except in reverse it's
random access. An iterator that can't easily be modeled with a
generator in Python is going to feel awkward.

-- 
Neil Cerutti

-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Deleting An Optional Dict Entry (Posting On Python-List Prohibited)

2017-06-23 Thread Steve D'Aprano
On Fri, 23 Jun 2017 07:19 pm, Lawrence D’Oliveiro wrote:

> The construct
> 
> del «dict»[«key»]
> 
> deletes the entry with key «key» from the dictionary «dict», provided it
> exists. If it does not, you get a KeyError.
> 
> To delete an entry which might or might not exist, the simplest way is this:
> 
> «dict».pop(«key», None)
> 
> Actually, the second argument to the pop method doesn’t matter, since the
> result from the call is ignored in this case.

Nice hint.




-- 
Steve
“Cheer up,” they said, “things could be worse.” So I cheered up, and sure
enough, things got worse.

-- 
https://mail.python.org/mailman/listinfo/python-list