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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T12:12:46+00:00 2026-06-06T12:12:46+00:00

I am creating an object in python. I have a numpy array from an

  • 0

I am creating an object in python. I have a numpy array from an H5 file that I would like to define within it. The numpy array is coordinates. I was poking around online and found tons of information about creating numpy arrays, or creating objects in numpy arrays.. but I can’t find anything on defining an already made numpy array inside an object.

class Node(object):
    def __init__(self, globalIndex, coordinates):

        #Useful things to record
        self.globalIndex = globalIndex
        self.coordinates = numpy.coordinates

        #Dictionaries to be used
        self.localIndices ={}
        self.GhostLayer = {}

My question: is there a specific way to define my numpy array within this class? If not (the fact that I couldn’t find anything about it makes me think that it can’t be done), how else could I import a numpy array?

  • 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-06-06T12:12:47+00:00Added an answer on June 6, 2026 at 12:12 pm
    class Node(object):
        def __init__(self, globalIndex, coordinates):
    
            #Useful things to record
            self.globalIndex = globalIndex
            self.coordinates = coordinates # now self.coordinates is just another name for your array
    

    Assuming n = Node(some_index, numpy_coordinate_array_name)

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

Sidebar

Related Questions

In Python 3.2 I am creating a Structure object from the data returned by
I have a method in c++ that gets called from python and needs to
When creating a simple object hierarchy in Python, I'd like to be able to
I have astring directly coming form the database and I am creating object of
Below I am creating an object in JavaScript. Within the constructor I am setting
I have a couple questions about creating a object (2 values) and how to
I have an esoteric question involving Python metaclasses. I am creating a Python package
Using Blender 2.49's Python API I'm creating a mesh. I have a list of
Still new to python and django, though learning ;-) I have a view that
I have two questions about creating thread safe types in python, and one related

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.