file write IOError Invalid argument

2009-07-16 Thread Robert Robert
Hello All, I am trying to write a binary string to file on a windows network share. I get an IOError. I've read that it is because the file size is too large. I did a type( binaryString) and saw that it was type "str". So I loop through it one by one element and use f.write to write to file, and

fil open close very slow

2009-08-01 Thread Robert Robert
hiya all, I have a "large" script written in python. There is in that big script at a certain point a loop in which I create a lots of simple small text files. Each text file just contain I think 4 or 5 short lines. When I simply run it in IDLE, it runs fast. But when I compile it to binary file

ActivePython: multiple versions on OSX?

2011-07-25 Thread Robert
Is it possible to install the 2 and 3 series side by side? -- Robert -- http://mail.python.org/mailman/listinfo/python-list

Re: 3.1 -> 3.2: base64 lost deprecation warning

2011-02-28 Thread Robert
nd this: Issue #3613: base64.{encode,decode}string are now called base64.{encode,decode}bytes which reflects what type they accept and return. The old names are still there as deprecated aliases. Doesn't exlain the "no warning" though. -- Robert -- http://mail.python.org/mailman/listinfo/python-list

What do you use with Python for GUI programming and why?

2011-03-10 Thread Robert
Is there a push to one toolkit or the other? -- Robert -- http://mail.python.org/mailman/listinfo/python-list

Re: What do you use with Python for GUI programming and why?

2011-03-11 Thread Robert
nd is automatically translated from a very 2.x-ish dialect of Python to Javascript.  Programming an AJAX app this way feels just like programming to a set of desktop widgets - because they are also desktop widgets. But what OSes are you using? On Thu, Mar 10, 2011 at 6:25 PM, Robert wrote: Is there a

[OSX] side by side python

2011-03-21 Thread Robert
Can I install Python 2.7 and 3.2 (from python.org) side by side on OSX without them stepping all over each other? -- http://mail.python.org/mailman/listinfo/python-list

Re: side by side python

2011-03-21 Thread Robert
On Mar 21, 9:45 am, macm wrote: > On Mar 21, 9:31 am, Robert wrote: > > > Can I install Python 2.7 and 3.2 (from python.org) side by side on OSX > > without them stepping all over each other? > > Yes, sure! Look for "python environment" > > http://pyp

[Book] Python 3 Web Development Beginner's Guide

2011-05-21 Thread Robert
Has anyone read this one? If so, what did you think? -- Bob -- http://mail.python.org/mailman/listinfo/python-list

What use is of this 'cast=float ,'?

2017-10-27 Thread Robert
Hi, I read below code snippet on line. I am interested in the second of the last line. cast=float , I've tried it in Python. Even simply with float it has no error, but what use is it? I do see a space before the comma ','. Is it a typo or not? Thanks, self.freqslider=forms.sli

Is it useful to set a fraction number here to the mask value?

2017-11-30 Thread Robert
Hi, I am new to Python. Now I follow a thread on mask array usage on line: https://stackoverflow.com/questions/31563970/fitting-a-binomial-distribution-with-pymc-raises-zeroprobability-error-for-certa I understand the problem, but I don't understand the answer follow the link. Because the 'ma

Re: Is it useful to set a fraction number here to the mask value?

2017-11-30 Thread Robert
On Thursday, November 30, 2017 at 6:17:05 PM UTC-5, Robert wrote: > Hi, > > I am new to Python. Now I follow a thread on mask array usage on line: > > > https://stackoverflow.com/questions/31563970/fitting-a-binomial-distribution-with-pymc-raises-zeroprobability-error-f

What meaning is "if k in [0, len(n_trials) - 1] else None"?

2016-12-03 Thread Robert
Hi, I am trying to understand the meaning of the below code snippet. Though I have a Python IDLE at computer, I can't get a way to know below line: if k in [0, len(n_trials) - 1] else None I feel it is strange for what returns when the 'if' condition is true? The second part 'None' is clear to m

Re: What meaning is "if k in [0, len(n_trials) - 1] else None"?

2016-12-03 Thread Robert
On Saturday, December 3, 2016 at 6:09:02 PM UTC-5, Robert wrote: > Hi, > > I am trying to understand the meaning of the below code snippet. Though I have > a Python IDLE at computer, I can't get a way to know below line: > > if k in [0, len(n_trials) - 1] else None >

Small python24.dll / how to strip off asian codecs to separate package(s) ?

