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

CSV file can't be read using great expectation

when I run this code on pycharm using python:

import great_expectations as ge
df=ge.read_csv("C:\Users\TasbeehJ\data\yellow_tripdata_2019-02.csv")

it gave me this error:

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

SyntaxError: (unicode error) ‘unicodeescape’ codec can’t decode bytes in position 2-3: truncated \UXXXXXXXX escape

how to solve it?

>Solution :

The esiast way whould be to add an r to use the \as a sign and not an escape value.

import great_expectations as ge 
df=ge.read_csv(r"C:\Users\TasbeehJ\data\yellow_tripdata_2019-02.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