Communities for your favorite technologies. Explore all Collectives
Stack Overflow for Teams is now called Stack Internal. Bring the best of human thought and AI automation together at your work.
Bring the best of human thought and AI automation together at your work. Learn more
Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Can I use numpy to create an array that can hold up to 12 objects?? I have an object like app.feOutput and I need 12 variables initialized with that object.
app.feOutput
I hope someone can help me. Just new to python stuff especially handling objects.
np.empty((12,), dtype=object)
You can initialize an empty array like this:
a = np.empty((12,), dtype=object)
And later you can assign your desired objects to its element:
a[i] = obj_i
Add a comment
Required, but never shown
By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.
Start asking to get answers
Find the answer to your question by asking.
Explore related questions
See similar questions with these tags.
np.empty((12,), dtype=object)maybe?