dtypes

dataframe

Returns the data types of each column

Syntax

dtypes(dataframe)

Parameters

dataframe (dataframe)

The DataFrame to get column types from

Returns

object

Object mapping column names to their data types

Examples

Get data types for all columns in the DataFrame
Input:
dtypes
Output:
{"id": "Int64", "name": "Utf8", "age": "Int64"}

The dtypes() function returns an object mapping each column name to its data type. This is useful for understanding the schema and data types in your DataFrame.

Usage

Use dtypes() to inspect column data types, validate data loading, or ensure proper type handling in your data processing pipeline.

Related Functions