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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T18:51:07+00:00 2026-06-08T18:51:07+00:00

So I have some data import pyfits import matplotlib.pyplot a = pyfits.getdata(‘data.fits’) x =

  • 0

So I have some data

import pyfits
import matplotlib.pyplot
a = pyfits.getdata('data.fits')
x = a['time']
y = a['flux']

I had a issue with some data where my arrays contained NaN values. To get rid of them, I did the following:

x = x[numpy.logical_not(numpy.isnan(x))]
y = y[numpy.logical_not(numpy.isnan(y))]

Which removes all NaN values from the arrays x and y. The problem is that x and y did not contain the same amount of NaN values.

so:

len(y) = 4275

whereas:

len(x) = 4313

I’d like to be able to do this:

pyplot.plot(x,y)

but there is a problem with trying to plot arrays of different dimensions. Is there a way that I can do this?

  • 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-08T18:51:09+00:00Added an answer on June 8, 2026 at 6:51 pm

    How are you getting your data plots? I would assume on import you would have x or y be 0 such that each x has an appropriate y?

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

Sidebar

Related Questions

I have to import some XML data into my app. Now I open a
I have some CSV data files that I want to import into mySQL. I
I have some code to retrieve XML data: import cStringIO import pycurl from xml.etree
I have some data files to import into a database with some unique delimiters:
I'm trying to import some data from Excel to SQL Server, I have a
I am going to import some data, and I have the data available in
I have a Microsoft SQL server DB that imports some data which needs a
I have an SSIS (2005) package that transforms some XML data and then imports
I have some data loaded as a np.ndarray and need to convert it to
I have some data from log files and would like to group entries by

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.