C2_W2 concept and data type

At the end of the assignment, it mentioned three optimization methods. The first one is referring mini-batch gradient descent, correct?
I’m new to Python. In the For statement, what is this operation “minibatch in minibatches” doing? What type of data structure is minibatches so that the loop can take out a set of array?


The code is all there for you to see. Where is minibatches defined? It is the return value from the function random_mini_batches, right? So what does that function return? You just wrote that code earlier in this notebook. If you examine it, you’ll find that it returns a python “list” datatype. You can verify that by adding a print statement like this:


You can “enumerate” the elements of a python list in a for statement by saying:

for eachElement in myList:
   .... do something with eachElement ....

Note that these courses are not set up as beginning python courses. It is assumed that you are already familiar with python, including basic data types like tuples, lists and dictionaries. If that is not the case, it might be worth your time to either take an “intro to python” course or spend some time reading all the great tutorial info that is out there on python. E.g. when you hit something like this, try googling “enumerate a python list” and see what you find.

Thank you for the advice!