@@ -79,8 +79,7 @@ def gcs_intro(args):
7979 )
8080 LOGGER .info (f"data file: { file_path .replace (PATHS ['repo' ], '.' )} " )
8181 name_label = "CC legal tool product"
82- data = shared .open_data_file (LOGGER , file_path )
83- data .set_index (name_label , inplace = True )
82+ data = shared .open_data_file (LOGGER , file_path , index_col = name_label )
8483 total_count = f"{ data ['Count' ].sum ():,d} "
8584 shared .update_readme (
8685 args ,
@@ -111,8 +110,7 @@ def plot_products(args):
111110 )
112111 LOGGER .info (f"data file: { file_path .replace (PATHS ['repo' ], '.' )} " )
113112 name_label = "CC legal tool product"
114- data = shared .open_data_file (LOGGER , file_path )
115- data .set_index (name_label , inplace = True )
113+ data = shared .open_data_file (LOGGER , file_path , index_col = name_label )
116114
117115 data = data [::- 1 ] # reverse order
118116
@@ -158,8 +156,7 @@ def plot_tool_status(args):
158156 )
159157 LOGGER .info (f"data file: { file_path .replace (PATHS ['repo' ], '.' )} " )
160158 name_label = "CC legal tool"
161- data = shared .open_data_file (LOGGER , file_path )
162- data .set_index (name_label , inplace = True )
159+ data = shared .open_data_file (LOGGER , file_path , index_col = name_label )
163160 data .sort_values (name_label , ascending = False , inplace = True )
164161
165162 title = "CC legal tools status"
@@ -202,8 +199,7 @@ def plot_latest_tools(args):
202199 )
203200 LOGGER .info (f"data file: { file_path .replace (PATHS ['repo' ], '.' )} " )
204201 name_label = "CC legal tool"
205- data = shared .open_data_file (LOGGER , file_path )
206- data .set_index (name_label , inplace = True )
202+ data = shared .open_data_file (LOGGER , file_path , index_col = name_label )
207203 data .sort_values (name_label , ascending = False , inplace = True )
208204
209205 title = "Latest CC legal tools"
@@ -245,8 +241,7 @@ def plot_prior_tools(args):
245241 )
246242 LOGGER .info (f"data file: { file_path .replace (PATHS ['repo' ], '.' )} " )
247243 name_label = "CC legal tool"
248- data = shared .open_data_file (LOGGER , file_path )
249- data .set_index (name_label , inplace = True )
244+ data = shared .open_data_file (LOGGER , file_path , index_col = name_label )
250245 data .sort_values (name_label , ascending = False , inplace = True )
251246
252247 title = "Prior CC legal tools"
@@ -291,8 +286,7 @@ def plot_retired_tools(args):
291286 )
292287 LOGGER .info (f"data file: { file_path .replace (PATHS ['repo' ], '.' )} " )
293288 name_label = "CC legal tool"
294- data = shared .open_data_file (LOGGER , file_path )
295- data .set_index (name_label , inplace = True )
289+ data = shared .open_data_file (LOGGER , file_path , index_col = name_label )
296290 data .sort_values (name_label , ascending = False , inplace = True )
297291
298292 title = "Retired CC legal tools"
@@ -338,8 +332,7 @@ def plot_countries_highest_usage(args):
338332 LOGGER .info (f"data file: { file_path .replace (PATHS ['repo' ], '.' )} " )
339333 name_label = "Country"
340334 data_label = "Count"
341- data = shared .open_data_file (LOGGER , file_path )
342- data .set_index (name_label , inplace = True )
335+ data = shared .open_data_file (LOGGER , file_path , index_col = name_label )
343336 total_count = f"{ data ['Count' ].sum ():,d} "
344337 data .sort_values (data_label , ascending = False , inplace = True )
345338 data = data [:10 ] # limit to highest 10
@@ -392,8 +385,7 @@ def plot_languages_highest_usage(args):
392385 LOGGER .info (f"data file: { file_path .replace (PATHS ['repo' ], '.' )} " )
393386 name_label = "Language"
394387 data_label = "Count"
395- data = shared .open_data_file (LOGGER , file_path )
396- data .set_index (name_label , inplace = True )
388+ data = shared .open_data_file (LOGGER , file_path , index_col = name_label )
397389 total_count = f"{ data ['Count' ].sum ():,d} "
398390 data .sort_values (data_label , ascending = False , inplace = True )
399391 data = data [:10 ] # limit to highest 10
0 commit comments