Markiian Tsalyk commited on
Commit
25e2c90
·
1 Parent(s): 887480a

Fixed pandas typing

Browse files
Files changed (2) hide show
  1. __pycache__/tools.cpython-313.pyc +0 -0
  2. tools.py +5 -4
__pycache__/tools.cpython-313.pyc CHANGED
Binary files a/__pycache__/tools.cpython-313.pyc and b/__pycache__/tools.cpython-313.pyc differ
 
tools.py CHANGED
@@ -262,19 +262,20 @@ def read_excel(path: str, **kwargs) -> pd.DataFrame:
262
  return pd.read_excel(path)
263
 
264
 
265
- def pandas_column_sum(df: pd.DataFrame, column_name: str, **kwargs) -> float:
 
 
266
  """
267
  Computes sum on pandas dataframe column
268
 
269
  Args:
270
- df: Pandas dataframe
271
  column_name: Name of the column
272
 
273
  Return:
274
  Sum of the column
275
  """
276
- df[column_name] = df[column_name].astype(float)
277
- return df[column_name].sum()
278
 
279
 
280
  def final_answer(query: str, answer: str, **kwargs) -> str:
 
262
  return pd.read_excel(path)
263
 
264
 
265
+ def pandas_column_sum(
266
+ pandas_column_values: list[int | float], column_name: str, **kwargs
267
+ ) -> float:
268
  """
269
  Computes sum on pandas dataframe column
270
 
271
  Args:
272
+ pandas_column_values: List with float or integer pandas values
273
  column_name: Name of the column
274
 
275
  Return:
276
  Sum of the column
277
  """
278
+ return sum(pandas_column_values)
 
279
 
280
 
281
  def final_answer(query: str, answer: str, **kwargs) -> str: