stimpyp.protocol_parser.generate_extended_dataframe#
- stimpyp.protocol_parser.generate_extended_dataframe(df)#
Undoes the magic n-i one-liner commands and generates needed extra lines. i=0 on line of declaration.
Example Raw:
┌───────┬─────┬─────┬─────┬───┬────────┬───────┬────────┬─────────┐ │ n ┆ dur ┆ xc ┆ yc ┆ … ┆ ori ┆ width ┆ height ┆ pattern │ │ --- ┆ --- ┆ --- ┆ --- ┆ ┆ --- ┆ --- ┆ --- ┆ --- │ │ str ┆ i64 ┆ i64 ┆ i64 ┆ ┆ str ┆ i64 ┆ i64 ┆ str │ ╞═══════╪═════╪═════╪═════╪═══╪════════╪═══════╪════════╪═════════╡ │ 0-11 ┆ 3 ┆ 0 ┆ 0 ┆ … ┆ {i}*30 ┆ 200 ┆ 200 ┆ sqr │ │ 12-23 ┆ 3 ┆ 0 ┆ 0 ┆ … ┆ {i}*30 ┆ 200 ┆ 200 ┆ sqr │ └───────┴─────┴─────┴─────┴───┴────────┴───────┴────────┴─────────┘Example Extended:
┌─────┬─────┬─────┬─────┬───┬─────┬───────┬────────┬─────────┐ │ n ┆ dur ┆ xc ┆ yc ┆ … ┆ ori ┆ width ┆ height ┆ pattern │ │ --- ┆ --- ┆ --- ┆ --- ┆ ┆ --- ┆ --- ┆ --- ┆ --- │ │ i64 ┆ i64 ┆ i64 ┆ i64 ┆ ┆ i64 ┆ i64 ┆ i64 ┆ str │ ╞═════╪═════╪═════╪═════╪═══╪═════╪═══════╪════════╪═════════╡ │ 0 ┆ 3 ┆ 0 ┆ 0 ┆ … ┆ 0 ┆ 200 ┆ 200 ┆ sqr │ │ 1 ┆ 3 ┆ 0 ┆ 0 ┆ … ┆ 30 ┆ 200 ┆ 200 ┆ sqr │ │ 2 ┆ 3 ┆ 0 ┆ 0 ┆ … ┆ 60 ┆ 200 ┆ 200 ┆ sqr │ │ … ┆ … ┆ … ┆ … ┆ … ┆ … ┆ … ┆ … ┆ … │ │ 22 ┆ 3 ┆ 0 ┆ 0 ┆ … ┆ 660 ┆ 200 ┆ 200 ┆ sqr │ │ 23 ┆ 3 ┆ 0 ┆ 0 ┆ … ┆ 690 ┆ 200 ┆ 200 ┆ sqr │ └─────┴─────┴─────┴─────┴───┴─────┴───────┴────────┴─────────┘
- Parameters:
df (DataFrame)
- Return type:
DataFrame