Home > Software design >  Unable to read csv file on Google Colab
Unable to read csv file on Google Colab

Time:07-14

I'm trying to read a sample dataset from Kaggle on Google Colab. I've tried to read the csv file by uploading it to my Google Drive as well as by loading it to my ipynb using the Kaggle API.

This is the command I'm trying:

df=pd.read_csv("/content/quality/MiningProcess_Flotation_Plant_Database.csv",usecols=need_cols,dtype=data_dir)

For some weird reason, the error message is from the very first command I've given.

TypeError: data type 'quality-prediction-in-a-mining-process' not understood

Since then, I've tried to rename the folder. I've also tried reconnecting the runtime.

Screenshot of the error

CodePudding user response:

Try removing dtype and use this instead:

df=pd.read_csv("/content/quality/MiningProcess_Flotation_Plant_Database.csv",usecols=[0,1])

need_cols should be like [0,1]

  • Related