Check if all elements in a list are identical

前端 未结 22 2329
死守一世寂寞
死守一世寂寞 2020-11-22 07:45

I need a function which takes in a list and outputs True if all elements in the input list evaluate as equal to each other using the standard equal

22条回答
  •  闹比i
    闹比i (楼主)
    2020-11-22 07:55

    Check if all elements equal to the first.

    np.allclose(array, array[0])

提交回复
热议问题