Enable boolean type columns from pandas DataFrame to be suitably converted into numpy structured array

This commit is contained in:
2025-02-10 15:52:17 +01:00
parent b58e205f9f
commit 68a9928c39

View File

@ -161,6 +161,8 @@ def convert_dataframe_to_np_structured_array(df: pd.DataFrame):
dtype.append((col, 'i4')) # Assuming 32-bit integer
elif pd.api.types.is_float_dtype(col_dtype):
dtype.append((col, 'f4')) # Assuming 32-bit float
elif pd.api.types.is_bool_dtype(col_dtype):
dtype.append((col,bool))
else:
# Handle unsupported data types
print(f"Unsupported dtype found in column '{col}': {col_data.dtype}")