setup complete framework of analysis
This commit is contained in:
@@ -10,10 +10,11 @@ def _():
|
||||
import polars as pl
|
||||
from pathlib import Path
|
||||
|
||||
from utils import JPMCSurvey
|
||||
from utils import JPMCSurvey, combine_exclusive_columns
|
||||
from plots import plot_average_scores_with_counts, plot_top3_ranking_distribution
|
||||
return (
|
||||
JPMCSurvey,
|
||||
combine_exclusive_columns,
|
||||
mo,
|
||||
pl,
|
||||
plot_average_scores_with_counts,
|
||||
@@ -38,8 +39,8 @@ def _(JPMCSurvey, QSF_FILE, RESULTS_FILE):
|
||||
|
||||
|
||||
@app.cell
|
||||
def _():
|
||||
# survey.qid_descr_map
|
||||
def _(survey):
|
||||
survey.qid_descr_map
|
||||
return
|
||||
|
||||
|
||||
@@ -286,15 +287,24 @@ def _(data, survey):
|
||||
@app.cell
|
||||
def _(data, survey):
|
||||
traits_refined = survey.get_character_refine(data)[0]
|
||||
|
||||
traits_refined.collect()
|
||||
|
||||
return (traits_refined,)
|
||||
|
||||
|
||||
@app.cell
|
||||
def _(traits_original, traits_refined):
|
||||
def _(combine_exclusive_columns, traits_refined):
|
||||
traits_refined_comb = combine_exclusive_columns(traits_refined.collect(), target_col_name='Top_8_Traits_Refined')
|
||||
traits_refined_comb
|
||||
return (traits_refined_comb,)
|
||||
|
||||
|
||||
@app.cell
|
||||
def _(traits_original, traits_refined_comb):
|
||||
# merge the two dataframes side by side for comparison
|
||||
traits_comparison = traits_original.join(traits_refined, on='_recordId')
|
||||
traits_comparison.collect()
|
||||
traits_comparison = traits_original.join(traits_refined_comb.lazy(), on='_recordId')
|
||||
print(traits_comparison.collect().head())
|
||||
return
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user