From 601c38c5d5d22b6857951891dc2ce9eeba1140ac Mon Sep 17 00:00:00 2001 From: Waylon Walker Date: Wed, 29 Mar 2017 22:19:23 -0500 Subject: [PATCH 01/10] updated readme.md --- readme.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/readme.md b/readme.md index 85dfdef..13a8d0d 100644 --- a/readme.md +++ b/readme.md @@ -1 +1,3 @@ -# test /n testing git from termux +# test + +testing git from Termux for android From 498b4b22e897f2ec7f4b7606287911dd2376cd4e Mon Sep 17 00:00:00 2001 From: Waylon Walker Date: Wed, 29 Mar 2017 22:26:57 -0500 Subject: [PATCH 02/10] consolehistory --- history.txt | 122 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 122 insertions(+) create mode 100644 history.txt diff --git a/history.txt b/history.txt new file mode 100644 index 0000000..33e542e --- /dev/null +++ b/history.txt @@ -0,0 +1,122 @@ + 1 pip list + 2 python + 3 nano temp.py + 4 packages install nano + 5 packages install nano + 6 nano temp.py + 7 python temp.py + 8 vim + 9 ls + 10 info bash + 11 $dir + 12 $dirname + 13 cd .. + 14 ls + 15 cd home + 16 ls + 17 cd .. + 18 cd usr + 19 ls + 20 cd bin + 21 ls + 22 cd .. + 23 cd + 24 cd.. + 25 ls + 26 git + 27 nano temp.py + 28 vi temp.py + 29 python temp.py + 30 nano temp.py + 31 python temp.py + 32 pip install pandas + 33 python + 34 pip3 install pandas + 35 pip install numpy --use-wheel + 36 apt install conda + 37 apt-get conda + 38 apt-get install conda + 39 apt install Miniconda3 + 40 bash Miniconda3 + 41 bash Anaconda-2.3.0-Linux-x86_64.sh + 42 apt install wget + 43 wget -c http://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh + 44 conda install pandas + 45 cknda + 46 minicomda + 47 miniconda + 48 ls + 49* bash Miniconda-latest-Linux-x86_64.sh w + 50 rm Miniconda-latest-Linux-x86_64.sh + 51 ls + 52 wget -c http://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86.sh + 53 sudo pip install numpy + 54 apt install sudo + 55 apt install python-numpy + 56 pip install numpy + 57 apt install gcc + 58 apt install brew + 59 apt-get install build-essential + 60 apt get clang -std=c++14 + 61 apt install clang++ -std=c++14 + 62 pip install numpy + 63 clang + 64 apt install clang + 65 pip install numpy + 66 apt install g++ + 67 apt remove clang + 68 pip install numpy + 69 apt install g++ + 70 pip install numpy + 71 pip install python-dev + 72 pip install python-devel + 73 apt install python-dev + 74 pip install numpy + 75 pip install pandas + 76 pip install matplotlib + 77 python + 78 pip install matplotlib + 79 pip install freetype + 80 python + 81 apt-get libfreetype6-dev + 82 apt-get install libfreetype6-dev + 83 apt install libfreetype6e-dev + 84 apt install libfreetype6-dev + 85 apt install freetype + 86 pip install matplotlib + 87* apt install freetype-devw + 88 pip install matplotlib + 89 pip install matplotlib + 90 python + 91 pip install pyobject + 92 pip install pygobject + 93 python + 94 python + 95 ls + 96 test.png + 97 open + 98 xdg-open test.png + 99 pip install bottle + 100 pip install jupyter + 101 jupyter notebook + 102 apt install zmq_strerror + 103 ipython + 104 apt install git + 105 mkdir test + 106 cd test + 107 echo "# test /n testing git from termux" >> readme.md + 108 git init + 109 git add readme.md + 110 git commit -m "first commit" + 111 git config --glob user.email quadmx08@gmail.com + 112 git config --global user.email quadmx08@gmail.com + 113 git config --global user.name "Waylon Walker" + 114 git commit -m "first commit" + 115 remote add origin https://github.com/WaylonWalker/test.git + 116 git remote add origin https://github.com/WaylonWalker/test.git + 117 git push -u origin master + 118 nano readme.md + 119 git commit . "updated readme.md" + 120 git commit . -m "updated readme.md" + 121 git push + 122 history >> history.txt From e6d59ca46a50a7d37ee18513011c48b3f5bb7eec Mon Sep 17 00:00:00 2001 From: Waylon Walker Date: Wed, 29 Mar 2017 23:13:53 -0500 Subject: [PATCH 03/10] updated readme --- readme.md | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/readme.md b/readme.md index 13a8d0d..c0dafdc 100644 --- a/readme.md +++ b/readme.md @@ -1,3 +1,25 @@ # test -testing git from Termux for android +testing git from Termux for android. This repo was made +entirely fom an android phone using Termux. + +## install + +install a text editor (vim or nano), python-dev, and +freetype-dev. I found python-dev better than python for `pip` +installing packages that required a compiler. freetype-dev was +required for matplotlib. + +``` +apt install nano +apt install python-dev +apt install freetype-dev +``` + + +Now setup your python environment with your favorite packages. +``` +pip install pandas matplotlib seaborn bottle +``` + + From a24b083e42b137a667c840fada704934209256d7 Mon Sep 17 00:00:00 2001 From: Waylon Walker Date: Wed, 29 Mar 2017 23:18:29 -0500 Subject: [PATCH 04/10] updated readme --- readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.md b/readme.md index c0dafdc..a65c5ba 100644 --- a/readme.md +++ b/readme.md @@ -19,7 +19,7 @@ apt install freetype-dev Now setup your python environment with your favorite packages. ``` -pip install pandas matplotlib seaborn bottle +pip install pandas matplotlib bottle ``` From 2b90fe86c3160cdac339f97ead9f12b9753b471e Mon Sep 17 00:00:00 2001 From: Waylon Walker Date: Thu, 30 Mar 2017 15:12:24 -0500 Subject: [PATCH 05/10] set up a simple working template for a bottle server --- andoid_bottle.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 andoid_bottle.py diff --git a/andoid_bottle.py b/andoid_bottle.py new file mode 100644 index 0000000..0fc7b19 --- /dev/null +++ b/andoid_bottle.py @@ -0,0 +1,22 @@ +import matplotlib +matplotlib.use('agg') +import pandas as pd +from bottle import Bottle + +app = Bottle() + +@app.route('/index') +def index(): + title = 'Hello World' + plot = 'plot placeholder' + footer = 'created fron an android device using Termux' + html = f'''

