On 2014-05-10 03:28:29 +0000, eckhle...@gmail.com said:

While it is fine for a small dataset, I need a more generic way to do so.

I don't get how the dataset size affects the generality of the solution here.

From your first message:

attr = {}
with open('test.txt','rb') as tsvin:
    tsvin = csv.reader(tsvin, delimiter='\t')
    for row in tsvin:
        ID = row[1]

so your is solved by adding a simple
 attr[ID] = {}

after the ID assignment. It seems simple to implement and generic enough to me.


unfortunately none of them illustrates how to store the values and access them later.

You access the stored value by using the variable name that holds it, but here you should probabily make more clear what your actual issue is.


Moreover, they bring some new terms, e.g. combined, [], etc.

The "[]" syntax is used in Python for lists.

The term "combined" hasn't a specific pythonic meaning there and is just used as a meaningful variable name as the author is combining, i.e. adding, numerical values.


--
Andrea

--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to