Created
          November 19, 2019 05:28 
        
      - 
      
- 
        Save leafsummer/43023c37920b8bbaf09e44bea28e0797 to your computer and use it in GitHub Desktop. 
    sample data
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | this_max = min(sample["this"], sample["this"] * sample["max"] / sample["total"] + 1) | |
| sample_a = 1 | |
| if this_max > 1: | |
| sample_b = math.log(sample["this"]) / math.log(this_max) | |
| else: | |
| sample_b = 1 | |
| sample_target = int(sample_a * ((line_num + 1) ** sample_b) + 0.5) # line_no >= sample_target | |
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment