dimanche 16 mai 2021

Calculating the Randomness of a Numpy Array

Say I have an array of the form:

string_array = ['Fe', 'Pt', 'Pt', ..., 'Fe', 'Pt', 'Fe']

With an array of the order of 10,000 entries long all of which are either 'Fe' or 'Pt', is there a way to establish the "randomness" of the array already built into numpy?

Currently I am using a for loop to calculate the runs of 'Fe' and 'Pt' and getting the standard deviation of the list that is produced. However, this is quite costly computationally, and complicated to read.




Aucun commentaire:

Enregistrer un commentaire