Skip to content

Instantly share code, notes, and snippets.

@flyfir248
Created July 19, 2022 12:27
Show Gist options
  • Save flyfir248/20e091964af2aa21d6cfd5fb4c9389d0 to your computer and use it in GitHub Desktop.
Save flyfir248/20e091964af2aa21d6cfd5fb4c9389d0 to your computer and use it in GitHub Desktop.
Website Notebook Classwork 3.ipynb
Display the source blob
Display the rendered blob
Raw
{
"nbformat": 4,
"nbformat_minor": 0,
"metadata": {
"colab": {
"name": "Website Notebook Classwork 3.ipynb",
"provenance": [],
"authorship_tag": "ABX9TyPyR/kn906u+RAflOtixvq6",
"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/20e091964af2aa21d6cfd5fb4c9389d0/untitled1.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "7iBClwC-a4UJ",
"outputId": "57cbf6e5-3e3c-4a0f-ef6f-fbbcaa6889ce"
},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"[[ 0 1 2 3 4]\n",
" [ 5 6 7 8 9]\n",
" [10 11 12 13 14]\n",
" [15 16 17 18 19]\n",
" [20 21 22 23 24]]\n"
]
}
],
"source": [
"import numpy as np\n",
"\n",
"Array2D = np.arange(0, 25).reshape([5,5])\n",
"\n",
"print(Array2D)"
]
},
{
"cell_type": "code",
"source": [
"np.mean(Array2D, axis = 1)"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "ptU0Y-03a9_5",
"outputId": "e95036ff-6e53-4e46-b8b0-83d7ac7ce0bb"
},
"execution_count": 2,
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/plain": [
"array([ 2., 7., 12., 17., 22.])"
]
},
"metadata": {},
"execution_count": 2
}
]
},
{
"cell_type": "code",
"source": [
"np.mean(Array2D, axis = 0)"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "RV3-t8rZbDRI",
"outputId": "b91beca7-9457-47aa-903a-f32f12f2ff44"
},
"execution_count": 3,
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/plain": [
"array([10., 11., 12., 13., 14.])"
]
},
"metadata": {},
"execution_count": 3
}
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment