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
#4
(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?
Reply


Messages In This Thread
RE: EXOTIC STATS PROBLEM ; MODE, FUZZY CLUSTERS, ETC - by Vysero - Aug-03-2018, 08:06 PM

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