Finding the range of a list and using it as a parameter in Python

58 Views Asked by At

I am attempting to use the range of a list, specifically col_test and then I would like to use that range to specify the cells to be filled on the new worksheet.

I want the list col_test to fill the second column in the new sheet starting at row 6.

Here I am trying to use the "write" function to do this but I do not know the correct parameters to use.

import os
import glob
import pandas as pd

for csvfile in glob.glob(os.path.join('.', '*.csv')):
    df = pd.read_csv(csvfile)

col_test = df['Test #'].tolist()
col_retest = df['Retest #'].tolist()

from xlrd import open_workbook
from xlutils.copy import copy

rb = open_workbook("Excel FDT Master_01_update.xlsx")
wb = copy(rb)

s = wb.get_sheet(3)
s.write(range_of_col_test, col_test)
wb.save('didthiswork.xls')
0

There are 0 best solutions below