Q:

How can I use a for loop to append from a Pandas DataFrame column? 

I have a Pandas DataFrame that contains a Column of Integers.  I'm trying to use a for loop to pull out only the Count values of that DataFrame where the 'Artist' column matches 'The Beatles'.  
tot=[]

for art in df:

    for df['Artist'] in art:

        if art['Artist'] == 'The Beatles':

            tot.append(artist['Count'])

The Dataframe format is as such:

'''

Rank    Album   Artist  Count
1   1   The Beatles [White Album]   The Beatles 1634
2   2   Rubber Soul The Beatles 1497
3   3   Revolver    The Beatles 1489
4   4   Abbey Road  The Beatles 1468
5   5   Meet Me in St. Louis    Judy Garland with Georgie Stoll and His Orchestra   1399

'''

I receive the "TypeError: string indices must be integers". 

A:

if you want to save a array with all Counts where Artist is The Beatles, use:
df.loc[df['Artist'] == 'The Beatles', 'Count'].tolist()

if you need to sum all the Counts, use .sum()
df.loc[df['Artist'] == 'The Beatles', 'Count'].sum()

