Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- data = []
- for i in d['items']:
- start_time = i["start_time"]
- end_time = i["end_time"]
- for k in i["alternatives"]:
- content = k["content"]
- data.append([start_time,end_time,content])
- 0 list 3 [6.367, 6.597, 'Hi']
- 1 list 3 [None, None, ',']
- 2 list 3 [6.597, 6.727, 'good']
- 3 list 3 [6.727, 6.987, 'afternoon']
- 4 list 3 [None, None, '.']
- 5 list 3 [6.987, 7.117, 'Thank']
- 0 list 2 [0.7500000000000004, 'christian_agent']
- 1 list 2 [4.949999999999997, 'christian_agent']
- 2 list 2 [12.659999999999922, 'christian_agent']
- 3 list 2 [21.57000000000006, 'christian_agent']
- 4 list 2 [27.810000000000297, 'christian_agent']
- 5 list 2 [36.75000000000063, 'christian_agent']
- 6 list 2 [47.55000000000104, 'christian_agent']
- 0 float 1 1.350000000000001
- 1 float 1 10.529999999999967
- 2 float 1 16.28999999999986
- 3 float 1 25.620000000000214
- 4 float 1 29.820000000000373
- 5 float 1 37.44000000000066
- 6 float 1 48.21000000000107.
- import numpy as np
- import pandas as pd
- df= pd.DataFrame(data)
- df=df.dropna(how='any')
- for start1,end1 in zip(start,end):
- start_time = start1
- end_time = end1
- for i, row in df.iterrows():
- start_word=row[0]
- end_word=row[1]
- content=row[2]
- if start_time >= start_word and end_time <= end_word:
- content1 = np.where[start_time >= start_word and end_time<=end_word]
Add Comment
Please, Sign In to add comment