<p>The error I see is,</p>
<blockquote>
<p>UnicodeDecodeError: 'charmap' codec can't decode byte 0x90 in position
2440: character maps to </p>
</blockquote>
<p>This suggests there is an error in the input format that the program doesn't like.</p>
<p>The thing that bothers me is why you have a mix of / and \ for directory paths. Windows uses \ and Linux and OS X use / . I don't Windows so I really can't comment.</p>
<ol>
<li>It looks like you've used a character at position 2440 that the code doesn't like, this is often the case with ambiguous characters such as degenerate nucleotides or ambiguity codes for example &quot;?&quot; or &quot;N&quot;. It seems to suggest its neither or these but something like ...</li>
<li>I'd be cautious of is the carriage returns because Windows is of course very different to Linux in this regard. \r (I think) versus \n</li>
</ol>
<p><code>undefined</code> mapping suggests is quite a specific error and therefore resolvable.</p>

CC BY-SA 4.0
2020-11-15T23:58:56.307Z
2020-11-15T23:58:56.307Z
M__
<p>from cmapPy.pandasGEXpress.parse import parse</p>
<p>from cmapPy.pandasGEXpress.write import write</p>
<p>parse(&quot;C:/Users/User/Desktop/gctx/CAS9_BASELINE_LEVEL3_BING__n10721x10174.gctx&quot;)</p>

CC BY-SA 4.0
2023-04-19T01:46:42.810Z
2023-04-19T01:47:13.393Z
2023-04-19T01:47:13.393Z
ShengHui Guan
<p>I'm trying to read gctx files with <a href="https://pypi.org/project/cmapPy/" rel="nofollow noreferrer">cmapPy</a>. This is my code:</p>
<pre><code>from cmapPy.pandasGEXpress.parse_gct import parse
from cmapPy.pandasGEXpress.write_gct import write
parse(&quot;C:/Users/User/Desktop/gctx/CAS9_BASELINE_LEVEL3_BING__n10721x10174.gctx&quot;)
</code></pre>
<p>This is the error:</p>
<pre><code>(base) C:\Users\User\Desktop\hello&gt;D:/anaconda/python.exe c:/Users/User/Desktop/gctx/readgcxtx.py
Traceback (most recent call last):
  File &quot;c:/Users/User/Desktop/gctx/readgcxtx.py&quot;, line 3, in &lt;module&gt;
    parse(&quot;C:/Users/User/Desktop/gctx/CAS9_BASELINE_LEVEL3_BING__n10721x10174.gctx&quot;)
  File &quot;D:\anaconda\lib\site-packages\cmapPy\pandasGEXpress\parse_gct.py&quot;, line 136, in parse
    num_row_metadata, num_col_metadata) = read_version_and_dims(file_path)
  File &quot;D:\anaconda\lib\site-packages\cmapPy\pandasGEXpress\parse_gct.py&quot;, line 168, in  read_version_and_dims
    version = f.readline().strip().lstrip(&quot;#&quot;)
  File &quot;D:\anaconda\lib\encodings\cp1252.py&quot;, line 23, in decode
    return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x90 in position 2440: character maps to &lt;undefined&gt;
</code></pre>
<p>I tried changing the path with double slashes or r&quot;...&quot; but it doesn't work. Thanks.</p>

<python><phylogeny><anaconda><phylogenetic>
cmapPy exception
# cmapPy exception

(Asked by: username_0 on 2020-11-13)

I'm trying to read gctx files with cmapPy. This is my code:
from cmapPy.pandasGEXpress.parse_gct import parse
from cmapPy.pandasGEXpress.write_gct import write
parse("C:/Users/User/Desktop/gctx/CAS9_BASELINE_LEVEL3_BING__n10721x10174.gctx")

This is the error:
(base) C:\Users\User\Desktop\hello>D:/anaconda/python.exe c:/Users/User/Desktop/gctx/readgcxtx.py
Traceback (most recent call last):
  File "c:/Users/User/Desktop/gctx/readgcxtx.py", line 3, in 
    parse("C:/Users/User/Desktop/gctx/CAS9_BASELINE_LEVEL3_BING__n10721x10174.gctx")
  File "D:\anaconda\lib\site-packages\cmapPy\pandasGEXpress\parse_gct.py", line 136, in parse
    num_row_metadata, num_col_metadata) = read_version_and_dims(file_path)
  File "D:\anaconda\lib\site-packages\cmapPy\pandasGEXpress\parse_gct.py", line 168, in  read_version_and_dims
    version = f.readline().strip().lstrip("#")
  File "D:\anaconda\lib\encodings\cp1252.py", line 23, in decode
    return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x90 in position 2440: character maps to 

I tried changing the path with double slashes or r"..." but it doesn't work. Thanks.

**Tags:** python, phylogeny, anaconda, phylogenetic

---

## 2 answers

### Answer by username_1 on 2020-11-15. Score: 1

The error I see is,

> UnicodeDecodeError: 'charmap' codec can't decode byte 0x90 in position
> 2440: character maps to

This suggests there is an error in the input format that the program doesn't like.

The thing that bothers me is why you have a mix of / and \ for directory paths. Windows uses \ and Linux and OS X use / . I don't Windows so I really can't comment.

1. It looks like you've used a character at position 2440 that the code doesn't like, this is often the case with ambiguous characters such as degenerate nucleotides or ambiguity codes for example "?" or "N". It seems to suggest its neither or these but something like ...
2. I'd be cautious of is the carriage returns because Windows is of course very different to Linux in this regard. \r (I think) versus \n

`undefined` mapping suggests is quite a specific error and therefore resolvable.


---

### Answer by username_2 on 2023-04-19. Score: 0

from cmapPy.pandasGEXpress.parse import parse

from cmapPy.pandasGEXpress.write import write

parse("C:/Users/User/Desktop/gctx/CAS9\_BASELINE\_LEVEL3\_BING\_\_n10721x10174.gctx")


---

