# DataFrames and schemas
source: https://docs.chalk.ai/docs/chalkdf/concepts/dataframes

## Inspect column names and types, and set a column's type when you construct a DataFrame.

A DataFrame's schema gives the name and type of each column. When you construct a frame from a dictionary, each key names a column and ChalkDF infers its type from the values. To set a column's type explicitly, supply a typed Arrow array for that column.

```python
import pyarrow as pa
from chalkdf import DataFrame

orders = DataFrame({
    "id": ["001", "002"],
    "amount": pa.array([8, 30], type=pa.int32()),
})
orders
```

| id · `string` | amount · `int32` |
| ------------- | ---------------- |
| 001           | 8                |
| 002           | 30               |

The string IDs retain their leading zeros. A Python list of these amounts would produce an `int64` column. The typed array gives `amount` the narrower `int32` type. Inspect an individual column's type with [`orders.schema["amount"]`](/dataframe-docs#DataFrame.schema).

To specify types for an entire table, see [Python and Arrow](/docs/chalkdf/io/python-and-arrow). To build a query before its rows arrive, see [Named table inputs](/docs/chalkdf/query-execution#named-table-inputs).





