Mofe commited on
Commit
2ebc879
·
1 Parent(s): 47d9b77

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -12
app.py CHANGED
@@ -59,11 +59,11 @@ def load_df(data_file: os.PathLike):
59
 
60
  df["authors_trimmed"] = df["authors_trimmed"]
61
 
62
- #sort dataframe by year
63
- df['year'] = pd.to_datetime(df['year'])
64
- df = df.sort_values('year', ascending=True)
65
- df['year'] = df['year'].dt.strftime('%Y')
66
- df['year'] = df['year'].astype(int)
67
 
68
  return df
69
 
@@ -87,14 +87,14 @@ with st.sidebar:
87
  # ["Topics 2: "],
88
  # )
89
 
90
- # start_year, end_year = st.select_slider(
91
- # "Publication year",
92
- # options=[str(y) for y in range(min_year, max_year + 1)],
93
- # value=(str(min_year), str(max_year)),
94
- # )
95
 
96
- start_year = 1997
97
- end_year = 2023
98
  df_mask = (DF["year"] >= start_year) & (DF["year"] <= end_year)
99
 
100
  if author_names:
 
59
 
60
  df["authors_trimmed"] = df["authors_trimmed"]
61
 
62
+ # #sort dataframe by year
63
+ # df['year'] = pd.to_datetime(df['year'])
64
+ # df = df.sort_values('year', ascending=True)
65
+ # df['year'] = df['year'].dt.strftime('%Y')
66
+ # df['year'] = df['year'].astype(int)
67
 
68
  return df
69
 
 
87
  # ["Topics 2: "],
88
  # )
89
 
90
+ start_year, end_year = st.select_slider(
91
+ "Publication year",
92
+ options=[str(y) for y in range(min_year, max_year + 1)],
93
+ value=(str(min_year), str(max_year)),
94
+ )
95
 
96
+ # start_year = 1997
97
+ # end_year = 2023
98
  df_mask = (DF["year"] >= start_year) & (DF["year"] <= end_year)
99
 
100
  if author_names: