Guest User

Untitled

a guest
Nov 20th, 2018
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.44 KB | None | 0 0
  1. data = []
  2. for i in d['items']:
  3. start_time = i["start_time"]
  4. end_time = i["end_time"]
  5. for k in i["alternatives"]:
  6. content = k["content"]
  7. data.append([start_time,end_time,content])
  8.  
  9. 0 list 3 [6.367, 6.597, 'Hi']
  10. 1 list 3 [None, None, ',']
  11. 2 list 3 [6.597, 6.727, 'good']
  12. 3 list 3 [6.727, 6.987, 'afternoon']
  13. 4 list 3 [None, None, '.']
  14. 5 list 3 [6.987, 7.117, 'Thank']
  15.  
  16. 0 list 2 [0.7500000000000004, 'christian_agent']
  17. 1 list 2 [4.949999999999997, 'christian_agent']
  18. 2 list 2 [12.659999999999922, 'christian_agent']
  19. 3 list 2 [21.57000000000006, 'christian_agent']
  20. 4 list 2 [27.810000000000297, 'christian_agent']
  21. 5 list 2 [36.75000000000063, 'christian_agent']
  22. 6 list 2 [47.55000000000104, 'christian_agent']
  23.  
  24. 0 float 1 1.350000000000001
  25. 1 float 1 10.529999999999967
  26. 2 float 1 16.28999999999986
  27. 3 float 1 25.620000000000214
  28. 4 float 1 29.820000000000373
  29. 5 float 1 37.44000000000066
  30. 6 float 1 48.21000000000107.
  31.  
  32. import numpy as np
  33. import pandas as pd
  34. df= pd.DataFrame(data)
  35. df=df.dropna(how='any')
  36. for start1,end1 in zip(start,end):
  37. start_time = start1
  38. end_time = end1
  39. for i, row in df.iterrows():
  40. start_word=row[0]
  41. end_word=row[1]
  42. content=row[2]
  43. if start_time >= start_word and end_time <= end_word:
  44. content1 = np.where[start_time >= start_word and end_time<=end_word]
Add Comment
Please, Sign In to add comment