I created a dataframe with the pandas library. I want to add a column to the dataframe. However I am getting the following error.But I think I have to enter as much data as the number of lines.How can I enter information in the row and column I want? How can I create a column without entering data?
import pandas as pd
kd = pd.DataFrame(data)
insertColumns = kd.insert(0, "Age", [21, 23, 24, 21],True )
print(kd)
error:
ValueError: Length of values (4) does not match length of index (6)