I have created a numpy arraylist from a CSV file that has a couple of thousand elements.
First, I used the np.array function to convert a dataframe column into an array.
Then I used a function that calculates the most common element in a list, but it gave me an error.
The code I wrote is shown below.
col_array = np.array(dataframe.col)
def most_common(lst): return max(set(lst), key=lst.count)