Part of code that I do not understand, how it work?
data_folders = [os.path.join(root, d) for d in sorted(os.listdir(root))
if os.path.isdir(os.path.join(root, d))]
Here is the link for the code: https://github.com/rndbrtrnd/udacity-deep-learning/blob/master/1_notmnist.ipynb
Screenshot for the entire code:
Question: "os.path.join(root, d)" joins the path and folder name (d) which is coming from the for loop, one at a time. But I do not understand what is the use of "if" condition which is doing the same thing? (I guess)