Re: Strange range

2016-04-01 Thread Mark Lawrence via Python-list
ce -- https://mail.python.org/mailman/listinfo/python-list

Re: [beginner] What's wrong?

2016-04-01 Thread Mark Lawrence via Python-list
he problem, other than failure to RTFM? -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list

Re: Drowning in a teacup?

2016-04-02 Thread Mark Lawrence via Python-list
expect the sort would be slower than most of the other suggestions. My gut feeling about how fast something is in Python has never once been right in 15 years. There is only way way to find out, measure it with things like https://docs.python.org/3/library/profile.html and https://docs.python.org/3/library/timeit.html. IIRC Steven D'Aprano has a wrapper for the latter called Stopwatch. -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list

tkinter Entry validation modes

2016-04-02 Thread Mark Lawrence via Python-list
rk, as I'm just venturing into the tkinter world. -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list

Re: [beginner] What's wrong?

2016-04-02 Thread Mark Lawrence via Python-list
-- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list

Re: [Beginner] - Hanging in the code, can't figure out what's wrong

2016-04-02 Thread Mark Lawrence via Python-list
bout Python. OTOH there are loads of people here who do know Python, backwards, sideways and inside out. If you state precisely what you are trying to achieve then you will get the correct answer. -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list

Re: [Beginner] - Hanging in the code, can't figure out what's wrong

2016-04-02 Thread Mark Lawrence via Python-list
e becomes "ABClaunch2.bat". Yes, of course. I ran the code and picked up the wrong line even though I printed out 'name'! But, it does look as though that path is supposed to form part of the resulting filename. -- Bartc -- https://mail.python.org/mailman/listinfo/python-list

Re: [beginner] What's wrong?

2016-04-02 Thread Mark Lawrence via Python-list
t you can do for our language. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list

Re: [Beginner] - Hanging in the code, can't figure out what's wrong

2016-04-02 Thread Mark Lawrence via Python-list
h is the most efficient, I'll leave that to others to test. -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list

Re: [beginner] What's wrong?

2016-04-02 Thread Mark Lawrence via Python-list
hat would happen to the poor little darlings if they had to spend the entire match on the pitch? -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list

ONE CLICK REST API

2016-04-03 Thread David Shi via Python-list
Eclipse has got one click app for creating REST services. What is it equivalent in Python? Regards. David -- https://mail.python.org/mailman/listinfo/python-list

Re: Strange range

2016-04-04 Thread Mark Lawrence via Python-list
ch?cq=range would appear to be as good a starting point as any. -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list

Re: [beginner] What's wrong?

2016-04-04 Thread Mark Lawrence via Python-list
do for our language. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list

How can I install

2016-04-04 Thread Mohamed Ali via Python-list
I have tried to install python and nltk but I couldn't. Please could you please help me because I need to work on natural language processing using Python. Regards,Mohamed -- https://mail.python.org/mailman/listinfo/python-list

Re: Best Practices for Internal Package Structure

2016-04-04 Thread Mark Lawrence via Python-list
tas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list

Re: IDLE's subprocess didn't make connection. Either IDLE can't start or personal firewall software is blocking connection.

2016-04-04 Thread Mark Lawrence via Python-list
for the answer. -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list

Re: ONE CLICK REST API

2016-04-05 Thread Roland Mueller via Python-list
for yourself: - http://blog.miguelgrinberg.com/post/designing-a-restful-api-with-python-and-flask BR, Roland 2016-04-04 9:09 GMT+03:00 David Shi via Python-list : > Eclipse has got one click app for creating REST services. > What is it equivalent in Python? > Regards. > David

Re: Label behavior's difference between tkinter and ttk

2016-04-05 Thread Mark Lawrence via Python-list
-map.html http://www.tkdocs.com/tutorial/styles.html In the latter you might like to note that there is a section called "Sound Difficult to you?". It's well worth the read. -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list

Re: tkinter Entry validation modes

