Advertisement
Guest User

Untitled

a guest
Dec 16th, 2020
16
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.31 KB | None | 0 0
  1. TypeError Traceback (most recent call last)
  2. <ipython-input-104-de1e6503efe6> in <module>
  3. 9 df1['дебит нефти, м3/сут'] = df1.apply(result_c_col, axis = 1)
  4. 10 df1['дебит воды, м3/сут'] = df1.apply(result_d_col, axis = 1)
  5. ---> 11 df1['коэффициент эксплуатации'] = df1.apply(result_e_col, axis = 1)
  6. 12 df1['дата'] = df1['дата'].dt.strftime('%d.%m.%Y')
  7. 13 mask = (df1['дата'] >= date_question) & (df1['дата'] <= end_date)
  8.  
  9. B:\Games\Anaconda3\lib\site-packages\pandas\core\frame.py in apply(self, func, axis, raw, result_type, args, **kwds)
  10. 6876 kwds=kwds,
  11. 6877 )
  12. -> 6878 return op.get_result()
  13. 6879
  14. 6880 def applymap(self, func) -> "DataFrame":
  15.  
  16. B:\Games\Anaconda3\lib\site-packages\pandas\core\apply.py in get_result(self)
  17. 184 return self.apply_raw()
  18. 185
  19. --> 186 return self.apply_standard()
  20. 187
  21. 188 def apply_empty_result(self):
  22.  
  23. B:\Games\Anaconda3\lib\site-packages\pandas\core\apply.py in apply_standard(self)
  24. 293
  25. 294 try:
  26. --> 295 result = libreduction.compute_reduction(
  27. 296 values, self.f, axis=self.axis, dummy=dummy, labels=labels
  28. 297 )
  29.  
  30. pandas\_libs\reduction.pyx in pandas._libs.reduction.compute_reduction()
  31.  
  32. pandas\_libs\reduction.pyx in pandas._libs.reduction.Reducer.get_result()
  33.  
  34. <ipython-input-102-4c31caa1af20> in result_e_col(row)
  35. 28 m = row['Месяц']
  36. 29 try:
  37. ---> 30 e_col = q_col / calendar.monthrange(y, m)[1]
  38. 31 return round(e_col, 2)
  39. 32 except ZeroDivisionError:
  40.  
  41. B:\Games\Anaconda3\lib\calendar.py in monthrange(year, month)
  42. 123 if not 1 <= month <= 12:
  43. 124 raise IllegalMonthError(month)
  44. --> 125 day1 = weekday(year, month, 1)
  45. 126 ndays = mdays[month] + (month == February and isleap(year))
  46. 127 return day1, ndays
  47.  
  48. B:\Games\Anaconda3\lib\calendar.py in weekday(year, month, day)
  49. 115 if not datetime.MINYEAR <= year <= datetime.MAXYEAR:
  50. 116 year = 2000 + year % 400
  51. --> 117 return datetime.date(year, month, day).weekday()
  52. 118
  53. 119
  54.  
  55. TypeError: integer argument expected, got float
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement