Classes and Objects
Welcome to the Classes and Objects page! Here, we will delve into the different classes and objects and their relationship. Refer to the Functions page to learn more about the functions that create these objects.
Note
Currently, not all Objects that exist in PT3S are documented. These will be added in the future.
m Object
The m object or dxWithMx object is a wrapper for Dx with attached Mx and the center piece in working with PT3S. It is created by Read SIR 3S Model and Results
- dxAndMxHelperFcts.dxWithMx.__init__(self, dx, mx, crs=None)
- Parameters:
dx (Dx.Dx()) – a Dx object
mx (Mx.Mx()) – a Mx object
crs (str, optional, default=None) – (=coordinate reference system) Determines crs used in geopandas-Dfs (Possible value:’EPSG:25832’). If None, crs will be read from SIR 3S’ database file.
A dxWithMx (or m) object has the following attributes:
- Model: Dx object:
dx.dataFrames[…]: pandas-Dfs 1:1 from SIR 3S’ tables in database file
dx.dataFrames[…]: several pandas-Dfs derived from the 1:1 Dfs
- Results: Mx object:
mx.df: pandas-Df (‘time curve data’) from from SIR 3S’ MXS file(s)
mx.dfVecAggs: pandas-Df (‘vector data’) from SIR 3S’ MXS file(s)
- Miscellaneous:
wDirMx: Mx-directory of the model
SirCalcXmlFile: SirCalc’s Xml-File of the model
SirCalcExeFile: SirCalc Executable used to (re-)calculate the model
- pandas-Dfs with Model- AND Result-Data:
V3_ROHR: Pipes
V3_FWVB: Housestations District Heating
V3_KNOT: Nodes
V3_VBEL: Edges
V3_ROHRVEC: Pipes including interior points
V3_AGSN: Longitudinal Sections; AGSN is the German abbreviation for longitudinal sections / cuts (defined in the SIR 3S model)
V3_AGSNVEC: Longitudinal Sections including Pipe interior points
- geopandas-Dfs based upon the Dfs above:
gdf_ROHR: Pipes
gdf_FWVB: Housestations District Heating
gdf_KNOT: Nodes
- NetworkX-Graphs:
G
GSig
Dx contains data for all models in the SIR 3S database. Mx contains only the results for one model. SYSTEMKONFIG / VIEW_MODELLE are used to determine which one.

Dataframes
From this object m, you can now access a variety of dataframes created by PT3S based on the model and results
>>> print([attr for attr in dir(m) if isinstance(getattr(m, attr), pd.DataFrame)])
['V3_AGSN', 'V3_AGSNVEC', 'V3_FWVB', 'V3_KNOT', 'V3_ROHR', 'V3_ROHRVEC', 'V3_VBEL', 'V3_WBLZ', 'dfAGSN', 'dfWBLZ', 'gdf_FWVB', 'gdf_KNOT', 'gdf_ROHR']
The following section presents these dataframes by documenting the functions that create them.
V3_ROHR
- dxAndMxHelperFcts.dxWithMx._V3_ROHR(self, df_V3_ROHR)
V3_ROHR is a m object Attribute.
- Parameters:
V3_ROHR – V3sErg[‘V3_ROHR’] from dx.MxAdd(mx)
- Return df_V3_ROHR:
df_V3_ROHR expanded
ROHR is the German word for pipe (defined in the SIR 3S model). In the returned V3_ROHR (one row per Pipe) the following columns are added:
Column Name
Description
QMAVAbs
Absolute value of STAT ROHR~*~*~*~QMAV (i.e. t/h, m3/h, l/s, …)
VAVAbs
Absolute value of STAT ROHR~*~*~*~VAV
PHRAbs
Absolute value of STAT ROHR~*~*~*~PHR
JVAbs
Absolute value of STAT ROHR~*~*~*~JV
MAV
value of STAT ROHR~*~*~*~MAV (kg/s)
LAMBDA
value of STAT ROHR~*~*~*~LAMBDA
>>> print(m.V3_ROHR)
pk fkDE ... PHRAbs JVAbs
0 5442010239090746007 5306805303452857793 ... 1.041356e-02 2.858564e-01
1 4917786378639043296 5306805303452857793 ... 1.464281e-02 2.559136e-01
2 4762482310382009633 5306805303452857793 ... 1.084467e-02 2.645375e-01
3 4987229536643024523 5306805303452857793 ... 1.804474e-03 2.640792e-01
4 5722206630503885118 5306805303452857793 ... 1.978778e-03 2.640800e-01
.. ... ... ... ... ...
519 4919408196640282331 5306805303452857793 ... 7.555330e-25 2.897193e-23
520 4957957828740199285 5306805303452857793 ... 0.000000e+00 0.000000e+00
521 5499776682108862751 5306805303452857793 ... 0.000000e+00 0.000000e+00
522 5285235772707481262 5306805303452857793 ... 7.560484e-03 7.560484e-01
523 5373158549695106826 5306805303452857793 ... 7.642428e-03 7.642428e-01
[524 rows x 216 columns]
V3_KNOT
- dxAndMxHelperFcts.dxWithMx._V3_KNOT(self, df_V3_KNOT)
V3_KNOT is a m object Attribute.
- Parameters:
df_V3_KNOT (df) – V3sErg[‘V3_KNOT’] from dx.MxAdd(mx)
- Return df_V3_VKNOT:
df_V3_KNOT expanded
KNOT is the German abbreviation for Nodes (defined in the SIR 3S model). In the returned V3_KNOT (one row per Node) the following columns are added:
Column Name
Description
PH
STAT PH-result (i.e. bar)
dPH
STAT (PHSL-PHRL)-result if Node-Partner is defined (i.e. bar)
QM
STAT QM-result (i.e. t/h, m3/h, l/s, …)
srcvector
Source signature vector eg. [30, 0, 20, 50]
T
STAT T-result
M
STAT M-result (kg/s)
>>> print(m.V3_KNOT)
pk fkDE ... QM dPH
3 5669301360686511351 5306805303452857793 ... 0.0 1.488921
4 5397948523091900401 5306805303452857793 ... 0.0 1.467910
5 5239335112004772156 5306805303452857793 ... 0.0 1.444288
6 5298886695042021307 5306805303452857793 ... 0.0 1.434558
7 4993257270457791438 5306805303452857793 ... 0.0 1.432193
.. ... ... ... ... ...
515 5705481928638455076 5306805303452857793 ... 0.0 NaN
516 4910948593863484232 5306805303452857793 ... 0.0 NaN
517 5032870132214455820 5306805303452857793 ... 0.0 -0.038701
518 4808122385198820357 5306805303452857793 ... 0.0 -0.038701
519 4810663080415972317 5306805303452857793 ... 0.0 NaN
[517 rows x 214 columns]
V3_VBEL
- dxAndMxHelperFcts.dxWithMx._V3_VBEL(self, df_V3_VBEL)
V3_VBEL is a m object Attribute.
- Parameters:
df_V3_VBEL (df) – V3sErg[‘V3_VBEL’] from dx.MxAdd(mx)
- Return df_V3_VBEL:
df_V3_VBEL expanded
VBEL is the German abbreviation for Edges (defined in the SIR 3S model). In the returned V3_VBEL (one row per Edge) the following columns are added:
Column Name
Description
PH_i,_k
STAT PH-result (i.e. bar)
H_i,_k
STAT H-result (i.e. barBzg)
mlc_i,_k
STAT H-result
RHO_i,_k
STAT RHO-result
T_i,_k
STAT T-result
QM
STAT QM-Result
M
STAT M-Result (kg/s)
>>> print(m.V3_VBEL)
pk ... mlc_k
OBJTYPE OBJID ...
FWES 5194722485643852853 5194722485643852853 ... 577.049723
5393031835236689087 5393031835236689087 ... 593.013845
FWVB 4611752310942477664 4611752310942477664 ... 574.339884
4612528660388965271 4612528660388965271 ... 551.357794
4612562908060328263 4612562908060328263 ... 574.527331
... ... ... ...
VENT 5397401198360947165 5397401198360947165 ... 577.04972
5514879539114546017 5514879539114546017 ... 586.490818
5586353371153335311 5586353371153335311 ... 577.15915
5652541284139882253 5652541284139882253 ... 592.208663
5684594766069449552 5684594766069449552 ... 577.085888
[883 rows x 619 columns]
V3_AGSN
- dxAndMxHelperFcts.dxWithMx._V3_AGSN(self, dfAGSN)
V3_AGSN is a m object Attribute.
- Parameters:
dfAGSN (df) – m.dfAGSN
- Returns:
V3_AGSN: dfAGSN expanded to V3_AGSN
- Return type:
df
AGSN is the German abbreviation for longitudinal sections / cuts (defined in the SIR 3S model). A section (a cut) can consist of several layers. In district heating systems, for example, the SL layer (supply line) and the RL (return line) layer. The returned V3_AGSN (one row per Edge in (Section, Layer)) has the following columns:
Column Name
Description
Pos
Position of Edge in (Section, Layer) starting with 0; Pos=-1: startNODE-row (same index as Pos=0 row)
pk
Section-pk
tk
Section-tk
LFDNR
Section-LFDNR (numeric)
NAME
Section-Name
XL
Layer: 0: everything; 1: SL (the stuff before BLn in SIR 3S BLOB); 2: RL (the stuff after BLn in SIR 3S BLOB)
compNr
Number of the connected Component in (Section, Layer) starting with 1
nextNODE
Name of the next Node in cut-direction reached by the Edge (startNODE-Name for Pos=-1)
OBJTYPE
Edge-Type
OBJID
Edge-ID
L
0 for Pos=-1
DN
Am2
Vm3
NAME_CONT
NAME_i
NAME_k
ZKOR_n
nextNODE’s ZKOR
BESCHREIBUNG_n
nextNODE’s BESCHREIBUNG
KVR_n
nextNODE’s KVR
LSum
cumulated L up to nextNODE
direction
XL=0,1: 1 if edge defined in cut-direction, otherwise -1; XL=2: 1 if edge defined in reverse cut-direction, otherwise -1
PH_n
nextNODE’s STAT PH-result (i.e. bar) (startNODE’s result for Pos=-1)
H_n
nextNODE’s STAT H-result (i.e. barBzg) (startNODE’s result for Pos=-1)
mlc_n
nextNODE’s STAT H-result (startNODE’s result for Pos=-1)
RHO_n
nextNODE’s STAT RHO-result (startNODE’s result for Pos=-1)
T_n
nextNODE’s STAT T-result (startNODE’s result for Pos=-1)
QM
Edge STAT QM-Result (startNODE’s result for Pos=-1)
(‘STAT|TIME|TMIN|…’, ‘QM’, a Timestamp, a Timestamp)
Edge QM-Results
“(‘STAT|TIME|TMIN|…’, ‘KNOT…PH|H|…’, a Timestamp, a Timestamp)”_n
nextNODE’s Results
“(‘STAT|TIME|TMIN|…’, ‘mlc|…’, a Timestamp, a Timestamp)”_n
nextNODE’s Results calculated by PT3S
>>> print(m.V3_AGSN)
Pos ... ('TMAX', 'mlc', Timestamp('2023-02-12 23:00:00'), Timestamp('2023-02-13 23:00:00'))_n
0 -1 ... 602.48758
0 0 ... 602.48758
1 1 ... 602.419501
2 2 ... 602.385399
3 3 ... 602.306951
.. .. ... ...
523 39 ... 582.046941
524 40 ... 582.197052
525 41 ... 582.361158
526 42 ... 582.680754
527 43 ... 583.017569
[537 rows x 52 columns]
V3_ROHRVEC
- dxAndMxHelperFcts.dxWithMx._V3_ROHRVEC(self, V3_ROHR)
V3_ROHRVEC: Expanding V3_ROHR to V3_ROHRVEC (includes interior points). V3_ROHRVEC is a dxWithMx object Attribute.
- Parameters:
V3_ROHR (df) – dxWithMx Attribute
- Returns:
V3_ROHRVEC
- Return type:
df
The interior points are defined by the output grid definition for pipes in the SIR 3S model. The numerical grid with which SIR 3S calculates is different from the output grid. The returned V3_ROHRVEC (one row per pipe and interior point) has the following columns:
Column Name
Description
pk
Pipe-pk
tk
Pipe-tk
…
…
L
…
…
NAME_i, NAME_k
mx2NofPts
dL (=L/(mx2NofPts-1))
…
…
mx2Idx
(‘STAT|TIME|TMIN|…’, ‘ROHR…QMAV|PHR|…’, a Timestamp, a Timestamp)
Pipe-Results
“(‘STAT|TIME|TMIN|…’, ‘KNOT…PH|H|…’, a Timestamp, a Timestamp)”_i
Pipe i-NODE Results
“(‘STAT|TIME|TMIN|…’, ‘KNOT…PH|H|…’, a Timestamp, a Timestamp)”_k
Pipe k-NODE Results
QMAVAbs
Pipes STAT QMAV-Result (absolute value)
VAVAbs
Pipes STAT VAV-Result (absolute value)
PHRAbs
Pipes STAT PHR-Result (absolute value)
JVAbs
Pipes STAT JV-Result (absolute value)
IptIdx
An Index of the points: S: Start (i-NODE), E: End (k-NODE), interior points: 0,1,2,…
IptIdxAsNo
An Index of the points starting with 0 at i-NODE: 0,1,2,…
IptIdxAsNoRev
An Index of the points starting with 0 at k-NODE: 0,1,2,…
SVEC
x in Edge-direction (IptIdx=S: 0.; IptIdx=E: L)
SVECRev
(IptIdx=S: L; IptIdx=E: 0)
ZVEC
z
(‘STAT|TIME|TMIN|…’, ‘ROHR…MVEC|PVEC|RHOVEC|…’, a Timestamp, a Timestamp)
Point Results
(‘STAT|TIME|TMIN|…’, ‘manPVEC|mlcPVEC|barBzgPVEC|’, QMVEC|tMVEC|…’, a Timestamp, a Timestamp)
Point Results calculated by PT3S
manPVEC
from PVEC …
mlcPVEC
from PVEC …
barBzgPVEC
from PVEC …
QMVEC
from MVEC … m3/h
tMVEC
from MVEC … t/h
>>> print(m.V3_ROHRVEC)
pk ... (TMAX, tMVEC, 2023-02-12 23:00:00, 2023-02-13 23:00:00)
0 5442010239090746007 ... 98.646645
1 5442010239090746007 ... 98.646645
2 4917786378639043296 ... 55.044947
3 4917786378639043296 ... 55.044947
4 4762482310382009633 ... 56.352818
... ... ... ...
1065 5499776682108862751 ... 0.0
1066 5285235772707481262 ... 56.845562
1067 5285235772707481262 ... 56.845562
1068 5373158549695106826 ... -30.267313
1069 5373158549695106826 ... -30.267313
[1070 rows x 294 columns]
V3_AGSNVEC
- dxAndMxHelperFcts.dxWithMx._V3_AGSNVEC(self, V3_AGSN)
V3_AGSNVEC is a m object Attribute.
- Parameters:
V3_AGSN (df) – m.V3_AGSN
- Returns:
V3_AGSNVEC: V3_AGSN expanded to V3_AGSNVEC
- Return type:
df
The returned V3_AGSNVEC (expands V3_AGSN from one row for each PIPE in (Section, Layer) to one row for each interior point) has the following columns:
Column Name
Description
V3_AGSN-columns:
Pos
Pos=-1: eliminated if Start-Edge is a Pipe
nextNODE
Pos=0: startNODE @IptIdxAsNo=0 if Start-Edge is a Pipe
LSum
Pos=0: 0. @IptIdxAsNo=0 if Start-Edge is a Pipe
…
…
cols mapped with VEC-Results:
LSum
ZKOR_n
PH_n
H_n
mlc_n
T_n
QM
(see m’s flowMVEC Attribute to determine which VEC-Result is used; default: QMVEC)
PH_n_end
H_n_end
mlc_n_end
T_n_end
QM_end
PH_n_min
H_n_min
mlc_n_min
T_n_min
QM_min
(buggy)
PH_n_max
H_n_max
mlc_n_max
T_n_max
QM_max
(buggy)
cols _n_1,2,3,… derived from mxsVecsResults2MxDfVecAggs=[idxt1,idxt2,idxt3,…,-1]
_1,_2,_3,… corresponds to sorted([idxt1,idxt2,idxt3,…]):
PH_n_1,2,3,…
H_n_1,2,3,…
mlc_n_1,2,3,…
T_n_1,2,3,…
QM_1,2,3,…
V3_ROHRVEC-columns:
pk_ROHRVEC
Pipe-pk
tk_ROHRVEC
Pipe-tk
…
…
L_ROHRVEC
…
…
NAME_i_ROHRVEC, NAME_k_ROHRVEC
mx2NofPts
dL (=L/(mx2NofPts-1))
…
…
mx2Idx
IptIdx
rows S or E are eliminated for all pipes except the 1st
…
…
>>> print(m.V3_AGSNVEC)
Pos pk ... QM_min QM_max
0 0 5755933101669454049 ... 287.090085 538.206592
1 0 5755933101669454049 ... 287.090085 538.206592
2 1 5755933101669454049 ... 287.090085 538.206592
3 2 5755933101669454049 ... -538.206592 -287.090085
4 3 5755933101669454049 ... -538.206592 -287.090085
.. .. ... ... ... ...
532 39 4868980900521118307 ... -28.479333 -15.303667
533 40 4868980900521118307 ... -28.479333 -15.303667
534 41 4868980900521118307 ... -26.661928 -14.329748
535 42 4868980900521118307 ... -18.238317 -9.812775
536 43 4868980900521118307 ... -5.141132 -2.769349
[537 rows x 352 columns]
GeoDataframes
- dxAndMxHelperFcts.dxWithMx._gdfs(self, crs=None)
gdf_FWVB, gdf_FWVB and gdf_KNOT are m object attributes.
- Parameters:
crs (str, optional, default=None) – (=coordinate reference system) Determines crs used in the geopandas-Dfs (Possible value: ‘EPSG:25832’). If None, crs will be read from SIR 3S’ database file.
- Returns:
(gdf_FWVB, gdf_ROHR, gdf_KNOT)
- Return type:
tuple of gdfs
In the returned GeoDataFrames (gdf_FWVB, gdf_ROHR, gdf_KNOT) the following columns are added to V3_FWVB, V3_ROHR, V3_KNOT:
>>> print(m.gdf_ROHR)
pk ... geometry
3 5669301360686511351 ... POINT (713620.268 5578828.419)
4 5397948523091900401 ... POINT (713602.295 5578860.106)
5 5239335112004772156 ... POINT (713574.062 5578909.873)
6 5298886695042021307 ... POINT (713553.840 5578945.533)
7 4993257270457791438 ... POINT (713553.394 5578952.352)
.. ... ... ...
515 5705481928638455076 ... POINT (645.000 285.000)
516 4910948593863484232 ... POINT (650.000 170.000)
517 5032870132214455820 ... POINT (530.000 285.000)
518 4808122385198820357 ... POINT (530.000 170.000)
519 4810663080415972317 ... POINT (530.000 103.000)
[517 rows x 215 columns]
>>> print(m.gdf_KNOT)
pk ... geometry
0 4743997951091160959 ... POINT (713181.847 5578489.925)
1 5014209100699808035 ... POINT (713369.327 5578395.123)
2 4627580049017248376 ... POINT (713251.536 5578455.252)
3 5018070164989726059 ... POINT (713037.635 5578289.847)
4 5668240250035163192 ... POINT (713066.258 5578315.171)
.. ... ... ...
333 5604960832731508460 ... POINT (713185.109 5578370.183)
334 5365421822901958434 ... POINT (713186.745 5578333.649)
335 5430995747331401210 ... POINT (713116.958 5578379.965)
336 5066450637911116733 ... POINT (713080.421 5578361.379)
337 5540117011473392085 ... None
[338 rows x 204 columns]
>>> print(m.gdf_FWVB)
pk ... geometry
0 4743997951091160959 ... POINT (713181.847 5578489.925)
1 5014209100699808035 ... POINT (713369.327 5578395.123)
2 4627580049017248376 ... POINT (713251.536 5578455.252)
3 5018070164989726059 ... POINT (713037.635 5578289.847)
4 5668240250035163192 ... POINT (713066.258 5578315.171)
.. ... ... ...
333 5604960832731508460 ... POINT (713185.109 5578370.183)
334 5365421822901958434 ... POINT (713186.745 5578333.649)
335 5430995747331401210 ... POINT (713116.958 5578379.965)
336 5066450637911116733 ... POINT (713080.421 5578361.379)
337 5540117011473392085 ... None
[338 rows x 204 columns]
Graphs
Also accesible are NetworkX-Graphs and a corresponding dictionnary with node positions.
>>> print([attr for attr in dir(m) if not attr.startswith('_') and isinstance(getattr(m, attr), (nx.Graph, nx.DiGraph, dict))])
['G', 'GSig', 'nodeposDctNx']
G
- dxAndMxHelperFcts.dxWithMx._G(self, V3_VBEL, V3_KNOT)
G is a m object Attribute: The NetworkX Graph of the Hydraulic Model.
- Parameters:
V3_VBEL (df) – edges
V3_KNOT (df) – nodes
- Returns:
G
- Return type:
NetworkX Graph
- Returns:
nodeposDctNx (corresponding nodeposDct)
- Return type:
dct
Note
Builds NetworkX Graph from V3_VBEL (from_pandas_edgelist) with edge attributes. NAME_i and NAME_k are used as source and target. Corresponding node attributes from V3_KNOT. edge and node attributes: keys: keys are tuples (not strings) if the source dfs contain cols which are tuples nodeposDctNx: coordinates of nodes relative to the lower left network corner.
GSig
- dxAndMxHelperFcts.dxWithMx._GSig(self, V3_RVBEL, V3_RKNOT)
GSig is a m object Attribute: The NetworkX Graph of the Signal Model.
- Parameters:
V3_RVBEL (df) – edges
V3_RKNOT (df) – nodes
- Returns:
GSig
- Return type:
NetworkX DiGraph
Note
Builds NetworkX Graph from V3_RVBEL (from_pandas_edgelist) with edge attributes. Corresponding node attributes from V3_RKNOT. The Signal Model Elements (like RSLW or RSTN) are the nodes of GSig and the connections between these Signal Model Elements are the edges of GSig. V3_RKNOT: nodes: node IDs: Kn V3_RVBEL: edges: node IDs: Kn_i (source) and Kn_k (target) node ID: KA (Element’s attribute KA is the ID of the Element’s output signal)
Miscellaneous
Also accesible SirCalcExecution- and -Xml-File and the dir to mx files
>>> print([attr for attr in dir(m) if not attr.startswith('_') and isinstance(getattr(m, attr), str)])
['SirCalcExeFile','SirCalcXmlFile', 'flowMVEC', 'wDirMx']
SirCalcExeFile exists if maxRecords=-1. Additioal forceSir3sRead=True might be necessary.
Dx object
You can find data regarding the model at the m.dx object
>>> dx=m.dx
From this object, you can access the model’s database and its tables.
>>> dx.dataFrames.keys()
>>> dfALLG=dx.dataFrames['ALLG']
Dataframes
Note
Currently, by far not all dfs that are attributes of a Dx object are documented. Maybe this will be added in the future. V3-VBEL, _KNOT, _ROHR and _FWVB are dx attributes. The corresponding m attributes (V3-VBEL, _KNOT, _ROHR and _FWVB) extend the dx dfs with result columns.
dfLAYR
- Dx.Dx._dfLAYR(self)
dfLAYR is a dx object Attribute.
Groups (also called Layers) are used in SIR 3S as a feature for data access, data filtering, and grouping.
The returned dfLAYR (one row per LAYR and OBJ) has the following columns:
Column Name
Description
LAYR:
pk
tk
LFDNR (numeric)
NAME
LAYR-Info:
AnzDerObjekteInGruppe
AnzDerObjekteDesTypsInGruppe
OBJ:
TYPE
ID
OBJ-Info:
NrDesObjektesDesTypsInGruppe
NrDesObjektesInGruppe
GruppenDesObjektsAnz
GruppenDesObjektsNamen
Mx object
You can find additional regarding the results at the m.mx object
>>> mx=m.mx
From this object you can acces the raw time curve and the vector data
>>> mx.df.head()
>>> mx.dfVecAggs.head()
Known Issues
Column tuple names
Columns containing values that are not generated by PT3S but directly read from SIR 3S are tuples like (‘STAT’, ‘ROHR~*~*~*~A’, Timestamp(‘2023-02-12 23:00:00’)).
>>> print([col for col in m.V3_ROHR.columns if isinstance(col, tuple)][:10])
[('STAT', 'ROHR~*~*~*~A', Timestamp('2023-02-12 23:00:00'), Timestamp('2023-02-12 23:00:00')), ('TIME', 'ROHR~*~*~*~A', Timestamp('2023-02-12 23:00:00'), Timestamp('2023-02-12 23:00:00')), ('TMIN', 'ROHR~*~*~*~A', Timestamp('2023-02-12 23:00:00'), Timestamp('2023-02-13 23:00:00')), ('TMAX', 'ROHR~*~*~*~A', Timestamp('2023-02-12 23:00:00'), Timestamp('2023-02-13 23:00:00')), ('STAT', 'ROHR~*~*~*~DTTR', Timestamp('2023-02-12 23:00:00'), Timestamp('2023-02-12 23:00:00')), ('TIME', 'ROHR~*~*~*~DTTR', Timestamp('2023-02-12 23:00:00'), Timestamp('2023-02-12 23:00:00')), ('TMIN', 'ROHR~*~*~*~DTTR', Timestamp('2023-02-12 23:00:00'), Timestamp('2023-02-13 23:00:00')), ('TMAX', 'ROHR~*~*~*~DTTR', Timestamp('2023-02-12 23:00:00'), Timestamp('2023-02-13 23:00:00')), ('STAT', 'ROHR~*~*~*~DWVERL', Timestamp('2023-02-12 23:00:00'), Timestamp('2023-02-12 23:00:00')), ('TIME', 'ROHR~*~*~*~DWVERL', Timestamp('2023-02-12 23:00:00'), Timestamp('2023-02-12 23:00:00'))]
Often times when using these names with other libraries like pandas, several issues can arise.
You are not able to access a pandas DataFrame column with such a name. You might have tried like this.
>>> m.V3_ROHR["('TIME', 'ROHR~*~*~*~DTTR', Timestamp('2023-02-12 23:00:00'), Timestamp('2023-02-12 23:00:00'))"]
KeyError: "('TIME', 'ROHR~*~*~*~DTTR', Timestamp('2023-02-12 23:00:00'), Timestamp('2023-02-12 23:00:00'))"
Try this instead:
>>> import pandas as pd
>>> from pandas import Timestamp
>>> column_name = ('TIME', 'ROHR~*~*~*~DTTR', Timestamp('2023-02-12 23:00:00'), Timestamp('2023-02-12 23:00:00'))
>>> column_data = m.V3_ROHR[column_name]
>>> print(column_data)
0 0.013439
1 0.025363
2 0.017844
3 0.002976
4 0.003263
...
519 26.078106
520 17.345263
521 20.641092
522 0.002895
523 0.00293
Name: (TIME, ROHR~*~*~*~DTTR, 2023-02-12 23:00:00, 2023-02-12 23:00:00), Length: 524, dtype: object
You could also transform all indices from tuple to string:
>>> m.V3_ROHR.columns = [str(col) for col in m.V3_ROHR.columns]
>>> print(m.V3_ROHR["('TIME', 'ROHR~*~*~*~DTTR', Timestamp('2023-02-12 23:00:00'), Timestamp('2023-02-12 23:00:00'))"])
1 0.025363
2 0.017844
3 0.002976
4 0.003263
...
519 26.078106
520 17.345263
521 20.641092
522 0.002895
523 0.00293