0

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

Ali Rad
  • 78
  • 7

1 Answers1

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')
mozway
  • 194,879
  • 13
  • 39
  • 75
adiaux
  • 103
  • 8