Checking an element in a list or Numpy array using "in" clause is extremely slow. You should convert Numpy array to Set to speed up the search logic.
Make the following changes in your code and hopefully, it will fix the issue.
mv_list = set(mv_list)
if (vals[0] in mv_list) #mv_list is numpy array
Also, make sure mv_list = set(mv_list) is not inside any loop, otherwise, it will also become slow.