Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding scripts used for my analysis #49

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

Conversation

kacieli
Copy link

@kacieli kacieli commented Aug 10, 2022

I think I removed outputs this time

Copy link
Contributor

@shankari shankari left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall, but I have some high level comments below.

Comment on lines 1409 to 1444
" if user['month'+str(i)][j].start_local_dt_month.iloc[0]==12 and user['month'+str(i)][j].start_local_dt_year.iloc[0]==2020:\n",
" timeline.at[str(user['month'+str(i)][j].Income.iloc[0]),'December 2020']=percent\n",
" elif user['month'+str(i)][j].start_local_dt_month.iloc[0]==1 and user['month'+str(i)][j].start_local_dt_year.iloc[0]==2021:\n",
" timeline.at[str(user['month'+str(i)][j].Income.iloc[0]),'January 2021']=percent\n",
" elif user['month'+str(i)][j].start_local_dt_month.iloc[0]==2 and user['month'+str(i)][j].start_local_dt_year.iloc[0]==2021:\n",
" timeline.at[str(user['month'+str(i)][j].Income.iloc[0]),'February 2021']=percent\n",
" elif user['month'+str(i)][j].start_local_dt_month.iloc[0]==3 and user['month'+str(i)][j].start_local_dt_year.iloc[0]==2021:\n",
" timeline.at[str(user['month'+str(i)][j].Income.iloc[0]),'March 2021']=percent\n",
" elif user['month'+str(i)][j].start_local_dt_month.iloc[0]==4 and user['month'+str(i)][j].start_local_dt_year.iloc[0]==2021:\n",
" timeline.at[str(user['month'+str(i)][j].Income.iloc[0]),'April 2021']=percent\n",
" elif user['month'+str(i)][j].start_local_dt_month.iloc[0]==5 and user['month'+str(i)][j].start_local_dt_year.iloc[0]==2021:\n",
" timeline.at[str(user['month'+str(i)][j].Income.iloc[0]),'May 2021']=percent\n",
" elif user['month'+str(i)][j].start_local_dt_month.iloc[0]==6 and user['month'+str(i)][j].start_local_dt_year.iloc[0]==2021:\n",
" timeline.at[str(user['month'+str(i)][j].Income.iloc[0]),'June 2021']=percent\n",
" elif user['month'+str(i)][j].start_local_dt_month.iloc[0]==7 and user['month'+str(i)][j].start_local_dt_year.iloc[0]==2021:\n",
" timeline.at[str(user['month'+str(i)][j].Income.iloc[0]),'July 2021']=percent\n",
" elif user['month'+str(i)][j].start_local_dt_month.iloc[0]==8 and user['month'+str(i)][j].start_local_dt_year.iloc[0]==2021:\n",
" timeline.at[str(user['month'+str(i)][j].Income.iloc[0]),'August 2021']=percent\n",
" elif user['month'+str(i)][j].start_local_dt_month.iloc[0]==9 and user['month'+str(i)][j].start_local_dt_year.iloc[0]==2021:\n",
" timeline.at[str(user['month'+str(i)][j].Income.iloc[0]),'September 2021']=percent\n",
" elif user['month'+str(i)][j].start_local_dt_month.iloc[0]==10 and user['month'+str(i)][j].start_local_dt_year.iloc[0]==2021:\n",
" timeline.at[str(user['month'+str(i)][j].Income.iloc[0]),'October 2021']=percent\n",
" elif user['month'+str(i)][j].start_local_dt_month.iloc[0]==11 and user['month'+str(i)][j].start_local_dt_year.iloc[0]==2021:\n",
" timeline.at[str(user['month'+str(i)][j].Income.iloc[0]),'November 2021']=percent\n",
" elif user['month'+str(i)][j].start_local_dt_month.iloc[0]==12 and user['month'+str(i)][j].start_local_dt_year.iloc[0]==2021:\n",
" timeline.at[str(user['month'+str(i)][j].Income.iloc[0]),'December 2021']=percent\n",
" elif user['month'+str(i)][j].start_local_dt_month.iloc[0]==1 and user['month'+str(i)][j].start_local_dt_year.iloc[0]==2022:\n",
" timeline.at[str(user['month'+str(i)][j].Income.iloc[0]),'January 2022']=percent\n",
" elif user['month'+str(i)][j].start_local_dt_month.iloc[0]==2 and user['month'+str(i)][j].start_local_dt_year.iloc[0]==2022:\n",
" timeline.at[str(user['month'+str(i)][j].Income.iloc[0]),'February 2022']=percent\n",
" elif user['month'+str(i)][j].start_local_dt_month.iloc[0]==3 and user['month'+str(i)][j].start_local_dt_year.iloc[0]==2022:\n",
" timeline.at[str(user['month'+str(i)][j].Income.iloc[0]),'March 2022']=percent\n",
" elif user['month'+str(i)][j].start_local_dt_month.iloc[0]==4 and user['month'+str(i)][j].start_local_dt_year.iloc[0]==2022:\n",
" timeline.at[str(user['month'+str(i)][j].Income.iloc[0]),'April 2022']=percent\n",
" elif user['month'+str(i)][j].start_local_dt_month.iloc[0]==5 and user['month'+str(i)][j].start_local_dt_year.iloc[0]==2022:\n",
" timeline.at[str(user['month'+str(i)][j].Income.iloc[0]),'May 2022']=percent\n",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is extremely repetitive and will not scale. What if I want to run the same script next summer?
Isn't there an easier way to do this using a loop or something?

Comment on lines +1455 to +1459
" for i in range(len(timeline)-1):\n",
" sns.lineplot(ax=ax,x=timeline.loc[timeline.index[-1]],y=timeline.iloc[i],data=timeline,marker='o')\n",
" plt.legend(bbox_to_anchor=(1, 1), loc='upper left', labels = timeline.index)\n",
" plt.show\n",
"\n",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, as we indicated, this doesn't really show any significant differences. Did you try the boxplot approach?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can look at #47
for boxplot examples

"outputs": [],
"source": [
"file_suffix = scaffolding.get_file_suffix(year, month, program)\n",
"quality_text = scaffolding.get_quality_text(participant_ct_df, participant)"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The quality text is still based on participant_ct_df, so I am not sure how it is fixed...

Comment on lines 1578 to 1582
" for i in range(len(timeline)-1):\n",
" sns.lineplot(ax=ax,x=timeline.loc[timeline.index[-1]],y=timeline.iloc[i],data=timeline,marker='o')\n",
" plt.legend(bbox_to_anchor=(1, 1), loc='upper left', labels = timeline.index)\n",
" plt.show\n",
"\n",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The output for this is super messy and is essentially unreadable. Please check with Bingrong on what story this is telling and how to represent it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants