Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5948181
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T17:04:15+00:00 2026-05-22T17:04:15+00:00

Since when did numpy allow you to define an array of python objects? Objects

  • 0

Since when did numpy allow you to define an array of python objects? Objects array with numpy.

Is there any fundamental difference between these arrays and a python list?

What is the difference between these arrays and say, a python tuple?

There are several handy numpy functions I would like to use, i.e. masks and element-wise operations, on an array of python objects and I would like to use them in my analysis, but I’m worried about using a feature I can’t find documentation for anywhere. Is there any documentation for this ‘object’ datatype?

Was this feature was added in preparation for merging numpy into the standard library?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T17:04:16+00:00Added an answer on May 22, 2026 at 5:04 pm

    The “fundamental” difference is that a Numpy array is fixed-size, while a Python list is a dynamic array.

    >>> class Foo:
    ...  pass
    ... 
    >>> x = numpy.array([Foo(), Foo()])
    >>> x.append(Foo())
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    AttributeError: 'numpy.ndarray' object has no attribute 'append'
    

    (You can get around this with numpy.concatenate, but still Numpy arrays aren’t meant as a drop-in replacement for list.)

    Arrays of object are perfectly well documented, but be aware that you’ll have to pass dtype=object sometimes:

    >>> numpy.array(['hello', 'world!'])
    array(['hello', 'world!'], 
          dtype='|S6')
    >>> numpy.array(['hello', 'world!'], dtype=object)
    array(['hello', 'world!'], dtype=object)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

It's been a while since I did any ASM, and decided to once again
It has been a few years since I did any development for PCs (I
It's been a long time since I did any classic asp work, but was
It's been a while since I last did Ruby programming -- looking at somebody
Since my question from yesterday was perhaps not completely clear and I did not
Sorry since this question is specific to my problem. While learning reflections i did
It's been a while since I used GTK+, and the last time I did
Since CS3 doesn't have a web service component, as previous versions had, is there
It's been a while since I did Java work, and even then I was
I want to do exactly what this guy did: Python - count sign changes

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.