Select cells randomly from NumPy array - without replacement

前端 未结 6 1049
萌比男神i
萌比男神i 2021-02-19 16:41

I\'m writing some modelling routines in NumPy that need to select cells randomly from a NumPy array and do some processing on them. All cells must be selected without replacemen

6条回答
  •  谎友^
    谎友^ (楼主)
    2021-02-19 17:01

    people using numpy version 1.7 or later there can also use the builtin function numpy.random.choice

提交回复
热议问题