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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T17:42:35+00:00 2026-06-15T17:42:35+00:00

I was trying to plot data only on continent. I asked a question about

  • 0

I was trying to plot data only on continent. I asked a question about this before and I’ve got the answer here.
Now when I implemented it in the code, the program will run without giving an error.

However, it RUNS FOREVER. When I use ctrl + C to force stop it, it traces back to "if not (map.is_land(X[i], Y[i])):", so I think there’s something wrong here. But I can’t figure it out.

Here is the part of code that involves picking out non-continental data and removing them:

X, Y = map(Lon,Lat)
ocean = []
for i in range(len(X)):
    if not (map.is_land(X[i], Y[i])):
        ocean.append(i)

X_new = np.delete(X, ocean)
Y_new = np.delete(Y, ocean)
HDO_new = np.delete(HDO, ocean)
  • 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-15T17:42:36+00:00Added an answer on June 15, 2026 at 5:42 pm

    Since you use a for loop, the program should stop anyway, the only problem is how large is X. I can only give two suggestions:

    1) try to print the value of len(X) before entering the for cicle to see how big is

    2) try to use xrange instead of range, if you use python 2.x

    Keep also in mind that using list with some hundred thousand element seems to be slow.
    Eventually try using a smaller data sample, if you can

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

Sidebar

Related Questions

I am trying to plot some test data (show at the end of this
I am trying to plot this kind of behaviour of a data set. I
I am trying to plot some data and I am getting this error from
I'm having a little trouble trying to plot certain graphs with this data set
I am trying plot data sets consisting of 3 coordinates: X-coordinate, x-coordinate and the
I'm trying to plot data in matplotlib. I would like to hide the upper
I am trying to plot some data using pylab scatter function. I'm using pylab.scatter(X,
I'm trying to plot some data into a histogram using pyplot.hist as such: hst
I am trying to plot some one-dimensional data onto a 2-D plot in MATLAB.
I'm trying to annotate a polar plot with data tips labelled with 'R:...,Theta:...' where

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.