Issue
I just copy-pasted this code block which I want to use on my script but this throwing red mark by pylance saying "(" "[" "{" was not closed, but I cannot find where I missed those, everything looks perfect for me
for idx, sentence in enumerate(sentences):
text = sentence['text'].lower()
sentence['audio'].export('books/audio_output/sample-'+str(idx)+'.mp3', format="mp3")
temp_df = pd.DataFrame([{'filename':'sample-'+str(idx)+'.mp3",'text':text,'up_votes':0,'down_votes':0,'age':0,'gender':'male','accent':','duration':'}], columns=['filename','text','up_votes','down_votes','age','gender','accent','duration'])
df = df.append(temp_df)
Solution
temp_df = pd.DataFrame([{'filename':'sample-'+str(idx)+".mp3",
'text':text,'up_votes':0,'down_votes':0,'age':0,'gender':'male','accent':'','duration':''}],
columns=['filename','text','up_votes','down_votes','age','gender','accent','duration'])
df = df.append(temp_df)
Answered By - DataSciRookie
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.