I studied data analysis in python. Today's topic is how to use Python libraries. I did a hands-on study of Numpy. Actually I used Numpy in Python before, But I forgot how to use some parts of it, so I will continue studying Numpy.
Memo:
import numpy as np
# In data analysis, NaN stands for "Not a Number". It is used to represent missing or undefined values in a dataset.
print(np.nan)
print(np.array([1, 2, np.nan]))
# np.linspace(start, stop, num) Generates an array of num evenly spaced values between start and stop.
a = np.linspace(0, 1, 5)
print(a)
# When using reshape, total number of elements must match the original array.
# If the number of elements doesn't match, it cause an error.
c1 = np.array([1, 2, 3, 4, 5, 6])
c2 = c1.reshape((2, 3))
# Generate normally distribution of random numbers.
rng = np.random.default_rng(123) # Set a random seed. Only for debugging.
print(rng.standard_normal(size=(4, 2)))
Hello, my name is Koki. I am currently learning the web framework Django and English. In my free time, I enjoy hiking, cycling, and visiting shrines and temples. At work, I make software for programmable logic controllers (PLCs), I work especially with OMRON and Mitsubishi PLCs. Please feel free to contact me for any inquiries, job requests, or just to chat. We look forward to hearing from you via email!