May-17-2022, 12:30 PM
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?
|
May-17-2022, 12:30 PM
i glad for any help because I tried without succeed
I attached link to data in array: https://pastebin.com/WnQMnn54 thanks netanel
May-17-2022, 12:42 PM
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>" |
|
Possibly Related Threads… | |||||
Thread | Author | Replies | Views | Last Post | |
Read json array data by pandas | vipinct | 0 | 1,972 |
Apr-13-2020, 02:24 PM Last Post: vipinct |
|
Parse XML String in Pandas Dataframe | creedX | 2 | 6,944 |
Dec-09-2019, 07:35 PM Last Post: creedX |
|
How to use pandas.rolling mean for 3D input array? | Prv_Yadv | 1 | 3,884 |
Mar-26-2019, 11:49 AM Last Post: scidam |