Skip to content

Instantly share code, notes, and snippets.

@Muhammad4hmed
Created December 11, 2020 19:07
Show Gist options
  • Save Muhammad4hmed/4d8584256e5fc5874d628f7b36d184c0 to your computer and use it in GitHub Desktop.
Save Muhammad4hmed/4d8584256e5fc5874d628f7b36d184c0 to your computer and use it in GitHub Desktop.
def rounding(num):
round_num, round_num2 = 0, 0
uniques = np.sort(np.unique(train['price']))
for i,n in enumerate(uniques):
if n > num:
break
round_num = n
round_num2 = uniques[i+1]
return (round_num+round_num2)/2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment