Hello!
Your pd dataframe should contain 2 columns, Feature ID and Taxon. In Taxon column, all taxonomy levels should be merged in one string, separated by ";". When your table is ready, save it as a tsv file (your_table.to_csv("taxonomy.tsv", sep="\t"). If feature ids column in your dataframe is not an index (your rows are numbered), then you will need to drop index while writing it to tsv table (something like index= False). Then you can import it to Qiime2. In this thread you can find example commands and format.
1 Like