1

I am using following python code to read csv file data :

import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
from sklearn import preprocessing
df = pd.read_csv("D:\Projects\BehaviorMining\breast-cancer.csv")

It returns error

OSError: [Errno 22] Invalid argument: 'D:\Projects\BehaviorMining\x08reast-cancer.csv'

I thought csv file has problem ,because some csv files has no problem with above syntax , but I didn't find any problem in csv file.

Thanks for any guides

0

1 Answer 1

2

Just use single quotation marks only or use 'r' raw string upfront and a single '/'. For example

df = pd.read_csv(r'D:\Projects\BehaviorMining\breast-cancer.csv')
Sign up to request clarification or add additional context in comments.

6 Comments

I think your "and" should be an "or", no? ;)
Oh yeah, my bad. I was typing in a hurry
(not fully sure of my edit I'm not using windows, feel free to remove)
I don't use windows either. Probably someone who does, can make sure it's right xD
Then better leave it out, your initial solution should work for sure
|

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.