I got the following error when trying to read a file off a network drive for use by Pandas: UnicodeDecodeError Traceback (most recent call last) pandas/_libs/parsers.pyx in pandas._libs.parsers.TextReader._convert_tokens() pandas/_libs/parsers.pyx in pandas._libs.parsers.TextReader._convert_with_dtype() pandas/_libs/parsers.pyx in pandas._libs.parsers.TextReader._string_convert() pandas/_libs/parsers.pyx in pandas._libs.parsers._string_box_utf8() UnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0xb6 in position 136: invalid start byte During handling of the above…(Continue Reading)
Tag: python
OSError: Unable to locate Ghostscript on paths
While reading in an EPS file, I get the error “OSError: Unable to locate Ghostscript on paths” Here’s my code that generates the error: def _readImage(self, image): actual_file = image # Try each, and open the one that actually exists: if exists(CFG.image_source + image.replace(“.gif”, “.eps”)): actual_file = image.replace(“.gif”, “.eps”) elif exists(CFG.image_source + image.replace(“.gif”, “.png”)): actual_file…(Continue Reading)
pd.cut()
pd.cut() is a handy way of converting a linear set of values into categorical values. First, let me point out that pd is not a standard python command. It a common way of referring to the pandas library. You need to import it, and while we are at it, lets import NumPy as well: import…(Continue Reading)