Q: Give an Array Element Labels from another Array I have two Arrays:
data got 300 arrays in it with 31 Values each,
char got 300 arrays in it with 1 value each.
what is the best way to merge these two in this form:
x[0] = [{char[0], data[0]; char[1], data[1]; char[n], data[n]; char[299], data[299]}]
I need it to use Pandas Profiler to find correlations from data to their appointed chars.
tyvm!

A: You can do this:
import pandas as pd

# Example data and char arrays
data = [[1, 2, 3] for i in range(300)]
char = [i for i in range(300)]

combined = list(zip(char, data))

grouped = {}
for c, d in combined:
    if c not in grouped:
        grouped[c] = []
    grouped[c].append(d)

dict_list = []
for c in range(300):
    dict_list.append({'char': c, 'data': grouped[c]})

# Assign the list of dictionaries to x[0]
x = [dict_list]
values = [[d['char']] + d['data'] for d in dict_list]

# Assign the values to x[0]
x = [values]

which gives:
[(0, [1, 2, 3]),
 (1, [1, 2, 3]),
 (2, [1, 2, 3]),
 (3, [1, 2, 3]),
 (4, [1, 2, 3]),
 (5, [1, 2, 3]),
 (6, [1, 2, 3]),
 (7, [1, 2, 3]),
 (8, [1, 2, 3]),
 (9, [1, 2, 3]),
 (10, [1, 2, 3]),
 (11, [1, 2, 3]),
 (12, [1, 2, 3]),
 (13, [1, 2, 3]),
 (14, [1, 2, 3]),
 (15, [1, 2, 3]),
 (16, [1, 2, 3]),
 (17, [1, 2, 3]),
 (18, [1, 2, 3]),
 (19, [1, 2, 3]),
 (20, [1, 2, 3]),
 (21, [1, 2, 3]),
 (22, [1, 2, 3]),
 (23, [1, 2, 3]),
 (24, [1, 2, 3]),
 (25, [1, 2, 3]),
 (26, [1, 2, 3]),
 (27, [1, 2, 3]),
 (28, [1, 2, 3]),
 (29, [1, 2, 3]),
 (30, [1, 2, 3]),
 (31, [1, 2, 3]),
 (32, [1, 2, 3]),
 (33, [1, 2, 3]),
 (34, [1, 2, 3]),
 (35, [1, 2, 3]),
 (36, [1, 2, 3]),
 (37, [1, 2, 3]),
 (38, [1, 2, 3]),
 (39, [1, 2, 3]),
 (40, [1, 2, 3])
....
(293, [1, 2, 3]),
 (294, [1, 2, 3]),
 (295, [1, 2, 3]),
 (296, [1, 2, 3]),
 (297, [1, 2, 3]),
 (298, [1, 2, 3]),
 (299, [1, 2, 3])]

