[Tutor] Numpy unexpected result: subtraction of cell values

2010-01-11 Thread Carnell, James E
I'm sure this is easy, but I am having a difficult time finding the right search terms to find it on the Internet. Any help much appreciated. 3 dimensional array(x,y,rgb) which is a PIL image into a numpy array using 'asarray' function. I want to subtract the Red Value in an array cell from a ne

Re: [Tutor] Numpy unexpected result: subtraction of cell values

2010-01-11 Thread Carnell, James E
> > I'm sure this is easy, but I am having a difficult time finding the > right search terms to find it on the Internet. Any help much > appreciated. > > 3 dimensional array(x,y,rgb) which is a PIL image into a numpy array > using 'asarray' function. > > I want to subtract the Red Value in an a

Re: [Tutor] Tutor Digest, Vol 72, Issue 3

2010-02-01 Thread Carnell, James E
Let there be 'n' circles (upper bound on n = 10**6) each of radius '1'. We enter their co-ordinates which are floating points and lies between (-1000, 1000). I need to find area of the resulting figure formed by intersection of circles. I came across these links : http://stackoverflow.com/questio

Re: [Tutor] language aid

2010-02-04 Thread Carnell, James E
> Hi, > ? > A dictionary (associative array of keys and values) seems a good > datatype to use. vocab = {} vocab[frenchword]?= englishword > ? ... > Cheers!! > Albert-Jan Sure, a dict is the obvious choice. For saving into file, if the app is to be used internally, you can even print it in

[Tutor] Is it possible for a Python Program to send commands to the Python Interpreter?

2010-02-19 Thread Carnell, James E
I am trying to teach a computer program - to program. It builds grammars and procedural memories on dictionary networks. How do I get the program to be able to input to the interpreter/command line and read the results? I have done this a wee bit with making a dictionary of functions, but in a sen

Re: [Tutor] Is it possible for a Python Program to send commands to the Python Interpreter?

2010-02-19 Thread Carnell, James E
Thanks Kent and Alan!! Problem solved, eval() will work great! ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Evaluating Swahili Part of Speech Tagging

2009-03-24 Thread Carnell, James E
Ok I think I understand now (maybe?) #=== Current Version == # Segmenter + POS Tagger output file# Gold Standard File the Determiner = The Determiner whocame Noun!= man Noun to Preposition

Re: [Tutor] Here's something to talk about (Weidner, Ronald)

2009-04-15 Thread Carnell, James E
Since # the list seems thick with OOP questions at the moment, I thought this might # be relevant. Digest and enjoy. class Item ( object ): def __init__( self ): self._FullName = '' self._Recovery = 0 self._Exporter = SimpleItemExporter (); #

Re: [Tutor] Here's something to talk about (Weidner, Ronald)

2009-04-15 Thread Carnell, James E
"""But what I hope is that the code # sparks conversations about what I did in this code and why I did it.""" If anyone answers me thank you. really. Nevertheless, I am personally not pursuing to understand this code. Ronald Weidner left on vacation and won't be back until the 19th (I don't kno

[Tutor] Convert doc to txt on Ubuntu

2009-09-16 Thread Carnell, James E
I am needing to access the text in hundreds of Microsoft .doc files on an Ubuntu OS. I looked at win32 , but only saw support for windows. I am going through all of these files to create a fairly simple text delimited file for a spreadsheet. A) Batch convert to text files so I can access them B)

[Tutor] IDLE colon = syntax error

2009-09-16 Thread Carnell, James E
I searched through archives and wasn't able to find the solution. Using IDLE, python 3, Ubuntu (default installations). Using command line: > if 1 == 1: print "equal" > equal Using IDLE: >if 1 == 1: print "equal" >SyntaxError: in

Re: [Tutor] Image Analysis

2007-09-11 Thread Carnell, James E
"wormwood_3" <[EMAIL PROTECTED]> wrote > I need some way to analyze an image for color patterns. > > My only lead right now is PIL, and I am not sure if it will meet my > needs. I am using PIL and numpy # something hat at least looks sorta like import numpy import PIL myImage = Image.

[Tutor] ValueError:too many values to unpack (passing 2d array to class)

2007-09-19 Thread Carnell, James E
Any help would greatly appreciated. Question: I am getting the following error from the validMove function: ValueError: too many values to unpack This program (currently) consists of a 2dArray and objects (represented by integers) in that array that can be moved. I am guessing that it has to d

[Tutor] Disregard Value Error:too many values to unpack

2007-09-19 Thread Carnell, James E
The problem was pointed out by Kent """ I think you want s.arrayEnv = arrayEnv Not s,arrayEnv (comma instead of period) """ Maybe I should put time limits on myself when I am programming... After a few hours my mind starts going fruity. Maybe I should be wearing the dunce cap. Hopefully, I can p

Re: [Tutor] Need help speeding up algorithm. (Terry Carroll)

2007-09-25 Thread Carnell, James E
Terry, I liked your answer! ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] VOID Can a python program access the python interpreter?

2007-09-28 Thread Carnell, James E
Never mind. Sorry, I should have thought about this more before sending this. In a way I already have access to the interpreter. ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] Can a python program access the python interpreter?

2007-09-28 Thread Carnell, James E
Let's say I have a program that is learning how to find patterns in a list etc. list = [1,2,3,5,8,13] So the python program (Kitty.py) opens the python interpreter and copies this list to it. It then can try some pattern finding things it already has stored (PositionN+1 - PositionN etc.) That

[Tutor] Controlling the number of decimal places "Representation Error"

2007-10-05 Thread Carnell, James E
Question: Is it a bad practice to avoid 0.1 representation errors (0.101) by just doing the following? #NOTE: all the myVariableName stuff is because Outlook keeps changing everything I type. #I need 2 decimal places (my input number shouldn't be over 255) myNum = 1 myDiv = 3 #1000

Re: [Tutor] 'sphere' object is unindexable

2009-02-06 Thread Carnell, James E
Sorry, I do see that I wrote that question in a confusing way, but I've worked out where I was going wrong now. Thanks for taking a look. > > m.pick = ["stab","stab","stab","..."] ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailma