我想通过使用praw通过用户名excel我得到:AttributeError:'列表'对象没有属性'to_excel

I'm trying to pass usernames to excel using praw I get: AttributeError: 'list' object has no attribute 'to_excel

I am trying to run analysis on a subreddit by users. When I try to send the the data (df) to excel I get this error: AttributeError: 'list' object has no attribute 'to_excel. My code is below.

import config

import pandas as pd

import os

import itertools

import xlsxwriter

df = []

def bot_login():

    print ("logging in")
    r = praw.Reddit(username = config.username,
            password = config.password,
            client_id = config.client_id,
            client_secret = config.client_secret,
            user_agent= "u/1234 testing bot for lerns programming")
    print("logged in")
    return r

def run_bot(r):

    settings = {'subreddit': 'test'}
    submissions = r.subreddit(settings['subreddit']).new(limit=1)

    print('still working')
    for s in submissions:
        print("Downvoted: '{}'".format(s.title[0:70]))
        df.append(s.author)
        time.sleep(2)

r = bot_login()

run_bot(r)

os.chdir('C:/users/jonathan/desktop/data')

df.to_excel('Users.xlsx')


print(df)