ColumnTypes
✖
ColumnTypes
Details


- ColumnTypes is typically used to obtain type information either to convert the type or decide what operations can be done. For instance, you cannot do date operations on strings.
- For a Tabular object tab with named columns, ColumnTypes[tab,…] returns a association of pairs coltype.
- For a Tabular object tab with unnamed columns, ColumnTypes[tab,…] returns a list of types.
- The column type selector tsel can have one of these forms:
-
tpatt type pattern tclass named class of types - Possible type patterns tpatt include cases like "Integer*" or "Quantity"::["Real64",_].
- Possible type classes tclass include:
-
"Numbers" number types "MachineNumbers" machine-sized number types "Reals" real-valued types, including integers "MachineReals" machine-sized real-valued types, including integers "Integers" integer types "MachineIntegers" machine-sized integer types "FloatingPoint" numbers with floating-point representation "MachineFloatingPoint" machine-sized real and complex numbers "FloatingPointReals" real numbers with floating-point representation "MachineFloatingPointReals" machine-sized real numbers "FloatingPointComplexes" complex numbers with floating-point representation "Lists" each element is a list

Examples
open allclose allBasic Examples (3)Summary of the most common use cases
Find the types that are automatically selected for this Tabular object:

https://wolfram.com/xid/0bdo36ezu-qcqgsq


https://wolfram.com/xid/0bdo36ezu-laejtt

Find the types of the columns of reals:

https://wolfram.com/xid/0bdo36ezu-unt8x2


https://wolfram.com/xid/0bdo36ezu-ph00jl

Construct a Tabular object without keys from a numeric matrix:

https://wolfram.com/xid/0bdo36ezu-0pqy61

Find the list of types of each column:

https://wolfram.com/xid/0bdo36ezu-f7x01i

Scope (15)Survey of the scope of standard use cases
Numeric Types (1)
Take a collection of integers or missing values:

https://wolfram.com/xid/0bdo36ezu-hw9zhe

https://wolfram.com/xid/0bdo36ezu-7yw8sh

By default, integers will be interpreted using the "Integer64" type in this machine:

https://wolfram.com/xid/0bdo36ezu-3r9hsc

Construct three columns with the same data but casting to different types of integers:

https://wolfram.com/xid/0bdo36ezu-br4bx1


https://wolfram.com/xid/0bdo36ezu-qlvli1

Boolean Type (1)
Take a collection of Boolean or missing values:

https://wolfram.com/xid/0bdo36ezu-6hwdxd

ToTabular automatically interprets the data as a column of "Boolean" type:

https://wolfram.com/xid/0bdo36ezu-70a48b


https://wolfram.com/xid/0bdo36ezu-cj7wu1

String Type (1)
Take a collection of words or missing values:

https://wolfram.com/xid/0bdo36ezu-ovrohd

ToTabular automatically interprets the data as a column of "String" type:

https://wolfram.com/xid/0bdo36ezu-oe0pz1


https://wolfram.com/xid/0bdo36ezu-k6hufl

Quantity Types (2)
Take a collection of Quantity durations and missing values:

https://wolfram.com/xid/0bdo36ezu-7h9sz4


https://wolfram.com/xid/0bdo36ezu-h9hya8

The values are stored using "Real64" magnitudes and a common unit of "Seconds":

https://wolfram.com/xid/0bdo36ezu-mx105s

For small enough Tabular objects, the original input data is cached by default and Normal recovers it:

https://wolfram.com/xid/0bdo36ezu-31aw6b

Specify the magnitude type and unit to use:

https://wolfram.com/xid/0bdo36ezu-qu9qe4


https://wolfram.com/xid/0bdo36ezu-y2wqrm

The original input was not cached:

https://wolfram.com/xid/0bdo36ezu-yerj87

Quantities of different dimensions can be stored using the "InertExpression" type:

https://wolfram.com/xid/0bdo36ezu-kf3pyn


https://wolfram.com/xid/0bdo36ezu-dh84ci


https://wolfram.com/xid/0bdo36ezu-buf5yi

Trying to impose a specific "Quantity" type will result in missing values:

https://wolfram.com/xid/0bdo36ezu-mgefwg


https://wolfram.com/xid/0bdo36ezu-6f461s

Date & Time Types (3)

https://wolfram.com/xid/0bdo36ezu-0nzv32

Create a Tabular object with automatic type detection:

https://wolfram.com/xid/0bdo36ezu-nwc9x2


https://wolfram.com/xid/0bdo36ezu-lh1th4

Specify a type to convert to granularity "Day" when dates are extracted:

https://wolfram.com/xid/0bdo36ezu-m10mw9


https://wolfram.com/xid/0bdo36ezu-ykdqbp


https://wolfram.com/xid/0bdo36ezu-gfd1gu


https://wolfram.com/xid/0bdo36ezu-eez1x4

Create a Tabular object with automatic type detection:

https://wolfram.com/xid/0bdo36ezu-i2qqbn


https://wolfram.com/xid/0bdo36ezu-eq3w5h

Specify a type to convert to granularity "Hour" when times are extracted:

https://wolfram.com/xid/0bdo36ezu-16epjm


https://wolfram.com/xid/0bdo36ezu-fxdnwi


https://wolfram.com/xid/0bdo36ezu-4pf164

Specify dates with a different calendar:

https://wolfram.com/xid/0bdo36ezu-rarm7g


