Open kenahoo opened 7 months ago
not at present. I think
with pint.UnitRegistry.option_context('default_format', '~C'):
...
would be a nice way of going about this. Would need some changes in pint
another approach would be a format arguement in dequantify+quantify.
If I want to set the units output format just for writing one output file, is there something less global than setting the
pint.UnitRegistry.default_format
like below?In this case, the code is handed a unit-aware DataFrame and needs to write it out, but it doesn't have direct access to the
UnitRegistry
associated with it. It would be great if there's some property ofdf
that controlled the formatting, or perhaps an argument toto_csv()
.