FDSRashid commited on
Commit
1f156de
·
verified ·
1 Parent(s): 9d87698

fixed bug with select columns

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -224,7 +224,7 @@ def visualize_subTaraf(taraf_num, hadith_str, yaxis):
224
  list_of_lists = [hadith_lookup[i] for i in taraf_hadith]
225
  flattened = list(set([elem for sublist in list_of_lists for elem in sublist]))
226
 
227
- isnad_hadith = isnad_info.iloc[flattened][['Source', 'Destination']]
228
  isnad_hadith[['Source', 'Destination']] = isnad_hadith[['Source', 'Destination']].astype(int)
229
 
230
  # Merge isnad_hadith with narrator_bios for Teacher and Student
@@ -272,7 +272,7 @@ def visualize_hadith_isnad(df, yaxis):
272
  list_of_lists = [hadith_lookup[i] for i in taraf_hadith]
273
  flattened = list(set([elem for sublist in list_of_lists for elem in sublist]))
274
 
275
- isnad_hadith = isnad_info.iloc[flattened][['Source', 'Destination']]
276
  isnad_hadith[['Source', 'Destination']] = isnad_hadith[['Source', 'Destination']].astype(int)
277
 
278
  # Merge isnad_hadith with narrator_bios for Teacher and Student
@@ -330,7 +330,7 @@ def visualize_narrator_taraf(taraf_num, narrator, yaxis):
330
 
331
  # Process each hadith in taraf_hadith_split
332
  for idx, split_hadith in enumerate(taraf_hadith):
333
- isnad_hadith1 = isnad_info.iloc[hadith_lookup[taraf_hadith[i]]][['Source', 'Destination']]
334
  G1 = nx.from_pandas_edgelist(isnad_hadith1, source='Source', target='Destination', create_using=nx.DiGraph())
335
  if narrator in G1.nodes:
336
  matns_with_narrator.append(taraf_hadith[idx])
 
224
  list_of_lists = [hadith_lookup[i] for i in taraf_hadith]
225
  flattened = list(set([elem for sublist in list_of_lists for elem in sublist]))
226
 
227
+ isnad_hadith = isnad_info.iloc[flattened]
228
  isnad_hadith[['Source', 'Destination']] = isnad_hadith[['Source', 'Destination']].astype(int)
229
 
230
  # Merge isnad_hadith with narrator_bios for Teacher and Student
 
272
  list_of_lists = [hadith_lookup[i] for i in taraf_hadith]
273
  flattened = list(set([elem for sublist in list_of_lists for elem in sublist]))
274
 
275
+ isnad_hadith = isnad_info.iloc[flattened]
276
  isnad_hadith[['Source', 'Destination']] = isnad_hadith[['Source', 'Destination']].astype(int)
277
 
278
  # Merge isnad_hadith with narrator_bios for Teacher and Student
 
330
 
331
  # Process each hadith in taraf_hadith_split
332
  for idx, split_hadith in enumerate(taraf_hadith):
333
+ isnad_hadith1 = isnad_info.iloc[hadith_lookup[taraf_hadith[i]]]
334
  G1 = nx.from_pandas_edgelist(isnad_hadith1, source='Source', target='Destination', create_using=nx.DiGraph())
335
  if narrator in G1.nodes:
336
  matns_with_narrator.append(taraf_hadith[idx])