Re: Question on List processing

2016-04-26 Thread Steven D'Aprano
On Wed, 27 Apr 2016 01:38 am, subhabangal...@gmail.com wrote: > I am trying to send you a revised example. > list1=[u"('koteeswaram/BHPERSN engaged/NA ','class1')", > u"('koteeswaram/BHPERSN is/NA ','class1')"] Please don't use generic names that mean nothing like "list1". We can see it is a li

Re: Question on List processing

2016-04-26 Thread Random832
On Tue, Apr 26, 2016, at 11:38, subhabangal...@gmail.com wrote: > I am trying to send you a revised example. > list1=[u"('koteeswaram/BHPERSN engaged/NA ','class1')", > u"('koteeswaram/BHPERSN is/NA ','class1')"] > > [('koteeswaram/BHPERSN engaged/NA ','class1'), > ('koteeswaram/BHPERSN is/NA '

Re: Question on List processing

2016-04-26 Thread subhabangalore
On Monday, April 25, 2016 at 10:07:13 PM UTC+5:30, Steven D'Aprano wrote: > > > > Dear Group, > > > > I have a list of tuples, as follows, > > > > list1=[u"('koteeswaram/BHPERSN engaged/NA himself/NA in/NA various/NA > [... 17 more lines of data ...] > > Hi Subhabrata, and thanks for the quest

Re: Question on List processing

2016-04-26 Thread subhabangalore
On Monday, April 25, 2016 at 10:07:13 PM UTC+5:30, Steven D'Aprano wrote: > On Tue, 26 Apr 2016 12:56 am, wrote: > > > Dear Group, > > > > I have a list of tuples, as follows, > > > > list1=[u"('koteeswaram/BHPERSN engaged/NA himself/NA in/NA various/NA > [... 17 more lines of data ...] > > Hi

Re: Question on List processing

2016-04-25 Thread Matt Wheeler
On Mon, 25 Apr 2016 15:56 , wrote: > Dear Group, > > I have a list of tuples, as follows, > > list1=[u"('koteeswaram/BHPERSN engaged/NA himself/NA in/NA various/NA > philanthropic/NA activities/NA ','class1')", u"('koteeswaram/BHPERSN is/NA > a/NA very/NA nice/NA person/NA ','class1')", u"('kot

Re: Question on List processing

2016-04-25 Thread Steven D'Aprano
On Tue, 26 Apr 2016 12:56 am, subhabangal...@gmail.com wrote: > Dear Group, > > I have a list of tuples, as follows, > > list1=[u"('koteeswaram/BHPERSN engaged/NA himself/NA in/NA various/NA [... 17 more lines of data ...] Hi Subhabrata, and thanks for the question. Please remember that we are

Question on List processing

2016-04-25 Thread subhabangalore
Dear Group, I have a list of tuples, as follows, list1=[u"('koteeswaram/BHPERSN engaged/NA himself/NA in/NA various/NA philanthropic/NA activities/NA ','class1')", u"('koteeswaram/BHPERSN is/NA a/NA very/NA nice/NA person/NA ','class1')", u"('koteeswaram/BHPERSN came/NA to/NA mumbai/LOC but/

Re: A Short Question on list

2011-03-03 Thread Miki Tebeka
Have a look at reduce (http://docs.python.org/library/functions.html#reduce) -- http://mail.python.org/mailman/listinfo/python-list

Re: A Short Question on list

2011-03-03 Thread Corey Richardson
On 03/03/2011 08:08 AM, joy99 wrote: > Dear Group, > If I have a list of elements, like, > list=[1,2,3,4,5,..] > now, if I want to multiply an increment of subset of the list each > time, > like, > > elem1_list=list[0] > elem2_list=list[1] > elem3_list=list[2] > elem4_list=list[3] Why do you assi

A Short Question on list

2011-03-03 Thread joy99
Dear Group, If I have a list of elements, like, list=[1,2,3,4,5,..] now, if I want to multiply an increment of subset of the list each time, like, elem1_list=list[0] elem2_list=list[1] elem3_list=list[2] elem4_list=list[3] multiplysubset1=elem1_list*elem2_list multiplysubset2=elem1_list*elem2_lis

Re: Question on List

2008-06-27 Thread subhabrata . iisc
Hi Chris, I solved the problem some other way round but thanx for your suggestion, I'll review it also. Best Regards, Subhabrata. Chris wrote: > On Jun 27, 9:51�am, [EMAIL PROTECTED] wrote: > > Dear All, > > I am trying to write the following code: > > > > def try1(n): > > � � � � a1="God Godess B

Re: Question on List

2008-06-27 Thread Chris
On Jun 27, 9:51 am, [EMAIL PROTECTED] wrote: > Dear All, > I am trying to write the following code: > > def try1(n): >         a1="God Godess Borother Sister Family" >         a2=a1.split() >         a3=raw_input("PRINT A WORD") >         a4=a1.find(a3) >         print a4 >         a5=[] >        

Question on List

2008-06-27 Thread subhabrata . iisc
Dear All, I am trying to write the following code: def try1(n): a1="God Godess Borother Sister Family" a2=a1.split() a3=raw_input("PRINT A WORD") a4=a1.find(a3) print a4 a5=[] if a4>0: a5=a2.index(a3) a6=a5+1

Re: simple question on list manipulation from a newbie

2008-06-08 Thread John Machin
On Jun 8, 4:42 pm, Sengly <[EMAIL PROTECTED]> wrote: [snip] > Thank you all for your help. I found a solution as the following: The following is a solution to what? > > alist = [ > {'noun': 'dog', 'domestic_dog', 'Canis_familiaris'}, That is not yet valid Python. You will get a syntax error

Re: simple question on list manipulation from a newbie

2008-06-07 Thread Sengly
On Jun 8, 6:38 am, Sam Denton <[EMAIL PROTECTED]> wrote: > Sengly wrote: > > Dear all, > > > I am working with wordnet and I am a python newbie. I'd like to know > > how can I transfer a list below > > > In [69]: dog > > Out[69]: > > [{noun: dog, domestic_dog, Canis_familiaris}, > >  {noun: frump,

Re: simple question on list manipulation from a newbie

2008-06-07 Thread Sam Denton
Sengly wrote: Dear all, I am working with wordnet and I am a python newbie. I'd like to know how can I transfer a list below In [69]: dog Out[69]: [{noun: dog, domestic_dog, Canis_familiaris}, {noun: frump, dog}, {noun: dog}, {noun: cad, bounder, blackguard, dog, hound, heel}, {noun: frank,

Re: simple question on list manipulation from a newbie

2008-06-07 Thread John Machin
On Jun 8, 5:14 am, Sengly <[EMAIL PROTECTED]> wrote: > Dear all, > > I am working with wordnet and I am a python newbie. I'd like to know > how can I transfer a list below > > In [69]: dog > Out[69]: > [{noun: dog, domestic_dog, Canis_familiaris}, > {noun: frump, dog}, > {noun: dog}, > {noun: ca

Re: simple question on list manipulation from a newbie

2008-06-07 Thread Larry Bates
Sengly wrote: Dear all, I am working with wordnet and I am a python newbie. I'd like to know how can I transfer a list below In [69]: dog Out[69]: [{noun: dog, domestic_dog, Canis_familiaris}, {noun: frump, dog}, {noun: dog}, {noun: cad, bounder, blackguard, dog, hound, heel}, {noun: frank,

simple question on list manipulation from a newbie

2008-06-07 Thread Sengly
Dear all, I am working with wordnet and I am a python newbie. I'd like to know how can I transfer a list below In [69]: dog Out[69]: [{noun: dog, domestic_dog, Canis_familiaris}, {noun: frump, dog}, {noun: dog}, {noun: cad, bounder, blackguard, dog, hound, heel}, {noun: frank, frankfurter, ho