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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T07:37:17+00:00 2026-06-03T07:37:17+00:00

I have a numpy structured array with one of the columns called ‘time’ I

  • 0

I have a numpy structured array with one of the columns called ‘time’ I want to restrict my data where the 'time' column is in a certain range. I tried this:

time_restricted_data = Data[ (Data['time'] > 0.6) & (Data['time'] < 0.7) ]

But that returned all the data where Data['time'] > 0.6.

Any suggestions?

  • 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-03T07:37:18+00:00Added an answer on June 3, 2026 at 7:37 am

    Something is wrong in your example, i.e. I can’t confirm it, and I think what you wrote should work as expected:

    In [19]: Data = np.zeros(100,dtype=[('time', np.float), ('y',np.float)])
    
    In [20]: Data['y'] = np.random.uniform(size=100)
    
    In [21]: Data['time'] = np.random.uniform(size=100)
    
    In [22]: print Data[ (Data['time'] > 0.6) & (Data['time'] < 0.7) ]
    [(0.6309334093696576, 0.5898588768194092)
     (0.6026040512366535, 0.4260650141076221)
     (0.6587399844526572, 0.033397798015253444)
     (0.6863639946779522, 0.67002523603246)
     (0.6522035987367735, 0.948019085443445)
     (0.6809894254849801, 0.5131390279565994)
     (0.6311277013562147, 0.5746610745753917)
     (0.6324174554481182, 0.8587836614681397)
     (0.6542221804687635, 0.9706926940115863)
     (0.671321726341415, 0.7446681474117195)]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a NumPy array, i want to accumulate the values of one column,
I have a NumPy array [1,2,3,4,5,6,7,8,9,10,11,12,13,14] and want to have an array structured like
I have a numpy array of pixel data that I want to draw at
I have a numpy array like this a = np.array(1) Now if I want
I have a numpy 2D array self.sub and i want to use it in
I have a numpy array of dimension (48, 366, 3) and I want to
I have a numpy array called landuse that's a series of numbers 1-3 representing
I have an numpy array of form a = [1,2,3] which I want to
I have a NumPy array of values. I want to count how many of
I have a numpy array of ints representing time periods, which I'm currently plotting

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.