Primary competition visual

Fault Impact Analysis: Towards Service-Oriented Network Operation & Maintenance by ITU

8 000 CHF
Completed (over 2 years ago)
Classification
273 joined
89 active
Starti
Jul 26, 23
Closei
Aug 18, 23
Reveali
Aug 18, 23
User avatar
RareGem
Loading the data using pandas
Help · 6 Aug 2023, 13:09 · 13

Please,can someone help me out,I want to load the dataset. I have been getting error

Discussion 13 answers

what error?

6 Aug 2023, 13:14
Upvotes 0
User avatar
RareGem

'utf-8' codec can't decode byte 0xe7 in position 8: invalid continuation byte

I already asked you to report the file that cause you the error. I can successfully load all the files in the test set.

6 Aug 2023, 16:10
Upvotes 0
User avatar
RareGem

Thank you for your answer. Please, the data I downloaded was validation clean.rar. Is like I'm getting something wrong. Help me

User avatar
Sidereus

Works for me:

import pandas as pd

example = pd.read_csv("train_test_dataset_Fault Impact Analysis/B0001-12_1.csv.csv")

6 Aug 2023, 17:44
Upvotes 0
User avatar
RareGem

Thank you for your answer. Please, the data I downloaded was validation clean.rar. Is like I'm getting something wrong. Help me

Is this a joke? You need to unzip the rar.

User avatar
RareGem

I did by extracting the file. To load the extracted file on google colab is where I'm having the issue

User avatar
RareGem

How did you load your file on google colab that you are able to view the tabular data

User avatar
Sidereus

Hello.

This is a way to extract the files from the zip and then import them with pandas.

You just have to change the path of the "file_name" that you have in Google Colab.

I hope it is useful for you.

# importing libraries

import zipfile

import os

import pandas as pd

# File zip

file_name = "train_test_dataset_Fault Impact Analysis.zip"

# extracting zipfile

with zipfile.ZipFile(file_name) as zf:

list_files = zf.namelist()

[zf.extract(i) for i in list_files]

# Optional: deleting the zipfile from the directory

os.remove(file_name)

# loading data from the file

data = pd.read_csv('train_test_dataset_Fault Impact Analysis/B0001-12_1.csv.csv')

data.head()

User avatar
RareGem

Is it the file name I should change bc the data I downloaded from the website is a rare file. I'm not using local machine

User avatar
RareGem

No file named "train_test_dataset_fault_fault_impact_analysis"

User avatar
RareGem

Thank you your explanation so far. I tried what you sent. It works but I'm with last two codes. This the error I got:

FileNotFoundError: [Errno 2] No such file or directory: 'train_test_dataset_Fault Impact Analysis/B0001-12_1.csv.csv'

In [ ]:

​
How should I solve this problem