np2ds¶
Convert a NumPy array into a URANIE DataServer object.
converter.np2ds(mat, attrib_names, name="", title="")
Parameters:
Parameter |
Type |
Description |
|---|---|---|
|
|
Input array with shape |
|
|
Colon-separated attribute names, e.g., |
|
|
Name for the DataServer object (optional, default: |
|
|
Title for the DataServer object (optional, default: |
Returns:
Type |
Description |
|---|---|
|
A DataServer object with attributes populated from the array columns. |
Example¶
import numpy as np
from uratools import converter
# Create data
X = np.random.randn(100, 3)
# Convert to DataServer
tds = converter.np2ds(X, "x1:x2:x3", name="samples", title="Random samples")
print(f"Patterns: {tds.getNPatterns()}") # 100
print(f"Attributes: {tds.getNAttributes()}") # 3
Use Cases¶
Prepare NumPy data for URANIE sampling workflows
Convert preprocessed data into URANIE format
Create DataServer objects from external data sources (CSV, HDF5, etc.)