From: Aquil H. A. <aqu...@gm...> - 2012-08-16 17:49:31
|
Hello All, I am trying to determine if there are any NaN values in one of my tables, but when I queried for numpy.nan I received a NameError. Can any tell be the best way to search for a NaN value? Thanks! In [7]: type(np.nan) Out[7]: float In [8]: bad_vols = tbl.getWhereList('volume == %f' % np.nan) --------------------------------------------------------------------------- NameError Traceback (most recent call last) /Users/aquilabdullah/<ipython-input-8-2c1b183b0581> in <module>() ----> 1 bad_vols = tbl.getWhereList('volume == %f' % np.nan) /Library/Python/2.7/site-packages/tables/table.pyc in getWhereList(self, condition, condvars, sort, start, stop, step) 1540 1541 coords = [ p.nrow for p in -> 1542 self._where(condition, condvars, start, stop, step) ] 1543 coords = numpy.array(coords, dtype=SizeType) 1544 # Reset the conditions /Library/Python/2.7/site-packages/tables/table.pyc in _where(self, condition, condvars, start, stop, step) 1434 1435 # Compile the condition and extract usable index conditions. -> 1436 condvars = self._requiredExprVars(condition, condvars, depth=3) 1437 compiled = self._compileCondition(condition, condvars) 1438 /Library/Python/2.7/site-packages/tables/table.pyc in _requiredExprVars(self, expression, uservars, depth) 1207 val = user_globals[var] 1208 else: -> 1209 raise NameError("name ``%s`` is not defined" % var) 1210 1211 # Check the value. NameError: name ``nan`` is not defined -- Aquil H. Abdullah "I never think of the future. It comes soon enough" - Albert Einstein |