You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 11, 2023. It is now read-only.
589 # Update _arr1 for the new dtype
--> 590 self._arr1 = np.empty(shape=(1,), dtype=self.dtype)
591
592 if not keep:
TypeError: Empty data-type
This means purge and flush are never called on the deleted column.
Example:
test_ctable = bcolz.ctable(numpy.zeros(2, dtype='f8, i4'))
test_ctable.delcol('f0')
test_ctable.delcol('f1') # fails with the above error
Probably not too critical since I imagine it's uncommon to delete everything like this.
Note: deleting the last col further puts the object in a broken state. This is the output from trying to print test_ctable after I ran the above 2 delcol statements.
In [671]: test_ctable
Out[671]: ---------------------------------------------------------------------------
ZeroDivisionError Traceback (most recent call last)
virtualenv_run/lib/python2.7/site-packages/IPython/core/formatters.pyc in __call__(self, obj)
697 type_pprinters=self.type_printers,
698 deferred_pprinters=self.deferred_printers)
--> 699 printer.pretty(obj)
700 printer.flush()
701 return stream.getvalue()
virtualenv_run/lib/python2.7/site-packages/IPython/lib/pretty.pyc in pretty(self, obj)
381 if callable(meth):
382 return meth(obj, self, cycle)
--> 383 return _default_pprint(obj, self, cycle)
384 finally:
385 self.end_group()
virtualenv_run/lib/python2.7/site-packages/IPython/lib/pretty.pyc in _default_pprint(obj, p, cycle)
501 if _safe_getattr(klass, '__repr__', None) not in _baseclass_reprs:
502 # A user-provided repr. Find newlines and replace them with p.break_()
--> 503 _repr_pprint(obj, p, cycle)
504 return
505 p.begin_group(1, '<')
virtualenv_run/lib/python2.7/site-packages/IPython/lib/pretty.pyc in _repr_pprint(obj, p, cycle)
692 """A pprint that just redirects to the normal repr function."""
693 # Find newlines and replace them with p.break_()
--> 694 output = repr(obj)
695 for idx,output_line in enumerate(output.splitlines()):
696 if idx:
virtualenv_run/lib/python2.7/site-packages/bcolz/ctable.pyc in __repr__(self)
1394
1395 def __repr__(self):
-> 1396 nbytes, cbytes, cratio = self._get_stats()
1397 snbytes = utils.human_readable_size(nbytes)
1398 scbytes = utils.human_readable_size(cbytes)
virtualenv_run/lib/python2.7/site-packages/bcolz/ctable.pyc in _get_stats(self)
1387 nbytes += column.nbytes
1388 cbytes += column.cbytes
-> 1389 cratio = nbytes / float(cbytes)
1390 return (nbytes, cbytes, cratio)
1391
ZeroDivisionError: float division by zero
The text was updated successfully, but these errors were encountered:
If we are deleting the last column, then
self.dtype == numpy.dtype([])
and so creation of arr1 fails:https://github.com/Blosc/bcolz/blob/master/bcolz/ctable.py#L590
This means purge and flush are never called on the deleted column.
Example:
Probably not too critical since I imagine it's uncommon to delete everything like this.
Note: deleting the last col further puts the object in a broken state. This is the output from trying to print
test_ctable
after I ran the above 2 delcol statements.The text was updated successfully, but these errors were encountered: