Answers for "python take only 2 columns from dataframe"

2

select 2 cols from dataframe python pandas

# Convert the dictionary into DataFrame 
df = pd.DataFrame(data)
  
# select two columns
df[['Name', 'Qualification']]
Posted by: Guest on May-10-2021
0

df only take 2 columns

df1 = df[['a', 'b']]
Posted by: Guest on August-06-2020

Code answers related to "python take only 2 columns from dataframe"

Python Answers by Framework

Browse Popular Code Answers by Language