Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Importing data
#1
Hi everyone,

I cannot seem to import data (I'm using spyder). I do the following code:

data = pd.read_csv('Python for Data Analysis/chap 6.csv'
data.head()


for that code I get the error:
FileNotFoundError: File b'Python for Data Analysis/chap 6.csv' does not exist

I also try the full path:
data = pd.read_csv('C:\Users\SGrah\OneDrive\Documents\Python Scripts\Python for Data Analysis/chap 6.csv'
data.head()


I get the error:
data = pd.read_csv('C:\Users\SGrah\OneDrive\Documents\Python Scripts\Python for Data Analysis\chap 6.csv')
^
SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape

Any help is appreciated.
Thanks
Reply


Messages In This Thread
Importing data - by Scott - May-10-2018, 08:37 AM
RE: Importing data - by petertyler - May-10-2018, 09:39 AM
RE: Importing data - by Scott - May-11-2018, 03:37 AM
RE: Importing data - by petertyler - May-12-2018, 11:13 AM
RE: Importing data - by snippsat - May-12-2018, 11:22 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  ssues with importing data from ODBC Slavek_d 1 1,435 Feb-01-2022, 09:57 AM
Last Post: ibreeden
  Importing python data to Textfile or CSV yanDvator 0 1,786 Aug-02-2020, 06:58 AM
Last Post: yanDvator
  Importing data from a text file into an SQLite database with Python macieju1974 7 4,222 Jun-29-2020, 08:51 PM
Last Post: buran
  Importing csv data into sql lite cant figure it out. jimmyvegas29 5 3,819 Jul-16-2018, 02:02 AM
Last Post: jimmyvegas29

Forum Jump:

User Panel Messages

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