How to change array<float64> to array<float32>

Hello - I have a table with a field that is <ArrayNumericExpression of type array<float64>> and I’d like to convert to float 32.

Let’s say I have:

ht.describe()

----------------------------------------
Global fields:
    None
----------------------------------------
Row fields:
    'locus': locus<GRCh37> 
    'rsid': str 
    'alleles': array<str> 
    'beta': array<float64> 
----------------------------------------
Key: ['locus']
----------------------------------------

and I want to convert beta to float32.

I’m having a difficult time finding how to change types in the documentation.
Thanks for your help.

t = t.annotate(beta=t.beta.map(hl.float32))
1 Like