Python Forum
Using VS Code with google cloud
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Using VS Code with google cloud
#1
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.
Gary
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Deploy Python to Cloud and save output to Google Drive chandrabr80 2 1,561 Jan-25-2022, 06:56 AM
Last Post: ndc85430
Question Google Foobar- Code works in my IDE but not in foobar. Static method? pr3ttykitty 4 4,948 Feb-24-2021, 05:03 PM
Last Post: nilamo
  how to import files in Google Collab wihout downloading them to PC and to Google Disk sveto4ka 9 3,873 Jun-03-2020, 12:40 PM
Last Post: sveto4ka
  Upload files to Google/Azure/AWS or cloud drives using python tej7gandhi 0 1,911 May-11-2019, 03:02 PM
Last Post: tej7gandhi
  Code Wireless Temperature sensor and send sensor readings to google sheet jenkins43 0 2,192 Nov-29-2018, 12:44 PM
Last Post: jenkins43
  Google Cloud Vision: Extracting Location of Text pablo_castano 0 2,653 Jun-24-2018, 02:47 AM
Last Post: pablo_castano
  Google Cloud App Deployment Help.. BlackHeart 1 2,978 Nov-14-2017, 01:58 PM
Last Post: sparkz_alot

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020