Re: best way to read a huge ascii file.

2016-11-30 Thread Rolando Espinoza
al: 251 ms Wall time: 16.9 s In [7]: y.shape (60, 4) In [8]: y[:2, :] array([[ 0.17329305, 0.36584998, 0.01356046, 0.6814617 ], [ 0.3352684 , 0.83274823, 0.24399607, 0.30103352]]) You can also use dask to convert the entire file to hdf5. Regards, [1] http://dask.pydata.org/ Rolan

Re: Idle thread (Polling) python GUI and saving program state

2014-03-03 Thread Rolando
On Monday, March 3, 2014 6:06:22 PM UTC-8, MRAB wrote: > On 2014-03-04 01:33, Rolando wrote: > > > I have a GUI with a bunch of cells which is my "View" in the MVC > > > design. The user enters some information in the view and I pass this > > > on to

Idle thread (Polling) python GUI and saving program state

2014-03-03 Thread Rolando
I have a GUI with a bunch of cells which is my "View" in the MVC design. The user enters some information in the view and I pass this on to the model so that using the information entered by the user it(model) can do some processing. I have coded up my model as a state machine. Wherein, once a f

How to get progress in python script.

2012-09-28 Thread Rolando Cañer Roblejo
Hi all, Please, I need you suggest me a way to get statistics about a progress of my python script. My python script could take a lot of time processing a file, so I need a way that an external program check the progress of the script. My first idea was that the python script write a temp fil

How to limit CPU usage in Python

2012-09-20 Thread Rolando Cañer Roblejo
Hi all, Is it possible for me to put a limit in the amount of processor usage (% CPU) that my current python script is using? Is there any module useful for this task? I saw Resource module but I think it is not the module I am looking for. Some people recommend to use nice and cpulimit unix

Re: Source code for itertools

2010-08-30 Thread Rolando Espinoza La Fuente
oint to a windows path. If the file ends with a ".py", you can open the file with any editor. If ends with ".so" or something else likely is a compiled module in C and you should search in the source distribution, not the binary distribution. Hope it helps. Regards, Rolando Espinoza La fuente www.insophia.com -- http://mail.python.org/mailman/listinfo/python-list

Re: python interview quuestions

2010-08-10 Thread Rolando Espinoza La Fuente
efore: http://gist.github.com/518370 Well.. I tried to use generators to make it "cool" but changed it for a test-friendly approach. I'll find hard to remember the one-liners in an interview and get it right. Rolando Espinoza La fuente www.insophia.com -- http://mail.python.org/mailman/listinfo/python-list

Re: understanding the mro (long)

2010-07-23 Thread Rolando Espinoza La Fuente
t could save time figuring out where a method comes from. Anyway, was a good exercise to figure out the mro by hand :) Thanks for your comments Benjamin and Steven. ~Rolando -- http://mail.python.org/mailman/listinfo/python-list

understanding the mro (long)

2010-07-23 Thread Rolando Espinoza La Fuente
BaseException * BBar(B, Bar): __init__ from RuntimeError __str__ from Bar Finally everything make sense. And make think about be careful when doing multiple inheritance. Any thoughts? ~Rolando -- http://mail.python.org/mailman/listinfo/python-list

Re: Difficulty w/json keys

2010-04-23 Thread Rolando Espinoza La Fuente
, lang >                text = j['text'] "lang" key is in "user" dict >>> tweet['text'] 'tech managers what size for your teams? better to have 10-20 ppl per manager or 2-5 and have the managers be more hands on?' >>> tweet['lang'] [...] KeyError: 'lang' >>> tweet['user']['lang'] 'en' ~Rolando -- http://mail.python.org/mailman/listinfo/python-list

Re: Incorrect scope of list comprehension variables

2010-04-06 Thread Rolando Espinoza La Fuente
%timeit [r for r in range(1)] 100 loops, best of 3: 1.93 ms per loop ~Rolando -- http://mail.python.org/mailman/listinfo/python-list

Re: How to access args as a list?

2010-04-03 Thread Rolando Espinoza La Fuente
Spam: def __init__(self, *args, **kwargs): print args print kwargs That's what are you looking for? Regards, ~Rolando -- http://mail.python.org/mailman/listinfo/python-list

Re: installing something to a virtualenv when it's already in site-packages

2010-03-19 Thread Rolando Espinoza La Fuente
s not available. A work around is to uninstall > ipython from apt, install to the virtualenv, then reinstall in apt. Is > there a better way? I use -U (--upgrade) to force the installation within virtualenv. e.g: $ pip install -E env/ -U ipython Regards, Rolando -- http://mail.python.org/mailman/listinfo/python-list

Re: isinstance(False, int)

2010-03-05 Thread Rolando Espinoza La Fuente
d of bewildered: I'd expect smth like that in Perl, > but not in Python.. Although I can understand the rationale after skimming > PEP 285, I still don't like it very much. > So, the pythonic way to check for True/False should be: >>> 1 is True False >>> 0 is False False instead of ==, right? Regards, Rolando -- http://mail.python.org/mailman/listinfo/python-list

Re: isinstance(False, int)

2010-03-05 Thread Rolando Espinoza La Fuente
e side effects not knowing that False/True are ints? Regards, Rolando -- http://mail.python.org/mailman/listinfo/python-list

Re: ConfigParser is not parsing

2010-02-12 Thread Rolando Espinoza La Fuente
read() does not return the config object >>> import ConfigParser >>> config = ConfigParser.SafeConfigParser() >>> config.read('S3Files.conf') ['S3Files.conf'] >>> config.sections() ['main'] >>> config.get(&

Re: BeautifulSoup

2010-01-13 Thread Rolando Espinoza La Fuente
;beautifulsoup" module. > but it doesnt work! > [snip] -- Rolando Espinoza La fuente www.rolandoespinoza.info -- http://mail.python.org/mailman/listinfo/python-list

Re: Regex help needed!

2010-01-07 Thread Rolando Espinoza La Fuente
; Take the advice other people gave you and use BeautifulSoup. > -- > Aahz (a...@pythoncraft.com)           <*>         http://www.pythoncraft.com/ > > "If you think it's expensive to hire a professional to do the job, wait > until you hire an amateur."  --Red Adair > -- > http://mail.python.org/mailman/listinfo/python-list > -- Rolando Espinoza La fuente www.rolandoespinoza.info -- http://mail.python.org/mailman/listinfo/python-list