> ## Documentation Index
> Fetch the complete documentation index at: https://kb.talostrading.com/llms.txt
> Use this file to discover all available pages before exploring further.

# DataCollection.todataframe

```python theme={null}
coinmetrics._data_collection.DataCollection.to_dataframe(
    dtype_mapper=None,
    dataframe_type='pandas',
    decimal_as_string=False,
)
```

Outputs a pandas or polars dataframe with schema-derived types.

Uses PyArrow as the intermediate representation for type-safe,
near-zero-copy conversion to both pandas and polars.

* **Parameters:**
  * **dtype\_mapper** ([*dict*](https://docs.python.org/3/library/stdtypes.html#dict)) -- Optional dictionary mapping column names to pandas
    dtypes.  Overrides schema-derived types for the specified columns.
  * **dataframe\_type** ([*str*](https://docs.python.org/3/library/stdtypes.html#str)) -- Type of dataframe outputted, either "pandas" (default) or "polars".
  * **decimal\_as\_string** ([*bool*](https://docs.python.org/3/library/functions.html#bool)) -- If True, decimal columns are returned as strings
    to preserve full precision. If False (default), decimals are cast to
    float64 which may lose precision for values with more than \~15
    significant digits.

**Returns:**

* DataFrameType
  * Data in a pandas or polars dataframe
