Example Usage

import zero_true as zt
import pandas as pd

# Sample data
data = {
  'Name': ['Alice', 'Bob', 'Charlie'],
  'Age': [24, 30, 22],
  'City': ['New York', 'Los Angeles', 'Chicago']
}

# Create a pandas DataFrame
df = pd.DataFrame(data)

# Create the headers for the DataFrame component
headers = [
  zt.Header(key='Name', title='Name', align='start'),
  zt.Header(key='Age', title='Age', align='start'),
  zt.Header(key='City', title='City', align='start')
]

# Create the DataFrame component from the pandas DataFrame
sample_dataframe = zt.DataFrame.from_dataframe(df, id='sample_dataframe')

# Update headers (if needed)
sample_dataframe.headers = headers

# Assuming you have a mechanism to render or use this DataFrame within a layout
layout = zt.Layout(components=[sample_dataframe])

Example Output

Overview

pydantic model zero_true.DataFrame

The DataFrame component utilizes the familiar structure of a data table, making it easy to integrate and display data from various sources, including directly from a pandas DataFrame.

This component is essential for applications that require data analysis and presentation, providing functionalities like sorting, filtering, and viewing detailed information in a user-friendly manner.

JSON Schema

Bellow are the various attributes you can assign to the component. Utlizing them can allow for modifications to the pre-created object.
zero_true.DataFrame
Zero True Component