在ipywidgets中,如何对滑块的大值使用科学的表示法?如果我有这样的事情:
FloatSlider(min=1e7, max=1e9, step=1e7)
滑块上的显示将满是零。我能把它转换成科学符号吗?
发布于 2016-07-22 06:15:28
如果你读到“帮助”,你会发现有一节说:
readout_format : str
default is '.2f', specifier for the format function used to represent
slider value for human consumption, modeled after Python 3's format
specification mini-language (PEP 3101).所以:
FloatSlider(min=1e7, max=1e9, step=1e7, readout_format='.2e')应该做好这份工作。
https://stackoverflow.com/questions/38518181
复制相似问题