ml-finance-python
python scripts for finance machine learning
git clone https://9o.is/git/ml-finance-python.git
lab_122.ipynb
(1927B)
1 {
2 "cells": [
3 {
4 "cell_type": "code",
5 "execution_count": 2,
6 "metadata": {},
7 "outputs": [],
8 "source": [
9 "import ipywidgets as widgets"
10 ]
11 },
12 {
13 "cell_type": "code",
14 "execution_count": 3,
15 "metadata": {},
16 "outputs": [],
17 "source": [
18 "def squareit(n):\n",
19 " return n*n"
20 ]
21 },
22 {
23 "cell_type": "code",
24 "execution_count": 4,
25 "metadata": {},
26 "outputs": [
27 {
28 "data": {
29 "text/plain": [
30 "25"
31 ]
32 },
33 "execution_count": 4,
34 "metadata": {},
35 "output_type": "execute_result"
36 }
37 ],
38 "source": [
39 "squareit(5)"
40 ]
41 },
42 {
43 "cell_type": "code",
44 "execution_count": 5,
45 "metadata": {},
46 "outputs": [
47 {
48 "data": {
49 "application/vnd.jupyter.widget-view+json": {
50 "model_id": "16c0b74bfb69492ea6bb4893b4529210",
51 "version_major": 2,
52 "version_minor": 0
53 },
54 "text/plain": [
55 "interactive(children=(IntSlider(value=50, description='n'), Output()), _dom_classes=('widget-interact',))"
56 ]
57 },
58 "metadata": {},
59 "output_type": "display_data"
60 },
61 {
62 "data": {
63 "text/plain": [
64 "<function __main__.squareit(n)>"
65 ]
66 },
67 "execution_count": 5,
68 "metadata": {},
69 "output_type": "execute_result"
70 }
71 ],
72 "source": [
73 "widgets.interact(squareit, n=(0, 100))"
74 ]
75 },
76 {
77 "cell_type": "code",
78 "execution_count": null,
79 "metadata": {},
80 "outputs": [],
81 "source": []
82 }
83 ],
84 "metadata": {
85 "kernelspec": {
86 "display_name": "Python 3",
87 "language": "python",
88 "name": "python3"
89 },
90 "language_info": {
91 "codemirror_mode": {
92 "name": "ipython",
93 "version": 3
94 },
95 "file_extension": ".py",
96 "mimetype": "text/x-python",
97 "name": "python",
98 "nbconvert_exporter": "python",
99 "pygments_lexer": "ipython3",
100 "version": "3.8.8"
101 }
102 },
103 "nbformat": 4,
104 "nbformat_minor": 2
105 }