Delete records from the provided table. Parameters, matching and output are identical to
        `find()`.

        Parameters
        ----------
        tname : str
            Table to delete records from.
        where : dict or None (default `None`)
            Dictionary of <column, value> where value can be of str type for exact match or a
            compiled regex expression for more advanced matching.
        where_not : dict or None (default `None`)
            Identical to `where` but for negative-matching.
        columns: list of str, str or None (default `None`)
            Column(s) to return for the deleted records, if any.
        astype: str, type or None (default `None`)
            Type to cast the output to. Possible values are: `nonetype`, `dataframe`, `str`,
            `dict`, `json`. If this is `None`, falls back to the type provided to the constructor.
            If a type was provided to the constructor but the user wants to avoid any casting,
            "nonetype" should be passed as the value.

        Returns
        -------
        records : str, list or dataframe
            Records deleted from the table. Output type depends on `astype` parameter.

        See Also
        --------
        PandasDatabase.find

def delete(self, tname, where=None, where_not=None, columns=None, astype=None):
        '''
        Delete records from the provided table. Parameters, matching and output are identical to
        `find()`.

        Parameters
        ----------
        tname : str
            Table to delete records from.
        where : dict or None (default `None`)
            Dictionary of <column, value> where value can be of str type for exact match or a
            compiled regex expression for more advanced matching.
        where_not : dict or None (default `None`)
            Identical to `where` but for negative-matching.
        columns: list of str, str or None (default `None`)
            Column(s) to return for the deleted records, if any.
        astype: str, type or None (default `None`)
            Type to cast the output to. Possible values are: `nonetype`, `dataframe`, `str`,
            `dict`, `json`. If this is `None`, falls back to the type provided to the constructor.
            If a type was provided to the constructor but the user wants to avoid any casting,
            "nonetype" should be passed as the value.

        Returns
        -------
        records : str, list or dataframe
            Records deleted from the table. Output type depends on `astype` parameter.

        See Also
        --------
        PandasDatabase.find
        '''
        tname = self._check_tname(tname)
        where = PandasDatabase._check_conditions(where)
        where_not = PandasDatabase._check_conditions(where_not)
        columns = PandasDatabase._check_type_iter(str, columns)

        # Find the rows to be deleted
        delrows = self.find(tname, where=where, where_not=where_not, astype=DataFrame)

        # Remove them from the table
        dataframe = self._db[tname]
        dataframe = dataframe[~(dataframe.index.isin(delrows.index))]
        self._db[tname] = dataframe

        self._print('Deleted %d records from table "%s"' % (len(delrows), tname))

        # Save the changes to disk if required
        if self.auto_save:
            self.save()

        # Return deleted rows
        return self._output(delrows, astype=astype)