def __delitem__(self, key):
    'Removes a record (or set of records) from the CDF\n\n        Only whole records can be deleted, so the del call must either specify\n        only one dimension or it must specify all elements of the non-record\n        dimensions. This is *not* a way to resize a variable!\n\n        Deleting records from the middle of a variable may be very slow in\n        some circumstances. To work around a bug in CDF library versions\n        3.4.0 and before, all the data must be read in, the requested deletions\n        done, and then all written back out.\n\n        @param key: index or slice to delete\n        @type key: int or slice\n        @raise TypeError: if an attempt is made to delete from a non\n                          record-varying variable, or to delete below\n                          the record level\n        '
    if (not self.rv()):
        raise TypeError('Cannot delete records from non-record-varying variable.')
    hslice = _Hyperslice(self, key)
    if ((hslice.dims > 1) and (hslice.counts[1:] != hslice.dimsizes[1:]).any()):
        raise TypeError('Can only delete entire records.')
    if (hslice.counts[0] == 0):
        return
    start = hslice.starts[0]
    count = hslice.counts[0]
    interval = hslice.intervals[0]
    dimsize = hslice.dimsizes[0]
    self._call()
    dangerous_delete = False
    if (lib._del_middle_rec_bug and ((interval != 1) or ((start != 0) and ((start + count) < dimsize)))):
        entries = ctypes.c_long(0)
        lib.call(const.GET_, const.zVAR_nINDEXENTRIES_, ctypes.byref(entries))
        dangerous_delete = (entries.value == 1)
    if dangerous_delete:
        data = self[...]
        data = numpy.delete(data, numpy.arange(start, (start + (count * interval)), interval), 0)
        self[0:(dimsize - count)] = data
        first_rec = (dimsize - count)
        last_rec = (dimsize - 1)
        lib.call(const.DELETE_, const.zVAR_RECORDS_, ctypes.c_long(first_rec), ctypes.c_long(last_rec))
    elif (interval == 1):
        first_rec = ctypes.c_long(start)
        last_rec = ctypes.c_long(((start + count) - 1))
        lib.call(const.DELETE_, const.zVAR_RECORDS_, first_rec, last_rec)
    else:
        self._call()
        for recno in range((start + ((count - 1) * interval)), (start - 1), ((- 1) * interval)):
            lib.call(const.DELETE_, const.zVAR_RECORDS_, ctypes.c_long(recno), ctypes.c_long(recno))
Removes a record (or set of records) from the CDF

Only whole records can be deleted, so the del call must either specify
only one dimension or it must specify all elements of the non-record
dimensions. This is *not* a way to resize a variable!

Deleting records from the middle of a variable may be very slow in
some circumstances. To work around a bug in CDF library versions
3.4.0 and before, all the data must be read in, the requested deletions
done, and then all written back out.

@param key: index or slice to delete
@type key: int or slice
@raise TypeError: if an attempt is made to delete from a non
                  record-varying variable, or to delete below
                  the record level
def __delitem__(self, key):
    'Removes a record (or set of records) from the CDF\n\n        Only whole records can be deleted, so the del call must either specify\n        only one dimension or it must specify all elements of the non-record\n        dimensions. This is *not* a way to resize a variable!\n\n        Deleting records from the middle of a variable may be very slow in\n        some circumstances. To work around a bug in CDF library versions\n        3.4.0 and before, all the data must be read in, the requested deletions\n        done, and then all written back out.\n\n        @param key: index or slice to delete\n        @type key: int or slice\n        @raise TypeError: if an attempt is made to delete from a non\n                          record-varying variable, or to delete below\n                          the record level\n        '
    if (not self.rv()):
        raise TypeError('Cannot delete records from non-record-varying variable.')
    hslice = _Hyperslice(self, key)
    if ((hslice.dims > 1) and (hslice.counts[1:] != hslice.dimsizes[1:]).any()):
        raise TypeError('Can only delete entire records.')
    if (hslice.counts[0] == 0):
        return
    start = hslice.starts[0]
    count = hslice.counts[0]
    interval = hslice.intervals[0]
    dimsize = hslice.dimsizes[0]
    self._call()
    dangerous_delete = False
    if (lib._del_middle_rec_bug and ((interval != 1) or ((start != 0) and ((start + count) < dimsize)))):
        entries = ctypes.c_long(0)
        lib.call(const.GET_, const.zVAR_nINDEXENTRIES_, ctypes.byref(entries))
        dangerous_delete = (entries.value == 1)
    if dangerous_delete:
        data = self[...]
        data = numpy.delete(data, numpy.arange(start, (start + (count * interval)), interval), 0)
        self[0:(dimsize - count)] = data
        first_rec = (dimsize - count)
        last_rec = (dimsize - 1)
        lib.call(const.DELETE_, const.zVAR_RECORDS_, ctypes.c_long(first_rec), ctypes.c_long(last_rec))
    elif (interval == 1):
        first_rec = ctypes.c_long(start)
        last_rec = ctypes.c_long(((start + count) - 1))
        lib.call(const.DELETE_, const.zVAR_RECORDS_, first_rec, last_rec)
    else:
        self._call()
        for recno in range((start + ((count - 1) * interval)), (start - 1), ((- 1) * interval)):
            lib.call(const.DELETE_, const.zVAR_RECORDS_, ctypes.c_long(recno), ctypes.c_long(recno))