Good afternoon, I'm just starting to learn python and, in particular, I am sorting out the task of finding the occurrence of certain words in a sentence. How the most beautiful in terms of python 2.7 can describe the text below?
import numpy as np sfArray=np.zeros((len(sfSentences),len(sfDict))) print len(sfSentences) i=0 for Sentence in sfSentences: j=0 for Word in sfDict: Wordlist=Sentence.split() sfArray[i,j]=Wordlist.count(Word) j=j+1 i=i+1 print sfArray I haven’t really figured out the lambda function and similar python constructions, so I’ll be happy with any advice