From: Aquil H. A. <aqu...@gm...> - 2012-08-16 17:57:17
|
I get the same error if I use: bad_vols = tbl.getWhereList('volume == nan') bad_vols = tbl.getWhereList('volume == NaN') -- Aquil H. Abdullah "I never think of the future. It comes soon enough" - Albert Einstein On Thursday, August 16, 2012 at 1:52 PM, Anthony Scopatz wrote: > Have you tried simply doing: > > 'volume == nan' or > 'volume == NaN' > > On Thu, Aug 16, 2012 at 12:49 PM, Aquil H. Abdullah <aqu...@gm... (mailto:aqu...@gm...)> wrote: > > 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 > > > > > > ------------------------------------------------------------------------------ > > Live Security Virtual Conference > > Exclusive live event will cover all the ways today's security and > > threat landscape has changed and how IT managers can respond. Discussions > > will include endpoint security, mobile security and the latest in malware > > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > > _______________________________________________ > > Pytables-users mailing list > > Pyt...@li... (mailto:Pyt...@li...) > > https://lists.sourceforge.net/lists/listinfo/pytables-users > > > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > > _______________________________________________ > Pytables-users mailing list > Pyt...@li... (mailto:Pyt...@li...) > https://lists.sourceforge.net/lists/listinfo/pytables-users > > |