---
title: "ClikaRT::tables"
sidebar_label: "tables"
description: "Namespace ClikaRT::tables"
---

<!-- Generated by tools/doxygen2mdx from Doxygen XML. Do not edit. -->

<span class="api-kind api-kind--namespace">namespace</span>

## Classes

| Name | Description |
| --- | --- |
| [`CsvReadOptions`](./CsvReadOptions.md) | Options for [`Table::read_csv`](./Table.md#read_csv) / `read_csv_string`. Column dtypes are inferred; an empty unquoted field is always null, and an unquoted field equal to one of [`null_tokens`](./CsvReadOptions.md#null_tokens) also becomes null. |
| [`Table`](./Table.md) | A columnar dataframe: an ordered set of named, typed columns sharing one row count (see the file overview for the model). Build with [`create()`](./Table.md#create) + [`add_column`](./Table.md#add_column) / [`read_csv`](./Table.md#read_csv), read columns back as tensors, iterate rows with [`rows()`](./Table.md#rows), transform with the verb methods, and mutate columns in place via `frame[name]`. |

## Functions

### json\_array\_to\_csv\_string() {#json_array_to_csv_string}

<div class="api-signature">

`std::string` **`json_array_to_csv_string`**(`std::string_view` `json_text`)

</div>

Render a JSON array-of-objects (`[{...}, {...}]`) straight to CSV text, the whole DOM → frame → CSV round trip runs inside the library, so a consumer that links only the shipped `.so` gets CSV without ever holding a [`Table`](./Table.md) by value. The objects' keys become columns (first-seen order); a missing key or a JSON `null` is an empty cell. Raises [`ClikaRT::Error`](../Error.md) on malformed JSON or a value that is not an array of objects. `json_text` is read during the call, not retained.

<div class="api-declared">

Declared in `ClikaRT/tables/table.h`, line 369

</div>

### csv\_string\_to\_json\_array() {#csv_string_to_json_array}

<div class="api-signature">

`std::string` **`csv_string_to_json_array`**(`std::string_view` `csv_text`)

</div>

The reverse text entry: a CSV table text (a header row plus rows, the text [`Table::to_csv_string`](./Table.md#to_csv_string) writes) straight to a JSON array-of-objects text, one object per row keyed by the header, cells typed as the CSV reader infers them (a number stays a number; an empty cell is JSON `null`). The whole CSV → frame → JSON round trip runs inside the library, so a consumer that links only the shipped `.so` reads a table's rows without ever holding a [`Table`](./Table.md) by value. Raises [`ClikaRT::Error`](../Error.md) on a text that is not a CSV table. `csv_text` is read during the call, not retained.

<div class="api-declared">

Declared in `ClikaRT/tables/table.h`, line 382

</div>

## `ClikaRT/tables/table.h` {#table-h}

```cpp
#include <ClikaRT/tables/table.h>
```

[`ClikaRT::tables::Table`](./Table.md): a columnar dataframe, an ordered set of named, typed columns sharing one row count. Positional rows (no labeled index). Build it from named `Tensor` columns (and string columns), print it pandas-style, read a column back as a `Tensor`, and mutate columns in place with pandas-style assignment:

```text
frame["price"] -= 5;        // in-place, on the live column
frame["bonus"] *= 1.5;
frame["total"] = some_tensor;   // create or replace a column
```

Every fallible call returns `Result<T>` (the library never throws); the assignment proxy raises [`ClikaRT::Error`](../Error.md) on your side via `value_or_throw` so `frame["x"] -= 5;` reads naturally. Backed by the same engine as the internal tables module; numeric work lowers to the compute kernels.
