import statements we're going to start by importing the qbsl$pog and qbsl$poufyu libraries that we need for any spark script that we run in pythonand then we're going to import )btijoh and *%using the following commands gspnqztqbsljnqpsu qbsl$pog qbsl$poufyu gspnqztqbslnmmjcgfbuvsfjnqpsu)btijoh gspnqztqbslnmmjcgfbuvsfjnqpsu*%sothis is what computes the term frequencies ( 'and inverse document frequencies (*%'within our documents creating the initial rdd we'll start off with our boilerplate spark stuff that creates local qbsl$pogjhvsbujpo and qbsl$poufyufrom which we can then create our initial rdd dpog qbsl$pog tfu btufs mpdbmtfu"qq/bnf  qbsl '*%'td qbsl$poufyu dpog dpog nextwe're going to use our qbsl$poufyu to create an rdd from tvctfutnbmmutw sbx%bub tdufyu'jmf  tvoephdpotvmu efnz%bub djfodftvctfutnbmmutwthis is file containing tab-separated valuesand it represents small sample of wikipedia articles againyou'll need to change your path as shown in the preceding code as necessary for wherever you installed the course materials for this book that gives me back an rdd where every document is in each line of the rdd the utw file contains one entire wikipedia document on every lineand know that each one of those documents is split up into tabular fields that have various bits of metadata about each article the next thing ' going to do is split those upgjfmet sbx%bubnbq mbnceby tqmju =ui' going to split up each document based on their tab delimiters into python listand create new gjfmet rdd thatinstead of raw input datanow contains python lists of each field in that input data