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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T01:02:18+00:00 2026-05-25T01:02:18+00:00

first of all I’m new to python and programming but you guys already helped

  • 0

first of all I’m new to python and programming but you guys already helped me a lot, so thanks a lot! But I’ve come to a problem I haven’t found an answer so far:

I have the data of several plates where the data represents the pressure on each plate at a large number of different spots. The thing is, these plates aren’t perfectly round because of the sensors measuring the pressure and sometimes these sensors even produce an error so I don’t have any data at a spot within the plate.

When I just have to plot one plate, I’ll do it like that:

import numpy.ma as ma    

matrix=ma.masked_all((160,65),float)
for x in range(len(plate.X)):
    matrix[(plate.Y[x],plate.X[x])]=data.index(plate.measurementname[x])
image.pcolormesh(matrix,min,max)

This works fine. Now that I have several plates I’d like to plot the mean pressure on each spot. Because I don’t know any mean function, I thought of adding all plates together and divide by the number of plates…I tried following:

import numpy.ma as ma    

meanmatrix=ma.masked_all((160,65),float)
for plate in plateslist:
    matrix=ma.masked_all((160,65),float)
    for x in range(len(plate.X)):
        matrix[(plate.Y[x],plate.X[x])]=data.index(plate.measurementname[x])
    meanmatrix+=matrix
meanmatrix=meanmatrix/len(plateslist)
image.pcolormesh(meanmatrix,min,max)

This works pretty good but there’s one problem I can’t solve. As I said sometimes some plates didn’t get all data, therefore there’s a “hole” at some spots in the plot. Now my meanmatrix has a whole where ever one of the plates had a whole even if all others had data at that spot.

How can I make sure I won’t get these holes or is there even a smoother way of getting my “meanmatrix”?? (I hope my question is clear enough…)

Edit:

The problem is not that I don’t get the mean of the data, this actually works (well I don’t like how I did it but it works), the problem is that I get these “holes” I described before. That’s what bothers me.

  • 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-25T01:02:19+00:00Added an answer on May 25, 2026 at 1:02 am

    Ok I got an answer:

    import numpy.ma as ma    
    
    allplats=ma.masked_all((160,65),float)
    for plate in plateslist:
        for x in range(len(plate.X)):
            allplates[(plate.Y[x],plate.X[x])]+=data.index(plate.measurementname[x])
    allplates=allplates/len(plateslist)
    image.pcolormesh(meanmatrix,min,max)
    

    This actually works! So i guess there was a mistake when adding two masked_all arrays…(“Stupid is as stupid does”)
    If someone has a better approach to get the mean of all plates at each single spot, it would be nice to read it.

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

Sidebar

Related Questions

First of all, I know how to build a Java application. But I have
First of all: I am not an experienced ClearCase user, but I have lots
First of all there is a partial question regarding this, but it is not
First of all, let me say I am very new to rails, have been
First of all - I don't have a problem with bad-indentated code and I
First of all a statement: I'm a newbie when it comes to programming for
First of all this is all just concept, I have no actual programming done
First of all thanks to folks who are currently involved in the development of
First of all, as usual, thanks to all for the great support from the
First of all Im new to vb 2010 and so far have enjoyed what

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.