I\'m trying to Assign multiple values to a single row in a DataFrame and I need the correct syntax.
See the code below.
import pandas as pd df = p
Use loc (and avoid chaining):
In [11]: df.loc[3] = ['V1', 4.3, 2.2, 2.2, 20.2]
This ensures the assigning is done inplace on the DataFrame, rather than on a copy (and garbage collected).
You can specify only certain columns:
In [12]: df.loc[3, list('ABCDE')] = ['V1', 4.3, 2.2, 2.2, 20.2]