gpt4 book ai didi

python - 如何在python中制作字典数组的数组

转载 作者:太空宇宙 更新时间:2023-11-04 10:18:02 25 4
gpt4 key购买 nike

<分区>

我基本上有 n 个玩家,对于每个玩家,我计算他们与其他玩家的相似程度,并按顺序或相似度存储它们。

我使用 Pearson 相关系数来衡量任何两个玩家之间的相似性。现在基本上我想要一个数据结构,我可以在其中存储每个玩家的信息,包括他们与所有其他玩家之间的相似度值。因此,对于 player1,我想保留其与所有其他玩家的相似度值列表。因此,我想创建一个数组列表,每个索引都代表玩家,例如索引 0 将是玩家 1,依此类推。现在在索引中我们将有一个字典数组。每个字典都有 playerId 键和值作为它与我们所指的玩家之间的相似性。

Player1 --> [[player2:0.0], [player3:0.5]]

so we would have one array where we have player1,player2,player3
and then in each index we have information as showed above.

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