File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed
Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -34,12 +34,12 @@ def stars_component(self):
3434 Prepare the graph to show the stars evolution
3535 and the differences
3636 """
37- df = self .data .stars_data (). reset_index ( level = 0 )
37+ df = self .data .stars_data ()
3838
3939 if df is not None and not df .empty :
4040 current = int (df .iloc [- 1 ].get ("stars" ))
41- last_week = int (df .iloc [- 2 ].get ("stars" ))
42- last_month = int (df .iloc [- 4 ].get ("stars" ))
41+ last_week = int (df .iloc [- 7 ].get ("stars" ))
42+ last_month = int (df .iloc [- 30 ].get ("stars" ))
4343
4444 else :
4545 st .write ("Error fetching Star data" )
Original file line number Diff line number Diff line change @@ -59,7 +59,8 @@ def stars_data(self) -> Optional[DataFrame]:
5959 )
6060
6161 df ["date" ] = pd .to_datetime (df ["date" ])
62- df = df .resample ("W" , on = "date" )[["stars" ]].sum ()
62+ # This resample groups by week. Let's keep grouping by day.
63+ # df = df.resample("W", on="date")[["stars"]].sum()
6364 df ["stars" ] = df ["stars" ].cumsum ()
6465
6566 return df
You can’t perform that action at this time.
0 commit comments