alimanfoo/vcfnp

Use (optionally) pandas instead of view2d

Closed this issue · 2 comments

Pandas is very useful to display tabular data with mixed dtypes. It might be nice to be optionally used to view also heterogeneous dtyped data like view2d uses for homogeneous data.

The disadvantage is that you can't create a view: a new object would need to be created.

Hi Luca, I believe you can construct a pandas dataframe directly from a
numpy recarray. So, e.g., you should be able to do something like:

import vcfnp
import pandas
df = pandas.DataFrame(vcfnp.variants('my.vcf'))

Closing this issue as I believe it is supported by passing recarray as constructor to pandas.DataFrame.