2005-09-22 Thread Robert
updating a py2exe'd software I was impressed by python24.dll's footprint - double size of python23.dll Is there a version without/separate asianc codecs (which seem to mainly blow up python24.dll)? Or how to build one? Robert -- http://mail.python.org/mailman/listinfo/python-list

Re: Small python24.dll / how to strip off asian codecs to separate package(s) ?

2005-09-24 Thread Robert
) - but asian codecs? Robert "Martin v. Löwis" <[EMAIL PROTECTED]> schrieb im Newsbeitrag news:[EMAIL PROTECTED] > Robert wrote: > > Or how to build one? > > Just download the source, and follow the instructions in > PCBuild/readme.txt. Then, edit the pythoncore

wxPython + pyPlot

2005-10-18 Thread Robert
self.Wykres_PT = wx.lib.plot.PlotCanvas(id=wxID_FRAME1WYKRES_PT, name=u'Wykres_PT', parent=self.Okno_PT, pos=wx.Point(0, 0), size=wx.Size(510, 328), style=0) and I don't now how to do that. thanks for any help. Robert -- http://mail.python.org/mailman/listinfo/python-list

Re: wxPython + pyPlot

2005-10-18 Thread Robert
Maebe, does anyone have some examples with wxPython and pyplot? Thanks again, Robert -- http://mail.python.org/mailman/listinfo/python-list

Re: wxPython + pyPlot

2005-10-18 Thread Robert
Philippe C. Martin wrote: > I think wxWidget comes with a sample > > Philippe Yes I use it, but there is not a sample with pyplot. Robert -- http://mail.python.org/mailman/listinfo/python-list

MySQLdb and cgi

2005-10-30 Thread robert
 Dear group, I have a problem with importing MySQLdb in a cgi-script. The code fragment at the beginning:   1 #!/usr/bin/env python   2   3 print "Content-Type: text/html\n\n"   4   5 import re   6 import cgi   7 import MySQLdb 8 print "something" but the print statemen

Re: MySQLdb and cgi

2005-10-31 Thread robert
I am sending it again, since it didn't appear on the mailing list.  Dear group, I have a problem with importing MySQLdb in a cgi-script. The code fragment at the beginning:   1 #!/usr/bin/env python   2   3 print "Content-Type: text/html\n\n"   4   5 import re   6 import cgi

Monster python24.dll / stripping off asian codecs to separate package(s) ?

2005-11-04 Thread Robert
Martin v. Löwis schrieb: > Robert wrote: > > Wouldn't it be an issue to think about if future win-python distributions > > should keep on including the asian codecs in the main-dll? > > Indeed, it would. As I said before: if somebody defines a clear, fair > policy

Re: Monster python24.dll / stripping off asian codecs to separate package(s) ?

2005-11-04 Thread Robert
. * _ssl.pyd has not the recent fixes. Robert -- http://mail.python.org/mailman/listinfo/python-list

Bugfix release 2.3.6 ?

2005-11-04 Thread Robert
. * _ssl.pyd has not the recent fixes. Robert -- http://mail.python.org/mailman/listinfo/python-list

something wrong in wx

2005-11-11 Thread Robert
tValue())) print desired_error fann.fann_train_on_file(ann, "zapis.txt", max_iterations, iterations_between_reports, desired_error) fann.fann_save(ann, "po_nauce.net") fann.fann_destroy(ann) app = wx.PySimpleApp() frame = TestFrame() frame.Show() app.MainLoop() ### Thanks for any help. Robert -- http://mail.python.org/mailman/listinfo/python-list

search backward

2005-01-04 Thread Robert
I need to find the location of a short string in a long string. The problem however is that i need to search backward. Does anybody know how to search in reverse direction? Thanks, Robert -- http://mail.python.org/mailman/listinfo/python-list

execute python code from db

2005-01-26 Thread robert
,)) for python_code in c.fetchall(): execute (python_code) Maybe feed python with stdin??. robert. -- http://mail.python.org/mailman/listinfo/python-list

installing tkiner

2005-01-28 Thread Robert
Python.') Please advise. Robert -- http://mail.python.org/mailman/listinfo/python-list

convert ftp.retrbinary to file object? - Python language lacks expression?

2005-02-03 Thread Robert
I just tried to convert a (hugh size) ftp.retrbinary run into a pseudo-file object with .read(bytes) method in order to not consume 500MB on a copy operation. First I thought, its easy as usual with python using something like 'yield' or so. Yet I didn't manage to do (without using threads or rew

Re: convert ftp.retrbinary to file object? - Python language lacks expression?

2005-02-03 Thread Robert
That turns into periodic new RETR commands with offset. Think its more an "odd" trick. I'd even prefer a threaded approach (thread puts the blocks into a stack; a while ... yield generator loop in the main thread serves the .read() function of the pseudo file object, which is my wish). Yet such

Re: importing pyc from memory?

2005-07-04 Thread Robert
;s content in a string like co = marshal.loads( pyc_s[8:] ) mod=imp.new_module('xy') exec co in mod.__dict__ Robert -- http://mail.python.org/mailman/listinfo/python-list

Error with Python

2005-08-22 Thread Robert
hints... Regards Robert -- http://mail.python.org/mailman/listinfo/python-list

sslerror: (8, 'EOF occurred in violation of protocol') ???

2005-08-29 Thread Robert
the same and ok. but different client-OS/proxies/firewalls/routers are in use. What is the nature of this error? How is it possible that an EOF in ssl-connections (during connect?) occures? What can be done to handle/circumvent that problem? Robert -- http://mail.python.org/mailman/listinfo/python-list

Re: sslerror: (8, 'EOF occurred in violation of protocol') ???

2005-08-30 Thread Robert
"Robert" <[EMAIL PROTECTED]> schrieb im Newsbeitrag news:[EMAIL PROTECTED] > On some connections only from some computers/network setups I get this > error: > > Traceback (most recent call last): > File "", line 1, in ? > File "ClientCookie\

Re: micro-python - is it possible?

2005-08-30 Thread Robert
e time can be compiled to > low-footprint resource-lean code? > > And could such a mini-python be worth using over C, Forth, etc? guess so if your app has non-trivial complexity: Faktor 5 in programming speed and clarity of code - if you can grant 0.5..2MB overhead. but guess you

socket.sslerror:(1, 'error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol')

2005-08-31 Thread Robert
ib2_support.pyo\', 807, \'https_open\', None), (\'ClientCookie_urllib2_support.pyo\', 656, \'do_open\', None), (\'httplib.pyo\', 715, \'endheaders\', None), (\'httplib.pyo\', 600, \'_send_output\', None), (\'httplib.pyo\', 567, \'send\', None), (\'httplib.pyo\', 988, \'connect\', None), (\'socket.pyo\', 73, \'ssl\', None)] Robert -- http://mail.python.org/mailman/listinfo/python-list

Python / web

2005-09-01 Thread Robert
..., Also a fair amount of googling. I'll say there's a large amount of technology to pick from. Rather than spend time going down the wrong road, can I get some feedback as directions from you folks that's "been there, done that." thanks a bunch. Robert -- http://mail.py

sslerror: (8, 'EOF occurred in violation of protocol')

2005-09-05 Thread Robert
ot;socket.pyo", line 73, in ssl sslerror: (8, 'EOF occurred in violation of protocol') The target-server is always the same and ok. but different client-OS(Windows)/proxies/firewalls/routers are in use. What is the nature of this error? How is it possible that an EOF in ssl-connections (during connect?) occures? What can be done to handle/circumvent that problem? Robert -- http://mail.python.org/mailman/listinfo/python-list

time.strptime intolerant on weekday string length?

2005-09-13 Thread Robert
data=%s fmt=%s" % ValueError: time data did not match format: data=Tues, 30 Aug 2005 20:48:31 fmt=%a, %d %b %Y %H:%M:%S >>> I also don't see how to alter the pattern for strptime to be tolerante for more long weekday strings? Any ideas? Shouldn't it be possible to insert real regexp-like stuff in the pattern? Robert -- http://mail.python.org/mailman/listinfo/python-list

Zope side-by-side with Python 2.4

2004-12-03 Thread Robert
If I have Python 2.4 installed and I want to install the latest stable Zope, will Zope have problems or does Zope looks to its own setup and not my install of Python 2.4? Robert -- http://mail.python.org/mailman/listinfo/python-list

Re: How is Python designed?

2004-12-04 Thread Robert
Sorry for my interrupting the discussion : ). I am a graduate student in a chinese university, and i am very interested in the Yuan language. I'd like to join in the development of Yuan and do some work for this language. BTW, i like this word, "Yuan" : ) I have 3 or 4 years experience in C++, a

Re: New versions breaking extensions, etc.

2004-12-10 Thread Robert
VS7 is a really a vastly different beastie than VS6. On 12/10/04 9:31 PM, in article [EMAIL PROTECTED], "Jive" <[EMAIL PROTECTED]> wrote: > Can someone explain to me why Python 2.4 on MS Windows has these backward > compatibility problems? What am I missing? Why won't extensions compiled > to

SSL and Proxy problem with urllib2 ?

2005-04-05 Thread Robert
lib.pyo", line 597, in _send_output File "httplib.pyo", line 564, in send File "httplib.pyo", line 985, in connect File "socket.pyo", line 73, in ssl sslerror: (1, 'error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol') using python 2.3.5 any Ideas about the problem? Robert -- http://mail.python.org/mailman/listinfo/python-list

"unknown protocol" error in httplib using HTTPS

2005-04-05 Thread Robert
did you solve this problem? It seems to be still present here with py2.3.5. Robert -- From: Manish Jethani <[EMAIL PROTECTED]> User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.6b) Gecko/20031205 Thunderbird/0.4 X-Accept-Language: en-us, en MIME-Version: 1.0 News

pygtk and long running process

2005-04-24 Thread Robert
Hi, I have a command line app that can take up to 20 minutes to complete and every minute or so updates it's status (spits it out to console). I am writing a front end for this app in python/gtk and was wondering what command I use to a) invoke the command and b) how to capture it's out put and f

Re: pygtk and long running process

2005-04-25 Thread Robert
On Sun, 24 Apr 2005 19:46:52 -0600, Daniel Cer wrote: > Daniel Cer wrote: >> Robert wrote: >> >>> I have a command line app that can take up to 20 minutes to complete and >>> every minute or so updates it's status (spits it out to console). I am >>

Question about split method

2015-12-02 Thread Robert
Hi, I learn split method online. When I try to run the line with ss1 beginning, I don't understand why its output of ss1 and ss2. I have check the help about split. It looks like that it is a numpy method. What is the split method parameter (within " ") for? Thanks, ... ss0="1, 2

Re: Question about split method

2015-12-02 Thread Robert
On Wednesday, December 2, 2015 at 3:45:34 PM UTC-5, Ian wrote: > On Wed, Dec 2, 2015 at 2:37 PM, Robert wrote: > > Hi, > > > > I learn split method online. When I try to run the line with ss1 beginning, > > I don't understand why its output of ss1 and ss2. I hav

'string.join' is wrong in my Python console

2015-12-02 Thread Robert
Hi, I read the tutorial on "Why is join() a string method instead of a list or tuple method?" at link: https://docs.python.org/2/faq/design.html#why-must-self-be-used-explicitly-in-method-definitions-and-calls I have a problem on running the last line: --- If none of these arguments

Is there a way to set several list elements a same value with one line code

2015-12-03 Thread Robert
Hi, I remember that there is a way to set several list elements a same value with one line code. Excuse me, I don't remember the accurate syntax on the code snippet. But the basic format looks like this. 1. There is a four-element list, such as: bb=[[[]],[[]],[[]],[[]]] 2. An assignment lin

Re: Is there a way to set several list elements a same value with one line code

2015-12-03 Thread Robert
On Thursday, December 3, 2015 at 7:59:16 PM UTC-5, MRAB wrote: > On 2015-12-04 00:30, Robert wrote: > > Hi, > > > > I remember that there is a way to set several list elements a same value > > with > > one line code. Excuse me, I don't remember the accurate

Re: Question about split method

