I created a dataframe df as below:
Type = ['A', 'B', 'C', 'D']
Size = [72,23,66,12]
df = pd.DataFrame({'Type': Type, 'Size': Size})
I can extract any existing column using:
df_count = df['Size']
However, if a data frame is too big, and I don't know if the column exist in df or not. In such if I call a column e.g. df['Shape'] as below:
df_null = df['Shape']
It raises a KeyError. However I want that df_null should get an empty column with name "Shape".