0

I wrote this code to get the time and the task of an "event" in an excel file:

def get_time():
    my_sheet = 'Sheet1'
    file_location = 'ReminderDiary.xlsx'
    df = pd.read_excel(file_location, sheet_name=my_sheet)
    reminder_time = df['time']
    return(reminder_time)

def get_task():
    my_sheet = 'Sheet1'
    file_location = 'ReminderDiary.xlsx'
    df = pd.read_excel(file_location, sheet_name=my_sheet)
    task = df['task']
    return(task)

how do i pait the data to get the task and time of the vents into one var or some

  • 1
    you can `zip(get_time(), get_task())`. Although if your particular case you should be able to extract both columns at the same time in a single function: just return `df[['time', 'task']]` – mozway Apr 01 '22 at 12:13

0 Answers0