2015-12-05 Thread Robert
On Saturday, December 5, 2015 at 2:29:28 PM UTC-5, Peter Pearson wrote: > On Wed, 2 Dec 2015 14:44:30 -0600, Ian Kelly wrote: > > On Wed, Dec 2, 2015 at 2:37 PM, Robert wrote: > [snip] > >> ss0="1, 2, 4, 8, 16".split(", ") > [snip] > > Try help(

Help on for loop understanding

2015-12-07 Thread Robert
Hi, When I learn for loop with below link: http://www.shutupandship.com/2012/01/understanding-python-iterables-and.html it has such explanation: \ for loop under the hood First let's look at the for loop under the hood. When Python executes the for loop, it first invokes the __iter__()

Re: Help on for loop understanding

2015-12-07 Thread Robert
On Monday, December 7, 2015 at 8:14:46 PM UTC-5, Robin Koch wrote: > Am 08.12.2015 um 02:05 schrieb Robert: > > Hi, > > When I learn for loop with below link: > > > > http://www.shutupandship.com/2012/01/understanding-python-iterables-and.html >

Re: Help on for loop understanding

2015-12-07 Thread Robert
On Monday, December 7, 2015 at 8:32:30 PM UTC-5, Robert wrote: > On Monday, December 7, 2015 at 8:14:46 PM UTC-5, Robin Koch wrote: > > Am 08.12.2015 um 02:05 schrieb Robert: > > > Hi, > > > When I learn for loop with below link: > > > > > > http:

Re: Help on for loop understanding

2015-12-07 Thread Robert
On Monday, December 7, 2015 at 8:39:48 PM UTC-5, Robert wrote: > On Monday, December 7, 2015 at 8:32:30 PM UTC-5, Robert wrote: > > On Monday, December 7, 2015 at 8:14:46 PM UTC-5, Robin Koch wrote: > > > Am 08.12.2015 um 02:05 schrieb Robert: > > > > Hi, > >

Re: Help on for loop understanding

2015-12-08 Thread Robert
On Monday, December 7, 2015 at 10:24:09 PM UTC-5, Chris Angelico wrote: > On Tue, Dec 8, 2015 at 1:36 PM, Erik wrote: > > So, you can write your class's iterator to do anything that makes sense when > > someone says "for i in myclassinstance:". > > > > If your class is a subclass of a class ("is-a

Is there a data type rule on 'x+=' and 'x0=x+'?

2015-12-09 Thread Robert
Hi, I have a numpy np.array data x: x= np.array([[157, 185], [169, 195], [162, 179], [145, 195], [159, 199], [165, 180], [172, 195], [180, 201], [163, 195], [169, 191]]) Here is the original code snippet: x+=uniform(-8, 8, x.shape) x Out[557]: array([[163, 192], [163, 187], [17

Why doesn't response pydoc on my Python 2.7?

2015-12-12 Thread Robert
Hi, I want to use pydoc as some online tutorial shows, but it cannot run as below. What is wrong? Thanks, >>> import pydoc >>> pydoc >>> pydoc sys SyntaxError: invalid syntax >>> import sys >>> pydoc sys SyntaxError: invalid syntax >>> help(pydoc) Help on module pydoc: .. -- https://m

Re: Why doesn't response pydoc on my Python 2.7?

2015-12-12 Thread Robert
On Saturday, December 12, 2015 at 6:02:11 PM UTC-5, Robert wrote: > Hi, > > I want to use pydoc as some online tutorial shows, but it cannot run as > below. What is wrong? > > > Thanks, > > > > > >>> import pydoc > >>> pydoc > &g

Re: Why doesn't response pydoc on my Python 2.7?

2015-12-12 Thread Robert
On Saturday, December 12, 2015 at 6:24:25 PM UTC-5, Erik wrote: > On 12/12/15 23:08, Robert wrote: > > In fact, I wanted to run the following code. When it failed, I moved to > > the original question above. > > How did it fail? Tell us what _did_ happen. > > It work

Re: Why doesn't response pydoc on my Python 2.7?

2015-12-12 Thread Robert
On Saturday, December 12, 2015 at 7:05:39 PM UTC-5, Robert wrote: > On Saturday, December 12, 2015 at 6:24:25 PM UTC-5, Erik wrote: > > On 12/12/15 23:08, Robert wrote: > > > In fact, I wanted to run the following code. When it failed, I moved to > > > the original quest

Re: Why doesn't response pydoc on my Python 2.7?

2015-12-12 Thread Robert
On Saturday, December 12, 2015 at 7:36:21 PM UTC-5, Peter Otten wrote: > Robert wrote: > > > On Saturday, December 12, 2015 at 7:05:39 PM UTC-5, Robert wrote: > >> On Saturday, December 12, 2015 at 6:24:25 PM UTC-5, Erik wrote: > >> > On 12/12/15 23:08, Robert wro

Help on class understanding in pymc code

2015-12-13 Thread Robert
Hi, I follow code example at link: https://users.obs.carnegiescience.edu/cburns/ipynbs/PyMC.html There is the following code line: sampler = pymc.MCMC([alpha,betax,betay,eps,model,tau,z_obs,x_true,y_true]) I want to know the detail of pymc.MCMC, then I get help content of it with: /

Re: Help on class understanding in pymc code

2015-12-13 Thread Robert
On Sunday, December 13, 2015 at 8:10:25 PM UTC-5, Peter Otten wrote: > Robert wrote: > > > Hi, > > > > I follow code example at link: > > > > https://users.obs.carnegiescience.edu/cburns/ipynbs/PyMC.html > > > > > > There is the followin

Question about figure plot

2015-12-14 Thread Robert
Hi, When I run the following code, there is no figure shown in the end. // import pymc import numpy as np n = 5*np.ones(4,dtype=int) x = np.array([-.86,-.3,-.05,.73]) alpha = pymc.Normal('alpha',mu=0,tau=.01) beta = pymc.Normal('beta',mu=0,tau=.01) @pymc.deterministic def theta(a=alph

Help on code comprehension from an example project of pymc

2015-12-15 Thread Robert
Hi, I find the useful small code project for me: #https://users.obs.carnegiescience.edu/cburns/ipynbs/PyMC.html It runs as expected. When I review the code, I find 'data' in the original line: data = pymc.Normal('data', mu=model, tau=tau, value=z_obs, observed=True) has not been referenced the

Help on error " ValueError: For numerical factors, num_columns must be an int "

2015-12-16 Thread Robert
Hi, When I run the following code, there is an error: ValueError: For numerical factors, num_columns must be an int import numpy as np import pandas as pd from patsy import dmatrices from sklearn.linear_model import LogisticRegression X = [0.5,0.75,1.0,1.25,1.5,1.75,1.75,2.0,

Re: Help on error " ValueError: For numerical factors, num_columns must be an int "

2015-12-16 Thread Robert
On Wednesday, December 16, 2015 at 5:44:21 AM UTC-5, Robert wrote: > Hi, > > When I run the following code, there is an error: > > ValueError: For numerical factors, num_columns must be an int > > > > import numpy as np > import pandas as pd

Re: Help on error " ValueError: For numerical factors, num_columns must be an int "

2015-12-16 Thread Robert
On Wednesday, December 16, 2015 at 5:57:04 AM UTC-5, Robert wrote: > On Wednesday, December 16, 2015 at 5:44:21 AM UTC-5, Robert wrote: > > Hi, > > > > When I run the following code, there is an error: > > > > ValueError: For numerical fa

Re: Help on error " ValueError: For numerical factors, num_columns must be an int "

2015-12-16 Thread Robert
On Wednesday, December 16, 2015 at 6:34:21 AM UTC-5, Mark Lawrence wrote: > On 16/12/2015 10:44, Robert wrote: > > Hi, > > > > When I run the following code, there is an error: > > > > ValueError: For numerical factors, num_columns must be an int > > > >

Re: Help on error " ValueError: For numerical factors, num_columns must be an int "

2015-12-16 Thread Robert
On Wednesday, December 16, 2015 at 8:57:30 PM UTC-5, Josef Pktd wrote: > On Wednesday, December 16, 2015 at 9:50:35 AM UTC-5, Robert wrote: > > On Wednesday, December 16, 2015 at 6:34:21 AM UTC-5, Mark Lawrence wrote: > > > On 16/12/2015 10:44, Robert wrote: > > > >

How can I get/save Pandas DataFrame help content?

2015-12-16 Thread Robert
Hi, When I use Enthought/Canopy, help(DataFrame) has so much content that it exceeds the display buffer, i.e. its head is cut off as I go up to see it. I would like to know whether there is a way similar to Linux redirection to save the help DataFrame content to a file? I have search on-line Pan

Re: How can I get/save Pandas DataFrame help content?

2015-12-16 Thread Robert
On Wednesday, December 16, 2015 at 9:56:23 PM UTC-5, Chris Angelico wrote: > On Thu, Dec 17, 2015 at 1:48 PM, Robert wrote: > > Hi, > > > > When I use Enthought/Canopy, help(DataFrame) has so much content that it > > exceeds the display buffer, i.e. its head is cut off

Can I call a pymc-function directly?

2015-12-20 Thread Robert
Hi, I am new to pymc package. I come across the following tutorial: The example is from: www.map.ox.ac.uk/media/PDF/Patil_et_al_2010.pdf . import pymc import numpy as np n = 5*np.ones(4,dtype=int) x = np.array([-.86,-.3,-.05,.73]) alpha = pymc.Normal('alpha',mu=0,tau=.01) beta =

What could cause a plot fail in my code?

2015-12-21 Thread Robert
Hi, I find a useful code snippet on link: http://stackoverflow.com/questions/25126444/logistic-regression-in-pymc/34400966#34400966 but it has error on plot function. The error message is as following: - %run "C:\Users\rj\pyprj\logic_regression0.py" [-100%

Re: What could cause a plot fail in my code?

2015-12-21 Thread Robert
On Monday, December 21, 2015 at 12:15:54 PM UTC-5, Robert wrote: > Hi, > > I find a useful code snippet on link: > > http://stackoverflow.com/questions/25126444/logistic-regression-in-pymc/34400966#34400966 > > but it has error on plot function. The error me

How to change/set compiler option for weave inline function

2015-12-27 Thread Robert
Hi, I want to run a few C code inside Python on Windows 7, 64-bit PC, Canopy 1.5.2.2785. I made a few trials, but I forget the detail commands I made on compiler setting. One thing I remember is that I added one file: distutils.cfg, whose content is: [build] compiler=mingw32 And another thing I

What meaning is '[: , None]'?

2016-01-02 Thread Robert
Hi, I read a code snippet, in which object w_A is: w_A Out[48]: array([ 0.10708809, 0.94933575, 0.8412686 , 0.03280939, 0.59985308]) Then, I don't know what is '[: ' below: vs_A = w_A[:, None] * xs I don't find the answer after searching around Could you explain above code to me? Than

What use of 'sum' in this line code?

2016-01-03 Thread Robert
Hi, I find below code snippet on line: // m = 10 theta_A = 0.8 theta_B = 0.3 theta_0 = [theta_A, theta_B] coin_A = bernoulli(theta_A) coin_B = bernoulli(theta_B) xs = map(sum, [coin_A.rvs(m), coin_A.rvs(m), coin_B.rvs(m), coin_A.rvs(m), coin_B.rvs(m)]) / I see [coin_A.rvs(m)

Re: What use of 'sum' in this line code?

2016-01-03 Thread Robert
On Sunday, January 3, 2016 at 7:54:13 PM UTC-5, Peter Otten wrote: > Robert wrote: > > > Hi, > > > > I find below code snippet on line: > > > > > > // > > m = 10 > > theta_A = 0.8 > > theta_B = 0.3 > > theta_0 =

Is '*args' useful in this example code?

2016-01-04 Thread Robert
Hi, I find an example code on wrap at this link: http://stackoverflow.com/questions/308999/what-does-functools-wraps-do Here is the code: def logged(func): def with_logging(*args, **kwargs): print func.__name__ + " was called" return func(*args, **kwargs) return w

Re: Is '*args' useful in this example code?

2016-01-04 Thread Robert
On Monday, January 4, 2016 at 9:26:47 PM UTC-5, Ben Finney wrote: > Robert writes: > > > I understand now, but I feel the args usage is weird. I don't see any way > > to use *args and **kwargs in above code. What is your opinion on it? > > Can you show example co

Re: Is '*args' useful in this example code?

2016-01-05 Thread Robert
On Monday, January 4, 2016 at 10:28:31 PM UTC-5, Ben Finney wrote: > Robert <.com> writes: > > > On Monday, January 4, 2016 at 9:26:47 PM UTC-5, Ben Finney wrote: > > > Can you show example code that you would expect, and specifically what > > > about > >

Why is there difference between cmd line and .py file?

2016-01-05 Thread Robert
Hi, I run below code, which is downloaded from link: http://stackoverflow.com/questions/15513792/expectation-maximization-coin-toss-examples?rq=1 # represent the experiments head_counts = np.array([5,9,8,4,7]) tail_counts = 10-head_counts experiments = zip(head_counts,tail_counts)

Re: Why is there difference between cmd line and .py file?

2016-01-05 Thread Robert
On Tuesday, January 5, 2016 at 3:26:15 PM UTC-5, Robert wrote: > Hi, > > I run below code, which is downloaded from link: > > http://stackoverflow.com/questions/15513792/expectation-maximization-coin-toss-examples?rq=1 > > > > > # represent

Re: Why is there difference between cmd line and .py file?

2016-01-05 Thread Robert
On Tuesday, January 5, 2016 at 3:37:53 PM UTC-5, John Gordon wrote: > In Robert > writes: > > > > > # represent the experiments > > head_counts = np.array([5,9,8,4,7]) > > The code doesn't define 'np', so this line should produce

Re: Why is there difference between cmd line and .py file?

2016-01-05 Thread Robert
On Tuesday, January 5, 2016 at 3:58:44 PM UTC-5, Joel Goldstick wrote: > On Tue, Jan 5, 2016 at 3:45 PM, Robert wrote: > > > On Tuesday, January 5, 2016 at 3:37:53 PM UTC-5, John Gordon wrote: > > > In Robert < > > r...@gmail.com> writes: > > > &g

What meaning is 'from . import'

2016-01-07 Thread Robert
Hi, I see the following code. After searching around, I still don't know the meaning of '.'. Could you tell me that ? Thanks, from . import _hmmc from .utils import normalize -- https://mail.python.org/mailman/listinfo/python-list

Re: Question about a class member

2016-01-07 Thread Robert
On Thursday, January 7, 2016 at 12:24:53 PM UTC-5, Robert wrote: > Hi, > > I am using a download package. When I read its code, see below please, I > don't know what 'sample' is: > > > -- > model = hmm.GaussianHMM(n_components=4, covari

Re: Question about a class member

2016-01-07 Thread Robert
On Thursday, January 7, 2016 at 5:06:07 PM UTC-5, Steven D'Aprano wrote: > On Fri, 8 Jan 2016 04:23 am, Robert wrote: > > > Hi, > > > > I am using a download package. When I read its code, see below please, I > > don't know what 'sample' is: &g

What use is '__reduce__'?

2016-01-08 Thread Robert
Hi, When I try to run the following code: / from collections import Counter, OrderedDict class OrderedCounter(Counter, OrderedDict): 'Counter that remembers the order elements are first seen' def __repr__(self): return '%s(%r)' % (self.__class__.__name__,

What use is '() here?

2016-01-08 Thread Robert
Hi, Thanks Ian for replying to my previous post. Here is a further question on the 'return' line below. import collections import pickle class C(collections.defaultdict): def __init__(self): collections.defaultdict.__init__(self, list) def __reduce__(self): t = coll

Re: What use is '__reduce__'?

2016-01-08 Thread Robert
#x27;s probably included so that it won't be missed when the code is > copied. > > On Fri, Jan 8, 2016 at 9:42 AM, Robert wrote: > > Hi, > > > > When I try to run the following code: > > > > > > > > / > > from collections import C

Re: What use is '() here?

2016-01-08 Thread Robert
On Friday, January 8, 2016 at 12:44:01 PM UTC-5, Robert wrote: > Hi, > > Thanks Ian for replying to my previous post. Here is a further question on > the 'return' line below. > > > > > import collections > import pickle > class C(collect

Help on return type(?)

2016-01-09 Thread Robert
Hi, I see below code snippet. The return line is not as the usual type. def make_cov(cov_type, n_comp, n_fea): mincv = 0.1 rand = np.random.random return { 'spherical': (mincv + mincv * np.dot(rand((n_components, 1)), np.ones((1,

What use of these _ prefix members?

2016-01-10 Thread Robert
Hi, When I read a sample file from hmm learn package, which is on top of scikit-learn package, I see there are many member functions (prefix with '_') have no caller. That is, I don't see anything uses those functions. Below is a sample part from class GMMHMM(_BaseHMM): // def _

Question on pytest example code

2016-01-10 Thread Robert
Hi, Below is a code snippet from pytest package. It passes pytest, i.e. there is no failure report. # content of test_sysexit.py import pytest def f(): raise SystemExit(1) def test_mytest(): with pytest.raises(SystemExit): f() I see that f() will generate 'SystemExit(1)'.

Confusing on bool data object or class function?

2016-01-10 Thread Robert
Hi, When I use an on line code snippet, see below please, I find that 'converged' in class ConvergenceMonitor is seen as a data. - class ConvergenceMonitor(object): """Monitors and reports convergence to :data:`sys.stderr`. Parameters -- tol : double

It looks like one function not tested by pytest

2016-01-12 Thread Robert
Hi, I modify a test suite, and simplified to the below content. I am interested in function: test_bad_covariance_type() I think that it tests for wrong type input, i.e. 'badcovariance_type' will generate error, which is expected. Thus, it passes test. When a correct type, such as 'diag', is giv

  1   2   3   4   5   6   7   8   9   10   >