Re: Removing items from a list

2012-02-13 Thread Thomas Philips
I could indeed have addressed this problem with a list comprehension. It escaped me at the time because the larger problem I was trying to solve included removing data from a dictionary: months = sorted(list(dataDict.keys())) #Sort months in ascending order

Re: Removing items from a list

2012-02-10 Thread Thomas Philips
Thanks for the insight. I saw the behavious as soon as I extended x with a bunch of 0's >>> x = list(range(10)) >>> x.extend([0]*10) >>> x [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] >>> for i in reversed(x): if i % 2 == 0: x.remove(i) >>> x [1, 3, 5, 7, 9

Removing items from a list

2012-02-10 Thread Thomas Philips
ve(i) >>> x [1, 3, 5, 7, 9] >>> for i in reversed(x): if i % 2 == 0: x.remove(i) >>> x [1, 3, 5, 7, 9] >>> x = list(range(10)) >>> for i in reversed(x): if i % 2 == 0: x.remove(i) >>> x [1, 3, 5, 7,

FTP problem

2011-01-14 Thread Thomas Philips
nt computers and on two different versions of Python (2.6 and 2.7). I get the same error both times, and have no understanding of what the problem might be. Any assistance would be greatly appreciated. Sincerely Thomas Philips -- http://mail.python.org/mailman/listinfo/python-list

Re: Simple addition to random module - Student's t

2009-09-02 Thread Thomas Philips
On Sep 2, 2:37 pm, Mark Dickinson wrote: > On Sep 2, 6:15 pm, Thomas Philips wrote: > > > I mis-spoke - the variance is infinite when df=2 (the variance is df/ > > (df-2), > > Yes:  the variance is infinite both for df=2 and df=1, and Student's t > with df=1 does

Re: Simple addition to random module - Student's t

2009-09-02 Thread Thomas Philips
On Sep 2, 1:03 pm, Thomas Philips wrote: > On Sep 2, 12:28 pm, Mark Dickinson wrote: > > > On Sep 2, 2:51 pm, Thomas Philips wrote: > > > > def student_t(df):         # df is the number of degrees of freedom > > >     if df < 2  or int(df) != df: > > &g

Re: Simple addition to random module - Student's t

2009-09-02 Thread Thomas Philips
On Sep 2, 12:28 pm, Mark Dickinson wrote: > On Sep 2, 2:51 pm, Thomas Philips wrote: > > > def student_t(df):         # df is the number of degrees of freedom > >     if df < 2  or int(df) != df: > >        raise ValueError, 'student_tvariate: df must be a integer

Simple addition to random module - Student's t

2009-09-02 Thread Thomas Philips
- how does one go about getting this incorporated into random so that the entire community can beneffit from it? Sincerely Thomas Philips def student_t(df): # df is the number of degrees of freedom if df < 2 or int(df) != df: raise ValueError, 'student_tvariate: df mus

Teething troubles with Python on a Mac

2008-08-02 Thread Thomas Philips
sed. I never thought I'd say this, but it actually seemed a lot easier to get Python and any associated programs up and running on Windows! I suspect that a large fraction of my troubles are due to the fact that I am brand new to the Mac and to Unix, but I bought the Mac in part because I th

MatplotLib errors

2008-04-29 Thread Thomas Philips
an unusual way. Please contact the application's support team for more information. I'm running Python 2.5.2 under Windows XP. Any thoughts on what what may be causing the problem? Thanks in advance Thomas Philips -- http://mail.python.org/mailman/listinfo/python-list