File tree Expand file tree Collapse file tree
src/mindlogger_data_export Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -527,14 +527,34 @@ def _prepare_activity_columns(
527527 col .replace ("_index" , "" ) for col in df .columns if col .endswith ("_index" )
528528 }
529529
530- return df .select (
531- [
532- col
533- for col in df .columns
534- if col not in (response_bases | score_bases | index_bases )
535- and not col .startswith (f"{ activity_prefix } _response_response_" )
536- and not col .startswith (f"{ activity_prefix } _response_value_" )
537- ]
530+ return (
531+ df .rename (
532+ {
533+ col : col .replace (
534+ f"{ activity_prefix } _response_response_" , f"{ activity_prefix } _"
535+ ).replace ("_response_response_" , "_" )
536+ + "_response"
537+ for col in df .columns
538+ if f"{ activity_prefix } _response_response_" in col
539+ }
540+ )
541+ .rename (
542+ {
543+ col : col .replace (
544+ f"{ activity_prefix } _response_value_" , f"{ activity_prefix } _"
545+ ).replace ("_response_value_" , "_" )
546+ + "_score"
547+ for col in df .columns
548+ if f"{ activity_prefix } _response_value_" in col
549+ }
550+ )
551+ .select (
552+ [
553+ col
554+ for col in df .columns
555+ if col not in (response_bases | score_bases | index_bases )
556+ ]
557+ )
538558 )
539559
540560 def _format_activity (self , df : pl .DataFrame , activity_name : str ) -> pl .DataFrame :
You can’t perform that action at this time.
0 commit comments