Reputation: 57
I am trying to open a dataset saved as a csv on Jupyter Notebook. I saved the dataset on my desktop:
data <- read.csv("Desktop/dataset1.csv")
I am getting the following error:
Warning message in file(file, "rt"): “cannot open file '"Desktop/dataset1.csv": No such file or directory” Error in file(file, "rt"): cannot open the connection Traceback:
- read.csv("\u2068/Desktop\u2069/dataset1.csv")
- read.table(file = file, header = header, sep = sep, quote = quote, . dec = dec, fill = fill, comment.char = comment.char, ...)
- file(file, "rt")
Can anyone understands what is going on? I am learning how to use Jupyter Notebook and I cannot find an answer online.
Upvotes: 0
Views: 5491
Reputation: 6567
Upload the file as in the red highlight in this screenshot. The uploaded file will then be local to any notebooks created in the same folder.
So your code would be
read.csv("yourfile.csv")
Upvotes: 0
Reputation: 11
There's another way to read file using relative path:
setwd() : set working directory
getwd() : get working directory
if you put your file in desktop,it will be like this:
setwd("C:/User/user/dektop")
a <- read.csv("filename.csv")
Upvotes: 0