gpt4 book ai didi

python - plotly fig 对象到 redis

转载 作者:可可西里 更新时间:2023-11-01 11:23:35 26 4
gpt4 key购买 nike

我有一个图形对象(类型:class 'plotly.graph_objs._figure.Figure'),我需要将它转换为其他数据类型,可以在 redis 数据库中存储和检索。

我正在使用 python。请帮助我了解如何转换类型

最佳答案

这可能是您需要的,来自文档 here :

  get_data(self, flatten=False)
Returns the JSON for the plot with non-data elements stripped.

Flattening may increase the utility of the result.

:param (bool) flatten: {'a': {'b': ''}} --> {'a.b': ''}
:returns: (dict|list) Depending on (flat|unflat)

关于python - plotly fig 对象到 redis,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55958067/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com