Colab google: downloading csv from your PC I had the same problem with an excel file (* .xlsx), I solved the problem as follows, and I think you can do the same with csv files: - If you have a file on your PC, called (file.xlsx), then: 1- Download it from your hard drive using this simple code:
from google.colab import files uploaded = files.upload()
Click (Select Files) and upload it to your Google drive.
2- Then:
import io data = io.BytesIO(uploaded['file.XLSX'])
3- Finally, read your file:
import pandas as pd f = pd.read_excel(data , sheet_name = '1min', header = 0, skiprows = 2)
4- Please change the parameter values ββto read your own file. I think that this could be generalized to read other types of files!
Enjoy it!
source share