<commit_before># -*- coding: utf-8 -*-
"""
fsictools
=========
Supporting tools for FSIC-based economic models.
"""

# Version number keeps track with the main `fsic` module
from fsic import __version__

from typing import List
from fsic import BaseModel, Symbol


def symbols_to_dataframe(symbols: List[Symbol]) -> 'DataFrame':
    """Convert the list of symbols to a `pandas` DataFrame."""
    from pandas import DataFrame

    return DataFrame([s._asdict() for s in symbols])

def model_to_dataframe(model: BaseModel) -> 'DataFrame':
    """Return the values and solution information from the model as a `pandas` DataFrame."""
    from pandas import DataFrame

    df = DataFrame(model.values.T, index=model.span, columns=model.names)
    df['status'] = model.status
    df['iterations'] = model.iterations

    return df<commit_msg>DOC: Update docstrings in fsictools module<commit_after># -*- coding: utf-8 -*-
"""
fsictools
=========
Supporting tools for FSIC-based economic models. See the individual docstrings
for dependencies additional to those of `fsic`.
"""

# Version number keeps track with the main `fsic` module
from fsic import __version__

import re
from typing import List

from fsic import BaseModel, Symbol


def symbols_to_dataframe(symbols: List[Symbol]) -> 'DataFrame':
    """Convert the list of symbols to a `pandas` DataFrame. **Requires `pandas`**."""
    from pandas import DataFrame

    return DataFrame([s._asdict() for s in symbols])

def model_to_dataframe(model: BaseModel) -> 'DataFrame':
    """Return the values and solution information from the model as a `pandas` DataFrame. **Requires `pandas`**."""
    from pandas import DataFrame

    df = DataFrame(model.values.T, index=model.span, columns=model.names)
    df['status'] = model.status
    df['iterations'] = model.iterations

    return df
{'fraction_non_alphanumeric': 0.11764705882352941, 'fraction_numerical': 0.0010893246187363835, 'mean_word_length': 4.355685131195335, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '4571682', 'n_tokens_mistral': 545, 'n_tokens_neox': 525, 'n_words': 193}