fetch name and categories

This commit is contained in:
shoney 2023-06-25 07:46:43 +00:00
parent 0176e7b9ab
commit fc55c7b5dc
2 changed files with 18 additions and 3 deletions

View file

@ -1,4 +1,6 @@
import pandas as pd
import numpy as np
from pandas.api.types import CategoricalDtype
class DataFrame:
def __init__(self,es):
self.es = es
@ -20,7 +22,7 @@ class DataFrame:
list_row["category"]=cats["label"]
if(list_row):
if(list_row["name"]!=None and list_row["category"]!=None):
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
@ -29,3 +31,5 @@ class DataFrame:

View file

@ -1,6 +1,8 @@
from ElasticSearchClass import ElasticSearchDb
from DataFrameClass import DataFrame
import pandas as pd
def main():
es =ElasticSearchDb("http://172.17.212.35:9200")
@ -9,7 +11,16 @@ def main():
df_eng=df.create()
print(df_eng)
# print(df_eng)
# df_eng["category"].astype("category")
# df =df_eng["category"].isnull()
# bool_name_series = pd.notnull(df_eng["name"])
bool_cat_series = pd.isnull(df_eng["name"])
print(df_eng[bool_cat_series])