将整个numpy数组映射到字典

时间:2020-09-13 14:53:27

标签: python arrays numpy dictionary

我有一个由字符串数据类型组成的大型numpy数组,具有19个唯一条目。如何用1到19之间的字母代码替换它,即将值映射到字母(MITOCHONDRIA为1,NUCLEI等为2)无法找到某种方法将字典映射到此数组。感谢您的帮助enter image description here

我查了一下,但对我没用 Translate every element in numpy array according to key

0 个答案:

没有答案