Python Forum
Write from dictionary to excel
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Write from dictionary to excel
#1
Hello everyone, I would like to ask about how to write from a dictionary into excel.

The program that I have written so far:

import numpy as np
import pandas as pd

n = 3
N = pow(2, n)

ilr_arr = np.zeros((n+1, N))
ilr_dict = dict()
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], index=[0]) when I use this syntax, it become error.
If there are any suggestions about this, please tell me.
Reply


Messages In This Thread
Write from dictionary to excel - by divon - Sep-27-2022, 05:06 AM
RE: Write from dictionary to excel - by Am1n3 - Oct-10-2022, 10:18 PM
RE: Write from dictionary to excel - by divon - Jun-10-2023, 01:06 AM
RE: Write from dictionary to excel - by Larz60+ - Jun-11-2023, 10:37 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Split excel file and write output at specific row and set sheet position DSCA 0 2,024 May-12-2022, 07:29 PM
Last Post: DSCA
  Write a dictionary with arrays as values into JSON format paul18fr 3 5,734 Oct-20-2021, 10:38 AM
Last Post: buran
  [Pandas] Write data to Excel with dot decimals manonB 1 5,943 May-05-2021, 05:28 PM
Last Post: ibreeden
  Read exel with merged cells and write to another excel SriMekala 0 3,016 Aug-10-2019, 07:14 AM
Last Post: SriMekala
  how read and write merged cells in excel SriMekala 1 15,200 Aug-07-2019, 11:27 PM
Last Post: scidam
  Python write result of VAR to excel file wissam1974 8 8,723 Jul-13-2019, 01:09 PM
Last Post: wissam1974
  Pandas - Write to Exisitng Excel File - Sorted List dj99 4 15,007 Jul-29-2018, 07:56 AM
Last Post: dj99
  How do I write a line of code into an excel spreadsheet using Python code? Emerogork 2 3,218 Feb-07-2018, 06:54 PM
Last Post: snippsat
  Write data into existing Excel (xlsx) file with multiple sheets BNB 1 15,393 Jun-01-2017, 04:22 PM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020