dh_null_to_nan
The dh_null_to_nan method converts Deephaven primitive null values in the given numpy array to numpy.nan. No conversion is performed on non-primitive values.
Note
dh_null_to_nan never modifies the input array. For an array of a primitive type, it returns a new array.
Syntax
Parameters
| Parameter | Type | Description |
|---|---|---|
| np_array | numpy.ndarray | The numpy array to convert. |
| type_promotion optional | bool | When True, integer, boolean, or character arrays are converted to new np.float64 arrays and Deephaven null values in them are converted to When False, integer, boolean, or character arrays will cause an exception to be raised. Default is False. |
Returns
A numpy.ndarray.
Examples
In the example below, we create a simple Deephaven table with null values. We then convert the table to a numpy array and use dh_null_to_nan to convert the Deephaven null values to numpy.nan.