Python Forum
Create array of values from 2 variables
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Create array of values from 2 variables
#2
Will each cell have only 1 disk type? You could use a dictionary
cells = {}
for ...
    cells[v_cellname] = v_model
Or if a cell can have multiple values.
cells = {}
for ...
    cells[v_cellname] = [model.find('makeModel').text for model in myrootcelldetail.findall('cell')]
Be warned that I don't understand your code at all including what part of the code is "var1" and what part is "var2". My guess is var1 is v_cellname and var2 is v_model.
paulo79 likes this post
Reply


Messages In This Thread
RE: Create array of values from 2 variables - by deanhystad - Apr-19-2022, 08:28 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Create X Number of Variables and Assign Data RockBlok 8 1,153 Nov-14-2023, 08:46 AM
Last Post: perfringo
Question How create programmatically variables ? SpongeB0B 6 1,512 Aug-19-2023, 05:10 AM
Last Post: SpongeB0B
  Creating a loop with dynamic variables instead of hardcoded values FugaziRocks 3 1,587 Jul-27-2022, 08:50 PM
Last Post: rob101
  Creating a numpy array from specific values of a spreadsheet column JulianZ 0 1,237 Apr-19-2022, 07:36 AM
Last Post: JulianZ
  How to create 2 dimensional variables in Python? plumberpy 5 1,984 Mar-31-2022, 03:15 AM
Last Post: plumberpy
  Calculate next rows based on previous values of array divon 0 1,894 Nov-23-2021, 04:44 AM
Last Post: divon
  Xlsxwriter: Create Multiple Sheets Based on Dataframe's Sorted Values KMV 2 3,618 Mar-09-2021, 12:24 PM
Last Post: KMV
  variables vcnt, ocnt, and mcnt adding previous values and not resetting to 0 archanut 2 2,010 Feb-12-2021, 06:56 PM
Last Post: deanhystad
  Giving all possible values to four different variables quest_ 7 3,109 Jan-18-2021, 05:18 AM
Last Post: deanhystad
  cannot create animation on 2D array using Matplotlib and FuncAnimation Caffeine_Addict 1 2,570 Jan-12-2021, 11:35 AM
Last Post: Caffeine_Addict

Forum Jump:

User Panel Messages

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