Python Forum
Exotic stats problem ; mode, fuzzy clusters, etc
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Exotic stats problem ; mode, fuzzy clusters, etc
#5
(Aug-03-2018, 08:06 PM)Vysero Wrote:
(Aug-03-2018, 07:53 PM)amyvaulhausen Wrote: what I essentially need
is to find out how to perform this kind of function on approximate numbers that are with a
range of say +,- 10 values difference but also allows for decimal values

If you have a range of decimal values which are acceptable then I would suggest you round them:

from statistics import mode
new_list = []

x = [12,11,10.4,12,10.3,10.4,15]

for y in x:
  new_list.append(round(y))

print('new_list = ', new_list, 'mode of new_list = ', mode(new_list))
Output:

new_list = [12, 11, 10, 12, 10, 10, 15] mode of new_list = 10
Is that acceptable or must you keep the decimal values?

Thank you sir, I honestly appreciate the kind feedback! :) In my situation, I need a
mode like function but I do not think mode will work here. I wish this were the case.
Ideally, it would be great if decimals could be retained, but it would be ok if we had
to lose these. The problem however comes, where I am dealing with randomized data
except that often numeric trends of similar magnitudes will occur in a set. It is the
values of similar magnitude I want to capture. So for example if out of ten numbers,
three of these values are close to, for example, 300 but may range up or down by say
ten, then I want to grab these values. So for example ; 299, 308, 303 have similiar
magnitudes but because they are not exact, mode wont return them if I understand correctly.
I like your suggestion however, wondering, do you think some kind of simple iterative
loop that checks and compares each number to all other numbers with an IF style statement
checking upper, lower bounds of number value within +,- 10 would work ok, or is there
a simpler way?
Reply


Messages In This Thread
RE: EXOTIC STATS PROBLEM ; MODE, FUZZY CLUSTERS, ETC - by amyvaulhausen - Aug-04-2018, 12:03 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Fuzzy Wuzzy how to get my fuzzyratio displayed windingsareuseful 3 305 Apr-04-2024, 05:38 PM
Last Post: deanhystad
  things that work in terminal mode but not in sublime mode alok 4 2,929 Aug-11-2021, 07:02 PM
Last Post: snippsat
  seeking simple|clean|pythonic way to capture {1,} numeric clusters NetPCDoc 6 3,160 Jun-10-2021, 05:14 PM
Last Post: NetPCDoc
  Clusters dawid294 6 2,402 Sep-17-2020, 02:18 PM
Last Post: Larz60+
  sports Stats > table output loop problems paulfearn100 3 2,561 Jul-22-2020, 03:21 AM
Last Post: c_rutherford
  implementation fuzzy logic using sckit fuzzy nana_4895 0 2,122 Oct-21-2019, 03:28 AM
Last Post: nana_4895
  Disk usage stats. MuntyScruntfundle 2 2,569 Jan-22-2019, 10:53 PM
Last Post: MuntyScruntfundle
  Fuzzy match on text columns within dataframe Nsaibot 0 4,341 Aug-27-2018, 10:52 PM
Last Post: Nsaibot
  Installing fuzzy wuzzy terrancepython11 6 18,314 Mar-25-2017, 06:55 PM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020