Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

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
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #read #specific #columns #csv #python #pandas
ADD COMMENT
Topic
Name
8+2 =