I have data in an Excel spreadsheet that has 4 rows and 1,000 columns. I am using Import
as follows:
fittedMatrix = Table[
Import["sheet.xlsx", {"Sheets", "MC", #, i}] & /@ Range[2, 5],
{i, 2, 1001}
]; // AbsoluteTiming
which is importing on a column by column basis -- a thousand imports per spreadsheet. Is there a way to import row by row basis? Hopefully, this would improve the speed of import. Or would it be better to transpose my data within Excel first?
EDIT: I tried transposing within Excel first to get dimensions of 1,000 x 4 and tried again using:
fittedMatrix=Table[
Import["sheet.xlsx",{"Sheets","mcTransposed", #,i}] &/Range[2,1001],
{i,2,5}
];//AbsoluteTiming
but now it is giving:
{{1/2 (Import[sheet.xlsx,{Sheets,mcTransposed,#1,i}]&),
1/3 (Import[sheet.xlsx,{Sheets,mcTransposed,#1,i}]&),
1/4 (Import[sheet.xlsx,{Sheets,mcTransposed,#1,i}]&),
1/5 (Import[sheet.xlsx,{Sheets,mcTransposed,#1,i}]&),
1/6 (Import[sheet.xlsx,{Sheets,mcTransposed,#1,i}]&),
1/7 (Import[sheet.xlsx,{Sheets,mcTransposed,#1,i}]&),
1/8 (Import[sheet.xlsx,{Sheets,mcTransposed,#1,i}]&),
1/9 (Import[sheet.xlsx,{Sheets,mcTransposed,#1,i}]&),
1/10 (Import[sheet.xlsx,{Sheets,mcTransposed,#1,i}]&),
1/11 (Import[sheet.xlsx,{Sheets,mcTransposed,#1,i}]&),
instead of my actual Excel data?