[Tutor] KeyError?
Shwinn Ricci
armvrt at gmail.com
Thu Jul 28 17:50:54 CEST 2011
I have an excel file that I am reading cell values from and putting them
into a dictionary. the dictionary looks like this:
scafPositions = {position[j]: direction[j]}
where position[j] is exclusively floating/numerical values and direction[j]
is exclusively strings.
When I try to find whether a test value val is in the array of positions,
and then try to look its direction up with ScafPositions[val], I get a
KeyError. Is this because my data isn't standalone numbers, but numbers that
are calculated based off other cells? Or can I not test for val?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20110728/dc5445dc/attachment.html>
More information about the Tutor
mailing list