Sai

Validate MyMap Function

Validate myMap Function¶ Let us validate the function by using some realistic examples. In [1]: %run 04_develop_myMap_function.ipynb In [2]: myMap Out[2]: <function __main__.myMap(c, f)> Use orders and extract order_dates. Also apply set and get only unique dates. In [3]: orders_path = “/data/retail_db/orders/part-00000” orders = open(orders_path). \ read(). \ splitlines() In [4]: orders[:10] Out[4]: [‘1,2013-07-25 00:00:00.0,11599,CLOSED’, ‘2,2013-07-25 00:00:00.0,256,PENDING_PAYMENT’, ‘3,2013-07-25 00:00:00.0,12111,COMPLETE’, …

Validate MyMap Function Read More »

Validating MyFilter Function

Validate myFilter Function¶ Use the same examples which were used before as part of Processing Collections using loops. In [1]: %run 02_develop_myFilter_function.ipynb In [2]: myFilter Out[2]: <function __main__.myFilter(c, f)> Read orders data In [3]: orders_path = “/data/retail_db/orders/part-00000” orders = open(orders_path). \ read(). \ splitlines() In [4]: orders[:10] Out[4]: [‘1,2013-07-25 00:00:00.0,11599,CLOSED’, ‘2,2013-07-25 00:00:00.0,256,PENDING_PAYMENT’, ‘3,2013-07-25 00:00:00.0,12111,COMPLETE’, ‘4,2013-07-25 00:00:00.0,8827,CLOSED’, ‘5,2013-07-25 00:00:00.0,11318,COMPLETE’, ‘6,2013-07-25 …

Validating MyFilter Function Read More »