Primary competition visual

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

8 000 CHF
Completed (~3 years ago)
Classification
284 joined
88 active
Starti
26 Jul 23
Closei
18 Aug 23
Reveali
18 Aug 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
User avatar
Upvotes 0
User avatar
RareGem

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

Upvotes 0
User avatar

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

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

Upvotes 0
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")

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

Upvotes 0
User avatar

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

Upvotes 0
User avatar
RareGem

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

Upvotes 0
User avatar
RareGem

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

Upvotes 0
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()

Upvotes 1
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

Upvotes 0
User avatar
RareGem

No file named "train_test_dataset_fault_fault_impact_analysis"

Upvotes 0
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                                                        
Upvotes 0