Skip to content
Advertisement

Fill Excel cells with random numbers

I have a question about how to fill some cells in Excels with random values? For example, I have a part of the code with:

JavaScript

Which gave me the error of: TypeError: Unsupported type <class ‘generator’> in write()

How to fix it?

Advertisement

Answer

To write multiple cells, use write_row() or write_column() as shown in the docs.

Also, try changing the first line to a list comprehension (using square brackets instead of parentheses):

JavaScript
Advertisement