<jupyter_start><jupyter_text>수학 기초  Day 1 함수<jupyter_code>import numpy as np
a = np.arange(1,6)
print(a)
b = np.arange(1, 10, 2)
print(b)
a.sum()
a.prod()
b.sum()
b.prod()
def identity(x):
    y = x
    return y
identity(2)
[identity(x) for x in a]
def constant(x):
    y = 1
    return y
[constant(x) for x in a]
def square(x):
    y = x ** 2
    return y
[square(x) for x in a]
def double(x):
    y = x * 2
    return y
[double(x) for x in a]
def composition(f, g):
    return lambda x: f(g(x))
comp1 = composition(double, square)
comp2 = composition(square, double)
comp1(2)
comp2(2)
def summation(x, y):
    z = x + y
    return z
summation(10, 20)
def production(x, y):
    z = x * y
    return z
production(10,20)
np.exp(0)
np.exp(1)
np.exp(2+3)
np.exp(7-2)
np.exp(7) / np.exp(2)
def exponential(a, b):
    return a ** b
exponential(2,3)
exponential(2, 1+2)
exponential(2, 1) * exponential(2, 2)
np.log(10)
np.log2(10)
np.log10(10)
np.log10(2 * 5)
np.log10(2) + np.log10(5)
np.log10(20/2)
np.log10(20) - np.log10(2)
import math
theta = math.radians(90)
math.sin(theta)
math.cos(theta)
math.tan(theta)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1742957746478873, 'fraction_numerical': 0.06602112676056338, 'mean_word_length': 3.6598360655737703, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '497207', 'license': 'MIT', 'n_tokens_mistral': 561, 'n_tokens_neox': 533, 'n_words': 137, 'path': 'python/sem0/Math Python Day1.ipynb', 'repo_name': 'dreandes/Code', 'size': '1136'}