Skip to main content
added 78 characters in body
Source Link
Max Coplan
  • 681
  • 3
  • 12

Going off of @corey979 's comment. A slightly more rigorous way to fix your problem with corey's comment is to use the standard deviation, as opposed to the arbitrary rounding of 1.

    Length /@ 
 DeleteDuplicates /@ {Round[#, 
      StandardDeviation[pts][[1]]/35] & /@ 
    Transpose[
      pts][[1]], (Round[#, 
       StandardDeviation[pts][[2]]/36] & /@ 
     Transpose[pts][[2]])}

Note that the 35 isand 36 are arbitrary, and you should modify itthem to whatever works best for you.

Also, this works for pts*100a*pts. In other words, this method is scale invariant, as you requested.

P.S. A prettier version of the code doesn't give the correct answer, unfortunately

Length /@ 
 DeleteDuplicates /@ (Round[#, StandardDeviation[#]/35] & /@ 
    Transpose[pts]) 

Going off of @corey979 's comment. A slightly more rigorous way to fix your problem with corey's comment is to use the standard deviation, as opposed to the arbitrary rounding of 1.

    Length /@ 
 DeleteDuplicates /@ {Round[#, 
      StandardDeviation[pts][[1]]/35] & /@ 
    Transpose[
      pts][[1]], (Round[#, 
       StandardDeviation[pts][[2]]/36] & /@ 
     Transpose[pts][[2]])}

Note that the 35 is arbitrary, and you should modify it to whatever works best for you.

Also, this works for pts*100

P.S. A prettier version of the code doesn't give the correct answer, unfortunately

Length /@ 
 DeleteDuplicates /@ (Round[#, StandardDeviation[#]/35] & /@ 
    Transpose[pts]) 

Going off of @corey979 's comment. A slightly more rigorous way to fix your problem with corey's comment is to use the standard deviation, as opposed to the arbitrary rounding of 1.

    Length /@ 
 DeleteDuplicates /@ {Round[#, 
      StandardDeviation[pts][[1]]/35] & /@ 
    Transpose[
      pts][[1]], (Round[#, 
       StandardDeviation[pts][[2]]/36] & /@ 
     Transpose[pts][[2]])}

Note that the 35 and 36 are arbitrary, and you should modify them to whatever works best for you.

Also, this works for a*pts. In other words, this method is scale invariant, as you requested.

P.S. A prettier version of the code doesn't give the correct answer, unfortunately

Length /@ 
 DeleteDuplicates /@ (Round[#, StandardDeviation[#]/35] & /@ 
    Transpose[pts]) 
added 1 character in body
Source Link
corey979
  • 24.3k
  • 7
  • 60
  • 105

Going off of @corey979 's comment. A slightly more rigorous way to fix your problem with corey's answercomment is to use the standard deviation, as opposed to the arbitrary rounding of 1.

    Length /@ 
 DeleteDuplicates /@ {Round[#, 
      StandardDeviation[pts][[1]]/35] & /@ 
    Transpose[
      pts][[1]], (Round[#, 
       StandardDeviation[pts][[2]]/36] & /@ 
     Transpose[pts][[2]])}

Note that the 35 is arbitrary, and you should modify it to whatever works best for you.

Also, this works for pts*100

P.S. A prettier version of the code doesn't give the correct answer, unfortunately

Length /@ 
 DeleteDuplicates /@ (Round[#, StandardDeviation[#]/35] & /@ 
    Transpose[pts]) 

Going off of @corey979 's comment. A slightly more rigorous way to fix your problem with corey's answer is to use the standard deviation, as opposed to the arbitrary rounding of 1.

    Length /@ 
 DeleteDuplicates /@ {Round[#, 
      StandardDeviation[pts][[1]]/35] & /@ 
    Transpose[
      pts][[1]], (Round[#, 
       StandardDeviation[pts][[2]]/36] & /@ 
     Transpose[pts][[2]])}

Note that the 35 is arbitrary, and you should modify it to whatever works best for you.

Also, this works for pts*100

P.S. A prettier version of the code doesn't give the correct answer, unfortunately

Length /@ 
 DeleteDuplicates /@ (Round[#, StandardDeviation[#]/35] & /@ 
    Transpose[pts]) 

Going off of @corey979 's comment. A slightly more rigorous way to fix your problem with corey's comment is to use the standard deviation, as opposed to the arbitrary rounding of 1.

    Length /@ 
 DeleteDuplicates /@ {Round[#, 
      StandardDeviation[pts][[1]]/35] & /@ 
    Transpose[
      pts][[1]], (Round[#, 
       StandardDeviation[pts][[2]]/36] & /@ 
     Transpose[pts][[2]])}

Note that the 35 is arbitrary, and you should modify it to whatever works best for you.

Also, this works for pts*100

P.S. A prettier version of the code doesn't give the correct answer, unfortunately

Length /@ 
 DeleteDuplicates /@ (Round[#, StandardDeviation[#]/35] & /@ 
    Transpose[pts]) 
added 197 characters in body
Source Link
Max Coplan
  • 681
  • 3
  • 12

Going off of @corey979 's comment. A slightly more rigorous way to fix your problem with corey's answer is to use the standard deviation, as opposed to the arbitrary rounding of 1.

    Length /@ 
 DeleteDuplicates /@ {Round[#, 
      StandardDeviation[pts][[1]]/35] & /@ 
    Transpose[
      pts][[1]], (Round[#, 
       StandardDeviation[pts][[2]]/36] & /@ 
     Transpose[pts][[2]])}

Note that the 35 is arbitrary, and you should modify it to whatever works best for you.

Also, this works for pts*100

P.S. A prettier version of the code doesn't give the correct answer, unfortunately

Length /@ 
 DeleteDuplicates /@ (Round[#, StandardDeviation[#]/35] & /@ 
    Transpose[pts]) 

Going off of @corey979 's comment. A slightly more rigorous way to fix your problem with corey's answer is to use the standard deviation, as opposed to the arbitrary rounding of 1.

    Length /@ 
 DeleteDuplicates /@ {Round[#, 
      StandardDeviation[pts][[1]]/35] & /@ 
    Transpose[
      pts][[1]], (Round[#, 
       StandardDeviation[pts][[2]]/36] & /@ 
     Transpose[pts][[2]])}

Note that the 35 is arbitrary, and you should modify it to whatever works best for you.

Also, this works for pts*100

Going off of @corey979 's comment. A slightly more rigorous way to fix your problem with corey's answer is to use the standard deviation, as opposed to the arbitrary rounding of 1.

    Length /@ 
 DeleteDuplicates /@ {Round[#, 
      StandardDeviation[pts][[1]]/35] & /@ 
    Transpose[
      pts][[1]], (Round[#, 
       StandardDeviation[pts][[2]]/36] & /@ 
     Transpose[pts][[2]])}

Note that the 35 is arbitrary, and you should modify it to whatever works best for you.

Also, this works for pts*100

P.S. A prettier version of the code doesn't give the correct answer, unfortunately

Length /@ 
 DeleteDuplicates /@ (Round[#, StandardDeviation[#]/35] & /@ 
    Transpose[pts]) 
Bug fix
Source Link
Max Coplan
  • 681
  • 3
  • 12
Loading
deleted 3 characters in body
Source Link
Max Coplan
  • 681
  • 3
  • 12
Loading
added 32 characters in body
Source Link
Max Coplan
  • 681
  • 3
  • 12
Loading
Source Link
Max Coplan
  • 681
  • 3
  • 12
Loading