get certain fields from csv pandas code example
Example 1: read specific columns from csv in python pandas
import pandas as pd
fields = ['star_name', 'ra']
df = pd.read_csv('data.csv', skipinitialspace=True, usecols=fields)
# See the keys
print df.keys()
# See content in 'star_name'
print df.star_name
Example 2: get a colomn of csv in pandas
import pandas as pd
df = pd.read_csv("test.csv", usecols = ['Wheat','Oil'])
print(df)