How can I use iloc to extract rows of a dataframe to create a separate dataframe?

Solution for How can I use iloc to extract rows of a dataframe to create a separate dataframe?
is Given Below:

I have a dataframe from which I would like to extract specific rows and create a separate dataframe consisting of those extracted rows.

The following is an example:

df =

Col1 Col2 Col3
0 red blue yellow
1 monago orange apple
2 five six seven

I have the row indices in an array called row_ind with values (0,2):

for i in range(len(df))
    a = row_ind[i]
    b = df.iloc[a]

How can I use this to create the data set that I want?

foo = []

for i in range(len(df))
    a = row_ind[i]
    foo.append(a)

newdf = df.iloc[foo]