gwpopulation_pipe.common_format.data_frame_to_sarray
- data_frame_to_sarray(data_frame)[source]
Convert a pandas DataFrame object to a numpy structured array. This is functionally equivalent to but more efficient than np.array(df.to_array()).
- Parameters:
- data_frame: pd.DataFrame
the data frame to convert
- Returns:
- output: np.ndarray
a numpy structured array representation of df