You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following post was exported from discuss.hail.is, a forum for asking questions about Hail which has since been deprecated.
(Nov 25, 2021 at 04:37) Gopi said:
Hi, MatrixTable 's annotate_cols adds new column fields. Table 's annotate adds new row fields.
Is there any way to add a new column to the hail table? We tried the below code but its throwing the following error “TypeError: ‘Table’ object does not support item assignment”
We try to avoid calling table fields “columns” because “column” has a particular meaning for matrix tables, and also often connotes homogenous kinds of data between columns.
The analog of a Pandas DataFrame ‘column’ is a table row field. annotate is exactly what you need here:
Is there a way to specify the location of the new fields? For example, creating FID and IID fields to place in the first 2 collumns of the table. The default is to add them at the end.
(Mar 12, 2024 at 16:47) patrick-schultz said:
Generally we don’t consider the order of fields significant. Why do you want them first?
(Mar 12, 2024 at 17:10) danking said:
I assume you want this for export. I think the only way to achieve this is:
key=ht.keyht=ht.key_by()
ht=ht.order_by(*key)
ht=ht.select(fields, in, the, order, you, want, ...)
ht.export(...)
The text was updated successfully, but these errors were encountered:
Note
The following post was exported from discuss.hail.is, a forum for asking questions about Hail which has since been deprecated.
(Nov 25, 2021 at 04:37) Gopi said:
Hi,
MatrixTable
'sannotate_cols
adds new column fields.Table
'sannotate
adds new row fields.Is there any way to add a new column to the hail table? We tried the below code but its throwing the following error “TypeError: ‘Table’ object does not support item assignment”
Code: ht[‘esp6500siv2_all’] = ht[‘AA_AF’]+ht[‘EA_AF’]
Regards,
Gopi
(Nov 25, 2021 at 14:25) tpoterba said:
We try to avoid calling table fields “columns” because “column” has a particular meaning for matrix tables, and also often connotes homogenous kinds of data between columns.
The analog of a Pandas DataFrame ‘column’ is a table row field.
annotate
is exactly what you need here:(Mar 12, 2024 at 13:02) jjfarrell said:
Is there a way to specify the location of the new fields? For example, creating FID and IID fields to place in the first 2 collumns of the table. The default is to add them at the end.
(Mar 12, 2024 at 16:47) patrick-schultz said:
Generally we don’t consider the order of fields significant. Why do you want them first?
(Mar 12, 2024 at 17:10) danking said:
I assume you want this for export. I think the only way to achieve this is:
The text was updated successfully, but these errors were encountered: