I am trying to fill 'NA' in a pandas column by randomly selecting elements from a list.
For example:
import pandas as pd
df = pandas.DataFrame()
df['A'] = [1, 2, None, 5, 53, None]
fill_list = [22, 56, 84]
Is it possible to write a function which takes the pandas DF with column name as input and replaces all NA by randomly selecting elements from the list 'fill_list'?
fun(df['column_name'], fill_list])