Sort by

recency

|

70 Discussions

|

  • + 0 comments

    We have built an enterprise ai platform - Centralized platform for quickly and securely deploying Generative & Classic AI in your enterprise. Choose from ready-to-deploy AI Applications, AI agents, build your own, or let us create tailored solutions for your enterprise needs. Empower your teams with AI-driven enterprise search and instant answers, no matter where your knowledge resides. OnDemand Console transforms the management of assets, devices, and networks through intuitive, conversational control. Manage any data—IoT, finance, business, and more—through natural language interactions. A completely dynamic UI that instantly generates widgets based on your natural language requests. You can ask for any graph, report, analytics, or prediction, and it’s presented to you instantly. No-learning-curve https://studiox-ai.com

  • + 1 comment
    import pandas as pd
    import numpy as np
    import math
    
    def custom_round(num, decimals=0):
        factor = 10 ** decimals
        return math.floor(num * factor + 0.5) / factor
    
    i = input()
    s = input()
    l = list(map(int, s.split(" ")))
    numbers_series = pd.Series(l)
    
    #Calculate the mean
    mean = numbers_series.mean()
    print(f"{custom_round(mean,1):.1f}")
    
    #Median
    print(f"{custom_round(numbers_series.median(),1):.1f}")
    
    #mode (which is a lsit)
    mode = numbers_series.mode()
    print(f"{mode[0]}")
    
    std = numbers_series.std(ddof=0)
    print(f"{custom_round(std,1):.1f}")
    
    
    #Find the critical value for a 95% confidence interval
    margin_of_error = 1.96 * (std / (len(numbers_series) ** 0.5))
    #margin_of_error = confidence_level * (std/(np.sqrt(len(numbers_series))))
    
    #Calculate the confidence interval
    lower_bound = mean - margin_of_error
    upper_bound = mean + margin_of_error
    
    print(f"{custom_round(lower_bound,1):.1f} {custom_round(upper_bound,1):.1f}")
    
  • + 0 comments
    # Enter your code here. Read input from STDIN. Print output to STDOUT
    import sys
    import numpy as np
    from scipy import stats
    
    # Read Data
    data = sys.stdin.read().splitlines()
    nums = data[1].split(' ')
    nums = np.array([int(num) for num in nums])
    
    # Calculate Stats
    mean = np.mean(nums)
    median = np.median(nums)
    mode = stats.mode(nums)[0]
    std = np.std(nums)
    z = 1.96
    std_error = (std/(np.sqrt(len(nums))))
    lower = mean - z*std_error
    upper = mean + z*std_error
    
    # Print Output
    print(f"{mean:.1f}")
    print(f"{median:.1f}")
    print(mode)
    print(f"{std:.1f}")
    print(f"{lower:.1f} {upper:.1f}")
    
  • + 0 comments
    num_int = int(input())
    string_nums = input()
    
    # Converting string_nums to list:
    string_list = string_nums.split()
    int_string_list = list(map(int, string_list))
    
    calc_mean = st.mean(int_string_list)
    calc_median = st.median(int_string_list)
    calc_mode = st.multimode(int_string_list)
    min_calc_mode = min(calc_mode)
    calc_std = st.pstdev(int_string_list)
    calc_std_round = round(calc_std, 1)
    
    # bounds:
    length = len(int_string_list)
    interval = 1.96 * (calc_std / length ** 0.5)
    ub = calc_mean + interval
    round_ub = round(ub, 1)
    lb = calc_mean - interval
    round_lb = round(lb, 1)
    
    print(calc_mean)
    print(calc_median)
    print(min_calc_mode)
    print(calc_std_round)
    print(round_lb, round_ub)
    
    
    
  • + 0 comments

    `Packages Used

    # Enter your code here. Read input from STDIN. Print output to STDOUT
    
    def median(x):
        x = sorted(x)
        length = len(x)
        if length % 2 == 0: 
            half_length = (length // 2)
            median = (x[half_length - 1] + x[half_length]) / 2
        else:   
            half_length = length // 2
            median = x[half_length]
        return median
        
    def mean(x):
        length = len(x)
        return sum(x) / length
        
        
    def mode(x):
        counter = {}
        for val in x:
            counter[val] = counter.get(val, 0) + 1
        
        max_frequency = max(counter.values())
        modes = [k for k, v in counter.items() if v == max_frequency]
        
        # If multiple elements have the same max frequency, return the smallest one
        return int(min(modes))
            
    def std(x):
        x_mean = mean(x)
        x_std = (sum(((val - x_mean) ** 2 for val in x)) / len(x)) ** 0.5
        return x_std
            
    
    def confidence_interval(x):
        x_mean = mean(x)
        x_std = std(x)
        length = len(x)
        interval = 1.96 * (x_std / (length ** 0.5))
        
        lower, upper = x_mean - interval, x_mean + interval
        
        return lower, upper, 1
    
    if __name__ == '__main__':
    
        length = input()
        values = [float(val) for val in input().split(" ")]
        print(mean(values))
        print(median(values))
        print(mode(values))
        print(round(std(values), 1))
        print(round(confidence_interval(values)[0], 1), round(confidence_interval(values)[1], 1))