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 6794989
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T18:17:20+00:00 2026-05-26T18:17:20+00:00

numpy’s ndarray class is defined as class ndarray(__builtin__.objects) From what I can gather, __builtin__.objects

  • 0

numpy’s ndarray class is defined as

class ndarray(__builtin__.objects)

From what I can gather, __builtin__.objects is not an iterable type? For this reason I find this behavior surprising:

Arr = numpy.array('As Far As I Know'.split())
=> array(['As', 'Far', 'As', 'I', 'Know'], dtype='|S4')
print map(lambda x: x[0],Arr)
=> ['A', 'F', 'A', 'I', 'K']

Or does this come from the attributes of the (list) object that is passed to the __init__ method of the ndarray? But then why cannot I not use methods like list.reverse on the array object, if it is internally stored as a list?

(and as a side not does anyone know any better way to apply string-operations on each element of ndarray objects?)

  • 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-26T18:17:20+00:00Added an answer on May 26, 2026 at 6:17 pm

    numpy.ndarray defines __iter__(), which the usual (and only) mechanism to make instances of a type iterable. Note that numpy.ndarray is a C extension type, but this doesn’t matter for the question why it is iterable. Both, types you define in Python and C extension types can be made iterable by defining __iter__().

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The numpy.equal function does not work if a list or array contains strings: >>>
I'm creating a numpy array which is to be filled with objects of a
How can I build a numpy array out of a generator object? Let me
this: numpy.histogram([1,3,2,3,1,1,1,1,2,3,2,5,6,6],bins=numpy.arange(0,7,1)) yields: (array([0, 5, 3, 3, 0, 3]), array([0, 1, 2, 3, 4,
I am using Numpy to store data into matrices. Coming from R background, there
I have a 2d numpy.array, where the first column contains datetime.datetime objects, and the
NumPy arrays can be indexed with an array of booleans to select the rows
In numpy one can use the 'newaxis' object in the slicing syntax to create
import numpy as np import numpy.ma as ma This operates as expected with one
In Numpy, how do I create an array of indices which can be used

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.