{ "cells": [ { "cell_type": "markdown", "id": "d79c7744", "metadata": {}, "source": [ "# Questions:" ] }, { "cell_type": "code", "execution_count": 4, "id": "29390dc7", "metadata": {}, "outputs": [], "source": [ "# 1) Given this array: (3 + 4 points for the following items, total 7 points)\n", "# a)\n", "\n", "arr = np.array([[44, 24, 46, 14, 22, 28, 36, 31, 5, 19, 46, 49, 49, 6, 1],\n", " [ 3, 14, 22, 46, 13, 45, 26, 48, 12, 20, 6, 46, 24, 17, 38],\n", " [35, 13, 31, 5, 25, 47, 1, 4, 0, 19, 20, 40, 28, 49, 39],\n", " [44, 22, 49, 31, 19, 25, 25, 16, 24, 8, 13, 28, 48, 11, 4],\n", " [27, 8, 34, 29, 49, 6, 14, 11, 37, 25, 9, 46, 7, 44, 4],\n", " [39, 48, 19, 44, 9, 23, 33, 18, 45, 23, 42, 49, 37, 21, 32],\n", " [39, 40, 1, 6, 49, 25, 29, 7, 36, 10, 12, 22, 3, 42, 10],\n", " [ 3, 14, 36, 26, 6, 15, 0, 29, 33, 46, 22, 8, 26, 24, 30],\n", " [ 6, 2, 11, 26, 2, 15, 14, 0, 42, 46, 19, 39, 47, 28, 22],\n", " [22, 34, 4, 25, 34, 32, 1, 43, 18, 4, 37, 24, 16, 4, 31],\n", " [15, 32, 42, 38, 17, 43, 41, 20, 31, 8, 33, 38, 13, 39, 26],\n", " [ 3, 15, 15, 5, 26, 32, 26, 45, 23, 2, 33, 49, 49, 10, 32],\n", " [33, 29, 38, 9, 12, 22, 34, 11, 5, 32, 11, 15, 8, 25, 41]])" ] }, { "cell_type": "code", "execution_count": 3, "id": "9f236732", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "array([[41, 20, 31],\n", " [26, 45, 23],\n", " [34, 11, 5]])" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# a) What should be written in this box so that the answer appears as shown below?\n", "# Answer: \n" ] }, { "cell_type": "code", "execution_count": null, "id": "8853931c", "metadata": {}, "outputs": [], "source": [ "# b) What are the differences between these 2 methods: linspace and arange?\n", "\n", "\"\"\"\n", "Answer: \n", "\n", "\"\"\"" ] }, { "cell_type": "markdown", "id": "83790b18", "metadata": {}, "source": [ "## 2) Create a random array with 40 elements. Then reshape it into a 3-dimensional array. Print all possible 4D array shapes that can be formed from these elements. (4 points)" ] }, { "cell_type": "code", "execution_count": null, "id": "641f67f6", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "markdown", "id": "5bf9fce8", "metadata": {}, "source": [ "## 3) Solve this system of equations using NumPy:(6 points)\n", "\n", "\\begin{cases}\n", "-x + 2z + 3t = 7 \\\\\n", "z - y + 4x - 5t = -3 \\\\\n", "3y + 2z + x - 6t = 11 \\\\\n", "4z - y + 2x + t = 8\n", "\\end{cases}" ] }, { "cell_type": "code", "execution_count": null, "id": "48b6e6ac", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "markdown", "id": "fc404db3", "metadata": {}, "source": [ "## 4) Given the following dataframe. Answer the following questions:(3 points for each item, total 9 points)" ] }, { "cell_type": "code", "execution_count": 8, "id": "32cd5c91", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
| \n", " | Name | \n", "Age | \n", "Department | \n", "Math_Score | \n", "Physics_Score | \n", "
|---|---|---|---|---|---|
| 0 | \n", "Ali | \n", "19.0 | \n", "CS | \n", "95.0 | \n", "100.0 | \n", "
| 1 | \n", "Ayxan | \n", "20.0 | \n", "Math | \n", "40.0 | \n", "85.0 | \n", "
| 2 | \n", "Mecnun | \n", "19.0 | \n", "CS | \n", "78.0 | \n", "75.0 | \n", "
| 3 | \n", "Leyla | \n", "NaN | \n", "Physics | \n", "50.0 | \n", "32.0 | \n", "
| 4 | \n", "Nahid | \n", "21.0 | \n", "Math | \n", "NaN | \n", "88.0 | \n", "
| 5 | \n", "Fatima | \n", "20.0 | \n", "CS | \n", "85.0 | \n", "NaN | \n", "
| 6 | \n", "Serxan | \n", "22.0 | \n", "Physics | \n", "70.0 | \n", "48.0 | \n", "
| 7 | \n", "Aydin | \n", "19.0 | \n", "CS | \n", "85.0 | \n", "84.0 | \n", "