2016-04-05 Thread Mark Lawrence via Python-list
On 02/04/2016 19:45, Terry Reedy wrote: On 4/2/2016 11:11 AM, Mark Lawrence via Python-list wrote: A typical call to create an Entry field would be:- e = Entry(master, validate='all', ...) Once this call has been made is it possible to change the validation mode at runtime? AF

Re: python script for .dat file

2016-04-05 Thread Mark Lawrence via Python-list
language. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list

Re: Install request

2016-04-05 Thread Mark Lawrence via Python-list
of months. For those who disagree, they can provide the patches, or the edits to a wiki as appropriate. -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list

Re: Best Practices for Internal Package Structure

2016-04-05 Thread Mark Lawrence via Python-list
n.org/mailman/listinfo/python-list

Re: python script for .dat file

2016-04-05 Thread Mark Lawrence via Python-list
/mailman/listinfo/python-list

Re: Promoting Python

2016-04-06 Thread Mark Lawrence via Python-list
uage. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list

Re: Checking function's parameters (type, value) or not ?

2016-04-06 Thread Mark Lawrence via Python-list
er in the function or worse provide a meaningless result. What library designers do ? Please see http://ftp.dev411.com/t/python/python-list/13bhcknhan/when-to-use-assert -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Ma

Re: Promoting Python

2016-04-06 Thread Mark Lawrence via Python-list
of GOTO will certainly help in that area. How does it go, something like "always consider that the person maintaining your code in six months time is a homicidal maniac armed with an axe"? -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list

Re: Promoting Python

2016-04-06 Thread Mark Lawrence via Python-list
him to like Python, it's been tried, it doesn't work. --Ned. So why isn't he politely told to shove off as he's not welcome on this Python list? -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list

Re: Promoting Python

2016-04-06 Thread Mark Lawrence via Python-list
he knows squat. About Python. On the main Python list. Perhaps he should hence forward be known as RUE2? Actually that is unfair, the original RUE only complains about PEP393 unicode, BartC complains about everything. I still do not believe that he could organise a piss up in a brewery,

Re: deque is not a subclass of Sequence.

2016-04-07 Thread Mark Lawrence via Python-list
ssubclass(deque, Sequence) True -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list

Re: how to convert code that uses cmp to python3

2016-04-07 Thread Mark Lawrence via Python-list
low Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list

Re: how to convert code that uses cmp to python3

2016-04-07 Thread Mark Lawrence via Python-list
se the two tuples almost always twice. Once to find out if they are equal and if not a second time to find out which is greater. Have you read this https://wiki.python.org/moin/HowTo/Sorting ? -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list

Re: [beginner] What's wrong?

2016-04-08 Thread Mark Lawrence via Python-list
s and apparently never makes mistakes. *plonk* -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list

Re: QWERTY was not designed to intentionally slow typists down

2016-04-09 Thread Mark Lawrence via Python-list
what our language can do for you, ask what you can do for our language. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list

Re: Find the number of robots needed to walk through the rectangular grid

2016-04-09 Thread Mark Lawrence via Python-list
rence -- https://mail.python.org/mailman/listinfo/python-list

Re: Unicode normalisation [was Re: [beginner] What's wrong?]

2016-04-09 Thread Mark Lawrence via Python-list
ailman/listinfo/python-list

Re: QWERTY was not designed to intentionally slow typists down

2016-04-09 Thread Mark Lawrence via Python-list
On 09/04/2016 20:25, Tim Golden wrote: On 09/04/2016 20:13, Mark Lawrence via Python-list wrote: On 09/04/2016 01:43, Ben Finney wrote: Dennis Lee Bieber writes: Yet another completely irrelevant thread that has nothing to do with Python. As this is meant to be the main Python mailing

Re: Find the number of robots needed to walk through the rectangular grid

2016-04-09 Thread Mark Lawrence via Python-list
On 09/04/2016 20:41, Joe wrote: Sorry, I was desperate I deleted the post You didn't. This will be showing in the archives in several places, e.g https://mail.python.org/pipermail/python-list/2016-April/707160.html -- My fellow Pythonistas, ask not what our language can do for you

Re: QWERTY was not designed to intentionally slow typists down

2016-04-09 Thread Mark Lawrence via Python-list
Ethan Furman did just a day or so back? -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list

Re: one-element tuples

2016-04-11 Thread Larry Hudson via Python-list
n use a for loop for the remaining strings. Note that this also works correctly for an empty list -- where it will do nothing. I hope this gets you started reworking (or re-thinking) your program. -- https://mail.python.org/mailman/listinfo/python-list

RE: how to setup for localhost:8000

2016-04-14 Thread Dan Strohl via Python-list
"well, just do this, and poof, all will be good". Sorry it's not more. Dan > -----Original Message- > From: Python-list [mailto:python-list-bounces+d.strohl=f5@python.org] > On Behalf Of wrh8...@gmail.com > Sent: Thursday, April 14, 2016 1:50 PM > To:

Re: How to XOR a byte output?

2016-04-14 Thread Chris Juried via Python-list
prohibited. If you have received this email in error, please immediately notify me at (754) 300-9972 and permanently delete the original and any copy of any e-mail and any printout thereof. -- https://mail.python.org/mailman/listinfo/python-list

RE: How to print a part of a string?

2016-04-15 Thread Dan Strohl via Python-list
"ABC", and it's matching non-"ABC" string, then lookup the string in the table and get your match, it's a bit brute forcey, but it would work (eventually) Good luck in your homework! Dan > -----Original Message- > From: Python-list [mailto:python-lis

Fraud

2016-04-16 Thread Mel Drosis via Python-list
n/listinfo/python-list

Re: Differences between Class(Object) and Class(Dict) for dictionary usage?

2016-04-27 Thread Christopher Reimer via Python-list
@property def notation(self): return self._state['notation'] @property def position(self): return self._state['position'] @position.setter def position(self, position): self._state['position'] = position if self._state['first_move']: self._state['first_move'] = False self._state['move_count'] += 1 -- https://mail.python.org/mailman/listinfo/python-list

RE: Controlling the passing of data

2016-04-28 Thread Dan Strohl via Python-list
ore (and more useful) help you are likely to receive. To this lists credit, even if you are completely unclear in your question, you will likely get *something* back, (as you saw with Peters response), but what you get back is more likely to be a general suggestion rather than a specific fix fo

RE: online python courses

2016-04-28 Thread Dan Strohl via Python-list
> -Original Message----- > From: Python-list [mailto:python-list-bounces+d.strohl=f5@python.org] > On Behalf Of ldompel...@casema.nl > Sent: Thursday, April 28, 2016 7:15 AM > To: python-list@python.org > Subject: online python courses > > I am follows on th

RE: Controlling the passing of data

2016-04-28 Thread Dan Strohl via Python-list
meeting_list.append((id, meeting)) > -Original Message- > From: Python-list [mailto:python-list-bounces+d.strohl=f5@python.org] > On Behalf Of Sayth Renshaw > Sent: Thursday, April 28, 2016 7:00 AM > To: python-list@python.org > Subject: Re: Controlling the passin

RE: What should Python apps do when asked to show help?

2016-04-28 Thread Dan Strohl via Python-list
formation about that specific argument. > -Original Message----- > From: Python-list [mailto:python-list-bounces+d.strohl=f5@python.org] > On Behalf Of alister > Sent: Thursday, April 28, 2016 9:45 AM > To: python-list@python.org > Subject: Re: What should Python apps do when a

RE: What should Python apps do when asked to show help?

2016-04-28 Thread Dan Strohl via Python-list
From: John Wong [mailto:gokoproj...@gmail.com] Sent: Thursday, April 28, 2016 10:06 AM To: Dan Strohl Cc: alister ; python-list@python.org Subject: Re: What should Python apps do when asked to show help? On Thu, Apr 28, 2016 at 1:02 PM, Dan Strohl via Python-list mailto:python-list@python.org

RE: What should Python apps do when asked to show help?

2016-04-28 Thread Dan Strohl via Python-list
;more" if needed (or whatever). Dan > -Original Message- > From: Python-list [mailto:python-list-bounces+d.strohl=f5@python.org] > On Behalf Of Irmen de Jong > Sent: Thursday, April 28, 2016 10:08 AM > To: python-list@python.org > Subject: Re: What should Python apps do

RE: What should Python apps do when asked to show help?

2016-04-28 Thread Dan Strohl via Python-list
to a common library. > -Original Message----- > From: Python-list [mailto:python-list-bounces+d.strohl=f5@python.org] > On Behalf Of Random832 > Sent: Thursday, April 28, 2016 10:30 AM > To: python-list@python.org > Subject: Re: What should Python apps do when asked to show help? >

Simplest way to locate a string in a column and get the value on the same row in another column

2016-04-28 Thread David Shi via Python-list
What is the simplest way to locate a string in a column and get the value on the same row in another column ? 1  a2  b3  c Locate b and obtain 2 in a table. Looking forward to hearing from you. Regards. David -- https://mail.python.org/mailman/listinfo/python-list

Pivot table of Pandas

2016-04-28 Thread David Shi via Python-list
python.org/mailman/listinfo/python-list

Not x.islower() Versus x.isupper Output Results

2016-04-29 Thread Christopher Reimer via Python-list
.islower()' and 'x.isupper()' be identical? The final form of this code is this: list(filter(str.isupper, string)) ['W', 'T', 'F'] Thank you, Chris R. -- https://mail.python.org/mailman/listinfo/python-list

How to fill in abbreviation in one column based on state name in another column?

2016-04-30 Thread David Shi via Python-list
S": "VI", "MARSHALL ISLANDS": "MH",                 "WYOMING": "WY", "OHIO": "OH", "SOUTH CAROLINA": "SC", "INDIANA": "IN", "NEVADA": "NV", "LOUISIANA": "LA",                 "NORTHERN MARIANA ISLANDS": "MP", "NEBRASKA": "NE", "ARIZONA": "AZ", "WISCONSIN": "WI", "NORTH DAKOTA": "ND",                 "Armed Forces Europe": "AE", "PENNSYLVANIA": "PA", "OKLAHOMA": "OK", "KENTUCKY": "KY", "RHODE ISLAND": "RI",                  "DISTRICT OF COLUMBIA": "DC", "ARKANSAS": "AR", "MISSOURI": "MO", "TEXAS": "TX", "MAINE": "ME"} #table['moa_state_name'] = map(lambda x: x.upper(), table['moa_state_name'])def convert_state(row):    abbrev1 =  state_to_code(table['moa_state_name']) #'aatest'    if abbrev1:         return abbrev1 ##state_to_code[abbrev[0]]    return np.nan#print convert_state(table['moa_state_name']) table.insert(0, "abbrev", np.nan)table['abbrev'] = table.apply(convert_state, axis=1) print state_to_code['ARKANSAS'] -- https://mail.python.org/mailman/listinfo/python-list

How to fill in abbreviation in one column based on state name in another column?

2016-05-01 Thread David Shi via Python-list
ate_name']) #'aatest'    if abbrev1:         return abbrev1 ##state_to_code[abbrev[0]]    return np.nan#print convert_state(table['moa_state_name']) table.insert(0, "abbrev", np.nan) table['abbrev'] = table.apply(convert_state, axis=1)print state_to_code['ARKANSAS'] -- https://mail.python.org/mailman/listinfo/python-list

RE: Need help understanding list structure

2016-05-03 Thread Dan Strohl via Python-list
mply add a line at the end like: __repr__() = __str__() Hope that helps. Dan Strohl -- https://mail.python.org/mailman/listinfo/python-list

RE: Need help understanding list structure

2016-05-03 Thread Dan Strohl via Python-list
ter much in this case, since it probably isn't called that much in normal use (though there are always exceptions), and in the end, Python is fast enough that unless you really need to slice off a few milliseconds, you will never notice the difference, but just some food for thought. -- https://mail.python.org/mailman/listinfo/python-list

RE: Use __repr__ to show the programmer's representation (was: Need help understanding list structure)

2016-05-03 Thread Dan Strohl via Python-list
nter or something). I know that isn’t per the rules, but in the end, it makes it easier for me to troubleshoot the code. Having said that, Ben is totally correct in terms of the "right" way to do it, my earlier suggestion was not "right". Dan -- https://mail.python.org/mailman/listinfo/python-list

How to call a Python Class?

2016-05-03 Thread David Shi via Python-list
gic number in 'intersection': b'\x03\xf3\r\n' Can any one help? Regards. David -- https://mail.python.org/mailman/listinfo/python-list

Re: How to become more motivated to learn Python

2016-05-03 Thread Larry Hudson via Python-list
to download it. -- https://mail.python.org/mailman/listinfo/python-list

Re: pylint woes

2016-05-08 Thread Larry Hudson via Python-list
to stick that "-->" as a prompt at the end, but obviously this (or a similar marker) is optional. -- https://mail.python.org/mailman/listinfo/python-list

Re: pylint woes

2016-05-08 Thread Larry Hudson via Python-list
On 05/08/2016 03:07 PM, Chris Angelico wrote: On Mon, May 9, 2016 at 6:45 AM, Larry Hudson via Python-list wrote: On 05/08/2016 06:01 AM, Chris Angelico wrote: [snip...] ... I like to recommend a little thing called "IIDPIO debugging" - I

Re: Python 3.5.1 Not Working

2016-05-13 Thread Aidan Silcock via Python-list
and it will say it was successful but then when I go to open it again it comes up with the same message.Can you help?Aidan -- https://mail.python.org/mailman/listinfo/python-list

How to put back a number-based index

2016-05-13 Thread David Shi via Python-list
I lost my indexes after grouping in Pandas. I managed to rest_index and got back the index column. But How can I get back a index row? Regards. David -- https://mail.python.org/mailman/listinfo/python-list

Re: How to put back a number-based index

2016-05-13 Thread David Shi via Python-list
Hello, Michael,Thank you.  Yes, aster grouping I lost my indexing in both x, y directions. How to convert a row, and a column into indexes or labels? On Friday, 13 May 2016, 17:57, Michael Selik wrote: On Fri, May 13, 2016 at 12:27 PM David Shi via Python-list wrote: I lost my

Re: How to put back a number-based index

2016-05-13 Thread David Shi via Python-list
Hello, Michael, Why reset_index before grouping? Regards. David On Friday, 13 May 2016, 17:57, Michael Selik wrote: On Fri, May 13, 2016 at 12:27 PM David Shi via Python-list wrote: I lost my indexes after grouping in Pandas. I managed to rest_index and got back the index column

Re: How to put back a number-based index

2016-05-13 Thread David Shi via Python-list
choose how your aggregation will operate on that column. On Fri, May 13, 2016 at 3:29 PM David Shi wrote: Hello, Michael, Why reset_index before grouping? Regards. David On Friday, 13 May 2016, 17:57, Michael Selik wrote: On Fri, May 13, 2016 at 12:27 PM David Shi via Python-list wrote

Re: How to put back a number-based index

2016-05-13 Thread David Shi via Python-list
eset_index before grouping? Regards. David On Friday, 13 May 2016, 17:57, Michael Selik wrote: On Fri, May 13, 2016 at 12:27 PM David Shi via Python-list wrote: I lost my indexes after grouping in Pandas. I managed to rest_index and got back the index column. But How can I get back a index

Re: How to put back a number-based index

2016-05-13 Thread David Shi via Python-list
hy don't you make a little example of before and after the grouping? This mailing list does not accept attachments, so you'll have to make do with pasting a few rows of comma-separated or tab-separated values. On Fri, May 13, 2016 at 3:56 PM Michael Selik wrote: In order to preserve yo

Re: How to put back a number-based index

2016-05-13 Thread David Shi via Python-list
d Shi wrote: Dear Michael, I have done a number of operation in between. Providing that information does not help you How to reset index after grouping and various operations is of interest. How to type in a command to find out its current dataframe? Regards. David On Friday, 13

Re: How to put back a number-based index

2016-05-13 Thread David Shi via Python-list
35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48], [0, 2, 1, 3, 4, 5, 7, 6, 8, 9, 11, 12, 13, 10, 14, 15, 16, 19, 18, 17, 20, 21, 23, 22, 24, 27, 31, 28, 29, 30, 32, 25, 26, 33, 34, 35, 36, 37, 38, 39, 41, 42, 43, 45, 44, 46, 48, 47, 49]], names=[u'StateFIPS', 0])Re

Re: How to put back a number-based index

2016-05-13 Thread David Shi via Python-list
43, 44, 45, 46, 47, 48], [0, 2, 1, 3, 4, 5, 7, 6, 8, 9, 11, 12, 13, 10, 14, 15, 16, 19, 18, 17, 20, 21, 23, 22, 24, 27, 31, 28, 29, 30, 32, 25, 26, 33, 34, 35, 36, 37, 38, 39, 41, 42, 43, 45, 44, 46, 48, 47, 49]], names=[u'StateFIPS', 0])Regards. David On Friday, 13 M

Re: How to put back a number-based index

2016-05-13 Thread David Shi via Python-list
0, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48], [0, 2, 1, 3, 4, 5, 7, 6, 8, 9, 11, 12, 13, 10, 14, 15, 16, 19, 18, 17, 20, 21, 23, 22, 24, 27, 31, 28, 29, 30, 32, 25, 26, 33, 34, 35, 36,

Re: How to put back a number-based index

2016-05-13 Thread David Shi via Python-list
31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48], [0, 2, 1, 3, 4, 5, 7, 6, 8, 9, 11, 12, 13, 10, 14, 15, 16, 19, 18, 17, 20, 21, 23, 22, 24, 27, 31, 28, 29, 30, 32, 25, 26, 33, 34, 35, 36, 37, 38, 39, 41, 42, 43, 45, 44, 46, 48, 47, 49]], names=[u'StateFIPS

Re: How to put back a number-based index

2016-05-13 Thread David Shi via Python-list
2, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48], [0, 2, 1, 3, 4, 5, 7, 6, 8, 9, 11, 12, 13, 10, 14, 15, 16, 19, 18, 17, 20, 21, 23, 22, 24, 27, 31, 28, 29, 30, 32, 25, 26, 33, 34, 35, 36, 37, 38, 39, 41, 42, 43, 45, 44, 46, 48, 47, 49]

