Pergunta de entrevista da empresa Airbnb

one column in data frame is a string such as [1,2,3,4,5], convert it to average number in int format