Check out Kite (free AI Coding Assistant) → Link



Buy Me a Coffee? Your support is much appreciated!

PayPal Me: https://www.paypal.me/jiejenn/5
Venmo: @Jie-Jenn

Source Code:  

 

import pandas as pd

df = pd.DataFrame({
    'Name': ['Joe', 'Mary'],
    'Age': [29, 30]
})

records = [['Mary', 30], ['Steve', 31]]

for record in records:
    if not record in df.values:
        df = df.append(pd.Series(record, index=df.columns), ignore_index=True)
print(df)