Answers for "panda df read_csv all columns to numeric type"

1

how to define dtype of each column before actually reading csv file

import pandas as pd 

# ...[.].csv = your .csv file 
# datatype = dtype you want to define.
read = pd.read_csv('......[.]csv',dtype={'name_column':'datatype'})
Posted by: Guest on June-06-2020

Python Answers by Framework

Browse Popular Code Answers by Language