1. The use of the map() function in Python 3.6 is different from that in 2.7. When calculating the length len(), you will get the following error
D=map(set,dataSet)
numItems = float ( len (D))
Using the map() function in Python 3.6 is different from that in 2.7. When calculating the length len(), you will get the following error:
TypeError: object of type 'map' has no len()
Solution: To get the same effect, add a list()
D=list(map(set,dataSet))
numItems = float ( len (D))