考虑具有以下形状的数据框:
label method args
Cluster 0 relayout ['shapes', 1]
Cluster 1 relayout ['shapes', 3]
Cluster 2 relayout ['shapes', 4]
我想创建一个像这样的字典:
{'buttons': [
{'label': 'Cluster 0', 'method': 'relayout', 'args': ['shapes', 1]},
{'label': 'Cluster 1', 'method': 'relayout', 'args': ['shapes', 3]},
{'label': 'Cluster 2', 'method': 'relayout', 'args': ['shapes', 4]},
]}