Skip to content

Instantly share code, notes, and snippets.

View BigPrject's full-sized avatar

Bellamy John BigPrject

View GitHub Profile
@BigPrject
BigPrject / .pyx
Created April 25, 2025 16:03
fast list of lists string to np arr
import numpy as np
cimport numpy as np
from libc.stdint cimport uint16_t
from libc.stdlib cimport strtod
from cpython.unicode cimport PyUnicode_AsUTF8
cpdef np.ndarray[np.double_t, ndim=2] parse_list_list_str_to_floats(list[list[str]] data):
"""
Parses a list of lists of strings into a NumPy array of floats.