I am trying to add the same column when creating a new Pandas DataFrame in Python. I am trying to do something like the following:
I am trying to make all columns of the DataFrame above the same list. Is it possible to do this for a list of integers (or more generally, a list of strings/objects/etc.)?
I've tried using arrays, dicts, lists for column names. This part is something I can figure out, but figuring out a scalable way to just pass in one list is what I am trying to figure out.
column_names = array(['col0', 'col1', 'col2', 'col3'], dtype=object)
some_list = [int0, int1, int2]
df = pd.DataFrame(some_list, columns=column_names)
I would like to see something like:
col0 col1 col2 col3
0 int0 int0 int0 int0
1 int1 int1 int1 int1
2 int2 int2 int2 int2