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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T19:18:59+00:00 2026-05-23T19:18:59+00:00

I am using scipy’s gmean() function to determine the geometric mean of a numpy

  • 0

I am using scipy’s gmean() function to determine the geometric mean of a numpy array that contains voltage outputs. The range of the numbers is between -80.0 and 30.0. Currently, the numpy array is two dimensional, giving the voltage for two different measurements.

array([[-60.0924, -60.0882],
       [-80.    , -80.    ],
       [-80.    , -80.    ],
       ...,
       [-60.9221, -66.0748],
       [-61.0971, -65.9637],
       [-61.2706, -65.8803]])

However, I get NaN when I take the geometric mean:

>>> from scipy import stats as scistats
>>> scistats.gmean(voltages)
array([ NaN,  NaN])

Does anybody have an idea what might be causing this? Am I doing something wrong?

Thanks in advance!

  • 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-23T19:19:00+00:00Added an answer on May 23, 2026 at 7:19 pm

    The geometric mean cannot be applied to negative values.

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

Sidebar

Related Questions

i am using this: http://docs.scipy.org/doc/numpy/reference/generated/numpy.histogram.html i have an list a that i want to
I am using scipy-cluster in my application. It provides a function to plot a
I am trying to do a fit to a given function using Scipy. Scipy.optimize.leastsq
I have been using the scipy.stats.invgamma.rvs function to randomly select values from an inverse
I am currently using scipy's linregress function for single regression. I am unable to
I am working on doing some digital filter work using Python and Numpy/Scipy. I'm
What does the following error: Warning: overflow encountered in exp in scipy/numpy using Python
I have scipy and numpy, Python v3.1 I need to create a 1D array
Using scipy's interpolate.splprep function get a parametric spline on parameter u , but the
I am using scipy intensively for various purposes. I have noticed that the first

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.