dmptf nfttbhf = kpjo mjoft zjfmeqbuinfttbhf efgebub'sbnf'spn%jsfdupsz qbuidmbttjgjdbujpo spxt joefy gpsgjmfobnfnfttbhfjosfbe'jmft qbui spxtbqqfoe nfttbhf nfttbhfdmbtt dmbttjgjdbujpojoefybqqfoe gjmfobnf sfuvso%bub'sbnf spxtjoefy joefy ebub %bub'sbnf nfttbhf dmbtt ebub ebubbqqfoe ebub'sbnf'spn%jsfdupsz tvoephdpotvmu efnz%bub djfodffnbjmttqbn tqbn ebub ebubbqqfoe ebub'sbnf'spn%jsfdupsz tvoephdpotvmu efnz%bub djfodffnbjmtibn ibn so the first thing we need to do is read all those -mails in somehowand we're going to again use pandas to make this little bit easier againpandas is useful tool for handling tabular data we import all the different packages that we're going to use within our example herethat includes the os librarythe io librarynumpypandasand countvectorizer and multinomialnb from scikit-learn let' go through this code in detail now we can skip past the function definitions of sfbe'jmft and ebub'sbnf'spn%jsfdupsz for now and go down to the first thing that our code actually does which is to create pandas dataframe object we're going to construct this from dictionary that initially contains little empty list for messages in an empty list of class so this syntax is saying" want dataframe that has two columnsone that contains the messagethe actual text of each -mailand one that contains the class of each -mailthat iswhether it' spam or hamso it' saying want to create little database of -mailsand this database has two columnsthe actual text of the -mail and whether it' spam or not now we needed to put something in that databasethat isinto that dataframein python syntax so we call the two methods bqqfoe and ebub'sbnf'spn%jsfdupsz to actually throw into the dataframe all the spam -mails from my tqbn folderand all the ham -mails from the ibn folder