def to_dataframe(self, cast_numeric=False): df = self._dataframe.copy() if cast_numeric: df = df.apply(lambda x: pd.to_numeric(x, errors='ignore')) return df