Advertisement
Guest User

Untitled

a guest
Jul 20th, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.85 KB | None | 0 0
  1. {
  2. "cells": [
  3. {
  4. "cell_type": "code",
  5. "execution_count": 1,
  6. "metadata": {},
  7. "outputs": [],
  8. "source": [
  9. "import numpy as np\n",
  10. "import math"
  11. ]
  12. },
  13. {
  14. "cell_type": "code",
  15. "execution_count": 2,
  16. "metadata": {},
  17. "outputs": [
  18. {
  19. "data": {
  20. "text/plain": [
  21. "array([[1, 2],\n",
  22. " [2, 3]])"
  23. ]
  24. },
  25. "execution_count": 2,
  26. "metadata": {},
  27. "output_type": "execute_result"
  28. }
  29. ],
  30. "source": [
  31. "a=np.array([[1,2],[2,3]])\n",
  32. "a"
  33. ]
  34. },
  35. {
  36. "cell_type": "code",
  37. "execution_count": 3,
  38. "metadata": {},
  39. "outputs": [
  40. {
  41. "data": {
  42. "text/plain": [
  43. "array([[4, 5],\n",
  44. " [5, 6]])"
  45. ]
  46. },
  47. "execution_count": 3,
  48. "metadata": {},
  49. "output_type": "execute_result"
  50. }
  51. ],
  52. "source": [
  53. "b=np.array([[4,5],[5,6]])\n",
  54. "b"
  55. ]
  56. },
  57. {
  58. "cell_type": "code",
  59. "execution_count": 4,
  60. "metadata": {},
  61. "outputs": [
  62. {
  63. "data": {
  64. "text/plain": [
  65. "array([[ 4, 10],\n",
  66. " [10, 18]])"
  67. ]
  68. },
  69. "execution_count": 4,
  70. "metadata": {},
  71. "output_type": "execute_result"
  72. }
  73. ],
  74. "source": [
  75. "#lets find value of c\n",
  76. "c=a*b\n",
  77. "c"
  78. ]
  79. },
  80. {
  81. "cell_type": "code",
  82. "execution_count": 7,
  83. "metadata": {},
  84. "outputs": [
  85. {
  86. "data": {
  87. "text/plain": [
  88. "array([[ 0.83635907, -0.81999226],\n",
  89. " [-0.74878058, 0.2676043 ]])"
  90. ]
  91. },
  92. "execution_count": 7,
  93. "metadata": {},
  94. "output_type": "execute_result"
  95. }
  96. ],
  97. "source": [
  98. "#lets find sin value\n",
  99. "c=np.sin(c)\n",
  100. "c\n",
  101. "#python show values of sin in radian not in degree"
  102. ]
  103. },
  104. {
  105. "cell_type": "code",
  106. "execution_count": 9,
  107. "metadata": {},
  108. "outputs": [
  109. {
  110. "data": {
  111. "text/plain": [
  112. "array([[1, 2, 3],\n",
  113. " [4, 5, 6]])"
  114. ]
  115. },
  116. "execution_count": 9,
  117. "metadata": {},
  118. "output_type": "execute_result"
  119. }
  120. ],
  121. "source": [
  122. "#lets multiply 2*3 matrix vs 3*3 matrix\n",
  123. "a=np.array([[1,2,3],[4,5,6]])\n",
  124. "a"
  125. ]
  126. },
  127. {
  128. "cell_type": "code",
  129. "execution_count": 10,
  130. "metadata": {},
  131. "outputs": [
  132. {
  133. "data": {
  134. "text/plain": [
  135. "array([[1, 2],\n",
  136. " [3, 4],\n",
  137. " [5, 6]])"
  138. ]
  139. },
  140. "execution_count": 10,
  141. "metadata": {},
  142. "output_type": "execute_result"
  143. }
  144. ],
  145. "source": [
  146. "b=np.array([[1,2],[3,4],[5,6]])\n",
  147. "b"
  148. ]
  149. },
  150. {
  151. "cell_type": "code",
  152. "execution_count": 20,
  153. "metadata": {},
  154. "outputs": [
  155. {
  156. "data": {
  157. "text/plain": [
  158. "array([[22, 28],\n",
  159. " [49, 64]])"
  160. ]
  161. },
  162. "execution_count": 20,
  163. "metadata": {},
  164. "output_type": "execute_result"
  165. }
  166. ],
  167. "source": [
  168. "#lest find multiplication\n",
  169. "c=np.dot(a,b)\n",
  170. "c"
  171. ]
  172. },
  173. {
  174. "cell_type": "code",
  175. "execution_count": 21,
  176. "metadata": {},
  177. "outputs": [
  178. {
  179. "data": {
  180. "text/plain": [
  181. "array([[-0.99996083, -0.96260587],\n",
  182. " [ 0.30059254, 0.39185723]])"
  183. ]
  184. },
  185. "execution_count": 21,
  186. "metadata": {},
  187. "output_type": "execute_result"
  188. }
  189. ],
  190. "source": [
  191. "#lets find cosin value\n",
  192. "c=np.cos(c)\n",
  193. "c"
  194. ]
  195. },
  196. {
  197. "cell_type": "code",
  198. "execution_count": null,
  199. "metadata": {},
  200. "outputs": [],
  201. "source": []
  202. }
  203. ],
  204. "metadata": {
  205. "kernelspec": {
  206. "display_name": "Python 3",
  207. "language": "python",
  208. "name": "python3"
  209. },
  210. "language_info": {
  211. "codemirror_mode": {
  212. "name": "ipython",
  213. "version": 3
  214. },
  215. "file_extension": ".py",
  216. "mimetype": "text/x-python",
  217. "name": "python",
  218. "nbconvert_exporter": "python",
  219. "pygments_lexer": "ipython3",
  220. "version": "3.6.7"
  221. }
  222. },
  223. "nbformat": 4,
  224. "nbformat_minor": 4
  225. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement