df = pd.DataFrame(columns=['сol_1','col_2','col_3','col_4']) data = [('str_1','str_2','str_3','str_4')] # именно так, а не иначе!!!
str_1 в col_1
str_2 в col_2
str_3 в col_3
str_4 в col_4
Как?
Спасибо!
df = pd.DataFrame(columns=['сol_1','col_2','col_3','col_4']) data = [('str_1','str_2','str_3','str_4')] # именно так, а не иначе!!!
df.loc[0]={'сol_1':'str_1','col_2':'str_2','col_3':'str_3','col_4':'str_4'}
xam1816
import pandas as pd df = pd.DataFrame(columns=['col_1','col_2','col_3','col_4']) data = [('str_1','str_2','str_3','str_4')] df.loc[0]={'сol_1':'str_1','col_2':'str_2','col_3':'str_3','col_4':'str_4'} print(df)
Begin_nerВы в
col_1 col_2 col_3 col_4
0 NaN str_2 str_3 str_4
сol_1
с