Please, confused with array in python. I want to group array based on the same values.
Code:
enter image description here
id_disease = ['penyakit_tepung','hawar_daun']
for id_disease in id_disease:qres = acacia.query( """PREFIX tst: <http://www.semanticweb.org/aalviian/ontologies/2017/1/untitled-ontology-10#>SELECT ?disease ?patogenWHERE { ?disease tst:caused_by ?patogen . FILTER regex(str(?disease), "%s") .} """ % id_disease )for row in qres:for r in row:print(r.replace('http://www.semanticweb.org/aalviian/ontologies/2017/1/untitled-ontology-10#',''))print("\n")
Output:
penyakit_tepung
spaerotheca_sppenyakit_tepung
oidium_sppenyakit_tepung
erysiphe_sphawar_daun
cylindrocladium_sphawar_daun
kirramyces_sphawar_daun
phaeophleopspora_sp
Expected Array :
[['spaeerotheca_sp','oidium_sp','erysiphe_sp'].['cylindrocladium_sp','kirramyces_sp','phaeophleopspora_sp']]
Please, help me if you know how step to get it.