Oct-10-2022, 10:18 PM
Hi divon,
The answer to your request by using df.to_excel() method, which creates the excel file then writes your dataframe into it,
The answer to your request by using df.to_excel() method, which creates the excel file then writes your dataframe into it,
import numpy as np import pandas as pd n = 3 N = pow(2, n) ilr_arr = np.zeros((n+1, N)) ilr_dict = dict() df = pd.DataFrame for idp in range(n + 1): a = pow(2, idp) b = pow(2, n - idp) ilr_dict[idp] = np.reshape(ilr_arr[idp], (a, b)) for ing in range(a): interleaver = np.arange(pow(2, n - idp)) np.random.shuffle(interleaver) ilr_dict[idp][ing] = interleaver df=pd.DataFrame(data=ilr_dict[idp]) print(df) df.to_excel('saveMyOutput.xlsx')