[Tutor] Comparing two CSV filess using Python

2015-02-12 Thread andy van
Hi, I'm trying to compare two CSV files (and many more like these below). I tried many ways, using lists, dictreader and more but nothing gave me the output I require. I want to compare all those rows that have same !Sample_title and !Sample_geo_accession values (whose positions vary). I've been st

Re: [Tutor] How to post: Was Re: The Charms of Gmail

2013-12-23 Thread Andy McKenzie
jority, just the loudest -- are just plain obnoxious. I don't need that in my life. Good luck to all of you, and I hope your lives are pleasant. And I hope those of you who don't currently know learn how to treat people politely. Andy McKenzie On Mon, Dec 23, 2013 at 10:11 AM, St

Re: [Tutor] Beginner Question

2013-10-22 Thread Andy McKenzie
on. Calling "lab_1.first_ip()" returns the first possible IP address. That was a lot more readable and a lot more concise than something like "first_ip( 1.2.3.0/24)". I hope this helps! Andy ___ Tutor maillist - Tutor@python.or

Re: [Tutor] global variables

2013-08-22 Thread Andy McKenzie
#x27;ve watched people use really nice drafting tools to design houses that would have been unusable for living in. Saying badly designed GUIs prove that OOP is bad is, frankly, illogical at best and stupid at worst. I strongly suspect that either the speaker they wer

Re: [Tutor] [OT] Replies go to individuals, not the list?

2013-08-20 Thread Andy McKenzie
polluting the net, or some other nonsense like that. The fact is, we just have different work flow preferences. You like one thing, I like another. If you want to present your view rationally and objectively, or talk about your preferred layouts, tha

Re: [Tutor] [OT] Replies go to individuals, not the list?

2013-08-20 Thread Andy McKenzie
On Tue, Aug 20, 2013 at 2:53 PM, Alan Gauld wrote: > On 20/08/13 13:15, Andy McKenzie wrote: > > Yep. Someone decided it didn't make sense for "reply" to go to the list >> that sent the message >> > > Lists never send messages. People do. > > So

Re: [Tutor] [OT] Replies go to individuals, not the list?

2013-08-20 Thread Andy McKenzie
the message and should be receiving the reply. I've never understood it, even after reading the arguments in favor. Andy ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

[Tutor] Multiple search and replace?

2013-05-02 Thread Andy McKenzie
ngs I've seen like it should be, but I can't figure out how. Thanks, Andy McKenzie ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] multiple versions of python on windows?

2013-04-22 Thread Andy McKenzie
ed to Wing, you might give Eclipse/PyDev a try. -Andy On Mon, Apr 22, 2013 at 2:42 AM, Jim Mooney wrote: > On 21 April 2013 22:47, School wrote: > > You can install multiple versions. The programs use the version they > were assigned to, so there shouldn't be any conflict. &g

Re: [Tutor] Hello, and a newbie question

2013-04-16 Thread Andy McKenzie
On Tue, Apr 16, 2013 at 7:39 PM, Alan Gauld wrote: > On 16/04/13 22:20, Andy McKenzie wrote: > > For instance: output of running print_r on a very short dictionary from >> PHP: >> >> Array >> ( >> [key3] => thing3 >> [key2] => thi

Re: [Tutor] Hello, and a newbie question

2013-04-16 Thread Andy McKenzie
On Tue, Apr 16, 2013 at 5:31 PM, Dave Angel wrote: > On 04/16/2013 05:20 PM, Andy McKenzie wrote: > >> >> >> > > >>> >>> Thanks for the advice, folks. Given that it looks like the biggest >> changes >> are unicode handling (w

Re: [Tutor] Hello, and a newbie question

2013-04-16 Thread Andy McKenzie
On Tue, Apr 16, 2013 at 4:18 PM, Dave Angel wrote: > On 04/16/2013 11:58 AM, Andy McKenzie wrote: > >> Hey folks. >> >> I'm just starting to pick up Python, and I'd like to avoid some of the >> mistakes I made in the past. To elaborate on that, my primar

[Tutor] Hello, and a newbie question

2013-04-16 Thread Andy McKenzie
stuff they do seems to be fairly personalized, rather than trying to follow standards. Should I just start out with the tutorial from docs.python.org? I would assume that that would start putting me in the right habits from the beginning... is that accurate, or

[Tutor] Removing GB pound symbols from Beautiful soup output

2010-07-16 Thread Andy
e a generic regex patten (re.compile(u"""\u\[A-Fa-f0-9\]\{4\}""") but this fails because it doesn't follow the standard patten for ascii. I'm not sure that I 100% understand the unicode system but is there a simple way to remove/subsitute these non ascii s

[Tutor] Html entities, beautiful soup and unicode

2010-01-19 Thread andy
or do i have to use regexp? and where does unicode fit into all of this? Thanks for your help Andy ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

[Tutor] Python and google sites

2009-09-09 Thread andy
been clever before me Thanks for any help Andy ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] delphi, pascal and Python

2009-06-11 Thread andy
type of error? (I'm on 64bit ubuntu btw) Thanks for any suggestions/help Andy > > By the way, the error was generated by following the tutorial and > compiling in lazarus > > > > After Much Looking and pointers from the author, There is this most > >

Re: [Tutor] delphi, pascal and Python

2009-06-03 Thread Andy Cheesman
m running 64bit ubuntu. I know this might be a bit off topic, but if > someone could point me in the right direction, I would be rather grateful > > Thanks > Andy > > > >> >> "Marc Tompkins" wrote >> >>>> Is there a Method for wrappi

Re: [Tutor] delphi, pascal and Python

2009-06-02 Thread Andy Cheesman
: Python: No such file: No such file or directory I've no clue what the issue is and I don't understand what should be going on. I'm running 64bit ubuntu. I know this might be a bit off topic, but if someone could point me in the right direction, I would be rather grateful Thanks An

[Tutor] delphi, pascal and Python

2009-05-20 Thread Andy Cheesman
Hi people Is there a Method for wrapping delphi and/or pascal code into python like SWIG? I've googled to no avail, Can anyone help me? Andy ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] replacing range with xrange

2008-01-28 Thread Andy Cheesman
change the example below where I need a non-continuous range. Any suggestions? Andy x = range(10) + range(20, 30) for thing in x: ... ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] printing format with list

2008-01-24 Thread Andy Cheesman
Hi people Is there a way to use a list with printf formating without having to explicitly expanding the list after the % e.g a = [1, 2, 3] print """ Testing %i, %i, %i """ %(a[0], a[1], a[2]) Cheers Andy

Re: [Tutor] Saving Objects

2008-01-17 Thread Andy Cheesman
want to do this this way. Thanks again for your help Andy Paul McGuire wrote: > My initial tests using pickle and a simple class system (shown below) have > failed. The method shown below fails with a AttributeError: > 'FakeModule' object has no attribute 'Spod', so

[Tutor] Saving Objects

2008-01-17 Thread Andy Cheesman
there a better way to do this? Andy class Spod: def __init__(self, name): self.name=name fish = Spod("andy") file = open("test.pickle","w") pickle.dump(fish, file) # New session file = open("test.pickle","r") pickle.load(file)

[Tutor] Condensed python2.5 cheat sheet

2007-12-19 Thread Samm and Andy
Hi people, I've a competent programmer friend who I'm trying to convert to the ways of python and I was wondering if people could recommend a decent cheat sheet for python 2.5. He know how to program but just needs the syntax to become pythonic Th

[Tutor] Best way of learning

2007-12-05 Thread andy
hours I have to learn how to program using Python. So, any advice for someone in their mid-40s who would like to learn Python in a more methodical and effective manner? Thanks in anticipation. Andy -- "If they can get you asking the wrong questions, they don't have to wor

Re: [Tutor] How to Practice Python?(Linpeiheng)

2007-10-01 Thread Andy
sually has some merit. > > HTH, > > Alan G > > > ___ > Tutor maillist - Tutor@python.org > http://mail.python.org/mailman/listinfo/tutor > -- -Andy "I have a great faith in fools; self-confidence my friends call it." – Edgar Allen Poe ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] Would an emulator be possible in Python?

2007-09-12 Thread Andy
ke to do an NES emulator eventually. Is Python anywhere near fast enough to do this and have it be playable? I hope so because I really don't like C/C++. -- -Andy "I have a great faith in fools; self-confidence my friends call it." – Edgar Allen Poe

[Tutor] Finding a row match within a numpy array

2007-08-13 Thread Andy Cheesman
6, 7], [ 8, 9, 10, 11], [12, 13, 14, 15]]) b = array([8, 9, 10, 11]) I was wondering if people could suggest a possible more efficient route as there seems to be numerous steps. Thanks Andy ___ Tutor maillist - Tutor@python.org

