nataliaElv commited on
Commit
99e4eea
·
1 Parent(s): fb6d2eb

fine-tuned cloud

Browse files
Files changed (1) hide show
  1. app.py +8 -7
app.py CHANGED
@@ -3,6 +3,7 @@ import pandas as pd
3
  from github import Github
4
  from wordcloud import WordCloud
5
  import matplotlib.pyplot as plt
 
6
 
7
  g = Github(st.secrets["ACCESS_TOKEN"])
8
  repo = g.get_repo(st.secrets["REPO_NAME"])
@@ -53,14 +54,14 @@ closed_issues = df.loc[df['State'] == 'closed']
53
  closed_issues['Time to Close'] = closed_issues['Closed at'] - closed_issues['Created at']
54
 
55
  with col1:
56
- st.metric(label="Open Issues", value=state_counts['open'])
57
 
58
  with col2:
59
- st.metric(label="Closed Issues", value=state_counts['closed'])
60
 
61
  with col3:
62
  average_time_to_close = closed_issues['Time to Close'].mean().days
63
- st.metric(label="Avg. Days to Close", value=average_time_to_close)
64
 
65
 
66
  # TODO Plot: number of open vs closed issues by date
@@ -120,13 +121,13 @@ with col1:
120
  "Link": st.column_config.LinkColumn("Link", display_text="🔗")
121
  }
122
  )
123
-
124
- ## Dataframe: Number of open bugs ordered by date
125
 
126
  ## Cloud of words: Issue titles
127
  with col2:
128
- st.subheader("Word cloud of issue titles")
129
- wordcloud = WordCloud(width=800, height=400, background_color="white").generate(" ".join(open_issues["Issue"]))
 
 
130
  plt.figure(figsize=(10, 5))
131
  plt.imshow(wordcloud, interpolation="bilinear")
132
  plt.axis("off")
 
3
  from github import Github
4
  from wordcloud import WordCloud
5
  import matplotlib.pyplot as plt
6
+ import re
7
 
8
  g = Github(st.secrets["ACCESS_TOKEN"])
9
  repo = g.get_repo(st.secrets["REPO_NAME"])
 
54
  closed_issues['Time to Close'] = closed_issues['Closed at'] - closed_issues['Created at']
55
 
56
  with col1:
57
+ st.metric(label="Open issues", value=state_counts['open'])
58
 
59
  with col2:
60
+ st.metric(label="Closed issues", value=state_counts['closed'])
61
 
62
  with col3:
63
  average_time_to_close = closed_issues['Time to Close'].mean().days
64
+ st.metric(label="Avg. days to close", value=average_time_to_close)
65
 
66
 
67
  # TODO Plot: number of open vs closed issues by date
 
121
  "Link": st.column_config.LinkColumn("Link", display_text="🔗")
122
  }
123
  )
 
 
124
 
125
  ## Cloud of words: Issue titles
126
  with col2:
127
+ st.subheader("Cloud of words ☁️")
128
+ titles = " ".join(open_issues["Issue"])
129
+ titles = re.sub(r'\[.*?\]', '', titles)
130
+ wordcloud = WordCloud(width=800, height=400, background_color="white").generate(titles)
131
  plt.figure(figsize=(10, 5))
132
  plt.imshow(wordcloud, interpolation="bilinear")
133
  plt.axis("off")