From b6d0d5b3133b62e1b489072a15b389636d825cac Mon Sep 17 00:00:00 2001 From: ferRm Date: Wed, 23 Oct 2019 15:48:01 -0500 Subject: [PATCH] DE-DA-PT-Fernando --- .DS_Store | Bin 0 -> 6148 bytes your-code/.DS_Store | Bin 0 -> 6148 bytes .../.ipynb_checkpoints/main-checkpoint.ipynb | 6 + your-code/main.ipynb | 525 ++++++++++++++++++ 4 files changed, 531 insertions(+) create mode 100644 .DS_Store create mode 100644 your-code/.DS_Store create mode 100644 your-code/.ipynb_checkpoints/main-checkpoint.ipynb create mode 100644 your-code/main.ipynb diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..3dcd9092d222cf11a39611e0626a9bc24356afde GIT binary patch literal 6148 zcmeHKJ5EC}5S)b+L1|J_`T{AqffXeu-~xy|x=2q7Nlu zk6wbLoQI;@%xtDCJl6pPz=ev5QiPt+&{q`;*D z_qkkq{om97=>IQCT1f#Za8nA{V)wk;@<~-&XOHt*+vqQJ&-tReaUK*7QI3gGj=Au1 e{1{1@*L=?XUN|KNo$;U(^)ukQ$fUr3EAS16%oQL2 literal 0 HcmV?d00001 diff --git a/your-code/.DS_Store b/your-code/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..5008ddfcf53c02e82d7eee2e57c38e5672ef89f6 GIT binary patch literal 6148 zcmeH~Jr2S!425mzP>H1@V-^m;4Wg<&0T*E43hX&L&p$$qDprKhvt+--jT7}7np#A3 zem<@ulZcFPQ@L2!n>{z**++&mCkOWA81W14cNZlEfg7;MkzE(HCqgga^y>{tEnwC%0;vJ&^%eQ zLs35+`xjp>T0 d_min and c < d_mean:\n", + " f[i][x][y] = 25\n", + " elif c > d_mean and c < d_max:\n", + " f[i][x][y] = 75\n", + " elif c == d_mean:\n", + " f[i][x][y] = 50\n", + " elif c == d_min:\n", + " f[i][x][y] = 0\n", + " elif c == d_max:\n", + " f[i][x][y] = 100" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[[[1.21147871 1.75804237 1.9115814 1.40667329 1.53182288]\n", + " [1.98374763 1.54271426 1.88799577 1.13082761 1.55748123]\n", + " [1.30306828 1.86861946 1.7067565 1.21372597 1.89081739]]\n", + "\n", + " [[1.8598921 1.02632583 1.90106924 1.07250084 1.03533543]\n", + " [1.48241424 1.76747678 1.5778101 1.06510067 1.91968937]\n", + " [1.63679283 1.01218623 1.79229505 1.21035119 1.66692815]]]\n", + "[[[ 25. 75. 75. 25. 75.]\n", + " [100. 75. 75. 25. 75.]\n", + " [ 25. 75. 75. 25. 75.]]\n", + "\n", + " [[ 75. 25. 75. 25. 25.]\n", + " [ 25. 75. 75. 25. 75.]\n", + " [ 75. 0. 75. 25. 75.]]]\n" + ] + } + ], + "source": [ + "#17. Print d and f. Do you have your expected f?\n", + "\n", + "print(d)\n", + "print(f)" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "[[['B' 'D' 'D' 'B' 'D']\n", + " ['E' 'D' 'D' 'B' 'D']\n", + " ['B' 'D' 'D' 'B' 'D']]\n", + "\n", + " [['D' 'B' 'D' 'B' 'B']\n", + " ['B' 'D' 'D' 'B' 'D']\n", + " ['D' 'A' 'D' 'B' 'D']]]\n" + ] + } + ], + "source": [ + "#18. Bonus question: instead of using numbers (i.e. 0, 25, 50, 75, and 100).\n", + "#How to use string values. (\"A\", \"B\", \"C\", \"D\", and \"E\") to label the array elements?\n", + "\n", + "ff = np.empty([2,3,5],dtype=\"object\")\n", + "\n", + "for i,a in enumerate(d):\n", + " #print(i,a)\n", + " for x,b in enumerate(a):\n", + " #print(x,b)\n", + " for y,c in enumerate(b):\n", + " #print(y,c)\n", + " if c > d_min and c < d_mean:\n", + " ff[i][x][y] = \"B\"\n", + " elif c > d_mean and c < d_max:\n", + " ff[i][x][y] = \"D\"\n", + " elif c == d_mean:\n", + " ff[i][x][y] = \"C\"\n", + " elif c == d_min:\n", + " ff[i][x][y] = \"A\"\n", + " elif c == d_max:\n", + " ff[i][x][y] = \"E\"\n", + "print(ff)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.7.3" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +}