LIMITED TIME OFFER: 50% OFF OF PREMIUM WITH OUR ANNUAL PLAN (THAT'S $294 IN SAVINGS).
GET OFFER

Can't Read In SEDE DSSE database In Guided Project: Popular Data Science Questions

Hello Friends, i have tried to read in the database i.e the Stack Exchange datascience questions from 2019 with the following, but no luck.

I imported a few libraries first

import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import numpy as np

Then tried to read in the database. I am still stuck here. Errors toggle between “FileNotFoundErrorTraceback (most recent call last)” and ’ SyntaxError unicode error unicodeescape codec can t decode bytes in position 2-3 truncated UXXXXXXXX escape"

data_questions = pd.read_csv("C:\Users\DELL\Downloads\2019_Questions.csv", encoding = 'latin1')

data_questions = pd.read_csv(r"C:\Users\DELL\Downloads\2019_Questions.csv", encoding = 'latin1')

data_questions = pd.read_csv(r"C:\Users\DELL\Downloads\2019_Questions.csv")

data_questions = pd.read_csv("C:\Users\DELL\Downloads\2019_Questions.csv")

data_questions = pd.read_csv("C:\\Users\\DELL\\Downloads\\2019_Questions.csv")

data_questions = pd.read_csv(r"C:\\Users\\DELL\\Downloads\\2019_Questions.csv")

data_questions = pd.read_csv(r"C:/Users/DELL/Downloads/2019_Questions.csv")

data_questions = pd.read_csv("C:/Users/DELL/Downloads/2019_Questions.csv")

Someone please advise what is wrong. I even changed file location

data_questions = pd.read_csv("Desktop\2019_questions.csv", encoding = 'latin1")

A File Not Found Error implies that either the file you provide the path to is not there or the path is incorrect.

These errors are more difficult to debug, especially since you are working on your local system. I would recommend going through the suggested approaches in the answers here - python - (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape - Stack Overflow which wouuld be very relevant since this seems to be Windows related.

You should be getting that error for some of your attempts, but not for others. Without knowing the error for “the others”, it’s hard to guide you to the answer.