-
Notifications
You must be signed in to change notification settings - Fork 23
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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.
viz_scripts/Ebike Usage Trends.ipynb
Outdated
" 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", |
There was a problem hiding this comment.
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?
" 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", |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
viz_scripts/Ebike Usage Trends.ipynb
Outdated
"outputs": [], | ||
"source": [ | ||
"file_suffix = scaffolding.get_file_suffix(year, month, program)\n", | ||
"quality_text = scaffolding.get_quality_text(participant_ct_df, participant)" |
There was a problem hiding this comment.
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...
viz_scripts/Ebike Usage Trends.ipynb
Outdated
" 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", |
There was a problem hiding this comment.
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.
I think I removed outputs this time