Python Forum

Full Version: Using VS Code with google cloud
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Using VS Code
I use pandas to import CSV files

    import pandas as pd
    import numpy as np

    import pandas as pd df = pd.read_table('summary.csv', skiprows=3, header=None, names=['id', 'rdate', 'rtype', 'hist', 'scan'], usecols=[0, 1, 2, 3, 4])
When I run the above on my PC C: drive I can access summary.csv and the script run.

I copied the python file and summary.csv to my google drive and tried to run it I get this error:

File b'summary.csv' does not exist

When I run it using PyCharm it works.

Anyone else having this problem?

I worked around the problem by using :

    data_folder = Path('C://Users//gary//pyfiles//charts//')

    # --------------------------------- read from csv ---------------------------
    df = pd.read_csv(data_folder / 'summary.csv', delimiter='\t', skiprows=3, header=None, 
    names=['id', 'rdate', 'rtype', 'hist', 'scan'], usecols=[0, 1, 2, 3, 4])
The problem is that if I want to move the files to another location I will have to edit file again. Not a very good work around.