We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
I don't know where I am making mistake. Please , Let me know if you see anything
# Enter your code here. Read input from STDIN. Print output to STDOUTimportnumpyasnpimportfileinputimportmath# Extracting the datai=-1forlineinfileinput.input():ifi==-1:count=0i+=1ifi==0:data=[int(element)forelementinline.split(" ")]# converting this data into an arrayarr_data=np.array(data)# Mean:mean_data=np.mean(arr_data)print(mean_data)# Median:median_data=np.median(arr_data)print(median_data)# Mode:mode_data=np.argmax(np.bincount(arr_data))print(mode_data)# Standard Deviationstd_data=np.std(arr_data)print(round(std_data,1))# confidence Interval Meandefconfidence(data,z=1.96):numerator=float(z)*(np.std(data))denominator=math.sqrt(len(data))boundary_limit=(numerator/denominator)returnboundary_limitboundary_limit=confidence(data)upper_limit=np.mean(data)+boundary_limitlower_limit=np.mean(data)-boundary_limitprint(np.ceil(lower_limit),' ',round(upper_limit,1))
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Basic Statistics Warmup
You are viewing a single comment's thread. Return to all comments →
I don't know where I am making mistake. Please , Let me know if you see anything