pandas add column from list
# creating a list for new column
places = ['Nellore', 'Mumbai', 'Andhra']
# we are using 'Places' as column name
# adding the list to the dataframe as column
dataframe['Places'] = places
pandas add column from list
# creating a list for new column
places = ['Nellore', 'Mumbai', 'Andhra']
# we are using 'Places' as column name
# adding the list to the dataframe as column
dataframe['Places'] = places
how to add a list to dataframe in python
to_append = [5, 6]
a_series = pd.Series(to_append, index = df.columns)
df = df.append(a_series, ignore_index=True)
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us