-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from corriporai/develop
ENH: Added support to columns metadata registration CLN: Black and flake8 cleanup DOC: Added examples with overview jupyter notebook DOC: Updated README with QuickStart. BLD: Fixes in docummentations makefile and requirements
- Loading branch information
Showing
13 changed files
with
4,999 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
name: runpandas_docs | ||
dependencies: | ||
- python=3.8 | ||
- sphinx_rtd_theme | ||
- jinja2 | ||
- tornado | ||
- nbformat | ||
- jupyter_client | ||
- ipykernel | ||
- sphinx | ||
- terminado | ||
- pip: | ||
- nbsphinx | ||
- pydata_sphinx_theme | ||
- requests_cache | ||
- Send2Trash | ||
- prometheus_client | ||
- sphinxcontrib_github_alt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
sphinx | ||
ipython | ||
sphinx_rtd_theme | ||
ipython | ||
requests_cache | ||
pydata_sphinx_theme | ||
nbsphinx | ||
sphinxcontrib_github_alt |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Version: **0 (+untagged, 7)** Date: **November 21, 2020** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,162 @@ | ||
{ | ||
"metadata": { | ||
"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.8.3-final" | ||
}, | ||
"orig_nbformat": 2, | ||
"kernelspec": { | ||
"name": "python3", | ||
"display_name": "Python 3" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 2, | ||
"cells": [ | ||
{ | ||
"source": [ | ||
"#%%\n", | ||
"%load_ext autoreload\n", | ||
"%autoreload 2" | ||
], | ||
"cell_type": "code", | ||
"metadata": {}, | ||
"execution_count": 1, | ||
"outputs": [] | ||
}, | ||
{ | ||
"source": [ | ||
"# Quick Start\n", | ||
"Install using ``pip`` and then import and use one of the tracking readers. This example\n", | ||
"loads a local file.tcx.\n" | ||
], | ||
"cell_type": "markdown", | ||
"metadata": {} | ||
}, | ||
{ | ||
"source": [ | ||
"# !pip install runpandas\n", | ||
"import runpandas as rpd\n", | ||
"activity = rpd.read_file('./sample.tcx')" | ||
], | ||
"cell_type": "code", | ||
"metadata": {}, | ||
"execution_count": 27, | ||
"outputs": [] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 28, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"output_type": "execute_result", | ||
"data": { | ||
"text/plain": [ | ||
" alt dist hr lon lat\n", | ||
"time \n", | ||
"00:00:00 178.942627 0.000000 62.0 -79.093187 35.951880\n", | ||
"00:00:01 178.942627 0.000000 62.0 -79.093184 35.951880\n", | ||
"00:00:06 178.942627 1.106947 62.0 -79.093172 35.951868\n", | ||
"00:00:12 177.500610 13.003035 62.0 -79.093228 35.951774\n", | ||
"00:00:16 177.500610 22.405027 60.0 -79.093141 35.951732" | ||
], | ||
"text/html": "<div>\n<style scoped>\n .dataframe tbody tr th:only-of-type {\n vertical-align: middle;\n }\n\n .dataframe tbody tr th {\n vertical-align: top;\n }\n\n .dataframe thead th {\n text-align: right;\n }\n</style>\n<table border=\"1\" class=\"dataframe\">\n <thead>\n <tr style=\"text-align: right;\">\n <th></th>\n <th>alt</th>\n <th>dist</th>\n <th>hr</th>\n <th>lon</th>\n <th>lat</th>\n </tr>\n <tr>\n <th>time</th>\n <th></th>\n <th></th>\n <th></th>\n <th></th>\n <th></th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <th>00:00:00</th>\n <td>178.942627</td>\n <td>0.000000</td>\n <td>62.0</td>\n <td>-79.093187</td>\n <td>35.951880</td>\n </tr>\n <tr>\n <th>00:00:01</th>\n <td>178.942627</td>\n <td>0.000000</td>\n <td>62.0</td>\n <td>-79.093184</td>\n <td>35.951880</td>\n </tr>\n <tr>\n <th>00:00:06</th>\n <td>178.942627</td>\n <td>1.106947</td>\n <td>62.0</td>\n <td>-79.093172</td>\n <td>35.951868</td>\n </tr>\n <tr>\n <th>00:00:12</th>\n <td>177.500610</td>\n <td>13.003035</td>\n <td>62.0</td>\n <td>-79.093228</td>\n <td>35.951774</td>\n </tr>\n <tr>\n <th>00:00:16</th>\n <td>177.500610</td>\n <td>22.405027</td>\n <td>60.0</td>\n <td>-79.093141</td>\n <td>35.951732</td>\n </tr>\n </tbody>\n</table>\n</div>" | ||
}, | ||
"metadata": {}, | ||
"execution_count": 28 | ||
} | ||
], | ||
"source": [ | ||
"activity.head(5)" | ||
] | ||
}, | ||
{ | ||
"source": [ | ||
"The data frames that are returned by runpandas when\n", | ||
"loading files is similar for different file types.\n", | ||
"The dataframe in the above example is a subclass of the\n", | ||
"``pandas.DataFrame`` and provides some additional features.\n", | ||
"Certain columns also return specific ``pandas.Series`` subclasses,\n", | ||
"which provides useful methods:" | ||
], | ||
"cell_type": "markdown", | ||
"metadata": {} | ||
}, | ||
{ | ||
"source": [ | ||
"print (type(activity))\n", | ||
"print(type(activity.alt))" | ||
], | ||
"cell_type": "code", | ||
"metadata": {}, | ||
"execution_count": 29, | ||
"outputs": [ | ||
{ | ||
"output_type": "stream", | ||
"name": "stdout", | ||
"text": [ | ||
"<class 'runpandas.types.frame.Activity'>\n<class 'runpandas.types.columns.Altitude'>\n" | ||
] | ||
} | ||
] | ||
}, | ||
{ | ||
"source": [ | ||
"For instance, if you want to get the base unit for the altitude ``alt`` data or the distance ``dist`` data:" | ||
], | ||
"cell_type": "markdown", | ||
"metadata": {} | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 41, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"output_type": "execute_result", | ||
"data": { | ||
"text/plain": [ | ||
"65883.68151855901" | ||
] | ||
}, | ||
"metadata": {}, | ||
"execution_count": 41 | ||
} | ||
], | ||
"source": [ | ||
"activity.alt.base_unit\n", | ||
"activity.alt.sum()" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 43, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"output_type": "execute_result", | ||
"data": { | ||
"text/plain": [ | ||
"4686.31103516" | ||
] | ||
}, | ||
"metadata": {}, | ||
"execution_count": 43 | ||
} | ||
], | ||
"source": [ | ||
"activity.dist.base_unit\n", | ||
"activity.dist[-1]" | ||
] | ||
} | ||
] | ||
} |
Oops, something went wrong.