TypeError: Parameter 'metadata' received Metadata as an argument, which is incompatible with parameter type: MetadataColumn[Categorical]
.get_column('name_of_column_w_categorical_type')
to check if column is numeric/categorical:
!metadata.actions.tabulate?
tabulate = metadata.actions.tabulate(sample_metadata)
tabulate.visualization #displays metadata table and whether columns numeric or categorical
e.g. .get_column('name_of_column_w_categorical_type')
uUniFrac_Subject_significance = diversity.actions.beta_group_significance(core_metrics.unweighted_unifrac_distance_matrix,
sample_metadata.get_column('name_of_column_w_categorical_type'))
1 Like
Oddant1
(Anthony Simard)
May 23, 2023, 11:01pm
2
Hello @kristinachan , what command did you run that created this error? It looks like you passed a Metadata object into a command that requires a Categorical column. In order to get a column you call .get_column("column name")
on your Metadata object.
1 Like
the original code that generated the error:
uUniFrac_Subject_significance = diversity.actions.beta_group_significance(core_metrics.unweighted_unifrac_distance_matrix,
sample_metadata)
^i.e. without .get_column()
Was trying to document how I solved it to improve documentation of errors. Thanks for the kind attention!
1 Like
Oddant1
(Anthony Simard)
May 24, 2023, 8:52pm
5
Oh, thank you! Has the issue been resolved?
Yes, thank you! much appreciated
system
(system)
Closed
June 25, 2023, 11:03pm
8
This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.