Skip to content

Instantly share code, notes, and snippets.

@flyfir248
Created July 19, 2022 12:08
Show Gist options
  • Save flyfir248/b57f626914fbdded693202a8a9ffdc41 to your computer and use it in GitHub Desktop.
Save flyfir248/b57f626914fbdded693202a8a9ffdc41 to your computer and use it in GitHub Desktop.
Website Notebook Classwork 2.ipynb
Display the source blob
Display the rendered blob
Raw
{
"nbformat": 4,
"nbformat_minor": 0,
"metadata": {
"colab": {
"name": "Website Notebook Classwork 2.ipynb",
"provenance": [],
"authorship_tag": "ABX9TyMoQmVdPlNJ4uY9BD5TeU1p",
"include_colab_link": true
},
"kernelspec": {
"name": "python3",
"display_name": "Python 3"
},
"language_info": {
"name": "python"
}
},
"cells": [
{
"cell_type": "markdown",
"metadata": {
"id": "view-in-github",
"colab_type": "text"
},
"source": [
"<a href=\"https://colab.research.google.com/gist/flyfir248/b57f626914fbdded693202a8a9ffdc41/website-notebook-classwork-2.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
]
},
{
"cell_type": "code",
"execution_count": 16,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "QTY6R5iUVgz1",
"outputId": "fa04ae91-d9fc-4111-8e78-647bc7829ddb"
},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"[[0 1 2 3]\n",
" [4 5 6 7]]\n"
]
}
],
"source": [
"import numpy as np\n",
"\n",
"Array2D = np.arange(0, 8).reshape([2,4])\n",
"\n",
"print(Array2D)"
]
},
{
"cell_type": "code",
"source": [
"np.sum(Array2D, axis = 0)"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "4LB-lusYV2zq",
"outputId": "4fd04510-e389-45b7-9a35-5294b522f830"
},
"execution_count": 17,
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/plain": [
"array([ 4, 6, 8, 10])"
]
},
"metadata": {},
"execution_count": 17
}
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment