Articles → Pandas → Return Multiple Columns From Dataframe In Pandas
Return Multiple Columns From Dataframe In Pandas
Example
import numpy as np
import pandas as pd
df = pd.DataFrame(np.random.randn(5,4),['A', 'B', 'C', 'D', 'E'],['W', 'X', 'Y', 'Z'])
print(df[['W', 'X']])
Click to Enlarge