Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
Unknown Quality Score

No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.

0 Endorsements
~2K People Reached
Favorite Forums
Favorite Tags
Member Avatar for girish_sahani

hi ppl, Consider a list like ['a.1','b.3','b.4','c.2']. Here 'a','b','c' are objects and 1,3,4,2 are their instance ids and they are unique e.g. a.1 and b.1 cannot exist together. From this list i want to generate multiple lists such that each list must have one and only one instance of every …

Member Avatar for vegaseat
0
82
Member Avatar for racerrunner

Halo can someone tell me how to convert a double variable to 2 decimals? I try using the below code but it cannot work. DecimalFormat df = new DecimalFormat("0.00"); String a = df.format(123.5%11); double AA = Double.parseDouble(a); for instance i want AA = 2.50 instead of 2.5. the program keep …

Member Avatar for jwenting
0
136
Member Avatar for girish_sahani

I want to generate all substrings of size k-1 from a string of size k. e.g 'abcd' should give me ['abc','abd','bcd','acd'] Order of these strings in the list doesnt matter. Also order doesnt matter inside the string e.g 'abc' or 'bca' or 'bac' is the same. The following code doesnt …

Member Avatar for a1eio
0
210
Member Avatar for girish_sahani

I have a list of strings all of length k. For every pair of k length strings which have k-1 characters in common, i want to generate a k+1 length string(the k-1 common characters + 2 not common characters). e.g i want to join 'abcd' with bcde' to get 'abcde' …

0
87
Member Avatar for girish_sahani

I wrote the following code to concatenate every 2 keys of a dictionary and their corresponding values. e.g if i have tiDict1 = tiDict1 = {'a':[1,2],'b':[3,4,5]} i should get tiDict2={'ab':[1,2][3,4,5]} and similarly for dicts with larger no. of features. Now i want to check each pair to see if they …

Member Avatar for a1eio
0
105
Member Avatar for girish_sahani

I want to generate all size 2 strings from a list of size 1 string e.g featureList = ['a','b','c','d'] gives ['ab','ac' etc] I wrote this code [code] def genC(featureList): for i in range(0,len(featureList) - 1,1): for k in range(1,len(featureList) - 1,1): if i+k <= len(featureList)-1: colocn = featureList[i] + featureList[i+k] …

Member Avatar for girish_sahani
0
68
Member Avatar for girish_sahani

I want to generate 'substrings' from a string as follows: for each substring j of string,generate the 2 lists [j,string - j] and [string -j,j] e.g If i have a string 'abc' i want to generate the list [['a','bc'],['bc','a'],['c':'ab'],['ab','c'],['b':ac],['ac':b]] Now i tried the following but its not giving me the …

Member Avatar for girish_sahani
0
203
Member Avatar for girish_sahani

I need to map one list onto another.l1 is a list of lists of lists and l2 is a list of numbers.I want elements of l1 to be the keys and elements of l2 as the values.I tried to convert l1 into a tuple and then mapping but it doesnt …

Member Avatar for girish_sahani
0
231
Member Avatar for girish_sahani

When i tried the following in python interpreter,i got a syntax error: [code] d = {[[['a': 1,'b': 2],['a': 4,'b': 3]][['a': 2,'c': 2],['a': 1,'c': 3]]] : 0.4} [/code] Pleeeez help :sad:

Member Avatar for bumsfeld
0
77
Member Avatar for girish_sahani

If i have a list (or list of lists) with elements of size k and i want to generate all higher level elements (of size k + 1) from it,what should i do??Any pointers would be of a great help I tried the following for lists...for list of lists i …

Member Avatar for girish_sahani
0
207
Member Avatar for girish_sahani

this doesnt work when the file is in the same directory as the .py file. [code] def get_colocations(filename): sentences = open(filename).read().split("\n") colocations = [] for sent in sentences: colocations.append(sent) return colocations def main(): get_colocations("colocations.txt") print "Colocations are",colocations [/code] Can anyone help????????

Member Avatar for girish_sahani
0
124