Answers for "only read few columns pandas"

0

df only take 2 columns

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

read one column 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
Posted by: Guest on April-30-2021

Code answers related to "only read few columns pandas"

Python Answers by Framework

Browse Popular Code Answers by Language