CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/pypi-datatable

Python package for manipulating 2-dimensional tabular data structures with emphasis on speed and big data support

Pending
Overview
Eval results
Files

string-operations.mddocs/

String Operations

Text processing and manipulation functions for string columns in datatable.

Capabilities

String Functions

def str.len(x):
    """
    String length function.
    
    Parameters:
    - x: String column expression
    
    Returns:
    Integer column with string lengths
    """

def str.slice(x, start, stop=None):
    """
    String slicing function.
    
    Parameters:
    - x: String column expression
    - start: Starting index
    - stop: Ending index (optional)
    
    Returns:
    String column with sliced strings
    """

def str.split_into_nhot(x):
    """
    Split strings into n-hot encoding.
    
    Parameters:
    - x: String column expression
    
    Returns:
    Frame with n-hot encoded columns
    """

Regular Expression Functions

def re.match(x, pattern):
    """
    Regular expression matching.
    
    Parameters:
    - x: String column expression
    - pattern: Regular expression pattern
    
    Returns:
    Boolean column indicating matches
    """

Examples

import datatable as dt

DT = dt.Frame({
    'text': ['hello', 'world', 'datatable', 'python'],
    'codes': ['ABC-123', 'DEF-456', 'GHI-789', 'JKL-012']
})

# String operations
result = DT[:, dt.update(
    text_length=dt.str.len(f.text),
    first_3_chars=dt.str.slice(f.text, 0, 3),
    last_2_chars=dt.str.slice(f.text, -2),
    matches_pattern=dt.re.match(f.codes, r'[A-Z]{3}-\d{3}')
)]

Install with Tessl CLI

npx tessl i tessl/pypi-datatable

docs

core-data-structures.md

data-manipulation.md

expression-system.md

file-io.md

index.md

mathematical-functions.md

reductions-aggregations.md

row-operations.md

set-operations.md

string-operations.md

time-operations.md

type-system.md

tile.json