FIN312: Mathematics and Programming for FinTech 1) The median, mode, and mean are basic statistical functions for data analytics. In this question, you will implement them in pure Python code without importing any packages. The following notations are used

FIN312: Mathematics and Programming for FinTech

1) The median, mode, and mean are basic statistical functions for data analytics. In this question, you will implement them in pure Python code without importing any packages.

The following notations are used:

  • v is a non-empty “list of numbers”
  • vm is a non-empty “list of numbers” OR “list of non-empty lists of numbers” where the sub-lists have equal lengths.

a) Create a function median(v) which returns the median of v
b) Create a function mode (v) that returns a list containing the modes of v. Note that it is possible to have more than one mode, hence we return a list.
c) Create a function mean(vm, axis=None) which returns the mean of vm. The return value depends on the value of the axis as follows:

  • 0: returns the mean down the rows
  • 1: returns the mean across the columns
  • None: return the mean of all the entries in vm

d) Show the result of your code running against these test cases:

  • median(v), modes(v) and mean(v) for

v = [i for j in (range(1180, 2022, k)
for k in (3, 5, 7)) for i in j]

  • mean(vm), mean(vm, 0) and mean(vm, 1) for

vm = [[11, 12, 13, 14, 15, 16, 17, 18],
[21, 22, 23, 24, 25, 26, 27, 28],

[91, 92, 93, 94, 95, 96, 97, 98]]

The post FIN312: Mathematics and Programming for FinTech 1) The median, mode, and mean are basic statistical functions for data analytics. In this question, you will implement them in pure Python code without importing any packages. The following notations are used appeared first on My Academic Papers.

GET HELP WITH YOUR HOMEWORK PAPERS @ 25% OFF

For faster services, inquiry about  new assignments submission or  follow ups on your assignments please text us/call us on +1 (251) 265-5102

Write My Paper Button

WeCreativez WhatsApp Support
We are here to answer your questions. Ask us anything!
👋 Hi, how can I help?
Scroll to Top