i glad for any help because I tried without succeed
I attached link to data in array:
https://pastebin.com/WnQMnn54
thanks
netanel
I attached link to data in array:
https://pastebin.com/WnQMnn54
thanks
netanel
how to parse this array with pandas?
|
i glad for any help because I tried without succeed
I attached link to data in array: https://pastebin.com/WnQMnn54 thanks netanel
I also attached relevant code:
def recursive_indicator(i,rec): li.append(f"{i} is found") try: ax=pd.DataFrame(data=i["relations"]) for xyz in i["relations"]: for tti in ax.values: tti[3]=datetime.datetime.fromtimestamp(tti[3]) tti[4]=datetime.datetime.fromtimestamp(tti[4]) return (ax.to_dict()) if(i["relations"]==None): return li else: if(i==""): rael=[] #ip=ip+1 return li elif(rec>=0): rael=i["relations"] rec=rec-1 #ip=ip+3 if rael == []: li.append(f'{i["id"]}') else: for xx in rael: li.append(recursive_indicator(i=xx,rec=rec)) # ip=ip+2 return li else: return li bx=pd.DataFrame(data=li) cx=pd.DataFrame(data=bx.values[1]) Dx=pd.DataFrame(data=cx.values[0]) Ex=pd.DataFrame(data=Dx.values[0]) ARREX=pd.DataFrame(data=Ex.values[0]) tx="" for i in range(len(bx.value_counts())): tx=tx+ARREX[i] return f"<hr>{li}<a href='/home'>return</a>"
May-18-2022, 06:09 PM
That's a weird array
["{'id': 'ip_address_123.123.123.123', 'indicator': '123.123.123.123', ....
|
|
Possibly Related Threads… | |||||
Thread | Author | Replies | Views | Last Post | |
Python convert csv to json with nested array without pandas | terrydidi | 2 | 11,118 |
Jan-12-2019, 02:25 AM Last Post: terrydidi |