Questions tagged [natural-logarithm]

Use this tag for questions related to Natural logarithm which is logarithm to the base `e`. The natural logarithm is generally written as `ln x` or `ln(x)`.

Natural logarithm is logarithm to the base e, where e is approximately equal to 2.718281828 (though, like π, it's a transcendental number). The natural logarithm is generally written as ln x or ln(x).

87 questions
0
votes
1 answer

Issues with np.log

I have a numpy array which got derived from pandas. I am trying to do np.log (natural logarithm) on each of its elements and it is giving me the error. AttributeError: 'float' object has no attribute 'log' The array looks something like…
Jesh Kundem
  • 960
  • 3
  • 18
  • 30
0
votes
0 answers

There is a way to calculate and plot means and standard deviation of multi-column python dataframe?

I have three pandas dataframes with more columns: import pandas as pd import numpy as np from matplotlib import pyplot as plt from scipy import stats import seaborn as sns data = np.random.randint(0, 1001, size=(1000, 100)) data[data < 0] = 0 df1 =…
Giantanque
  • 45
  • 4
0
votes
0 answers

Logarithmic Transformation in Linear Regression Model Problem - Accuracy of Values at the Exponential Level

I have a problem that I am sure people with more mathematical knowledge may be able to solve fairly easily. I have a simple model I have built between two variables where an exponential relationship exists. I have taken the natural log of my…
tfut22312
  • 21
  • 2
0
votes
0 answers

Natural logarithm cannot be computed in Delphi const at compile time

As I understand a thumb rule for allowing expressions in Delphi constants is that the expression should be able to get evaluated in complile time. So it's greatly unclear for me why the following is not allowed ([dcc64 Error] E2026 Constant…
0
votes
2 answers

Why my natural log function is so imprecise?

Firstly, I'm using this approximation of a natural log. Or look here (4.1.27) for a better representation of formula. Here's my implementation: constexpr double eps = 1e-12; constexpr double my_exp(const double& power) { double numerator = 1; …
Learpcs
  • 282
  • 3
  • 10
0
votes
0 answers

C#: Natural Log needed with decimal values for financial purpose

Is there a way to compute a natural log using decimal values in C#? I need something like decimal dec = Math.Log(decimalInput);` The problem is that Math.Log(x) only works with a double type as input and another double as output.
0
votes
0 answers

Python: log-lin plot with negative values

I am attempting to make a log-lin plot where my y-axis has negative values. I also want to fit a best-fit line to it. Here's the lin-lin plot: Here's the plot with the (wrong) code: plt.scatter(x, y, c='indianred', alpha=0.5) z = np.polyfit(x, y,…
Joehat
  • 979
  • 1
  • 9
  • 36
0
votes
0 answers

Reversing a Natural Log Algorithm

Trying to write an encoder and decoder that has to use this formula. Basically after all is said and done, the formula encodes any number between 25 and 2294E6 into an int between 0 and 254. However there is an extreme loss of value when decoding it…
0
votes
1 answer

Calculating the coefficients a and b of an exponential equation in Power Query/M in power BI

I am trying to recreate numbers which I easily calculated in excel and now I would like to have calculated in Power BI. To be more precise I would like to have it in power query/M and NOT in DAX due to later calculations. To be more specific I…
0
votes
1 answer

What is the definition of the natural logarithm? - Finding the value of natural logarithm using codes

I have created an algorithm for the base of the natural logarithm with HTML and JS. And this is the code: HTML: bonl.html bonl
0
votes
1 answer

AttributeError:Float' object has no attribute log /TypeError: ufunc 'log' not supported for the input types

I have a series of fluorescence intensity data in a column ('2.4M'). I tried to create a new column 'ln_2.4M' by taking the ln of column '2.4M' I got an error: AttributeError: 'float' object has no attribute 'log' df["ln_2.4M"] =…
0
votes
1 answer

Understand log scale and actually taking np.log of a data

I am currently working up some experimental data and am having a hard time understanding whether I should be doing a log scale or actually applying np.log onto the data. Here is the plot I have made. Blue represents using plt.yscale('log'), whereas…
Luke Teo
  • 87
  • 7
0
votes
0 answers

How to deal with negative and positive variables in a log transformation

I am creating a baseline. This baseline is composed by some variables. Some of these variables are positive, whilst others present positive and negative values. Here the problem: I need to do a log transformation of these variables for another…
0
votes
1 answer

RStudio: How to convert the horizontal axis to a natural log-scale in ggplot2?

I am using the package tidyverse and would like to scale the X axis of the below plot to the natural log of the values. require(tidyverse) require(gapminder) gapminder07 <- dplyr::filter(gapminder, year == 2007) ggplot(data = gapminder07) +…
0
votes
1 answer

How to convert the y-axis of a plot from log(y) to y

I'm an R newbie. I want to estimate a regression of log(CONSUMPTION) on INCOME and then make a plot of CONSUMPTION and INCOME. I can run the following regression and plot the results. results <- lm(I(log(CONSUMPTION)) ~ INCOME,…
bobreednz
  • 1
  • 1