Re: [coding style] Searching for uniqness in a list of data

2006-03-01 Thread Bruno Desthuilliers
Claudio Grondi a écrit : (snip) > > list=['1p2m_3.3-1.8v_sal_ms','1p2m_3.3-1.8v_pol_ms','1p3m_3.3-18.v_sal_ms'] Avoid using 'list' as an identifier. (snip) -- http://mail.python.org/mailman/listinfo/python-list

Re: Searching for uniqness in a list of data

2006-03-01 Thread Paul McGuire
"rh0dium" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi all, > > I am having a bit of difficulty in figuring out an efficient way to > split up my data and identify the unique pieces of it. > > list=['1p2m_3.3-1.8v_sal_ms','1p2m_3.3-1.8_sal_log'] > > Now I want to split each item

Re: Searching for uniqness in a list of data

2006-03-01 Thread Alexander Schmolck
Alexander Schmolck <[EMAIL PROTECTED]> writes: > The easiest way to do this is to have a nested dictionary of prefixes: for > each prefix as key add a nested dictionary of the rest of the split as value > or an empty dict if the split is empty. Accessing the dict with an userinput > will give you

Re: Searching for uniqness in a list of data

2006-03-01 Thread johnzenger
You can come quite close to what you want without splitting the string at all. It sounds like you are asking the user to build up a string, and you want to keep checking through your list to find any items that begin with the string built up by the user. Try something like this: mylist = ['1p2m_

Re: Searching for uniqness in a list of data

2006-03-01 Thread Alexander Schmolck
"rh0dium" <[EMAIL PROTECTED]> writes: > Hi all, > > I am having a bit of difficulty in figuring out an efficient way to > split up my data and identify the unique pieces of it. > > list=['1p2m_3.3-1.8v_sal_ms','1p2m_3.3-1.8_sal_log'] > > Now I want to split each item up on the "_" and compare i

Re: Searching for uniqness in a list of data

2006-03-01 Thread Claudio Grondi
rh0dium wrote: > Hi all, > > I am having a bit of difficulty in figuring out an efficient way to > split up my data and identify the unique pieces of it. > > list=['1p2m_3.3-1.8v_sal_ms','1p2m_3.3-1.8_sal_log'] > > Now I want to split each item up on the "_" and compare it with all > others on t

Searching for uniqness in a list of data

2006-03-01 Thread rh0dium
Hi all, I am having a bit of difficulty in figuring out an efficient way to split up my data and identify the unique pieces of it. list=['1p2m_3.3-1.8v_sal_ms','1p2m_3.3-1.8_sal_log'] Now I want to split each item up on the "_" and compare it with all others on the list, if there is a difference