I understand that in order to pretty print things like discriminated unions in Deedle, you have to override ToString()
. But what about built in types, like float
?
Specifically, I want floats in one column to be displayed as percentages, or at the very least, to not have a million digits past the decimal.
Is there a way to do this?
There is no built-in support for doing this - it sounds like a useful addition, so if you want to contribute this to Deedle, please open an issue to discuss this! We'd be happy to accepta pull request that adds this feature.
As a workaround, I think your best chance is to transform the data in the frame before printing. Something like this should do the trick:
This creates a new frame where all
float
values of a column namedA
are transformed using the formatting functionsprintf "%f%%" (v*100.0)
and the rest is left unchanged.