Tambahkan baris kosong ke dataframe pandas
df = df.append(pd.Series(), ignore_index=True)
Eufemiano Fuentes Pérez
df = df.append(pd.Series(), ignore_index=True)
# Append rows in Empty Dataframe by adding dictionaries
dfObj = dfObj.append({'User_ID': 23, 'UserName': 'Riti', 'Action': 'Login'}, ignore_index=True)
dfObj = dfObj.append({'User_ID': 24, 'UserName': 'Aadi', 'Action': 'Logout'}, ignore_index=True)
dfObj = dfObj.append({'User_ID': 25, 'UserName': 'Jack', 'Action': 'Login'}, ignore_index=True)
dict = {'First Name': 'Vikram', 'Last Name': 'Aruchamy', 'Country': 'India'}
df = df.append(dict, ignore_index = True)
df
df2 = pd.DataFrame({'First Name': ['Kumar'],
'Last Name' : ['Ram'],
'Country' : ['India']})
df = pd.concat([df, df2], ignore_index = True, axis = 0)
df
df.iloc[1] = ['India', 'Shivam', 'Pandey']
df