Files
JPMC-quant/01_ingest_qualtrics_export.py

65 lines
1.4 KiB
Python

import marimo
__generated_with = "0.19.2"
app = marimo.App(width="medium")
@app.cell
def _():
import marimo as mo
import polars as pl
import sqlite3
from pathlib import Path
return Path, pl
@app.cell
def _():
# RESULTS_FILE = 'data/exports/OneDrive_2026-01-21/Soft Launch Data/JPMC_Chase Brand Personality_Quant Round 1_January 21, 2026_Soft Launch_Labels.csv'
RESULTS_FILE = 'data/exports/OneDrive_1_1-16-2026/JPMC_Chase Brand Personality_Quant Round 1_TestData_Labels.csv'
return (RESULTS_FILE,)
@app.cell
def _(Path, RESULTS_FILE, pl):
results_file = Path(RESULTS_FILE)
df = pl.read_csv(results_file, skip_rows=0)
df
return df, results_file
@app.cell
def _(df, pl, results_file):
colset = set(df.columns)
this_df_verify = pl.DataFrame({'column_names': [colset], 'results_file': results_file.as_posix()})
this_df_verify
return (this_df_verify,)
@app.cell
def _(Path, pl, this_df_verify):
verification_record = Path('./data/exports/verification.csv')
if verification_record.exists():
verify_df = pl.read_csv(verification_record)
verify_df = pl.concat([verify_df, this_df_verify], how='vertical')
# save verify_df
verify_df.write_csv(verification_record)
else:
verify_df = this_df_verify
# append this_df_verify to verify_df
verify_df
return
@app.cell
def _():
return
if __name__ == "__main__":
app.run()