mihaeladuta commited on
Commit
85d56af
·
1 Parent(s): a7dfb64

Re-instated dataset explorer for the Research Groups page.

Browse files
data/ResearchGroups_ppreprocessed.csv.gz CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:cd0e4c2400cfee4dd11bddb54aead00760f140ccd0f45b12a32392d3a2231746
3
- size 27500
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:70bfd57586a6f9f343cd288d590dec8e5c1667abc31bf72adfa109faa1dd761a
3
+ size 32839
src/pages/1_Research_Groups.py CHANGED
@@ -14,8 +14,6 @@ st.title(page_title)
14
  with st.spinner(rw.PROC_TEXT):
15
  (dset, _) = rw.get_data(rw.DATA_PPROC_RGROUPS,
16
  categories_columns=[cb.COL_RG_NAME])
17
- for column in dset.columns:
18
- print(f"{column}: {dset[column].dtype}")
19
 
20
  dset_to_print = pd.DataFrame.from_dict(
21
  {
@@ -28,37 +26,35 @@ dset_to_print.columns = ["count"]
28
  pd.set_option("display.max_colwidth", None)
29
  st.dataframe(dset_to_print)
30
 
31
- tabs = st.tabs(["Charts"])
32
 
33
- with tabs[0]:
34
- st.markdown("Select from the charts below to view the "
35
- "distributions for the number of research groups records by ...")
36
 
37
- columns = [cb.COL_PANEL_NAME,
38
- cb.COL_UOA_NAME]
39
- tab_names = columns.copy()
40
- tab_names.append(f"{cb.COL_PANEL_NAME} & {cb.COL_UOA_NAME}")
41
- tabs = st.tabs(tab_names)
42
 
43
- for i, column in enumerate(columns):
44
 
45
- with tabs[i]:
46
- dset_stats = proc.calculate_counts(dset,
47
- column,
48
- sort=False)
49
- vis.draw_counts_percent_chart(dset_stats,
50
- column)
51
- with tabs[2]:
52
- dset_stats = proc.calculate_grouped_counts(dset,
53
- [cb.COL_PANEL_NAME, cb.COL_UOA_NAME]
54
- )
55
- vis.draw_grouped_counts_chart(dset_stats,
56
- cb.COL_PANEL_NAME,
57
- cb.COL_UOA_NAME,
58
- cb.COL_PANEL_NAME
59
- )
60
 
61
 
62
- # with tabs[1]:
63
- # dset_explore = dataframe_explorer(dset)
64
- # # st.dataframe(dset_explore, use_container_width=False)
 
14
  with st.spinner(rw.PROC_TEXT):
15
  (dset, _) = rw.get_data(rw.DATA_PPROC_RGROUPS,
16
  categories_columns=[cb.COL_RG_NAME])
 
 
17
 
18
  dset_to_print = pd.DataFrame.from_dict(
19
  {
 
26
  pd.set_option("display.max_colwidth", None)
27
  st.dataframe(dset_to_print)
28
 
 
29
 
30
+ st.markdown("Select from the charts below to view the "
31
+ "distributions for the number of research groups records by ...")
 
32
 
33
+ columns = [cb.COL_PANEL_NAME,
34
+ cb.COL_UOA_NAME]
35
+ tab_names = columns.copy()
36
+ tab_names.append(f"{cb.COL_PANEL_NAME} & {cb.COL_UOA_NAME}")
37
+ tabs = st.tabs(tab_names)
38
 
39
+ for i, column in enumerate(columns):
40
 
41
+ with tabs[i]:
42
+ dset_stats = proc.calculate_counts(dset,
43
+ column,
44
+ sort=False)
45
+ vis.draw_counts_percent_chart(dset_stats,
46
+ column)
47
+ with tabs[2]:
48
+ dset_stats = proc.calculate_grouped_counts(dset,
49
+ [cb.COL_PANEL_NAME, cb.COL_UOA_NAME]
50
+ )
51
+ vis.draw_grouped_counts_chart(dset_stats,
52
+ cb.COL_PANEL_NAME,
53
+ cb.COL_UOA_NAME,
54
+ cb.COL_PANEL_NAME
55
+ )
56
 
57
 
58
+ dset_explore = dataframe_explorer(dset)
59
+ st.dataframe(dset_explore, use_container_width=False)
60
+
src/read_write.py CHANGED
@@ -60,7 +60,7 @@ def get_data(fname, categories_columns=[]):
60
  dtype[column] = 'category'
61
 
62
  dset = pd.read_csv(os.path.join(PROJECT_PATH, fname),
63
- index_col=None,
64
  dtype=dtype)
65
  print(f"Read {fname}: {dset.shape[0]} records")
66
 
 
60
  dtype[column] = 'category'
61
 
62
  dset = pd.read_csv(os.path.join(PROJECT_PATH, fname),
63
+ index_col=0,
64
  dtype=dtype)
65
  print(f"Read {fname}: {dset.shape[0]} records")
66