77315/unicodedecodeerror-codec-decode-position-invalid-start-byte
hi, guys, I need to deal with a zipped CSV file ......but getting this error again and again
import gzip import csv import pandas as pd with gzip.open(path) as f: features_train = pd.read_csv(f) features_train.head()
Hi@Himanshu,
This type of error will occur if there is any problem to decode any value. To avoid this you can follow the below-given code.
$ features_train = pd.read_csv('csv_file', encoding='ISO-8859–1')
Hey, @Himanshu.
It's still most likely gzipped data. gzip's the magic number is 0x1f 0x8b, which is consistent with the UnicodeDecodeError you get.
You have to use the encoding as latin1 ...READ MORE
Hi, @hala, Regarding your query, you can go ...READ MORE
my code import wordcloud import numpy as np from matplotlib ...READ MORE
I should start by stating that using ...READ MORE
A simple "if" statement should suffice. you ...READ MORE
Try using the following: df['id'] = df.index+1 df.set_index('id').col_name.str.split(',', expand ...READ MORE
Hello @kartik, Try this: import pandas as pd df = ...READ MORE
Thanks, This answer was helpful. READ MORE
Hi@zena, The error is because there is some non-ASCII ...READ MORE
OR
At least 1 upper-case and 1 lower-case letter
Minimum 8 characters and Maximum 50 characters
Already have an account? Sign in.