CBSE Class 12 Informatics Practices
Question 100 of 167
Python Pandas — I — Question 11
Back to all questionsThe syntax to add a new column to a DataFrame is <DF object>.[<column>] = <new value>. Therefore, according to this syntax, the statement to add a column named 'val' to a dataframe df with 10 rows is :
df['val'] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]