Tôi đang sử dụng fbprophet và chúng ta nên che dữ liệu để ghi lại các giá trị vào orer để bình thường hóa dữ liệu như thế này: ____ 13 nhưng một khi tôi đã dự đoán các giá trị, thì tôi sẽ nhận được một khung dữ liệu như thế này:
ds n_tickets yhat
0 2018-02-17 2202 7.545468
1 2018-02-18 2449 7.703022
2 2018-02-19 2409 7.705301
3 2018-02-20 2364 7.675143
4 2018-02-21 2306 7.693359
5 2018-02-22 2492 7.728534
6 2018-02-23 2300 7.669022
7 2018-02-24 2359 7.534430
8 2018-02-25 2481 7.691983
9 2018-02-26 2446 7.694263
Ở đây, yhat là các giá trị dự đoán của tôi nhưng chúng là giá trị nhật ký và n_tickets là giá trị thực tế của tôi. Vì vậy, tôi cần chuyển đổi YHAT trở lại số bình thường để so sánh. Tôi đang cố gắng tìm hiểu nhưng bị bối rối.
Đã hỏi ngày 10 tháng 3 năm 2018 lúc 12:59Mar 10, 2018 at 12:59
1
Theo dõi câu trả lời do Lambda cung cấp, giải pháp đầy đủ là:
from io import StringIO
import numpy as np
import pandas as pd
s = """
ds n_tickets yhat
0 2018-02-17 2202 7.545468
1 2018-02-18 2449 7.703022
2 2018-02-19 2409 7.705301
3 2018-02-20 2364 7.675143
4 2018-02-21 2306 7.693359
5 2018-02-22 2492 7.728534
6 2018-02-23 2300 7.669022
7 2018-02-24 2359 7.534430
8 2018-02-25 2481 7.691983
9 2018-02-26 2446 7.694263
"""
# Load your example
df = pd.read_csv[StringIO[s], delim_whitespace=True]
# Add the exponential of the yhat column as a new column
df['exp_yhat'] = np.exp[df['yhat']]
print[df.head[]]
# ds n_tickets yhat exp_yhat
# 0 2018-02-17 2202 7.545468 1892.148056
# 1 2018-02-18 2449 7.703022 2215.031714
# 2 2018-02-19 2409 7.705301 2220.085527
# 3 2018-02-20 2364 7.675143 2154.131705
# 4 2018-02-21 2306 7.693359 2193.730943
Đã trả lời ngày 22 tháng 6 năm 2018 lúc 3:25Jun 22, 2018 at 3:25
Python cung cấp nhiều hàm logarit inbuild trong mô -đun Math Math, cho phép chúng tôi tính toán nhật ký bằng một dòng. Có 4 biến thể của các hàm logarit, tất cả đều được thảo luận trong bài viết này.1. log [a, [cơ sở]]: hàm này được sử dụng để tính toán logarit tự nhiên [cơ sở e] của a. Nếu 2 đối số được truyền, nó sẽ tính toán logarit của cơ sở mong muốn của đối số A, giá trị số của log [a]/log [cơ sở]. & Nbsp;math” which allows us to compute logs using a single line. There are 4 variants of logarithmic functions, all of which are discussed in this article.
1. log[a,[Base]] : This function is used to compute the natural logarithm [Base e] of a. If 2 arguments are passed, it computes the logarithm of the desired base of argument a, numerically value of
log[a]/log[Base].
Syntax : math.log[a,Base] Parameters : a : The numeric value Base : Base to which the logarithm has to be computed. Return Value : Returns natural log if 1 argument is passed and log with specified base if 2 arguments are passed. Exceptions : Raises ValueError if a negative no. is passed as argument.
Python3
from io import StringIO
import numpy as np
import pandas as pd
s = """
ds n_tickets yhat
0 2018-02-17 2202 7.545468
1 2018-02-18 2449 7.703022
2 2018-02-19 2409 7.705301
3 2018-02-20 2364 7.675143
4 2018-02-21 2306 7.693359
5 2018-02-22 2492 7.728534
6 2018-02-23 2300 7.669022
7 2018-02-24 2359 7.534430
8 2018-02-25 2481 7.691983
9 2018-02-26 2446 7.694263
"""
# Load your example
df = pd.read_csv[StringIO[s], delim_whitespace=True]
# Add the exponential of the yhat column as a new column
df['exp_yhat'] = np.exp[df['yhat']]
print[df.head[]]
# ds n_tickets yhat exp_yhat
# 0 2018-02-17 2202 7.545468 1892.148056
# 1 2018-02-18 2449 7.703022 2215.031714
# 2 2018-02-19 2409 7.705301 2220.085527
# 3 2018-02-20 2364 7.675143 2154.131705
# 4 2018-02-21 2306 7.693359 2193.730943
4 from io import StringIO
import numpy as np
import pandas as pd
s = """
ds n_tickets yhat
0 2018-02-17 2202 7.545468
1 2018-02-18 2449 7.703022
2 2018-02-19 2409 7.705301
3 2018-02-20 2364 7.675143
4 2018-02-21 2306 7.693359
5 2018-02-22 2492 7.728534
6 2018-02-23 2300 7.669022
7 2018-02-24 2359 7.534430
8 2018-02-25 2481 7.691983
9 2018-02-26 2446 7.694263
"""
# Load your example
df = pd.read_csv[StringIO[s], delim_whitespace=True]
# Add the exponential of the yhat column as a new column
df['exp_yhat'] = np.exp[df['yhat']]
print[df.head[]]
# ds n_tickets yhat exp_yhat
# 0 2018-02-17 2202 7.545468 1892.148056
# 1 2018-02-18 2449 7.703022 2215.031714
# 2 2018-02-19 2409 7.705301 2220.085527
# 3 2018-02-20 2364 7.675143 2154.131705
# 4 2018-02-21 2306 7.693359 2193.730943
5from io import StringIO
import numpy as np
import pandas as pd
s = """
ds n_tickets yhat
0 2018-02-17 2202 7.545468
1 2018-02-18 2449 7.703022
2 2018-02-19 2409 7.705301
3 2018-02-20 2364 7.675143
4 2018-02-21 2306 7.693359
5 2018-02-22 2492 7.728534
6 2018-02-23 2300 7.669022
7 2018-02-24 2359 7.534430
8 2018-02-25 2481 7.691983
9 2018-02-26 2446 7.694263
"""
# Load your example
df = pd.read_csv[StringIO[s], delim_whitespace=True]
# Add the exponential of the yhat column as a new column
df['exp_yhat'] = np.exp[df['yhat']]
print[df.head[]]
# ds n_tickets yhat exp_yhat
# 0 2018-02-17 2202 7.545468 1892.148056
# 1 2018-02-18 2449 7.703022 2215.031714
# 2 2018-02-19 2409 7.705301 2220.085527
# 3 2018-02-20 2364 7.675143 2154.131705
# 4 2018-02-21 2306 7.693359 2193.730943
6 from io import StringIO
import numpy as np
import pandas as pd
s = """
ds n_tickets yhat
0 2018-02-17 2202 7.545468
1 2018-02-18 2449 7.703022
2 2018-02-19 2409 7.705301
3 2018-02-20 2364 7.675143
4 2018-02-21 2306 7.693359
5 2018-02-22 2492 7.728534
6 2018-02-23 2300 7.669022
7 2018-02-24 2359 7.534430
8 2018-02-25 2481 7.691983
9 2018-02-26 2446 7.694263
"""
# Load your example
df = pd.read_csv[StringIO[s], delim_whitespace=True]
# Add the exponential of the yhat column as a new column
df['exp_yhat'] = np.exp[df['yhat']]
print[df.head[]]
# ds n_tickets yhat exp_yhat
# 0 2018-02-17 2202 7.545468 1892.148056
# 1 2018-02-18 2449 7.703022 2215.031714
# 2 2018-02-19 2409 7.705301 2220.085527
# 3 2018-02-20 2364 7.675143 2154.131705
# 4 2018-02-21 2306 7.693359 2193.730943
7from io import StringIO
import numpy as np
import pandas as pd
s = """
ds n_tickets yhat
0 2018-02-17 2202 7.545468
1 2018-02-18 2449 7.703022
2 2018-02-19 2409 7.705301
3 2018-02-20 2364 7.675143
4 2018-02-21 2306 7.693359
5 2018-02-22 2492 7.728534
6 2018-02-23 2300 7.669022
7 2018-02-24 2359 7.534430
8 2018-02-25 2481 7.691983
9 2018-02-26 2446 7.694263
"""
# Load your example
df = pd.read_csv[StringIO[s], delim_whitespace=True]
# Add the exponential of the yhat column as a new column
df['exp_yhat'] = np.exp[df['yhat']]
print[df.head[]]
# ds n_tickets yhat exp_yhat
# 0 2018-02-17 2202 7.545468 1892.148056
# 1 2018-02-18 2449 7.703022 2215.031714
# 2 2018-02-19 2409 7.705301 2220.085527
# 3 2018-02-20 2364 7.675143 2154.131705
# 4 2018-02-21 2306 7.693359 2193.730943
8from io import StringIO
import numpy as np
import pandas as pd
s = """
ds n_tickets yhat
0 2018-02-17 2202 7.545468
1 2018-02-18 2449 7.703022
2 2018-02-19 2409 7.705301
3 2018-02-20 2364 7.675143
4 2018-02-21 2306 7.693359
5 2018-02-22 2492 7.728534
6 2018-02-23 2300 7.669022
7 2018-02-24 2359 7.534430
8 2018-02-25 2481 7.691983
9 2018-02-26 2446 7.694263
"""
# Load your example
df = pd.read_csv[StringIO[s], delim_whitespace=True]
# Add the exponential of the yhat column as a new column
df['exp_yhat'] = np.exp[df['yhat']]
print[df.head[]]
# ds n_tickets yhat exp_yhat
# 0 2018-02-17 2202 7.545468 1892.148056
# 1 2018-02-18 2449 7.703022 2215.031714
# 2 2018-02-19 2409 7.705301 2220.085527
# 3 2018-02-20 2364 7.675143 2154.131705
# 4 2018-02-21 2306 7.693359 2193.730943
9Syntax : math.log[a,Base] Parameters : a : The numeric value Base : Base to which the logarithm has to be computed. Return Value : Returns natural log if 1 argument is passed and log with specified base if 2 arguments are passed. Exceptions : Raises ValueError if a negative no. is passed as argument.0
Syntax : math.log[a,Base] Parameters : a : The numeric value Base : Base to which the logarithm has to be computed. Return Value : Returns natural log if 1 argument is passed and log with specified base if 2 arguments are passed. Exceptions : Raises ValueError if a negative no. is passed as argument.1
from io import StringIO
import numpy as np
import pandas as pd
s = """
ds n_tickets yhat
0 2018-02-17 2202 7.545468
1 2018-02-18 2449 7.703022
2 2018-02-19 2409 7.705301
3 2018-02-20 2364 7.675143
4 2018-02-21 2306 7.693359
5 2018-02-22 2492 7.728534
6 2018-02-23 2300 7.669022
7 2018-02-24 2359 7.534430
8 2018-02-25 2481 7.691983
9 2018-02-26 2446 7.694263
"""
# Load your example
df = pd.read_csv[StringIO[s], delim_whitespace=True]
# Add the exponential of the yhat column as a new column
df['exp_yhat'] = np.exp[df['yhat']]
print[df.head[]]
# ds n_tickets yhat exp_yhat
# 0 2018-02-17 2202 7.545468 1892.148056
# 1 2018-02-18 2449 7.703022 2215.031714
# 2 2018-02-19 2409 7.705301 2220.085527
# 3 2018-02-20 2364 7.675143 2154.131705
# 4 2018-02-21 2306 7.693359 2193.730943
6 Syntax : math.log[a,Base] Parameters : a : The numeric value Base : Base to which the logarithm has to be computed. Return Value : Returns natural log if 1 argument is passed and log with specified base if 2 arguments are passed. Exceptions : Raises ValueError if a negative no. is passed as argument.3
Syntax : math.log[a,Base] Parameters : a : The numeric value Base : Base to which the logarithm has to be computed. Return Value : Returns natural log if 1 argument is passed and log with specified base if 2 arguments are passed. Exceptions : Raises ValueError if a negative no. is passed as argument.4
Syntax : math.log[a,Base] Parameters : a : The numeric value Base : Base to which the logarithm has to be computed. Return Value : Returns natural log if 1 argument is passed and log with specified base if 2 arguments are passed. Exceptions : Raises ValueError if a negative no. is passed as argument.5
from io import StringIO
import numpy as np
import pandas as pd
s = """
ds n_tickets yhat
0 2018-02-17 2202 7.545468
1 2018-02-18 2449 7.703022
2 2018-02-19 2409 7.705301
3 2018-02-20 2364 7.675143
4 2018-02-21 2306 7.693359
5 2018-02-22 2492 7.728534
6 2018-02-23 2300 7.669022
7 2018-02-24 2359 7.534430
8 2018-02-25 2481 7.691983
9 2018-02-26 2446 7.694263
"""
# Load your example
df = pd.read_csv[StringIO[s], delim_whitespace=True]
# Add the exponential of the yhat column as a new column
df['exp_yhat'] = np.exp[df['yhat']]
print[df.head[]]
# ds n_tickets yhat exp_yhat
# 0 2018-02-17 2202 7.545468 1892.148056
# 1 2018-02-18 2449 7.703022 2215.031714
# 2 2018-02-19 2409 7.705301 2220.085527
# 3 2018-02-20 2364 7.675143 2154.131705
# 4 2018-02-21 2306 7.693359 2193.730943
6 from io import StringIO
import numpy as np
import pandas as pd
s = """
ds n_tickets yhat
0 2018-02-17 2202 7.545468
1 2018-02-18 2449 7.703022
2 2018-02-19 2409 7.705301
3 2018-02-20 2364 7.675143
4 2018-02-21 2306 7.693359
5 2018-02-22 2492 7.728534
6 2018-02-23 2300 7.669022
7 2018-02-24 2359 7.534430
8 2018-02-25 2481 7.691983
9 2018-02-26 2446 7.694263
"""
# Load your example
df = pd.read_csv[StringIO[s], delim_whitespace=True]
# Add the exponential of the yhat column as a new column
df['exp_yhat'] = np.exp[df['yhat']]
print[df.head[]]
# ds n_tickets yhat exp_yhat
# 0 2018-02-17 2202 7.545468 1892.148056
# 1 2018-02-18 2449 7.703022 2215.031714
# 2 2018-02-19 2409 7.705301 2220.085527
# 3 2018-02-20 2364 7.675143 2154.131705
# 4 2018-02-21 2306 7.693359 2193.730943
7Syntax : math.log[a,Base] Parameters : a : The numeric value Base : Base to which the logarithm has to be computed. Return Value : Returns natural log if 1 argument is passed and log with specified base if 2 arguments are passed. Exceptions : Raises ValueError if a negative no. is passed as argument.8
from io import StringIO
import numpy as np
import pandas as pd
s = """
ds n_tickets yhat
0 2018-02-17 2202 7.545468
1 2018-02-18 2449 7.703022
2 2018-02-19 2409 7.705301
3 2018-02-20 2364 7.675143
4 2018-02-21 2306 7.693359
5 2018-02-22 2492 7.728534
6 2018-02-23 2300 7.669022
7 2018-02-24 2359 7.534430
8 2018-02-25 2481 7.691983
9 2018-02-26 2446 7.694263
"""
# Load your example
df = pd.read_csv[StringIO[s], delim_whitespace=True]
# Add the exponential of the yhat column as a new column
df['exp_yhat'] = np.exp[df['yhat']]
print[df.head[]]
# ds n_tickets yhat exp_yhat
# 0 2018-02-17 2202 7.545468 1892.148056
# 1 2018-02-18 2449 7.703022 2215.031714
# 2 2018-02-19 2409 7.705301 2220.085527
# 3 2018-02-20 2364 7.675143 2154.131705
# 4 2018-02-21 2306 7.693359 2193.730943
9Syntax : math.log[a,Base] Parameters : a : The numeric value Base : Base to which the logarithm has to be computed. Return Value : Returns natural log if 1 argument is passed and log with specified base if 2 arguments are passed. Exceptions : Raises ValueError if a negative no. is passed as argument.0
Syntax : math.log[a,Base] Parameters : a : The numeric value Base : Base to which the logarithm has to be computed. Return Value : Returns natural log if 1 argument is passed and log with specified base if 2 arguments are passed. Exceptions : Raises ValueError if a negative no. is passed as argument.1
from io import StringIO
import numpy as np
import pandas as pd
s = """
ds n_tickets yhat
0 2018-02-17 2202 7.545468
1 2018-02-18 2449 7.703022
2 2018-02-19 2409 7.705301
3 2018-02-20 2364 7.675143
4 2018-02-21 2306 7.693359
5 2018-02-22 2492 7.728534
6 2018-02-23 2300 7.669022
7 2018-02-24 2359 7.534430
8 2018-02-25 2481 7.691983
9 2018-02-26 2446 7.694263
"""
# Load your example
df = pd.read_csv[StringIO[s], delim_whitespace=True]
# Add the exponential of the yhat column as a new column
df['exp_yhat'] = np.exp[df['yhat']]
print[df.head[]]
# ds n_tickets yhat exp_yhat
# 0 2018-02-17 2202 7.545468 1892.148056
# 1 2018-02-18 2449 7.703022 2215.031714
# 2 2018-02-19 2409 7.705301 2220.085527
# 3 2018-02-20 2364 7.675143 2154.131705
# 4 2018-02-21 2306 7.693359 2193.730943
6 Syntax : math.log[a,Base] Parameters : a : The numeric value Base : Base to which the logarithm has to be computed. Return Value : Returns natural log if 1 argument is passed and log with specified base if 2 arguments are passed. Exceptions : Raises ValueError if a negative no. is passed as argument.3
Syntax : math.log[a,Base] Parameters : a : The numeric value Base : Base to which the logarithm has to be computed. Return Value : Returns natural log if 1 argument is passed and log with specified base if 2 arguments are passed. Exceptions : Raises ValueError if a negative no. is passed as argument.4
Natural logarithm of 14 is : 2.6390573296152584 Logarithm base 5 of 14 is : 1.63973851319556065
Natural logarithm of 14 is : 2.6390573296152584 Logarithm base 5 of 14 is : 1.63973851319556066
Syntax : math.log[a,Base] Parameters : a : The numeric value Base : Base to which the logarithm has to be computed. Return Value : Returns natural log if 1 argument is passed and log with specified base if 2 arguments are passed. Exceptions : Raises ValueError if a negative no. is passed as argument.5
Đầu ra: & nbsp;
Natural logarithm of 14 is : 2.6390573296152584 Logarithm base 5 of 14 is : 1.6397385131955606
Bài viết này được đóng góp bởi Manjeet Singh. Nếu bạn thích GeekSforGeeks và muốn đóng góp, bạn cũng có thể viết một bài viết bằng Write.GeekSforGeek.org hoặc gửi bài viết của bạn. Xem bài viết của bạn xuất hiện trên trang chính của GeekSforGeek và giúp các chuyên viên máy tính khác. Xin vui lòng viết nhận xét nếu bạn tìm thấy bất cứ điều gì không chính xác hoặc bạn muốn chia sẻ thêm thông tin về chủ đề được thảo luận ở trên. This function is used to compute the logarithm base 2 of a. Displays more accurate result than log[a,2].
Syntax : math.log2[a] Parameters : a : The numeric value Return Value : Returns logarithm base 2 of a Exceptions : Raises ValueError if a negative no. is passed as argument.
Python3
from io import StringIO
import numpy as np
import pandas as pd
s = """
ds n_tickets yhat
0 2018-02-17 2202 7.545468
1 2018-02-18 2449 7.703022
2 2018-02-19 2409 7.705301
3 2018-02-20 2364 7.675143
4 2018-02-21 2306 7.693359
5 2018-02-22 2492 7.728534
6 2018-02-23 2300 7.669022
7 2018-02-24 2359 7.534430
8 2018-02-25 2481 7.691983
9 2018-02-26 2446 7.694263
"""
# Load your example
df = pd.read_csv[StringIO[s], delim_whitespace=True]
# Add the exponential of the yhat column as a new column
df['exp_yhat'] = np.exp[df['yhat']]
print[df.head[]]
# ds n_tickets yhat exp_yhat
# 0 2018-02-17 2202 7.545468 1892.148056
# 1 2018-02-18 2449 7.703022 2215.031714
# 2 2018-02-19 2409 7.705301 2220.085527
# 3 2018-02-20 2364 7.675143 2154.131705
# 4 2018-02-21 2306 7.693359 2193.730943
4 from io import StringIO
import numpy as np
import pandas as pd
s = """
ds n_tickets yhat
0 2018-02-17 2202 7.545468
1 2018-02-18 2449 7.703022
2 2018-02-19 2409 7.705301
3 2018-02-20 2364 7.675143
4 2018-02-21 2306 7.693359
5 2018-02-22 2492 7.728534
6 2018-02-23 2300 7.669022
7 2018-02-24 2359 7.534430
8 2018-02-25 2481 7.691983
9 2018-02-26 2446 7.694263
"""
# Load your example
df = pd.read_csv[StringIO[s], delim_whitespace=True]
# Add the exponential of the yhat column as a new column
df['exp_yhat'] = np.exp[df['yhat']]
print[df.head[]]
# ds n_tickets yhat exp_yhat
# 0 2018-02-17 2202 7.545468 1892.148056
# 1 2018-02-18 2449 7.703022 2215.031714
# 2 2018-02-19 2409 7.705301 2220.085527
# 3 2018-02-20 2364 7.675143 2154.131705
# 4 2018-02-21 2306 7.693359 2193.730943
5Làm thế nào để bạn chuyển đổi giá trị nhật ký thành giá trị bình thường?
Bạn có thể chuyển đổi các giá trị nhật ký thành các giá trị bình thường bằng cách nâng 10 thành nguồn cho các giá trị nhật ký [bạn muốn chuyển đổi]. Chẳng hạn, nếu bạn có 0,30103 là giá trị nhật ký và muốn nhận giá trị bình thường, bạn sẽ có: "10^0.30103" và kết quả sẽ là giá trị bình thường.
Đầu ra: & nbsp;
Logarithm base 2 of 14 is : 3.807354922057604
Bài viết này được đóng góp bởi Manjeet Singh. Nếu bạn thích GeekSforGeeks và muốn đóng góp, bạn cũng có thể viết một bài viết bằng Write.GeekSforGeek.org hoặc gửi bài viết của bạn. Xem bài viết của bạn xuất hiện trên trang chính của GeekSforGeek và giúp các chuyên viên máy tính khác. Xin vui lòng viết nhận xét nếu bạn tìm thấy bất cứ điều gì không chính xác hoặc bạn muốn chia sẻ thêm thông tin về chủ đề được thảo luận ở trên. This function is used to compute the logarithm base 10 of a. Displays more accurate result than log[a,10].
Syntax : math.log10[a] Parameters : a : The numeric value Return Value : Returns logarithm base 10 of a Exceptions : Raises ValueError if a negative no. is passed as argument.
Python3
from io import StringIO
import numpy as np
import pandas as pd
s = """
ds n_tickets yhat
0 2018-02-17 2202 7.545468
1 2018-02-18 2449 7.703022
2 2018-02-19 2409 7.705301
3 2018-02-20 2364 7.675143
4 2018-02-21 2306 7.693359
5 2018-02-22 2492 7.728534
6 2018-02-23 2300 7.669022
7 2018-02-24 2359 7.534430
8 2018-02-25 2481 7.691983
9 2018-02-26 2446 7.694263
"""
# Load your example
df = pd.read_csv[StringIO[s], delim_whitespace=True]
# Add the exponential of the yhat column as a new column
df['exp_yhat'] = np.exp[df['yhat']]
print[df.head[]]
# ds n_tickets yhat exp_yhat
# 0 2018-02-17 2202 7.545468 1892.148056
# 1 2018-02-18 2449 7.703022 2215.031714
# 2 2018-02-19 2409 7.705301 2220.085527
# 3 2018-02-20 2364 7.675143 2154.131705
# 4 2018-02-21 2306 7.693359 2193.730943
4 from io import StringIO
import numpy as np
import pandas as pd
s = """
ds n_tickets yhat
0 2018-02-17 2202 7.545468
1 2018-02-18 2449 7.703022
2 2018-02-19 2409 7.705301
3 2018-02-20 2364 7.675143
4 2018-02-21 2306 7.693359
5 2018-02-22 2492 7.728534
6 2018-02-23 2300 7.669022
7 2018-02-24 2359 7.534430
8 2018-02-25 2481 7.691983
9 2018-02-26 2446 7.694263
"""
# Load your example
df = pd.read_csv[StringIO[s], delim_whitespace=True]
# Add the exponential of the yhat column as a new column
df['exp_yhat'] = np.exp[df['yhat']]
print[df.head[]]
# ds n_tickets yhat exp_yhat
# 0 2018-02-17 2202 7.545468 1892.148056
# 1 2018-02-18 2449 7.703022 2215.031714
# 2 2018-02-19 2409 7.705301 2220.085527
# 3 2018-02-20 2364 7.675143 2154.131705
# 4 2018-02-21 2306 7.693359 2193.730943
5Làm thế nào để bạn chuyển đổi giá trị nhật ký thành giá trị bình thường?
Bạn có thể chuyển đổi các giá trị nhật ký thành các giá trị bình thường bằng cách nâng 10 thành nguồn cho các giá trị nhật ký [bạn muốn chuyển đổi]. Chẳng hạn, nếu bạn có 0,30103 là giá trị nhật ký và muốn nhận giá trị bình thường, bạn sẽ có: "10^0.30103" và kết quả sẽ là giá trị bình thường.
Đầu ra: & nbsp;
Logarithm base 10 of 14 is : 1.146128035678238
Bài viết này được đóng góp bởi Manjeet Singh. Nếu bạn thích GeekSforGeeks và muốn đóng góp, bạn cũng có thể viết một bài viết bằng Write.GeekSforGeek.org hoặc gửi bài viết của bạn. Xem bài viết của bạn xuất hiện trên trang chính của GeekSforGeek và giúp các chuyên viên máy tính khác. Xin vui lòng viết nhận xét nếu bạn tìm thấy bất cứ điều gì không chính xác hoặc bạn muốn chia sẻ thêm thông tin về chủ đề được thảo luận ở trên. This function is used to compute logarithm[1+a] .
Syntax : math.log1p[a] Parameters : a : The numeric value Return Value : Returns log[1+a] Exceptions : Raises ValueError if a negative no. is passed as argument.
Python3
from io import StringIO
import numpy as np
import pandas as pd
s = """
ds n_tickets yhat
0 2018-02-17 2202 7.545468
1 2018-02-18 2449 7.703022
2 2018-02-19 2409 7.705301
3 2018-02-20 2364 7.675143
4 2018-02-21 2306 7.693359
5 2018-02-22 2492 7.728534
6 2018-02-23 2300 7.669022
7 2018-02-24 2359 7.534430
8 2018-02-25 2481 7.691983
9 2018-02-26 2446 7.694263
"""
# Load your example
df = pd.read_csv[StringIO[s], delim_whitespace=True]
# Add the exponential of the yhat column as a new column
df['exp_yhat'] = np.exp[df['yhat']]
print[df.head[]]
# ds n_tickets yhat exp_yhat
# 0 2018-02-17 2202 7.545468 1892.148056
# 1 2018-02-18 2449 7.703022 2215.031714
# 2 2018-02-19 2409 7.705301 2220.085527
# 3 2018-02-20 2364 7.675143 2154.131705
# 4 2018-02-21 2306 7.693359 2193.730943
4 from io import StringIO
import numpy as np
import pandas as pd
s = """
ds n_tickets yhat
0 2018-02-17 2202 7.545468
1 2018-02-18 2449 7.703022
2 2018-02-19 2409 7.705301
3 2018-02-20 2364 7.675143
4 2018-02-21 2306 7.693359
5 2018-02-22 2492 7.728534
6 2018-02-23 2300 7.669022
7 2018-02-24 2359 7.534430
8 2018-02-25 2481 7.691983
9 2018-02-26 2446 7.694263
"""
# Load your example
df = pd.read_csv[StringIO[s], delim_whitespace=True]
# Add the exponential of the yhat column as a new column
df['exp_yhat'] = np.exp[df['yhat']]
print[df.head[]]
# ds n_tickets yhat exp_yhat
# 0 2018-02-17 2202 7.545468 1892.148056
# 1 2018-02-18 2449 7.703022 2215.031714
# 2 2018-02-19 2409 7.705301 2220.085527
# 3 2018-02-20 2364 7.675143 2154.131705
# 4 2018-02-21 2306 7.693359 2193.730943
5Làm thế nào để bạn chuyển đổi giá trị nhật ký thành giá trị bình thường?
Bạn có thể chuyển đổi các giá trị nhật ký thành các giá trị bình thường bằng cách nâng 10 thành nguồn cho các giá trị nhật ký [bạn muốn chuyển đổi]. Chẳng hạn, nếu bạn có 0,30103 là giá trị nhật ký và muốn nhận giá trị bình thường, bạn sẽ có: "10^0.30103" và kết quả sẽ là giá trị bình thường.
Đầu ra: & nbsp;
Logarithm[1+a] value of 14 is : 2.70805020110221
Bài viết này được đóng góp bởi Manjeet Singh. Nếu bạn thích GeekSforGeeks và muốn đóng góp, bạn cũng có thể viết một bài viết bằng Write.GeekSforGeek.org hoặc gửi bài viết của bạn. Xem bài viết của bạn xuất hiện trên trang chính của GeekSforGeek và giúp các chuyên viên máy tính khác. Xin vui lòng viết nhận xét nếu bạn tìm thấy bất cứ điều gì không chính xác hoặc bạn muốn chia sẻ thêm thông tin về chủ đề được thảo luận ở trên.
Làm thế nào để bạn chuyển đổi giá trị nhật ký thành giá trị bình thường? This function returns value error if number is negative.
Python3
from io import StringIO
import numpy as np
import pandas as pd
s = """
ds n_tickets yhat
0 2018-02-17 2202 7.545468
1 2018-02-18 2449 7.703022
2 2018-02-19 2409 7.705301
3 2018-02-20 2364 7.675143
4 2018-02-21 2306 7.693359
5 2018-02-22 2492 7.728534
6 2018-02-23 2300 7.669022
7 2018-02-24 2359 7.534430
8 2018-02-25 2481 7.691983
9 2018-02-26 2446 7.694263
"""
# Load your example
df = pd.read_csv[StringIO[s], delim_whitespace=True]
# Add the exponential of the yhat column as a new column
df['exp_yhat'] = np.exp[df['yhat']]
print[df.head[]]
# ds n_tickets yhat exp_yhat
# 0 2018-02-17 2202 7.545468 1892.148056
# 1 2018-02-18 2449 7.703022 2215.031714
# 2 2018-02-19 2409 7.705301 2220.085527
# 3 2018-02-20 2364 7.675143 2154.131705
# 4 2018-02-21 2306 7.693359 2193.730943
4 from io import StringIO
import numpy as np
import pandas as pd
s = """
ds n_tickets yhat
0 2018-02-17 2202 7.545468
1 2018-02-18 2449 7.703022
2 2018-02-19 2409 7.705301
3 2018-02-20 2364 7.675143
4 2018-02-21 2306 7.693359
5 2018-02-22 2492 7.728534
6 2018-02-23 2300 7.669022
7 2018-02-24 2359 7.534430
8 2018-02-25 2481 7.691983
9 2018-02-26 2446 7.694263
"""
# Load your example
df = pd.read_csv[StringIO[s], delim_whitespace=True]
# Add the exponential of the yhat column as a new column
df['exp_yhat'] = np.exp[df['yhat']]
print[df.head[]]
# ds n_tickets yhat exp_yhat
# 0 2018-02-17 2202 7.545468 1892.148056
# 1 2018-02-18 2449 7.703022 2215.031714
# 2 2018-02-19 2409 7.705301 2220.085527
# 3 2018-02-20 2364 7.675143 2154.131705
# 4 2018-02-21 2306 7.693359 2193.730943
5Bạn có thể chuyển đổi các giá trị nhật ký thành các giá trị bình thường bằng cách nâng 10 thành nguồn cho các giá trị nhật ký [bạn muốn chuyển đổi]. Chẳng hạn, nếu bạn có 0,30103 là giá trị nhật ký và muốn nhận giá trị bình thường, bạn sẽ có: "10^0.30103" và kết quả sẽ là giá trị bình thường.
Làm thế nào để bạn quay lại một bản ghi?
Đầu ra: & nbsp;
from io import StringIO
import numpy as np
import pandas as pd
s = """
ds n_tickets yhat
0 2018-02-17 2202 7.545468
1 2018-02-18 2449 7.703022
2 2018-02-19 2409 7.705301
3 2018-02-20 2364 7.675143
4 2018-02-21 2306 7.693359
5 2018-02-22 2492 7.728534
6 2018-02-23 2300 7.669022
7 2018-02-24 2359 7.534430
8 2018-02-25 2481 7.691983
9 2018-02-26 2446 7.694263
"""
# Load your example
df = pd.read_csv[StringIO[s], delim_whitespace=True]
# Add the exponential of the yhat column as a new column
df['exp_yhat'] = np.exp[df['yhat']]
print[df.head[]]
# ds n_tickets yhat exp_yhat
# 0 2018-02-17 2202 7.545468 1892.148056
# 1 2018-02-18 2449 7.703022 2215.031714
# 2 2018-02-19 2409 7.705301 2220.085527
# 3 2018-02-20 2364 7.675143 2154.131705
# 4 2018-02-21 2306 7.693359 2193.730943
0Bài viết này được đóng góp bởi Manjeet Singh. Nếu bạn thích GeekSforGeeks và muốn đóng góp, bạn cũng có thể viết một bài viết bằng Write.GeekSforGeek.org hoặc gửi bài viết của bạn. Xem bài viết của bạn xuất hiện trên trang chính của GeekSforGeek và giúp các chuyên viên máy tính khác. Xin vui lòng viết nhận xét nếu bạn tìm thấy bất cứ điều gì không chính xác hoặc bạn muốn chia sẻ thêm thông tin về chủ đề được thảo luận ở trên.
from io import StringIO
import numpy as np
import pandas as pd
s = """
ds n_tickets yhat
0 2018-02-17 2202 7.545468
1 2018-02-18 2449 7.703022
2 2018-02-19 2409 7.705301
3 2018-02-20 2364 7.675143
4 2018-02-21 2306 7.693359
5 2018-02-22 2492 7.728534
6 2018-02-23 2300 7.669022
7 2018-02-24 2359 7.534430
8 2018-02-25 2481 7.691983
9 2018-02-26 2446 7.694263
"""
# Load your example
df = pd.read_csv[StringIO[s], delim_whitespace=True]
# Add the exponential of the yhat column as a new column
df['exp_yhat'] = np.exp[df['yhat']]
print[df.head[]]
# ds n_tickets yhat exp_yhat
# 0 2018-02-17 2202 7.545468 1892.148056
# 1 2018-02-18 2449 7.703022 2215.031714
# 2 2018-02-19 2409 7.705301 2220.085527
# 3 2018-02-20 2364 7.675143 2154.131705
# 4 2018-02-21 2306 7.693359 2193.730943
1Làm thế nào để bạn chuyển đổi giá trị nhật ký thành giá trị bình thường?
Bạn có thể chuyển đổi các giá trị nhật ký thành các giá trị bình thường bằng cách nâng 10 thành nguồn cho các giá trị nhật ký [bạn muốn chuyển đổi]. Chẳng hạn, nếu bạn có 0,30103 là giá trị nhật ký và muốn nhận giá trị bình thường, bạn sẽ có: "10^0.30103" và kết quả sẽ là giá trị bình thường.no. of digits of a number. Code below illustrates the same.
Python3
from io import StringIO
import numpy as np
import pandas as pd
s = """
ds n_tickets yhat
0 2018-02-17 2202 7.545468
1 2018-02-18 2449 7.703022
2 2018-02-19 2409 7.705301
3 2018-02-20 2364 7.675143
4 2018-02-21 2306 7.693359
5 2018-02-22 2492 7.728534
6 2018-02-23 2300 7.669022
7 2018-02-24 2359 7.534430
8 2018-02-25 2481 7.691983
9 2018-02-26 2446 7.694263
"""
# Load your example
df = pd.read_csv[StringIO[s], delim_whitespace=True]
# Add the exponential of the yhat column as a new column
df['exp_yhat'] = np.exp[df['yhat']]
print[df.head[]]
# ds n_tickets yhat exp_yhat
# 0 2018-02-17 2202 7.545468 1892.148056
# 1 2018-02-18 2449 7.703022 2215.031714
# 2 2018-02-19 2409 7.705301 2220.085527
# 3 2018-02-20 2364 7.675143 2154.131705
# 4 2018-02-21 2306 7.693359 2193.730943
4 from io import StringIO
import numpy as np
import pandas as pd
s = """
ds n_tickets yhat
0 2018-02-17 2202 7.545468
1 2018-02-18 2449 7.703022
2 2018-02-19 2409 7.705301
3 2018-02-20 2364 7.675143
4 2018-02-21 2306 7.693359
5 2018-02-22 2492 7.728534
6 2018-02-23 2300 7.669022
7 2018-02-24 2359 7.534430
8 2018-02-25 2481 7.691983
9 2018-02-26 2446 7.694263
"""
# Load your example
df = pd.read_csv[StringIO[s], delim_whitespace=True]
# Add the exponential of the yhat column as a new column
df['exp_yhat'] = np.exp[df['yhat']]
print[df.head[]]
# ds n_tickets yhat exp_yhat
# 0 2018-02-17 2202 7.545468 1892.148056
# 1 2018-02-18 2449 7.703022 2215.031714
# 2 2018-02-19 2409 7.705301 2220.085527
# 3 2018-02-20 2364 7.675143 2154.131705
# 4 2018-02-21 2306 7.693359 2193.730943
5from io import StringIO
import numpy as np
import pandas as pd
s = """
ds n_tickets yhat
0 2018-02-17 2202 7.545468
1 2018-02-18 2449 7.703022
2 2018-02-19 2409 7.705301
3 2018-02-20 2364 7.675143
4 2018-02-21 2306 7.693359
5 2018-02-22 2492 7.728534
6 2018-02-23 2300 7.669022
7 2018-02-24 2359 7.534430
8 2018-02-25 2481 7.691983
9 2018-02-26 2446 7.694263
"""
# Load your example
df = pd.read_csv[StringIO[s], delim_whitespace=True]
# Add the exponential of the yhat column as a new column
df['exp_yhat'] = np.exp[df['yhat']]
print[df.head[]]
# ds n_tickets yhat exp_yhat
# 0 2018-02-17 2202 7.545468 1892.148056
# 1 2018-02-18 2449 7.703022 2215.031714
# 2 2018-02-19 2409 7.705301 2220.085527
# 3 2018-02-20 2364 7.675143 2154.131705
# 4 2018-02-21 2306 7.693359 2193.730943
6 from io import StringIO
import numpy as np
import pandas as pd
s = """
ds n_tickets yhat
0 2018-02-17 2202 7.545468
1 2018-02-18 2449 7.703022
2 2018-02-19 2409 7.705301
3 2018-02-20 2364 7.675143
4 2018-02-21 2306 7.693359
5 2018-02-22 2492 7.728534
6 2018-02-23 2300 7.669022
7 2018-02-24 2359 7.534430
8 2018-02-25 2481 7.691983
9 2018-02-26 2446 7.694263
"""
# Load your example
df = pd.read_csv[StringIO[s], delim_whitespace=True]
# Add the exponential of the yhat column as a new column
df['exp_yhat'] = np.exp[df['yhat']]
print[df.head[]]
# ds n_tickets yhat exp_yhat
# 0 2018-02-17 2202 7.545468 1892.148056
# 1 2018-02-18 2449 7.703022 2215.031714
# 2 2018-02-19 2409 7.705301 2220.085527
# 3 2018-02-20 2364 7.675143 2154.131705
# 4 2018-02-21 2306 7.693359 2193.730943
7Logarithm[1+a] value of 14 is : 2.708050201102211
from io import StringIO
import numpy as np
import pandas as pd
s = """
ds n_tickets yhat
0 2018-02-17 2202 7.545468
1 2018-02-18 2449 7.703022
2 2018-02-19 2409 7.705301
3 2018-02-20 2364 7.675143
4 2018-02-21 2306 7.693359
5 2018-02-22 2492 7.728534
6 2018-02-23 2300 7.669022
7 2018-02-24 2359 7.534430
8 2018-02-25 2481 7.691983
9 2018-02-26 2446 7.694263
"""
# Load your example
df = pd.read_csv[StringIO[s], delim_whitespace=True]
# Add the exponential of the yhat column as a new column
df['exp_yhat'] = np.exp[df['yhat']]
print[df.head[]]
# ds n_tickets yhat exp_yhat
# 0 2018-02-17 2202 7.545468 1892.148056
# 1 2018-02-18 2449 7.703022 2215.031714
# 2 2018-02-19 2409 7.705301 2220.085527
# 3 2018-02-20 2364 7.675143 2154.131705
# 4 2018-02-21 2306 7.693359 2193.730943
9Syntax : math.log[a,Base] Parameters : a : The numeric value Base : Base to which the logarithm has to be computed. Return Value : Returns natural log if 1 argument is passed and log with specified base if 2 arguments are passed. Exceptions : Raises ValueError if a negative no. is passed as argument.0
Syntax : math.log[a,Base] Parameters : a : The numeric value Base : Base to which the logarithm has to be computed. Return Value : Returns natural log if 1 argument is passed and log with specified base if 2 arguments are passed. Exceptions : Raises ValueError if a negative no. is passed as argument.1
from io import StringIO
import numpy as np
import pandas as pd
s = """
ds n_tickets yhat
0 2018-02-17 2202 7.545468
1 2018-02-18 2449 7.703022
2 2018-02-19 2409 7.705301
3 2018-02-20 2364 7.675143
4 2018-02-21 2306 7.693359
5 2018-02-22 2492 7.728534
6 2018-02-23 2300 7.669022
7 2018-02-24 2359 7.534430
8 2018-02-25 2481 7.691983
9 2018-02-26 2446 7.694263
"""
# Load your example
df = pd.read_csv[StringIO[s], delim_whitespace=True]
# Add the exponential of the yhat column as a new column
df['exp_yhat'] = np.exp[df['yhat']]
print[df.head[]]
# ds n_tickets yhat exp_yhat
# 0 2018-02-17 2202 7.545468 1892.148056
# 1 2018-02-18 2449 7.703022 2215.031714
# 2 2018-02-19 2409 7.705301 2220.085527
# 3 2018-02-20 2364 7.675143 2154.131705
# 4 2018-02-21 2306 7.693359 2193.730943
6 from io import StringIO
import numpy as np
import pandas as pd
s = """
ds n_tickets yhat
0 2018-02-17 2202 7.545468
1 2018-02-18 2449 7.703022
2 2018-02-19 2409 7.705301
3 2018-02-20 2364 7.675143
4 2018-02-21 2306 7.693359
5 2018-02-22 2492 7.728534
6 2018-02-23 2300 7.669022
7 2018-02-24 2359 7.534430
8 2018-02-25 2481 7.691983
9 2018-02-26 2446 7.694263
"""
# Load your example
df = pd.read_csv[StringIO[s], delim_whitespace=True]
# Add the exponential of the yhat column as a new column
df['exp_yhat'] = np.exp[df['yhat']]
print[df.head[]]
# ds n_tickets yhat exp_yhat
# 0 2018-02-17 2202 7.545468 1892.148056
# 1 2018-02-18 2449 7.703022 2215.031714
# 2 2018-02-19 2409 7.705301 2220.085527
# 3 2018-02-20 2364 7.675143 2154.131705
# 4 2018-02-21 2306 7.693359 2193.730943
7Logarithm[1+a] value of 14 is : 2.708050201102217
Logarithm base 2 of 14 is : 3.8073549220576049
Logarithm[1+a] value of 14 is : 2.708050201102219
from io import StringIO
import numpy as np
import pandas as pd
s = """
ds n_tickets yhat
0 2018-02-17 2202 7.545468
1 2018-02-18 2449 7.703022
2 2018-02-19 2409 7.705301
3 2018-02-20 2364 7.675143
4 2018-02-21 2306 7.693359
5 2018-02-22 2492 7.728534
6 2018-02-23 2300 7.669022
7 2018-02-24 2359 7.534430
8 2018-02-25 2481 7.691983
9 2018-02-26 2446 7.694263
"""
# Load your example
df = pd.read_csv[StringIO[s], delim_whitespace=True]
# Add the exponential of the yhat column as a new column
df['exp_yhat'] = np.exp[df['yhat']]
print[df.head[]]
# ds n_tickets yhat exp_yhat
# 0 2018-02-17 2202 7.545468 1892.148056
# 1 2018-02-18 2449 7.703022 2215.031714
# 2 2018-02-19 2409 7.705301 2220.085527
# 3 2018-02-20 2364 7.675143 2154.131705
# 4 2018-02-21 2306 7.693359 2193.730943
00from io import StringIO
import numpy as np
import pandas as pd
s = """
ds n_tickets yhat
0 2018-02-17 2202 7.545468
1 2018-02-18 2449 7.703022
2 2018-02-19 2409 7.705301
3 2018-02-20 2364 7.675143
4 2018-02-21 2306 7.693359
5 2018-02-22 2492 7.728534
6 2018-02-23 2300 7.669022
7 2018-02-24 2359 7.534430
8 2018-02-25 2481 7.691983
9 2018-02-26 2446 7.694263
"""
# Load your example
df = pd.read_csv[StringIO[s], delim_whitespace=True]
# Add the exponential of the yhat column as a new column
df['exp_yhat'] = np.exp[df['yhat']]
print[df.head[]]
# ds n_tickets yhat exp_yhat
# 0 2018-02-17 2202 7.545468 1892.148056
# 1 2018-02-18 2449 7.703022 2215.031714
# 2 2018-02-19 2409 7.705301 2220.085527
# 3 2018-02-20 2364 7.675143 2154.131705
# 4 2018-02-21 2306 7.693359 2193.730943
01 from io import StringIO
import numpy as np
import pandas as pd
s = """
ds n_tickets yhat
0 2018-02-17 2202 7.545468
1 2018-02-18 2449 7.703022
2 2018-02-19 2409 7.705301
3 2018-02-20 2364 7.675143
4 2018-02-21 2306 7.693359
5 2018-02-22 2492 7.728534
6 2018-02-23 2300 7.669022
7 2018-02-24 2359 7.534430
8 2018-02-25 2481 7.691983
9 2018-02-26 2446 7.694263
"""
# Load your example
df = pd.read_csv[StringIO[s], delim_whitespace=True]
# Add the exponential of the yhat column as a new column
df['exp_yhat'] = np.exp[df['yhat']]
print[df.head[]]
# ds n_tickets yhat exp_yhat
# 0 2018-02-17 2202 7.545468 1892.148056
# 1 2018-02-18 2449 7.703022 2215.031714
# 2 2018-02-19 2409 7.705301 2220.085527
# 3 2018-02-20 2364 7.675143 2154.131705
# 4 2018-02-21 2306 7.693359 2193.730943
022Đầu ra: & nbsp;
from io import StringIO
import numpy as np
import pandas as pd
s = """
ds n_tickets yhat
0 2018-02-17 2202 7.545468
1 2018-02-18 2449 7.703022
2 2018-02-19 2409 7.705301
3 2018-02-20 2364 7.675143
4 2018-02-21 2306 7.693359
5 2018-02-22 2492 7.728534
6 2018-02-23 2300 7.669022
7 2018-02-24 2359 7.534430
8 2018-02-25 2481 7.691983
9 2018-02-26 2446 7.694263
"""
# Load your example
df = pd.read_csv[StringIO[s], delim_whitespace=True]
# Add the exponential of the yhat column as a new column
df['exp_yhat'] = np.exp[df['yhat']]
print[df.head[]]
# ds n_tickets yhat exp_yhat
# 0 2018-02-17 2202 7.545468 1892.148056
# 1 2018-02-18 2449 7.703022 2215.031714
# 2 2018-02-19 2409 7.705301 2220.085527
# 3 2018-02-20 2364 7.675143 2154.131705
# 4 2018-02-21 2306 7.693359 2193.730943
2Bài viết này được đóng góp bởi Manjeet Singh. Nếu bạn thích GeekSforGeeks và muốn đóng góp, bạn cũng có thể viết một bài viết bằng Write.GeekSforGeek.org hoặc gửi bài viết của bạn. Xem bài viết của bạn xuất hiện trên trang chính của GeekSforGeek và giúp các chuyên viên máy tính khác. Xin vui lòng viết nhận xét nếu bạn tìm thấy bất cứ điều gì không chính xác hoặc bạn muốn chia sẻ thêm thông tin về chủ đề được thảo luận ở trên.Manjeet Singh. If you like GeeksforGeeks and would like to contribute, you can also write an article using write.geeksforgeeks.org or mail your article to . See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please write comments if you find anything incorrect, or you
want to share more information about the topic discussed above.