File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change 99
1010logger = logging .getLogger ("django" )
1111
12+ MAX_ELEMENTS_SCREEN = 12
13+
1214
1315class BaseDf :
1416 def __init__ (self , df : pd .DataFrame ):
@@ -79,7 +81,6 @@ class DfProcessor:
7981 def __init__ (self , bdf : BaseDf , time_unit : str = "year" ):
8082 self .df = bdf .df .copy ()
8183 self .time_unit = time_unit
82- self .max_elements_screen = 12
8384 if self .time_unit == "year" :
8485 self .df ["date" ] = self .df ["date" ].dt .strftime ("%Y-01-01" )
8586 elif self .time_unit == "month" :
@@ -180,7 +181,7 @@ def values_by_date(self):
180181 ip .set_index ("date" )
181182 .sort_values ("rank" )
182183 .groupby (level = 0 )
183- .head (self . max_elements_screen * 2 ) # times 2 to be safe
184+ .head (MAX_ELEMENTS_SCREEN * 2 ) # times 2 to be safe
184185 .groupby (level = 0 )
185186 ):
186187 values = grouped .to_dict (orient = "records" )
You can’t perform that action at this time.
0 commit comments