<commit_before>--------------
Types Overview
--------------

In Python, ``5`` is of type :obj:`int` while ``"hello"`` is of type :obj:`str`.
Python is a dynamically-typed language, meaning that a function like:

    >>> def add_x_and_y(x, y):
    ...     return x + y

can be called on any two objects which can be added, like numbers, strings, or
:mod:`numpy` arrays.

Types are very important in Hail, because the fields of :class:`.Table` and
:class:`.MatrixTable` objects have data types.

Hail's primitive data types for boolean, numeric and string objects are:

 - :py:data:`.tstr` - Text string.
 - :py:data:`.tbool` - Boolean (``True`` or ``False``) value.
 - :py:data:`.tint32` - 32-bit integer.
 - :py:data:`.tint64` - 64-bit integer.
 - :py:data:`.tfloat32` - 32-bit floating point number.
 - :py:data:`.tfloat64` - 64-bit floating point number.

Hail's container types are:

 - :class:`.tarray` - Ordered collection of homogenous objects.
 - :class:`.tset` - Unordered collection of distinct homogenous objects.
 - :class:`.tdict` - Key-value map. Keys and values are both homogenous.
 - :class:`.ttuple` - Tuple of heterogeneous values.
 - :class:`.tstruct` - Structure containing named fields, each with its own
   type.

Hail also has a few genetics-specific types:

 - :py:data:`.tcall` - Genotype calls.
 - :class:`.tlocus` - Genomic locus, parameterized by reference genome.

When to work with types
~~~~~~~~~~~~~~~~~~~~~~~

In general, you won't need to mention types explicitly. Hail will
automatically impute the type of your data.

There are a few situations where you may want to specify types explicitly:

- To specify column types in :func:`import_table` if the imputed types
  do not match what you want.
- When converting a Python value to a Hail expression with :func:`.literal`,
  if you don't wish to rely on the imputed type.
- When using missing types via the :func:`.null` constructor.

Viewing an object's type
~~~~~~~~~~~~~~~~~~~~~~~~
<commit_msg>Update Hail Docs types overview file (#9097)<commit_after>--------------
Types Overview
--------------

In Python, ``5`` is of type :obj:`int` while ``"hello"`` is of type :obj:`str`.
Python is a dynamically-typed language, meaning that a function like:

    >>> def add_x_and_y(x, y):
    ...     return x + y

can be called on any two objects which can be added, like numbers, strings, or
:mod:`numpy` arrays.

Types are very important in Hail, because the fields of :class:`.Table` and
:class:`.MatrixTable` objects have data types.

Hail's primitive data types for boolean, numeric and string objects are:

 - :py:data:`.tstr` - Text string.
 - :py:data:`.tbool` - Boolean (``True`` or ``False``) value.
 - :py:data:`.tint32` - 32-bit integer.
 - :py:data:`.tint64` - 64-bit integer.
 - :py:data:`.tfloat32` - 32-bit floating point number.
 - :py:data:`.tfloat64` - 64-bit floating point number.

Hail's container types are:

 - :class:`.tarray` - Ordered collection of homogenous objects.
 - :class:`.tndarray` - Ordered n-dimensional arrays of homogenous objects.
 - :class:`.tset` - Unordered collection of distinct homogenous objects.
 - :class:`.tdict` - Key-value map. Keys and values are both homogenous.
 - :class:`.ttuple` - Tuple of heterogeneous values.
 - :class:`.tstruct` - Structure containing named fields, each with its own
   type.

Hail also has a few genetics-specific types:

 - :py:data:`.tcall` - Genotype calls.
 - :class:`.tlocus` - Genomic locus, parameterized by reference genome.

When to work with types
~~~~~~~~~~~~~~~~~~~~~~~

In general, you won't need to mention types explicitly. Hail will
automatically impute the type of your data.

There are a few situations where you may want to specify types explicitly:

- To specify column types in :func:`import_table` if the imputed types
  do not match what you want.
- When converting a Python value to a Hail expression with :func:`.literal`,
  if you don't wish to rely on the imputed type.
- When using missing types via the :func:`.null` constructor.

Viewing an object's type
~~~~~~~~~~~~~~~~~~~~~~~~

{'fraction_non_alphanumeric': 0.14836649471874233, 'fraction_numerical': 0.009334315892901008, 'mean_word_length': 3.5855855855855854, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5203772', 'n_tokens_mistral': 1284, 'n_tokens_neox': 1194, 'n_words': 503}