Re: [Tutor] Simple way to compare Two lists

2007-08-10 Thread Andy Cheesman
I think you could use sets, (I asked a similar question a few days ago re numpy arrays). ie Convert both list to sets use Set intersection convert answer to lists HTH Andy Tom Fitzhenry wrote: > On Fri, Aug 10, 2007 at 02:54:44AM -0700, Jaggo wrote: >> Can anyone think of any b

Re: [Tutor] comparing two numpy arrays

2007-08-08 Thread Andy Cheesman
Thats a great solution, thanks! I've googled a bit for manipulation of sets into other data structure(lists, arrays) and not seen much. Is the only way of interconversion a brute force method? i.e a = set([1, 2, 3]) b = [] for thing in a: b.append(thing)

[Tutor] comparing two numpy arrays

2007-08-07 Thread Andy Cheesman
nswer = array([ 5,6,7,8,9]) Thanks Andy ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Issue with iterating within lists, objects and functions

2007-08-03 Thread Andy Cheesman
Thanks for your help Kent The error was that I was trying to assign to a non-assignable reference as you highlighted. Everything works now Thanks Andy Kent Johnson wrote: > Andy Cheesman wrote: >> for thing in ["top", "right", "bottom", "left&

[Tutor] Issue with iterating within lists, objects and functions

2007-08-03 Thread Andy Cheesman
l function as shown below? e.g for thing in ["top", "right", "bottom", "left"]: eval("self." + thing).append("fish") eval("self." + thing +"_extra") eval("sel

[Tutor] rotation within arrays

2007-07-04 Thread Andy Cheesman
problem which I have is that I now need to rotated alternative layer of the arrays but I still need to have the original mapping i.e 3 -> 12. 0 1 2 3 4 5 6 7 8 11 14 17 10 13 16 9 12 15 Does anyone have any suggestions for how to do this? T

[Tutor] Animating changes with Numpy arrays

2007-06-26 Thread Andy Cheesman
hard to spot but as this is just a minor debuging tool, I don't want to spend weeks coding it in! Thanks Andy Examples from-=> to 1 1 1 1 2 1 1 2 1 1 1 1 1 1 1 1 1 1 ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Automatic generation of an "all possible combinations" array

2007-06-15 Thread Andy Cheesman
urn map(lambda x: x+[0], recursive_bit_list(n-1)) + \ >map(lambda x: x+[1], recursive_bit_list(n-1)) > > Hope this helps! > > -Hugh > > > On 6/14/07, *Andy Cheesman* <[EMAIL PROTECTED] > <mailto:[EMAIL PROTECTED]>> wrote: > >

[Tutor] Automatic generation of an "all possible combinations" array

2007-06-14 Thread Andy Cheesman
ms for the array. Many Thanks Andy Example Data 3 species array([[1, 1, 1], [1, 1, 0], [1, 0, 1], [0, 1, 1], [1, 0, 0], [0, 1, 0], [0, 0, 1], [0, 0, 0]]) 4 species array([[1, 1, 1, 1], [0, 1, 1, 1], [1, 0, 1, 1], [1, 1, 0, 1],

[Tutor] Ipython and refreshing changed modules

2007-06-11 Thread Andy Cheesman
Dear People Silly question, I'm using Ipython and importing python modules which I've written. After a code modification, is there an easy, quick way to refresh changed modules? I've googled for the solutions but the answers does not se

[Tutor] UnicodeDecodeError in kinterbasdb

2007-04-05 Thread Andy Koch
;bin' UnicodeDecodeError: 'ascii' codec can't decode byte 0xff in position 237: ordinal not in range(128) .. From searching the web I'm led to think this is related to the default encodings on the machine. But I'm not sure what to do about this

[Tutor] Is Python the language for me?

2007-01-14 Thread Andy
ues? Why would something like Pygame work with Python 2.4 but not 2.5? I'm sorry if this is a horribly dumb question but I've been looking around and I can't find the answer to these on my own. Thank you all for any help you can give me. -- -Andy &

Re: [Tutor] die or exit function?

2006-06-14 Thread Andy Koch
doug shawhan wrote: > Hi Andy, > > Putting a try:/except: loop in your __main__() (or whatever you call > your base function) with sys.exit("Message") is pretty much the way I > always do it. > > try: > gak = puke + die > except: > sys.exit(&qu

[Tutor] die or exit function?

2006-06-13 Thread Andy Koch
Bkgd: I've been doing PHP for the last several years. Q: In PHP there are functions die and exit which terminate processing of a script with an optional string output. Is there something similar to this in Python? ___ Tutor maillist - Tutor@python.

Re: [Tutor] Problem installing MySQLdb under windows

2006-04-25 Thread Andy Koch
port the new password protocol? And if not, are there plans to implement this? Disclosure: this is my first post in this group, also it may be worth noting that I'm learning python as a side effect of developing a Plone site. So if my python knowledge comes across as a bit warped... well

Re: [Tutor] wanted exercises in python

2006-04-18 Thread Andy
Well, these are from a Ruby group but I don't see any reason why you couldn't do them in Python. http://www.rubyquiz.com Look through their quiz's, might find something fun to try. -Andy "Be who you are and be that well." - Saint Francis de Sales On 4/18/06, Payal

Re: [Tutor] Open file error

2006-01-18 Thread andy senoaji
Thanks Danny & Alan,your print repr(os.listdir("C:/")) has embarrased myself :(. I found out the file name is Test.txt.txt in my c: drive. I guess I learn something here.Again ThanksAndy On 1/17/06, Danny Yoo <[EMAIL PROTECTED]> wrote: On Tue, 17 Jan 2006, andy senoaji wrote:&

Re: [Tutor] Open file error

2006-01-17 Thread andy senoaji
x27;Now with all the explanations of r, slash, double slash, and backslash, I can't really figure out what's going on. Any hints is much appreciated.Thanks,AndyOn 1/17/06, Python < [EMAIL PROTECTED]> wrote: (replying back to the list also)On Tue, 2006-01-17 at 10:03 -0800, an

[Tutor] Open file error

2006-01-17 Thread andy senoaji
look at /LIB first? How does it knows drive lettering, network mapping etc? Is there a configuration settings that I can tweak in my Python? FYI I am using Activestate's. Thx, Andy ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Python 2.4.1 on Mndrk Linux 10.1 - path

2005-10-15 Thread Andy Dani
harm If I comment the it out (import readline)? Thanks - Andy - Original Message - From: "Nick Lunt" <[EMAIL PROTECTED]> To: "Andy Dani" <[EMAIL PROTECTED]>, tutor@python.org Subject: RE: [Tutor] Python 2.4.1 on Mndrk Linux 10.1 - path Date: Fri

[Tutor] Python 2.4.1 on Mndrk Linux 10.1 - path

2005-10-14 Thread Andy Dani
Python 2.3.2 came with the linux distribution which is located in /usr/lib. Installed 2.4.1 in /usr/local/Python-2.4.1 updated /etc/profile path so IDLE or "python" would point to the latest version (2.4.1). PATH="$PATH:/usr/local/Python-2.4.1/:." export PATH But it is still poin

[Tutor] upgrading from 2.3 to 2.4.1 on Mandrake Linux 10.1

2005-09-12 Thread Andy Dani
Hi, Which is the best location to install Python in Linux? Should it be under one directory or different (like lib, doc, bin etc.)? I followed installation instructions in "inst.pdf" from python documents. I can see that Python 2.4.1 has been installed in /user/lib/local by standard installati