Python

Room rules: sopython.com/chatroom Code formatting guide: tinyu...
Feb 24, 2017 23:11
ah the 1% getting away with everything once again
Feb 24, 2017 23:10
you might be better off with Eclipse. I don't use it (vim for me) but I know people who have large python software projects in it. Atom and Sublime are good if you use a Mac.
Feb 24, 2017 23:04
I counted 12
Feb 24, 2017 23:04
that's strange because what you posted has less than 23 lines
Mar 31, 2015 16:18
Is there any type of lint checker that can warn about things like that (returning the_dict instead of the_dict.copy()). Is that even possible in a productive way (because sometimes you want the reference instead of the copy)?
Mar 31, 2015 16:10
Spent almost a day running down a bad mistake-- returned the_dict instead of the_dict.copy() and blasted it in memory later on.
Mar 13, 2015 22:53
can pandas sample a timestamped series into regular intervals? what's the jist of it?
Mar 3, 2015 20:10
What is the name of the XML parsing library that does hybrid SAX/DOM i.e. it is a SAX parser but when you hit something of interest you can retrieve a DOM fragment
Mar 2, 2015 23:00
Which brings up a second question; am I drinking too much or not enough?
Mar 2, 2015 22:58
Does anyone know the name of the hybrid SAX-DOM parser library? The one that is like a SAX parser, but lets you get a DOM fragment when you get to the interesting parts. I even used it once and I can't even find where.
Feb 24, 2015 19:06
Feb 24, 2015 18:21
@davidism wow, haven't seen that one. mx brown keyswitches? Recently got the daskeyboard brown. love it.
Feb 24, 2015 18:04
that's right, we have to add envvars to the list :)
Feb 24, 2015 18:02
it's an interesting thought process... what should I put in the CL options, config.py, input.xml or input.json...
Feb 24, 2015 18:01
but config.py fails when you have to iterate your program many times over different configs
Feb 24, 2015 18:00
true, config.py is sometimes the best option
Feb 24, 2015 17:56
json.load is extremely powerful and puts everything into a dict for you
Feb 24, 2015 17:55
you might consider moving to input files e.g. json in those cases
Feb 24, 2015 17:53
@tristan usually args.whatever is fine, but here and there I will assign to something else more compact or readable. But I don't re-map as a rule
Feb 24, 2015 17:50
i use argparse all the time... what do you mean bail?
Feb 24, 2015 17:32
I love the futuristic/archaic motif as in the movie Dark City
Feb 24, 2015 17:30
@DSM that's so cool
Feb 24, 2015 17:29
any mechanical keyboard aficionados here?
Feb 24, 2015 17:20
Jon, outstanding
Feb 24, 2015 17:08
Thanks all for the help
Feb 24, 2015 17:07
being that this is an optimization problem in the first place
Feb 24, 2015 17:07
I guess subconsciously I was wondering if there was something about Counter that was important for speed, vs. rolling your own
Feb 24, 2015 17:05
@Kevin got it
Feb 24, 2015 17:05
it's a list with 1 element
Feb 24, 2015 17:04
I had not heard of a collections.counter before. But I get the idea.
Feb 24, 2015 17:03
I think that's where the collections.counter comes in
Feb 24, 2015 17:02
the caveat is removing the item once it disappears
Feb 24, 2015 17:01
for sure
Feb 24, 2015 16:59
yes, there's an exhaustive list. it doesn't change. It's prices, by the way.
Feb 24, 2015 16:57
I'm checking if certain elements are absent. E.g. make sure there are no "John's" and "Jack's" in the set.
Feb 24, 2015 16:55
I have a long list that is continually updated (one element at a time). From this list I continually need to get the set of unique values for a subset of the list items (for example, the unique names of boys, and the list is all boys + girls). Currently using a set comprehension and it is causing an effing speed bottleneck. Someone suggested using a Collections.counter instead. Agree/disagree/other ideas?
Feb 13, 2015 17:10
@DSM the computer version of "package check", LOL
Feb 13, 2015 16:38
you are correct. The quick number/estimate is a foot per nanosecond. Laser guy trick.
Feb 13, 2015 16:33
light can travel an additional 28.6 feet during time difference