Re: How to put back a number-based index

2016-05-14 Thread David Shi via Python-list
25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48], [0, 2, 1, 3, 4, 5, 7, 6, 8, 9, 11, 12, 13, 10, 14, 15, 16, 19, 18, 17, 20, 21, 23, 22, 24, 27, 31, 28, 29, 30, 32, 25, 26, 33, 34, 35, 36, 37, 38, 39, 41, 42, 43, 45, 44, 46, 48, 47, 49]], names=

Pandas GroupBy does not behave consistently

2016-05-15 Thread David Shi via Python-list
2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48], [0, 2, 1, 3, 4, 5, 7, 6, 8, 9, 11, 12, 13, 10, 14, 15, 16, 19, 18, 17, 20, 21, 23, 22, 24, 27, 31, 28, 29, 30,

RE: Wanted Python programmer to join team

2016-05-16 Thread Dan Strohl via Python-list
rk might not be totally legit. (NOTE: I am NOT saying you aren’t legit, nor that the work is criminal, just that the impression you gave was less than professional, and even if I was looking, I would not consider contacting someone who presented that way.) -- https://mail.python.org/mailman/listinfo/python-list

Re: Summing/combining tuples

2016-05-18 Thread Larry Hudson via Python-list
mmation? Thanks Why two loops? Put both summations in a single loop. Then you're only scanning the alist once instead of twice. groups1 = defaultdict(int) groups2 = defaultdict(int) for nm, matches, words in alist: groups1[nm] += matches groups2[nm] += words -=- Larry -=- -- https://mail.python.org/mailman/listinfo/python-list

Re: Program prints questions for user input, but won't show the answer output

2016-05-18 Thread Larry Hudson via Python-list
ersion 3 is where all future development will occur. It is definitely the better version, and while there are certainly differences, to a beginning programmer the learning curve will be the same. -- https://mail.python.org/mailman/listinfo/python-list

Re: Summing/combining tuples

2016-05-19 Thread Larry Hudson via Python-list
: tdic[dat[1]] = addtpl(tdic.get(dat[1], (0,0)), dat[2:]) return sorted([(str(n), tdic[n][0], tdic[n][1]) for n in tdic]) -=-Larry -=- -- https://mail.python.org/mailman/listinfo/python-list

RE: reduction

2016-05-31 Thread Dan Strohl via Python-list
ch object itself. (good for more complex issues, but probably increases the size of each object) - create an index or caching structure of some sort as you find the objects, (good for saving computation time if the determination is "hard" and you hit the same ones again and again) - create a dictionary structure instead of a list. (good for fast lookups with known data) - using something like pandas or another data analysis library (SciPy, NumPy, iPython Notebook). (especially good if your data is more numbers based than you seem to be indicating) - writing the data to a database and using that for matching. (good If you have LOTS of data to compare). Some of these are probably overkill, some probably won't work at all for what you are trying to achieve. Dan -- https://mail.python.org/mailman/listinfo/python-list

Re: Recommendation for GUI lib?

2016-06-07 Thread Roland Koebler via Python-list
Python-bindings. But I was never happy with Qt and think some GUI-concepts of GTK+ are much better than the ones of Qt, and I like Glade much more than the Qt designer. best regards Roland -- https://mail.python.org/mailman/listinfo/python-list

Re: i'm a python newbie & wrote my first script, can someone critique it?

2016-06-10 Thread Larry Hudson via Python-list
than variables. But in general (in all programming languages) it is usually better and safer to avoid globals if possible. # -------- # NOW FINISH print("" + get_timestamp() + " " + get_script_filename() + " FINISHED.") #import os #os._exit(0) Yes, your exit() is redundant and you are correct to comment it out. But again I suggest that you get used to using print formatting, it is really versatile. -- -=- Larry -=- -- https://mail.python.org/mailman/listinfo/python-list

Re: how to search item in list of list

2016-06-13 Thread Larry Hudson via Python-list
7;01': 1}, ['000', '0 01', '010', '011', '100', '101', '110', '111'], 'yz', 'start')], [(2, {'11': 1, '10': 0, '00': 1, '01': 1}, ['000', '001', '010', '011', '100', '101', '110', '1 11'], 'xz', 'start')], [(1, {'11': 1, '10': 1, '00': 0, '01': 1}, ['00', '01', ' 11', '11', '10', '11', '11', '11'], 'xy', 'node')], [(1, {'11': 1, '10': 1, '00' : 0, '01': 1}, ['00', '01', '10', '11', '11', '11', '11', '11'], 'xy', 'node')], [(1, {'11': 1, '10': 1, '00': 0, '01': 1}, ['00', '00', '10', '10', '10', '10', '11', '11'], 'xy', 'node')], [(1, {'11': 1, '10': 1, '00': 0, '01': 1}, ['00', '00', '10', '11', '10', '10', '10', '11'], 'xy', 'node')], [(1, {'11': 1, '10': 1, '00': 0, '01': 1}, ['00', '00', '10', '10', '10', '11', '10', '11'], 'xy', 'n ode')]] I (manually) reformatted your list and found you have a missing left square bracket in the middle. But the way your list is formatted here I really can't tell you where it is -- you'll have to reformat it and/or use an editor that highlights matching brackets to find it yourself. Most programming editors have that bracket matching capability. -- -=- Larry -=- -- https://mail.python.org/mailman/listinfo/python-list

Proposal: named return values through dict initialization and unpacking

2016-06-21 Thread Ari Freund via Python-list
**RunShellCmd("ls .") # Here we don't care about order. -- https://mail.python.org/mailman/listinfo/python-list

Re: ASCII or Unicode? (was best text editor for programming Python on a Mac)

2016-06-21 Thread Larry Hudson via Python-list
Mint Linux (and I think Ubuntu is the same. I don't know about other distros.): From the menu, select Preferences->Keyboard->Layouts->Options->Position of Compose Key This opens a list of checkboxes with about a dozen choices -- select whatever you want (I use the Menu key). -- -=- Larry -=- -- https://mail.python.org/mailman/listinfo/python-list

Re: Operator Precedence/Boolean Logic

2016-06-22 Thread Larry Hudson via Python-list
in the design of Python... Wart?? I *strongly* disagree. I find it one of the strengths of Python, it enhances Python's expressiveness. Of course, everyone is entitled to their own opinion...and this is mine. -- -=- Larry -=- -- https://mail.python.org/mailman/listinfo/python-list

Pandas to CSV and .dbf

2016-06-23 Thread David Shi via Python-list
Has anyone tested on Pandas to CSV and .dbf lately? I am looking for proven, tested examples to output Panda Data Frame to CSV and dbf files. Looking forward to hearing from you. Regards. David -- https://mail.python.org/mailman/listinfo/python-list

Which one is the best XML-parser?

2016-06-23 Thread David Shi via Python-list
Which one is the best XML-parser? Can any one tell me? Regards. David -- https://mail.python.org/mailman/listinfo/python-list

Which one is the best JSON parser?

2016-06-23 Thread David Shi via Python-list
Can any one tell me? Regards. David -- https://mail.python.org/mailman/listinfo/python-list

How to reset IPython notebook file association

2016-06-25 Thread David Shi via Python-list
-- https://mail.python.org/mailman/listinfo/python-list

JSON to Pandas data frame

2016-06-25 Thread David Shi via Python-list
How to convert a JSON object into a Pandas data frame? I know that for XML, there are XML parsers. Regards. David -- https://mail.python.org/mailman/listinfo/python-list

Re: Proposal: named return values through dict initialization and unpacking

2016-06-26 Thread Ari Freund via Python-list
Thanks everybody. There seems to be a lot of resistance to dict unpacking, in addition to the problem with my proposed shorthand dict() initialization syntax pointed out by Steven D'Aprano, so I won't be pursuing this. -- https://mail.python.org/mailman/listinfo/python-list

Live installation of Pandas for Windows 64

2016-06-27 Thread David Shi via Python-list
Is there a live installation of Pandas for Windows 64? Regards. David -- https://mail.python.org/mailman/listinfo/python-list

Re: Appending an asterisk to the end of each line

2016-07-05 Thread Larry Hudson via Python-list
's empty. Not your problem, but you can simplify your read/write loop to: for line in f_in: f_out.write(line[:-1] + ' *\n') The 'line[:-1]' expression gives you the line up to but not including the trailing newline. Alternately, use: f_out.write(line.rstrip() + ' *\n') -- -=- Larry -=- -- https://mail.python.org/mailman/listinfo/python-list

How asyncio works? and event loop vs exceptions

2016-07-22 Thread Marco S. via Python-list
non-blocking, but in this case exceptions can't be caught in a try statement. Is this correct? If so, asyncio programming style can't be a little divergent from what was the philosophy of Python until now? -- https://mail.python.org/mailman/listinfo/python-list

Re: Why not allow empty code blocks?

2016-07-24 Thread Marco Sulla via Python-list
e): __tablename__ = 'parent' id = Column(Integer, primary_key=True) children = relationship("Child"), # comma inserted by error. children will be a tuple and SQLAlchemy will fail with misleading errors -- https://mail.python.org/mailman/listinfo/python-list

Re: How asyncio works? and event loop vs exceptions

2016-07-25 Thread Marco Sulla via Python-list
On 23 July 2016 at 16:06, Ian Kelly wrote: > On Fri, Jul 22, 2016 at 6:27 PM, Marco S. via Python-list > wrote: >> Furthermore I have a question about exceptions in asyncio. If I >> understand well how it works, tasks exceptions can be caught only if >> you wait for tas

<    29   30   31   32   33   34   35   36   37   38   >