https://wolfram.com/xid/0bdo36ezu-2r057v


https://wolfram.com/xid/0bdo36ezu-yqg4zy


https://wolfram.com/xid/0bdo36ezu-n88pyv

Categorical Type (2)

https://wolfram.com/xid/0bdo36ezu-4lpghr

ToTabular automatically interprets the data as a column of "String" type:

https://wolfram.com/xid/0bdo36ezu-blahrj


https://wolfram.com/xid/0bdo36ezu-3m8bl2

Explicitly specify a "Categorical" type for the column, categorizing the data:

https://wolfram.com/xid/0bdo36ezu-vb77n1


https://wolfram.com/xid/0bdo36ezu-t5er0h


https://wolfram.com/xid/0bdo36ezu-5p34kc


https://wolfram.com/xid/0bdo36ezu-0qm41m

Split a gene sequence into a list of the nucleotide bases:

https://wolfram.com/xid/0bdo36ezu-izhm10

Create a Tabular object with specific categories of the nucleotide bases:

https://wolfram.com/xid/0bdo36ezu-9gmrb4


https://wolfram.com/xid/0bdo36ezu-71igk2


https://wolfram.com/xid/0bdo36ezu-hpjqjs

Visualize the beginning of the sequence:

https://wolfram.com/xid/0bdo36ezu-x9i6c4

Categorical Ordered Type (1)

https://wolfram.com/xid/0bdo36ezu-8day37


https://wolfram.com/xid/0bdo36ezu-c4azhl

Create a Tabular object with automatic type detection:

https://wolfram.com/xid/0bdo36ezu-nbs0gj

The automatically detected type is "String":

https://wolfram.com/xid/0bdo36ezu-rpl2xn

Specify the "CategoricalOrdered" type providing the list categories, which defines the ordering:

https://wolfram.com/xid/0bdo36ezu-op4yc2


https://wolfram.com/xid/0bdo36ezu-q6gw9e

Lists & Tuples (2)
Take a collection of integer tuples:

https://wolfram.com/xid/0bdo36ezu-l998e0


https://wolfram.com/xid/0bdo36ezu-g8p5iw


https://wolfram.com/xid/0bdo36ezu-dlbw1q

Specify the type of the elements of the tuples:

https://wolfram.com/xid/0bdo36ezu-go9t6e


https://wolfram.com/xid/0bdo36ezu-1rat4z

Take a collection of tuples of objects of various types:

https://wolfram.com/xid/0bdo36ezu-80r5oq

Create a Tabular object with automatic type detection:

https://wolfram.com/xid/0bdo36ezu-p81eiy


https://wolfram.com/xid/0bdo36ezu-nattje

Specify the types of the elements of the tuples:

https://wolfram.com/xid/0bdo36ezu-2hoabh


https://wolfram.com/xid/0bdo36ezu-v56inb

General Expressions (1)

https://wolfram.com/xid/0bdo36ezu-zhlu5c

Creating a Tabular object assigns type "Expression" to general Wolfram Language expressions:

https://wolfram.com/xid/0bdo36ezu-1d9fpm


https://wolfram.com/xid/0bdo36ezu-5lrdn7

Column Selectors (1)
Get column types for all columns:

https://wolfram.com/xid/0bdo36ezu-vectp8


https://wolfram.com/xid/0bdo36ezu-7u8v6l

Extract column types for two columns:

https://wolfram.com/xid/0bdo36ezu-iiiea

Extract columns of Boolean type:

https://wolfram.com/xid/0bdo36ezu-tb7tuu

Extract columns of any integer type:

https://wolfram.com/xid/0bdo36ezu-gjqj8w

Extract columns that are either string or Boolean:

https://wolfram.com/xid/0bdo36ezu-vlodef

Applications (1)Sample problems that can be solved with this function
Create a TabularRow with automatic input type detection:

https://wolfram.com/xid/0bdo36ezu-wzwqpg


https://wolfram.com/xid/0bdo36ezu-lj4as5


https://wolfram.com/xid/0bdo36ezu-4bsag3


https://wolfram.com/xid/0bdo36ezu-evfvhg

Wolfram Research (2025), ColumnTypes, Wolfram Language function, https://reference.wolfram.com/language/ref/ColumnTypes.html.
Text
Wolfram Research (2025), ColumnTypes, Wolfram Language function, https://reference.wolfram.com/language/ref/ColumnTypes.html.
Wolfram Research (2025), ColumnTypes, Wolfram Language function, https://reference.wolfram.com/language/ref/ColumnTypes.html.
CMS
Wolfram Language. 2025. "ColumnTypes." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/ColumnTypes.html.
Wolfram Language. 2025. "ColumnTypes." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/ColumnTypes.html.
APA
Wolfram Language. (2025). ColumnTypes. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ColumnTypes.html
Wolfram Language. (2025). ColumnTypes. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ColumnTypes.html
BibTeX
@misc{reference.wolfram_2025_columntypes, author="Wolfram Research", title="{ColumnTypes}", year="2025", howpublished="\url{https://reference.wolfram.com/language/ref/ColumnTypes.html}", note=[Accessed: 15-May-2025
]}
BibLaTeX
@online{reference.wolfram_2025_columntypes, organization={Wolfram Research}, title={ColumnTypes}, year={2025}, url={https://reference.wolfram.com/language/ref/ColumnTypes.html}, note=[Accessed: 15-May-2025
]}