# pykx pandas.read\_html() fails to convert string to html table

**URL:** <https://forum.kx.com/t/pykx-pandas-read-html-fails-to-convert-string-to-html-table/13927>\
**Category:** Community Support\
**Tags:** pykx, imported\
**Created:** [May 20, 2024, 4:09pm UTC](https://forum.kx.com/t/pykx-pandas-read-html-fails-to-convert-string-to-html-table/13927 "2024-05-20T16:09:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jameswatt995](https://avatars.discourse-cdn.com/v4/letter/j/51bf81/32.png) [@jameswatt995](https://forum.kx.com/u/jameswatt995)\
**Post date:** [May 20, 2024, 4:09pm UTC](https://forum.kx.com/t/pykx-pandas-read-html-fails-to-convert-string-to-html-table/13927/1 "2024-05-20T16:09:36Z")

</div>

[https://learninghub.kx.com/forums/topic/pykx-pandas-read\_html-fails-to-convert-string-to-html-table](https://learninghub.kx.com/forums/topic/pykx-pandas-read_html-fails-to-convert-string-to-html-table)

Hi   
  
I have started using pykx within my kdb system .   
  
Here's the issue:

(see the photo. something went wrong with the code editor)

```
``
```

I cannot seem to be able to post an example html table, but it fails with any (you can generate a basic one on chatgpt).

This code works well with old embedPy.   
Any ideas ?

---

<div class="post-metadata">

**Author:** ![rocuinneagain](https://sea2.discourse-cdn.com/flex002/user_avatar/forum.kx.com/rocuinneagain/32/287_2.png) [@rocuinneagain](https://forum.kx.com/u/rocuinneagain)\
**Post date:** [May 21, 2024, 9:12am UTC](https://forum.kx.com/t/pykx-pandas-read-html-fails-to-convert-string-to-html-table/13927/2 "2024-05-21T09:12:31Z")

</div>

PyKX converts a q CharVector to Python NumPy array of bytes by default.

[https://code.kx.com/pykx/2.5/pykx-under-q/upgrade.html#functional-differences](https://code.kx.com/pykx/2.5/pykx-under-q/upgrade.html#functional-differences)

``` q).pykx.eval["lambda x: print(type(x))"][test];

q).pykx.eval[“lambda x: print(x)”][test];  
[b’\<’ b’t’ b’a’ b’b’ b’l’ b’e’ b’\>’ b’\<’ b’t’ b’r’ b’\>’ b’\<’ b’t’ b’h’ …

`<p>You can create a helper to convert to strings as you require:</p>`  
q)b2s:.pykx.eval[“lambda x: x.tobytes().decode(‘UTF-8’)”]  
q).pykx.print pd[`:read\_html]b2s[test]

[ First Name Last Name Age  
0 John Doe 30  
1 Jane Smith 25  
2 Emily Jones 22]

```auto

```
