Advertisement
Guest User

Untitled

a guest
Aug 21st, 2019
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. %%cython -a
  2. # cython: linetrace=True
  3. # cython: binding=True
  4. # distutils: define_macros=CYTHON_TRACE_NOGIL=1
  5. import numpy as np
  6. cimport numpy as np
  7. from datetime import datetime
  8. import math
  9.  
  10.  
  11. cpdef np.int64_t get_days(np.int64_t year, np.int64_t month):
  12. cdef np.ndarray months=np.array([31,28,31,30,31,30,31,31,30,31,30,31])
  13. if month==2:
  14. if (year%4==0 and year%100!=0) or (year%400==0):
  15. return 29
  16. return months[month-1]
  17.  
  18. Timer unit: 1e-07 s
  19.  
  20. Total time: 0.0033868 s
  21. File: .ipythoncython_cython_magic_0154a9feed9bbd6e4f23e57d73acf50f.pyx
  22. Function: loanDates at line 34
  23.  
  24. Line # Hits Time Per Hit % Time Line Contents
  25. ==============================================================
  26. 34 cpdef np.ndarray[np.int64_t] loanDates(np.int64_t startDate,np.int64_t endDate,np.int64_t freq):
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement