Commit ·
391b919
1
Parent(s): 51ce8b5
cache loading of dataframes
Browse files
app.py
CHANGED
|
@@ -19,6 +19,18 @@ st.set_page_config(
|
|
| 19 |
#</style>
|
| 20 |
#""", unsafe_allow_html=True)
|
| 21 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
st.markdown("Note: this analysis is meant to viewed on a computer and not a phone (sorry!)")
|
| 23 |
|
| 24 |
st.markdown("[Code can be found [here](https://github.com/joshdavham/cij-analysis)]")
|
|
@@ -37,8 +49,6 @@ st.markdown("To answer this question, I'll be analyzing the videos on \
|
|
| 37 |
[cijapanese.com](https://cijapanese.com/) (CIJ), a \
|
| 38 |
video platform for learning Japanese.")
|
| 39 |
|
| 40 |
-
video_df = pd.read_csv("video_data.tsv", sep="\t")
|
| 41 |
-
|
| 42 |
# Plot the WPM histogram
|
| 43 |
|
| 44 |
st.markdown("## How fast is CI?")
|
|
@@ -751,8 +761,6 @@ st.markdown("If we take all the words in CIJ, count them then order them from mo
|
|
| 751 |
@st.cache_data
|
| 752 |
def get_word_coverage_chart(zoom=False):
|
| 753 |
|
| 754 |
-
word_coverage_df = pd.read_csv('word_coverage_df_plot.tsv', sep='\t')
|
| 755 |
-
|
| 756 |
if zoom:
|
| 757 |
word_coverage_df_sub = word_coverage_df.loc[word_coverage_df['coverage_perc']>=90]
|
| 758 |
else:
|
|
@@ -1729,8 +1737,6 @@ st.markdown("We've just found a number of statistics that lead to orderings in t
|
|
| 1729 |
st.markdown("To answer this, we can look at a correlation heatmap between each of the variables \
|
| 1730 |
and observe which statistics correlate the most strongly with the video's level.")
|
| 1731 |
|
| 1732 |
-
num_video_df = pd.read_csv('num_video_df.tsv', sep='\t')
|
| 1733 |
-
|
| 1734 |
@st.cache_data
|
| 1735 |
def render_vanilla_heatmap():
|
| 1736 |
|
|
|
|
| 19 |
#</style>
|
| 20 |
#""", unsafe_allow_html=True)
|
| 21 |
|
| 22 |
+
@st.cache_data
|
| 23 |
+
def load_dataframes():
|
| 24 |
+
|
| 25 |
+
video_df = pd.read_csv("video_data.tsv", sep="\t")
|
| 26 |
+
word_coverage_df = pd.read_csv('word_coverage_df_plot.tsv', sep='\t')
|
| 27 |
+
num_video_df = pd.read_csv('num_video_df.tsv', sep='\t')
|
| 28 |
+
|
| 29 |
+
return video_df, word_coverage_df, num_video_df
|
| 30 |
+
|
| 31 |
+
video_df, word_coverage_df, num_video_df = load_dataframes()
|
| 32 |
+
|
| 33 |
+
|
| 34 |
st.markdown("Note: this analysis is meant to viewed on a computer and not a phone (sorry!)")
|
| 35 |
|
| 36 |
st.markdown("[Code can be found [here](https://github.com/joshdavham/cij-analysis)]")
|
|
|
|
| 49 |
[cijapanese.com](https://cijapanese.com/) (CIJ), a \
|
| 50 |
video platform for learning Japanese.")
|
| 51 |
|
|
|
|
|
|
|
| 52 |
# Plot the WPM histogram
|
| 53 |
|
| 54 |
st.markdown("## How fast is CI?")
|
|
|
|
| 761 |
@st.cache_data
|
| 762 |
def get_word_coverage_chart(zoom=False):
|
| 763 |
|
|
|
|
|
|
|
| 764 |
if zoom:
|
| 765 |
word_coverage_df_sub = word_coverage_df.loc[word_coverage_df['coverage_perc']>=90]
|
| 766 |
else:
|
|
|
|
| 1737 |
st.markdown("To answer this, we can look at a correlation heatmap between each of the variables \
|
| 1738 |
and observe which statistics correlate the most strongly with the video's level.")
|
| 1739 |
|
|
|
|
|
|
|
| 1740 |
@st.cache_data
|
| 1741 |
def render_vanilla_heatmap():
|
| 1742 |
|