Skip to content

Commit db3f9af

Browse files
authored
Explain column identifiers (#296)
1 parent 0fa50e6 commit db3f9af

3 files changed

Lines changed: 48 additions & 1 deletion

File tree

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
.. _api_column_identifier:
2+
3+
******************
4+
Column identifiers
5+
******************
6+
7+
.. autoapimodule:: pedpy.column_identifier
8+
:members:
9+
:no-private-members:
10+
:no-special-members:

docs/source/api/index.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ API Reference
1313
- Analysis methods to compute: density, speed, flow, etc
1414
* - :doc:`Plotting <plotting>`
1515
- Plot methods for displaying the measurement setup and other computed results
16+
* - :doc:`Column identifiers <column_identifiers>`
17+
- Identifier of the data and result columns
1618

1719
.. toctree::
1820
:maxdepth: 1
@@ -22,3 +24,4 @@ API Reference
2224
Load Trajectories <io>
2325
Analysis Methods <methods>
2426
Plotting <plotting>
27+
Column identifiers <column_identifiers>

notebooks/user_guide.ipynb

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3036,10 +3036,44 @@
30363036
"\n",
30373037
"Now we have completed our analysis, what can be done to \n",
30383038
"\n",
3039+
"- access specific columns\n",
30393040
"- combine for further analysis\n",
30403041
"- save results"
30413042
]
30423043
},
3044+
{
3045+
"cell_type": "markdown",
3046+
"metadata": {},
3047+
"source": [
3048+
"### Access specific columns\n",
3049+
"\n",
3050+
"In order to access a specific column of the computed results or the {class}`trajectory data<trajectory_data.TrajectoryData>` *PedPy* provides all the column names for access.\n",
3051+
"It is highly encouraged to use these identifiers instead of using the column names directly, as the identifier would be updated, if they change. \n",
3052+
"A list of all identifiers can be found in the [API reference](api_column_identifier)."
3053+
]
3054+
},
3055+
{
3056+
"cell_type": "code",
3057+
"execution_count": null,
3058+
"metadata": {},
3059+
"outputs": [],
3060+
"source": [
3061+
"from pedpy.column_identifier import *\n",
3062+
"\n",
3063+
"# Access with column identifier\n",
3064+
"traj.data[[ID_COL, FRAME_COL, POINT_COL]]"
3065+
]
3066+
},
3067+
{
3068+
"cell_type": "code",
3069+
"execution_count": null,
3070+
"metadata": {},
3071+
"outputs": [],
3072+
"source": [
3073+
"# Access with column names\n",
3074+
"traj.data[[\"id\", \"frame\", \"point\"]]"
3075+
]
3076+
},
30433077
{
30443078
"cell_type": "markdown",
30453079
"metadata": {
@@ -3267,7 +3301,7 @@
32673301
"name": "python",
32683302
"nbconvert_exporter": "python",
32693303
"pygments_lexer": "ipython3",
3270-
"version": "3.11.5"
3304+
"version": "3.11.8"
32713305
}
32723306
},
32733307
"nbformat": 4,

0 commit comments

Comments
 (0)