Python: выберите конкретные столбцы в кадре данных
df = df[["Column_Name1", "Column_Name2"]]
Andrea Perlato
df = df[["Column_Name1", "Column_Name2"]]
#only the column names specified will be put into the new sub df
#enter a minimum of one column name
print(df[['column_name_1', 'column_name_2', ... , 'column_name_n']])
df1 = df.iloc[:,0:2] # Remember that Python does not slice inclusive of the ending index.
df['name']