Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Python Read CSV File By Pandas

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’

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

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

>Solution :

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')
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading