I am basically trying to read data from an excel file and I want to add it in an array. The excel file has multiple rows and multiple columns and I want them to be shown the exact same way in the array too. This data needs to be shown in an array
from importlib.resources import open_binary
import openpyxl
import numpy as np
import array
import sys
wb = openpyxl.load_workbook("IEEE.xlsx")
bus1 = wb['33-Bus']
bus2 = wb['69-Bus']
rowMax = bus1.max_row
columnMax = bus1.max_column
print(rowMax,columnMax)
for i in range(1,rowMax+1):
for j in range(1,columnMax+1):
result = [bus1.cell(i,j).value]
print(result)
I want the loop to run and add the first cell to the array, then run again and add the second element and keep doing that until it hits the end of that row. Then I want it to create another array for the second row. Then add all of these arrays of the rows data together in a new array. So a 2D array. Can anyone help me with that? I have javascript knowledge and python is kinda different so I can't seem to figure this out