Error when opening CEL files in python
0
0
Entering edit mode
5 weeks ago
Paula • 0

Hi! I am trying to open a CEL file using:

with open("pathtofile/file.CEL", "r") as handle:
  c = CelFile.read(handle)

and it is returning the error:

---------------------------------------------------------------------------
UnicodeDecodeError                        Traceback (most recent call last)
<ipython-input-24-1a8e8da51c49> in <module>()
      1 with open("/content/drive/MyDrive/explore genomics/MB-7138.CEL", "r") as handle:
----> 2   c = CelFile.read(handle)

1 frames
/usr/lib/python3.7/codecs.py in decode(self, input, final)
    320         # decode input (taking the buffer into account)
    321         data = self.buffer + input
--> 322         (result, consumed) = self._buffer_decode(data, self.errors, final)
    323         # keep undecoded input until the next call
    324         self.buffer = data[consumed:]

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc8 in position 426: invalid continuation byte

Has anybody encountered this before? Thanks

python • 151 views
ADD COMMENT
1
Entering edit mode

This is usually a LOCALE issue in your terminal. Take a look at a guide like: https://webkul.com/blog/setup-locale-python3/

ADD REPLY
0
Entering edit mode

Already answered here

ADD REPLY

Login before adding your answer.

Traffic: 2430 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6