'Writing out an AnnData object containing NaN values

For one of my datasets, there are NaN values in the variable annotations. When attempting to write out the AnnData into a .h4ad file, an error is thrown:

TypeError: Can't implicitly convert non-string objects to strings

Is there anyway to keep the NaN values when writing out AnnData objects?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source