Write a NumPy program to compute the natural logarithm of one plus each element of a given array in floating-point accuracy

  • برمجة بايثون

Write a NumPy program to compute the natural logarithm of one plus each element of a given array in floating-point accuracy.

الأجوبة

import numpy as np
x = np.array([1e-99, 1e-100])
print("Original array: ")
print(x)
print("\nNatural logarithm of one plus each element:")
print(np.log1p(x))
Sample Output:
Original array: 
[1.e-099 1.e-100]

Natural logarithm of one plus each element:
[1.e-099 1.e-100]
هل كان المحتوى مفيد؟

تبحث عن مدرس اونلاين؟

محتاج مساعدة باختيار المدرس الافضل؟ تواصل مع فريقنا الان لمساعدتك بتأمين افضل مدرس
ماهو التخصص الذي تبحث عنه؟
اكتب هنا...