I am getting following error:
df_OP = pd.DataFrame([excel_write_data[idx].__dict__ for idx in range(0,
len(excel_write_data))])
TypeError: object of type 'IMapIterator' has no len().
I am using imap for parrallel processing but I am getting above error
excel_write_data = pool.imap(pre_process, excel_read_data)
How can i overcome this error . can any one help
So IMapIterator
is an iterable, but you need something that acts like a list (has a len()
). So, make it a list:
excel_write_data = list(pool.imap(pre_process, excel_read_data))