# Export column of table as pandas or numpy.ndarray

**URL:** <https://discuss.hail.is/t/export-column-of-table-as-pandas-or-numpy-ndarray/1651>\
**Category:** Hail Query & hailctl\
**Created:** [September 11, 2020, 9:31pm UTC](https://discuss.hail.is/t/export-column-of-table-as-pandas-or-numpy-ndarray/1651 "2020-09-11T21:31:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![nonchev](https://avatars.discourse-cdn.com/v4/letter/n/54ee81/32.png) [@nonchev](https://discuss.hail.is/u/nonchev)\
**Post date:** [September 11, 2020, 9:31pm UTC](https://discuss.hail.is/t/export-column-of-table-as-pandas-or-numpy-ndarray/1651/1 "2020-09-11T21:31:40Z")

</div>

Hello,

I have a table ht which has a column named GQ, what is the best way to export  
ht.GQ as a pandas or numpy object?

I found:

> ht.GQ.\_to\_table(‘ok’)[1].to\_pandas()

But I am not sure if this is the best way to do it.

Thanks,

---

<div class="post-metadata">

**Author:** ![tpoterba](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/tpoterba/32/61_2.png) [@tpoterba](https://discuss.hail.is/u/tpoterba)\
**Post date:** [September 12, 2020, 3:25pm UTC](https://discuss.hail.is/t/export-column-of-table-as-pandas-or-numpy-ndarray/1651/2 "2020-09-12T15:25:10Z")

</div>

You can get a python list of ints with:

```auto
ht.GQ.collect()

```

Then convert to numpy/pandas as normal.

However, I really wouldn’t recommend this approach, and if you’re mixing Hail/numpy/pandas then you’re going to hit scaling issues really quickly.

---

<div class="post-metadata">

**Author:** ![nonchev](https://avatars.discourse-cdn.com/v4/letter/n/54ee81/32.png) [@nonchev](https://discuss.hail.is/u/nonchev)\
**Post date:** [September 12, 2020, 3:28pm UTC](https://discuss.hail.is/t/export-column-of-table-as-pandas-or-numpy-ndarray/1651/3 "2020-09-12T15:28:52Z")

</div>

My idea is to use Hail internally for my project, but in the end of the day I want to return to the end user a numpy.matrix with numbers, which is required for the rest of his/her pipeline.

---

<div class="post-metadata">

**Author:** ![tpoterba](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.hail.is/tpoterba/32/61_2.png) [@tpoterba](https://discuss.hail.is/u/tpoterba)\
**Post date:** [September 12, 2020, 3:38pm UTC](https://discuss.hail.is/t/export-column-of-table-as-pandas-or-numpy-ndarray/1651/4 "2020-09-12T15:38:23Z")

</div>

ah, okay. In that case, this seems fine.
