Re: [Tutor] list to numpy record array

2010-02-23 Thread Skipper Seabold
On Mon, Feb 22, 2010 at 11:50 PM, Vincent Davis wrote: > > I must be missing something simple. I have a list of lists data = "[['  0', ' >  0', '234.0', '24.0', ' 25'], ['  1', '  0', '22428.0', '2378.1', ' > 25'],.." and what to make a record array from it but it gets screwed up > or I don

Re: [Tutor] i can't for the life of me get "#! /usr/bin/env python" or "#!/usr/bin/python" to work

2009-10-21 Thread Skipper Seabold
On Wed, Oct 21, 2009 at 5:56 PM, Jason Willis wrote: > so i changed the .bashrc and added at the end : > PATH="/home/compy/pythons:$PATH"  ###which is the actual path to my python > proggies### > > and i still get > co...@compy-laptop:~/pythons$ herosinventory.py > herosinventory.py: command not f

Re: [Tutor] Rounding to n significant digits

2009-09-01 Thread Skipper Seabold
On Tue, Sep 1, 2009 at 10:00 PM, Skipper Seabold wrote: > On Tue, Sep 1, 2009 at 9:44 PM, Richard Wagner wrote: >> I'm fairly new to Python and am trying to find a simple way to round floats >> to a specific number of significant digits.  I found an old post on this >>

Re: [Tutor] Rounding to n significant digits

2009-09-01 Thread Skipper Seabold
On Tue, Sep 1, 2009 at 9:44 PM, Richard Wagner wrote: > I'm fairly new to Python and am trying to find a simple way to round floats > to a specific number of significant digits.  I found an old post on this > list with exactly the same problem: > Python 2.5.4 (r254:67916, Apr 4 2009, 17:56:17) [G

Re: [Tutor] Dealing with bitfields in Python

2009-08-30 Thread Skipper Seabold
On Sun, Aug 30, 2009 at 1:58 PM, Alan Gauld wrote: > > "Skipper Seabold" wrote > >> You can just do a binary AND with your consts and your bitfield value to >> get >> > each bit. The values will be the actual value (2, 4, 8, etc.) but if > >>

Re: [Tutor] Dealing with bitfields in Python

2009-08-30 Thread Skipper Seabold
x27;re asking, just clarify what you meant and I'll try > to help. > HTH, > -Luke No that's perfect. It looks like I need to read up a bit more (pun not intended) on the binary AND, but I think I see what it does and I understand your example. Thanks, Skipper > On Sun, Aug 3

[Tutor] Dealing with bitfields in Python

2009-08-30 Thread Skipper Seabold
Hello all, Fair warning, I didn't know what a bitfield was a few hours ago. I am working with a program via the dbus module and I am wondering if there is built-in support to deal with bitfields in Python. I query my application and it returns a bitfield 119. The bitfield "key" is NONE

Re: [Tutor] curve fitting

2009-07-29 Thread Skipper Seabold
equations and a data example, you will almost certainly get some more help. Cheers, Skipper > > On Wed, Jul 29, 2009 at 3:59 PM, Skipper Seabold > wrote: >> >> On Wed, Jul 29, 2009 at 9:42 AM, Eike Welk wrote: >> > On Wednesday 29 July 2009, Bala subramanian wrote: &

Re: [Tutor] curve fitting

2009-07-29 Thread Skipper Seabold
On Wed, Jul 29, 2009 at 9:42 AM, Eike Welk wrote: > On Wednesday 29 July 2009, Bala subramanian wrote: >> Friends, >> >> I wish to do some curve fitting with python by defining my own >> equations. Could someone please give some guidance or examples on >> doing the same. > What kind of curve fitti

Re: [Tutor] What kind of number is this

2009-07-24 Thread Skipper Seabold
2009/7/24 Emad Nawfal (عماد نوفل) : > Hi Tutors, > I have a bunch of text files that have many occurrences like the following > which I believe, given the context,  are numbers: > > ١٨٧٢ > > ٥٧ > >  ٢٠٠٨ > > etc. > > So, can somebody please explain what kind of numbers these are, and how I > can ge

Re: [Tutor] using datetime and calculating hourly average

2009-07-07 Thread Skipper Seabold
On Tue, Jul 7, 2009 at 6:16 AM, John [H2O] wrote: > > Here's a function I wrote to calculate hourly averages: > > It seems a bit slow, however... any thoughts on how to improve it? > > def calc_hravg(X): >    """Calculates hourly average from input data""" > >    X_hr = [] >    minX = X[:,0].min()

Re: [Tutor] newton's method for system of nonlinear equations

2009-06-26 Thread Skipper Seabold
On Fri, Jun 26, 2009 at 6:54 AM, wrote: > Hi, > I am trying to write a program in python that solves a system of nonlinear > equations using newton's method. I don't know what I am doing wrong. > Please help > > from scipy import* > > x = array([0.0,0.0,0.0]) > n=len(x) > tol= 0.1 > N=30 > > k

[Tutor] Discussion of super

2009-06-14 Thread Skipper Seabold
Hello all, I am working under the umbrella of the Python Software Foundation for the Google Summer of Code and am keeping a blog about the work. Part of my work is refactoring and extending some existing code. This code makes use of Python's super, and so I am trying to understand the ins and ou

Re: [Tutor] creating interactive program with python

2009-05-29 Thread Skipper Seabold
On Thu, May 28, 2009 at 7:43 PM, Andre Walker-Loud wrote: > Hi All, > > I am thinking of creating a data analysis suite with python, and I want it > to be interactive - ie the program asks the user (me) for input, like which > data file to use, how many parameters to minimize, etc.  There are a fe

Re: [Tutor] creating a dict-like class - asigning variables... this one may take some thought ; )

2009-05-28 Thread Skipper Seabold
On Thu, May 28, 2009 at 6:47 AM, John [H2O] wrote: > > Hello, I am trying to create a class to hold and reference things similar to > matlab's structure. > > ## A class definition to hold things > class stuff(object): >    """ holds stuff """ >    def __init__(): >        pass >   �...@classmethod

Re: [Tutor] OOP / Classes questions

2009-04-10 Thread Skipper Seabold
On Fri, Apr 10, 2009 at 2:44 PM, Stefan Lesicnik wrote: > I guess as a general kind of question, can anyone recommend some > tutorial or documentation re OOP and classes? I've found Alan Gauld's tutorials to be very useful when just getting started in both OOP and Python. http://www.freenetpages