andreash
unread,Oct 4, 2011, 10:38:49 AM10/4/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to pystatsmodels
Hi there,
I'm running into an error when checking a DataFrame == None:
In [1]: import pandas
In [2]: import numpy as np
In [3]: import datetime
In [4]: DF = pandas.DataFrame(np.atleast_2d(np.arange(12)),
index=[datetime.date(1999,1,1)])
In [5]: if DF is None:
...: print "Success!"
...:
In [6]: if DF == None:
...: print "Success!"
...:
---------------------------------------------------------------------------
PandasError Traceback (most recent call
last)
/home/USER/<ipython-input-6-f8077529972e> in <module>()
----> 1 if DF == None:
2 print "Success!"
3
/home/USER/.virtualenvs/pydoas/lib/python2.7/site-packages/pandas/core/
frame.pyc in f(self, other)
82 return self._combine_series_infer(other, func)
83 else:
---> 84 return self._combine_const(other, func)
85
86 f.__name__ = name
/home/USER/.virtualenvs/pydoas/lib/python2.7/site-packages/pandas/core/
frame.pyc in _combine_const(self, other, func)
1536
1537 return self._constructor(func(self.values, other),
index=self.index,
-> 1538 columns=self.columns,
copy=False)
1539
1540 def _compare_frame(self, other, func):
/home/USER/.virtualenvs/pydoas/lib/python2.7/site-packages/pandas/core/
frame.pyc in __init__(self, data, index, columns, dtype, copy)
164 copy=copy)
165 else:
--> 166 raise PandasError('DataFrame constructor not
properly called!')
167
168 self._data = mgr
PandasError: DataFrame constructor not properly called!