T
T
Timebird2018-01-11 18:23:49
Python
Timebird, 2018-01-11 18:23:49

How to create a certain number of empty arrays without their numeric numbering?

Let's say I have a list with names: names = [a, b, c, d, ..., z].
I want to create z empty arrays:

a = np.empty(0)
b = np.empty(0)
...
z = np.empty(0)

Is this even possible in python? It is important that there is no index numbering in the names of the arrays, unlike this example .

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Max Payne, 2018-01-13
@Timebird

{i: np.empty(0) for i in names}

K
kzoper, 2018-01-11
@kzoper

mas = {}
for i in names:
    mas[i] = np.empty(0)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question