Removing all occurences of a character from a string.

Sean Ross sross at connectmail.carleton.ca
Wed Sep 25 23:18:59 EDT 2002


True.
In fact, I will be using a dictionary as you say. However, before I could
use the dictionary in the manner you've indicated it was first necessary, or
at least preferred by me, to remove the single quotes around the attribute
name and attribute values. Thanks to the suggestions here, that is
accomplished. And, yes, the list of lists has since been converted into a
dictionary with attribute name keys and list of attribute values. Although,
I'm still working on my solution to the larger problem (making a decision
tree), and I may choose to change the dictionary keys to indexers into my
data set. Anyway, that's neither here nor there. For now, let me thank you
all again for your time,
Thanks,
Sean

"John Hunter" <jdhunter at ace.bsd.uchicago.edu> wrote in message
news:mailman.1032965672.24886.python-list at python.org...
>
> From the example you gave, I was wondering if a dictionary might be a
> more suitable data structure:
>
> attr = { "gill-attachment" : ["a", "d", "f", "n"],
>          "gill-spacing"    : ["c", "d", "w"],
>          "gill-size"       : ["b", "n"]
>          }
>
> print attr["gill-size"]
>
> John Hunter
>





More information about the Python-list mailing list