I need a data frame, which contains just one column which is filled with ones. Here is my code so far.
label_values = np.empty(10)
label_values.fill(1)
label_df = pd.DataFrame()
label_df.insert(column=0, value=label_values.transpose(), allow_duplicates=True)
I get the following error:
label_df.insert(column=0, value=label_values.transpose(), allow_duplicates=True)
TypeError: insert() missing 1 required positional argument: 'loc'
As far as I see the problem is that the position (row) for the insert is missing. Do I really need to iterate over the array and insert each single value?
Thanks in advance!