File tree Expand file tree Collapse file tree 1 file changed +12
-9
lines changed
Expand file tree Collapse file tree 1 file changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -69,16 +69,19 @@ def csv_bytes_list_to_numpy(
6969 try :
7070 import polars as pl
7171
72- out : npt .NDArray [np .float64 ] = (
73- pl .read_csv (
74- io .BytesIO (b"" .join (csv_bytes_list )),
75- has_header = includes_header ,
76- schema_overrides = [pl .Float64 ] * num_cols ,
77- infer_schema = False ,
72+ try :
73+ out : npt .NDArray [np .float64 ] = (
74+ pl .read_csv (
75+ io .BytesIO (b"" .join (csv_bytes_list )),
76+ has_header = includes_header ,
77+ schema_overrides = [pl .Float64 ] * num_cols ,
78+ infer_schema = False ,
79+ )
80+ .to_numpy ()
81+ .astype (np .float64 )
7882 )
79- .to_numpy ()
80- .astype (np .float64 )
81- )
83+ except pl .exceptions .NoDataError :
84+ return np .empty ((0 ,))
8285 except ImportError :
8386 with warnings .catch_warnings ():
8487 warnings .filterwarnings ("ignore" )
You can’t perform that action at this time.
0 commit comments