Re: [Tutor] [OT] Programming practice was: Re: string list in alphabetical!

2013-10-21 Thread Danny Yoo
> > > I agree. I've recently started coaching the son of a friend in computing > for his new school (he is effectively a year behind > his new classmates). They use VB6 but at a level I can cope with! :-) > > The interesting thing however is that the schools have not taught > any kind of approach t

[Tutor] [OT] Programming practice was: Re: string list in alphabetical!

2013-10-21 Thread Alan Gauld
On 22/10/13 00:07, Steven D'Aprano wrote: I'd like to upgrade that process :D ... 1) think about your problem 2) if there are some heplful libraries that can make it way easier, use them 3) write some code 4) fix the bugs until it'll run 5) write unittests 6) test if it works correctly and if u

Re: [Tutor] string list in alphabetical!

2013-10-21 Thread Steven D'Aprano
On Mon, Oct 21, 2013 at 01:21:59PM +0200, Lukas Nemec wrote: > On 10/21/2013 01:16 PM, Steven D'Aprano wrote: > >That is the normal process of programming: > > > >1) write some code > >2) fix the bugs until it will run > >3) test if it works correctly > >4) repeat until done > > > > > I'd like to

Re: [Tutor] Tutor] string list in alphabetical!

2013-10-21 Thread Alan Gauld
On 21/10/13 17:16, Siva Cn wrote: Hi Sammy, Try this this may help you ! Siva, the list policy is not to provide full solutions for homework type questions. It's better to provide some hints and let the OP figure it out for him/her self. That having been said there are a few issues with the

Re: [Tutor] Reading CSV files in Pandas

2013-10-21 Thread Manish Tripathi
It's pipeline data so must have been generated through Siebel and sent as excel csv. On Mon, Oct 21, 2013 at 11:32 PM, Danny Yoo wrote: > > > > * Where is this data coming from? > > * Who or what is generating this file? > > > Just to be more specific about this: I have a very strong suspicion

Re: [Tutor] Reading CSV files in Pandas

2013-10-21 Thread Mark Lawrence
On 21/10/2013 22:42, Danny Yoo wrote: This question has now been placed on the correct forum here http://article.gmane.org/gmane.comp.python.pydata/2294 so I see little sense in us attempting to follow it up. -- Python is the second best programming language in the world. But the best has

Re: [Tutor] How to add a new column to a hierarchical dataframe grouped by groupby

2013-10-21 Thread Mark Lawrence
On 21/10/2013 20:38, Boris Vladimir Comi wrote: This is the Python tutor mailing list so it is essentially aimed at beginners to programming and/or Python, so please ask your pandas specific question on the google group here https://groups.google.com/forum/#!forum/pydata or the equivalent mail

Re: [Tutor] Reading CSV files in Pandas

2013-10-21 Thread Danny Yoo
On Mon, Oct 21, 2013 at 11:57 AM, Manish Tripathi wrote: > It's pipeline data so must have been generated through Siebel and sent as > excel csv. > > I am assuming that you are talking about "Siebel Analytics", some kind of analysis software from Oracle: http://en.wikipedia.org/wiki/Siebel_Sy

[Tutor] How to add a new column to a hierarchical dataframe grouped by groupby

2013-10-21 Thread Boris Vladimir Comi
The following script try to calculate the resulting average of the direction and magnitude of the wind. My monthly dataframe has the following column: data FechaHoraDirViento MagViento Temperatura Humedad PreciAcu 0 2011/07/01 00:003186.621.22 1

Re: [Tutor] string list in alphabetical!

2013-10-21 Thread Albert-Jan Roskam
On Mon, 10/21/13, Lukas Nemec wrote: Subject: Re: [Tutor] string list in alphabetical! To: tutor@python.org Date: Monday, October 21, 2013, 1:21 PM On 10/21/2013 01:16 PM, Steven D'Aprano wrote: > On Sun, Oct 20, 2013 at 09:15:05PM -0500, Samm

Re: [Tutor] Tutor] string list in alphabetical!

2013-10-21 Thread bob gailer
On 10/21/2013 12:16 PM, Siva Cn wrote: Hi Sammy, Try this this may help you ! -- def sort_file1_to_file2(file1, file2): """.""" input_content = [] with open(file1, 'r') as fp: input_content = fp.

Re: [Tutor] Reading CSV files in Pandas

2013-10-21 Thread Danny Yoo
> > * Where is this data coming from? > * Who or what is generating this file? Just to be more specific about this: I have a very strong suspicion that whatever is generating the input that you're trying to read is doing something ad-hoc with regards to CSV file format. Knowing what generated th

Re: [Tutor] Reading CSV files in Pandas

2013-10-21 Thread Danny Yoo
On Sat, Oct 19, 2013 at 7:29 AM, Manish Tripathi wrote: > > I am trying to import a csv file in Pandas but it throws an error. The format of the data when opened in notepad++ is as follows with first row being column names: > > "End Customer Organization ID,End Customer Organization Name,End Custo

[Tutor] Tutor] string list in alphabetical!

2013-10-21 Thread Siva Cn
Hi Sammy, Try this this may help you ! -- def sort_file1_to_file2(file1, file2): """.""" input_content = [] with open(file1, 'r') as fp: input_content = fp.read() input_content = input_content

Re: [Tutor] string list in alphabetical!

2013-10-21 Thread Sammy Cornet
I appreciate your help and advices in concern of my challenge. In fact, I'm confuse because I was sent a lot of lesson in comparison to what I usually have for each week. I will try it the you told me. Think you for all of your email. On Oct 21, 2013, at 4:08, "Sammy Cornet" wrote: > Thank yo

Re: [Tutor] string list in alphabetical!

2013-10-21 Thread Lukas Nemec
On 10/21/2013 01:16 PM, Steven D'Aprano wrote: On Sun, Oct 20, 2013 at 09:15:05PM -0500, Sammy Cornet wrote: Thank you for help Steven! I intend to correct it. But also I would like to know if I wrote the correctly in order to the output that I'm looking for? I don't know, I didn't study your c

Re: [Tutor] string list in alphabetical!

2013-10-21 Thread Steven D'Aprano
On Sun, Oct 20, 2013 at 09:15:05PM -0500, Sammy Cornet wrote: > Thank you for help Steven! I intend to correct it. But also I would > like to know if I wrote the correctly in order to the output that I'm > looking for? I don't know, I didn't study your code in that much detail. Why don't you fi

Re: [Tutor] string list in alphabetical!

2013-10-21 Thread Alan Gauld
On 21/10/13 01:16, Sammy Cornet wrote: so here is what I have on my script: OK some comments below... infile = open('Desktop/unsorted_fruits.docx' ,"r") outfile = open('Desktop/sorted_fruits.docx', 'w') You probably want to use txt files. def find(): index = 0 while index < 26:

Re: [Tutor] string list in alphabetical!

2013-10-21 Thread Sammy Cornet
Thank you for help Steven! I intend to correct it. But also I would like to know if I wrote the correctly in order to the output that I'm looking for? On Oct 20, 2013, at 19:22, "Sammy Cornet" wrote: > Hello! > > I'm using python 2.7.5 version and I'm trying to write a program related to a

Re: [Tutor] Reading CSV files in Pandas

2013-10-21 Thread Mark Lawrence
On 21/10/2013 04:05, Sivaram Neelakantan wrote: you could try the following newsgroup or mailing list for more specialised help. gmane.org:gmane.comp.python.pydata sivaram -- Thanks for this, it explains why I couldn't find pandas there :) -- Python is the second best programming lang