📜  如何在python代码示例中反转真假数组

📅  最后修改于: 2022-03-11 14:47:19.588000             🧑  作者: Mango

代码示例1
>>> import numpy
>>> mylist = [True, True, False]
>>> ~numpy.array(mylist)
array([False, False, True], dtype=bool)
>>> list(~numpy.array(mylist))
[False, False, True]