{title}

+
+ {plot} +
+ {footer}''' + return html + + +if __name__ == '__main__': + app.run() From 9fe8510454868929ef03b64ff40d5679a30fa169 Mon Sep 17 00:00:00 2001 From: Waylon Walker Date: Sat, 1 Apr 2017 13:49:16 -0500 Subject: [PATCH 06/10] initial commit for co2data.py \n\n This module pulls data from data.world --- co2data.py | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 co2data.py diff --git a/co2data.py b/co2data.py new file mode 100644 index 0000000..0fb2e73 --- /dev/null +++ b/co2data.py @@ -0,0 +1,2 @@ +import pandas as pd +df = pd.read_csv('https://query.data.world/s/bc2a2nmk6avafkdwy9x5jt7zz') From 2e731f31de188c98f2264380aeecae43bc73dc91 Mon Sep 17 00:00:00 2001 From: Waylon Walker Date: Sat, 1 Apr 2017 13:50:46 -0500 Subject: [PATCH 07/10] initial commit /n/n co2plot.py makes the plots. runnint Processing chunk 1 named None from line 3 Processing chunk 2 named None from line 10 Processing chunk 3 named None from line 17 Processing chunk 4 named None from line 28 Published co2plot.py to co2plot.html will create the report --- co2plot.py | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 co2plot.py diff --git a/co2plot.py b/co2plot.py new file mode 100644 index 0000000..69c4ca5 --- /dev/null +++ b/co2plot.py @@ -0,0 +1,32 @@ +#' #Testing out pweave on android with Termux + +import matplotlib +matplotlib.use('agg') +from tabulate import tabulate +from co2data import df + +#' ## raw data +#' *from data.world* +# This example will plot the co2 emissions trend for the top 5 countries in 2011 + + +print(tabulate(df.iloc[0:10, 0:5], headers=df.columns, tablefmt='simple')) + +#' ## Transform Data for plotting +#' +plot_df = (df + .set_index('CO2 emission total') + .sort_values('2011', ascending=False) + .head(5) + .T + .dropna(how='all') + ) + +print(tabulate(plot_df.iloc[0:10, 0:5], headers=plot_df.columns, tablefmt='simple')) + +#' Plot the data +title = 'Top 5 countries CO2 emissions trend\n(based on 2011 emissions data)' +ax = plot_df.plot(title=title) +ax.figure.savefig('tmp.png') + + From 131d0d581dc47db445462639d4697c2e8329682b Mon Sep 17 00:00:00 2001 From: Waylon Walker Date: Sat, 1 Apr 2017 13:51:48 -0500 Subject: [PATCH 08/10] initial commit \n\n CO2 report made with --- co2plot.html | 702 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 702 insertions(+) create mode 100644 co2plot.html diff --git a/co2plot.html b/co2plot.html new file mode 100644 index 0000000..ddd5fd1 --- /dev/null +++ b/co2plot.html @@ -0,0 +1,702 @@ + + + + + + + + + + + + + + + + + + + + +
+
+
+

Testing out pweave on android with Termux

+
import matplotlib
+matplotlib.use('agg')
+from tabulate import tabulate
+from co2data import df
+
+ +

raw data

+

from data.world

+
# This example will plot the co2 emissions trend for the top 5
+countries in 2011
+
+
+print(tabulate(df.iloc[0:10, 0:5], headers=df.columns,
+tablefmt='simple'))
+
+
  CO2 emission total  1751           1755    1760    1765    1770
+--------------------  -----------  ------  ------  ------  ------
+                   0  Abkhazia        nan     nan     nan     nan
+                   1  Afghanistan     nan     nan     nan     nan
+                   2  Argentina       nan     nan     nan     nan
+                   3  Iceland         nan     nan     nan     nan
+                   4  India           nan     nan     nan     nan
+                   5  Indonesia       nan     nan     nan     nan
+                   6  Iran            nan     nan     nan     nan
+                   7  Iraq            nan     nan     nan     nan
+                   8  Ireland         nan     nan     nan     nan
+                   9  Isle of Man     nan     nan     nan     nan
+
+ +

Transform Data for plotting

+
plot_df = (df
+    .set_index('CO2 emission total')
+    .sort_values('2011', ascending=False)
+    .head(5)
+    .T
+    .dropna(how='all')
+    )
+
+print(tabulate(plot_df.iloc[0:10, 0:5], headers=plot_df.columns,
+tablefmt='simple'))
+
+
        India    Iran    Indonesia    Argentina    Ireland
+----  -------  ------  -----------  -----------  ---------
+1850  nan         nan          nan          nan        396
+1858  436.333     nan          nan          nan        nan
+1859  704         nan          nan          nan        nan
+1860  711.333     nan          nan          nan        nan
+1861  550         nan          nan          nan        nan
+1862  608.667     nan          nan          nan        nan
+1863  674.667     nan          nan          nan        nan
+1864  638         nan          nan          nan        nan
+1865  627         nan          nan          nan        nan
+1866  707.667     nan          nan          nan        nan
+
+ +

Plot the data

+
title = 'Top 5 countries CO2 emissions trend\n(based on 2011 emissions
+data)'
+ax = plot_df.plot(title=title)
+ax.figure.savefig('tmp.png')
+
+ + +
+ + +
+
+
+ + From a763037871cceae329bd83b65fb721a35444aac3 Mon Sep 17 00:00:00 2001 From: Waylon Walker Date: Sat, 1 Apr 2017 14:30:42 -0500 Subject: [PATCH 09/10] added CO2 report --- readme.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/readme.md b/readme.md index a65c5ba..fdc00e2 100644 --- a/readme.md +++ b/readme.md @@ -21,5 +21,7 @@ Now setup your python environment with your favorite packages. ``` pip install pandas matplotlib bottle ``` +##Example +CO2 emissions data from data.world [report](http://htmlpreview.github.io/?https://github.com/WaylonWalker/test/blob/gh-pages/co2plot.html) From af3335f8b3b814bad2e927ce717bc1aa533cf045 Mon Sep 17 00:00:00 2001 From: Waylon Walker Date: Sat, 1 Apr 2017 15:18:03 -0500 Subject: [PATCH 10/10] fixed markdown error --- readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.md b/readme.md index fdc00e2..a663d01 100644 --- a/readme.md +++ b/readme.md @@ -21,7 +21,7 @@ Now setup your python environment with your favorite packages. ``` pip install pandas matplotlib bottle ``` -##Example +## Example CO2 emissions data from data.world [report](http://htmlpreview.github.io/?https://github.com/WaylonWalker/test/blob/gh-pages/co2plot.html)