I am trying to add couple of empty columns to a python Dataframe , the columns to be added are in the form of list, how could I do it
list=[4,5,6]
data1={'77':[1.2,2.2,3.5],'18':[4.5,6.5,9.9],'89':[8.8,9.8,7.7]}
Input=pd.DataFrame(data1)
Input
data2={'77':[1.2,2.2,3.5],'18':[4.5,6.5,9.9],'89':[8.8,9.8,7.7],'4':[np.NaN,np.NaN,np.NaN],'5':[np.NaN,np.NaN,np.NaN],'6':[np.NaN,np.NaN,np.NaN]}
Output=pd.DataFrame(data2)
Output
What I thought of doing: I cant manually add each column one at a time to dataframe as in my usecase we will be adding 1000+ empty columns, I tried of running through a loop but it dint work out
Do this:
Output: