FDSRashid commited on
Commit
73c9524
·
verified ·
1 Parent(s): ef641ab

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -79,10 +79,11 @@ def visualize_isnad(taraf_num, yaxis):
79
  isnad_in_hadith1 = isnad_hadith['Hadiths Cleaned'].apply(lambda x: taraf_hadith_split[i] in x )
80
  isnad_hadith1 = isnad_hadith[isnad_in_hadith1][['Source', 'Destination']]
81
  G = nx.from_pandas_edgelist(isnad_hadith1, source = 'Source', target = 'Destination', create_using = nx.DiGraph())
82
- node = [int(n) for n, d in G.out_degree() if d == 0][0]
83
- gen_node = narrator_bios[narrator_bios['Rawi ID']==node]['Generation'].iloc[0]
84
- name_node = narrator_bios[narrator_bios['Rawi ID']==node]['Famous Name'].iloc[0]
85
- lst_hadith.append([taraf_matns[i], gen_node, name_node, taraf_book[i], taraf_author[i], taraf_hadith_number[i], str(node), str(i)])
 
86
  df = pd.DataFrame(lst_hadith, columns = ['Matn', 'Generation', 'Name', 'Book_Name', 'Author', 'Book Hadith Number', 'End Transmitter ID', 'Hadith Number'])
87
 
88
  #hadith_cleaned = isnad_info['Hadiths Cleaned'].apply(lambda x: any(i in x for i in taraf_hadith_split) )
 
79
  isnad_in_hadith1 = isnad_hadith['Hadiths Cleaned'].apply(lambda x: taraf_hadith_split[i] in x )
80
  isnad_hadith1 = isnad_hadith[isnad_in_hadith1][['Source', 'Destination']]
81
  G = nx.from_pandas_edgelist(isnad_hadith1, source = 'Source', target = 'Destination', create_using = nx.DiGraph())
82
+ node = [int(n) for n, d in G.out_degree() if d == 0]
83
+ for n in node:
84
+ gen_node = narrator_bios[narrator_bios['Rawi ID']==node]['Generation'].iloc[0]
85
+ name_node = narrator_bios[narrator_bios['Rawi ID']==node]['Famous Name'].iloc[0]
86
+ lst_hadith.append([taraf_matns[i], gen_node, name_node, taraf_book[i], taraf_author[i], taraf_hadith_number[i], str(node), str(i)])
87
  df = pd.DataFrame(lst_hadith, columns = ['Matn', 'Generation', 'Name', 'Book_Name', 'Author', 'Book Hadith Number', 'End Transmitter ID', 'Hadith Number'])
88
 
89
  #hadith_cleaned = isnad_info['Hadiths Cleaned'].apply(lambda x: any(i in x for i in taraf_hadith_split) )