i have solved this issue.
we can use this code
import codecs
types_of_encoding = ["utf8", "cp1252"]
for encoding_type in types_of_encoding:
with codecs.open(filename, encoding = encoding_type, errors="replace") as csvfile:
your code
....
....
More Related Contents:
- Encoding Error in Panda read_csv [duplicate]
- python pandas read_csv delimiter in column data
- pandas.read_csv from string or package data
- UnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0x8b in position 1: invalid start byte, while reading csv file in pandas
- Pandas ParserError EOF character when reading multiple csv files to HDF5
- bash: Python import – Command not found for pandas
- How to change the location of the column name in pandas?
- How to provide a reproducible copy of your DataFrame with to_clipboard()
- Reading file using relative path in python project
- Relative imports in Python 3
- Relative imports – ModuleNotFoundError: No module named x
- How to get rid of “Unnamed: 0” column in a pandas DataFrame read in from CSV file?
- pandas: merge (join) two data frames on multiple columns
- Pandas Extract Number from String
- Can you encode CR/LF in into CSV files?
- Pandas: ValueError: cannot convert float NaN to integer
- Use Multiple Character Delimiter in Python Pandas read_csv
- Panda’s Write CSV – Append vs. Write
- Pandas number rows within group in increasing order
- Pandas dataframe read_csv on bad data
- Python: create a pandas data frame from a list
- Python pandas: how to remove nan and -inf values
- pandas multiindex – how to select second level when using columns?
- Calculate summary statistics of columns in dataframe
- Python 3 CSV file giving UnicodeDecodeError: ‘utf-8’ codec can’t decode byte error when I print
- double quoted elements in csv cant read with pandas
- how to specify the datetime format in read_csv
- How to combine multiple columns in a DataFrame to Pandas datetime
- UnicodeDecodeError when reading CSV file in Pandas
- How to return a csv file/Pandas DataFrame in JSON format using FastAPI?