I have two sets
tf_ar=[0.0,0.032,0.235,0.65,0,....] and
idf=[1.2,1.6,0.68,....]
I have to do multiplication of idf and tf_ar so that each term in idf multiply to six terms in tf_ar. It implies that
(number of terms in tf_ar)= [6*(number of terms in idf)]
How should i need to give conditions for it so it will continue to loop for next six terms in tf_ar?
j=0
for term in idf:
i=0
for tf in tf_ar:
if i==6:
break
else:
tf_idf+=str(float(tf)* idf[j])+','
i+=1
tf_idf=tf_idf.strip()+'\n'
j+=1
For Example:
tf_ar=[1,2,3,4,5,6,7,8,9,10,11,12...]
idf=[A,B,...]
I want result as
tf_idf=[1A,2A,3A,4A,5A,6A,7B,8B,9B,10B,11B,12B...]
I want idf should be multiplied by six terms of tf_ar and should continue with next terms.