I want to generate a numpy array filled empty lists. I tried this:
import numpy as np
arr=np.full(6, fill_value=[], dtype=object)
And I got an error:
ValueError: could not broadcast input array from shape (0) into shape (6)
But if I use:
arr = np.empty(6, dtype=object)
arr.fill([])
It is ok. Why does numpy.full not work here? What is the right way to initialize an array filled with empty lists?