doc
This commit is contained in:
parent
045889b70b
commit
0176e7b9ab
1 changed files with 8 additions and 5 deletions
|
|
@ -9,18 +9,21 @@ class DataFrame:
|
|||
resp=self.es.getFeatures()
|
||||
|
||||
for hit in resp['hits']['hits']:
|
||||
list_row =[]
|
||||
list_row = dict (name=None,category=None)
|
||||
for name in hit['_source']['nameSource']:
|
||||
if (name["language"]=="en"):
|
||||
list_row.append((name["value"]))
|
||||
if (name["language"]=="en"):
|
||||
list_row["name"]=name["value"]
|
||||
|
||||
|
||||
for cats in hit['_source']['categoriesSource']:
|
||||
if (cats["language"]=="en"):
|
||||
list_row.append((cats["label"]))
|
||||
list_row["category"]=cats["label"]
|
||||
|
||||
|
||||
df_eng.loc[len(df_eng)] = list_row
|
||||
if(list_row):
|
||||
new_row = pd.Series(list_row)
|
||||
df_eng=pd.concat([df_eng, new_row.to_frame().T], ignore_index=True)
|
||||
# df_eng.loc[len(df_eng)] = list_row
|
||||
|
||||
return df_eng
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue