Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

read_csv only certain columns

col_list = ["Name", "Department"]
df = pd.read_csv("sample_file.csv", usecols=col_list)
Comment

only read some columns from csv

df_spec = pd.read_csv("/content/churn.csv", usecols=['Gender', 'Age', 'Tenure', 'Balance'])
Comment

PREVIOUS NEXT
Code Example
Python :: read excel date in python 
Python :: how to pause a python script 
Python :: python defaultdict to dict 
Python :: fibonacci recursive python 
Python :: translate french to english 
Python :: python regular expression 
Python :: modify a list with for loop and range function in python 
Python :: python parcourir ligne 
Python :: python string cut first n characters 
Python :: flask session timeout 
Python :: import path in django 
Python :: password guessing game python 
Python :: pygame text wrapping 
Python :: how to add coloumn based on other column 
Python :: how to swap two variables without using third variable python 
Python :: squre value of a column pandas 
Python :: Tensor.expand_as 
Python :: days in month function python 
Python :: openpyxl read sheet row by row 
Python :: dense layer keras 
Python :: install simple audio in python 
Python :: how to make python code faster 
Python :: distance of a point from a line python 
Python :: django start app 
Python :: bokeh xlabel rotate 
Python :: change value in excel in python 
Python :: detailview 
Python :: python list files in folder with wildcard 
Python :: typing pandas dataframe 
Python :: Highlight Active Links in Django Website 
ADD CONTENT
Topic
Content
Source link
Name
4+9 =