Skip to content

Commit

Permalink
provide pandas with a valid encoding string for each file to read
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan Jurgen Griesfeller committed Aug 14, 2023
1 parent 4e61e0f commit 477eb1a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions pyaerocom/io/read_airnow.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class ReadAirNow(ReadUngriddedBase):
_FILEMASK = f"/**/*{_FILETYPE}"

#: Version log of this class (for caching)
__version__ = "0.07"
__version__ = "0.08"

#: Column delimiter
FILE_COL_DELIM = "|"
Expand Down Expand Up @@ -285,7 +285,11 @@ def _read_file(self, file):
# determine file encoding first and provide that to pandas
encoding = self.get_file_encoding(file)
df = pd.read_csv(
file, sep=self.FILE_COL_DELIM, names=self.FILE_COL_NAMES, encoding=encoding
file,
sep=self.FILE_COL_DELIM,
names=self.FILE_COL_NAMES,
encoding=encoding,
on_bad_lines="skip",
)
return df

Expand Down

0 comments on commit 477eb1a

Please sign in to comment.