Untitled
Anonymous
Plain Text
03/12/2024 10:24 AM
731 B
28
Indexable
Never
import scipy.stats as stats
def get_data_from_user():
try:
data_str = input("Enter your data separated by spaces: ")
data = list(map(float, data_str.split()))
return data
except ValueError:
print("Invalid input. Please enter numeric values separated by spaces.")
return get_data_from_user()
def calculate_skewness(data):
skewness = stats.skew(data)
return skewness
def main():
print("Welcome to the Skewness Calculator for Ungrouped Data!")
# Get data from the user
data = get_data_from_user()
# Calculate and print skewness
skewness_result = calculate_skewness(data)
print("Skewness:", skewness_result)
if __name__ == "__main__":
main()Editor is loading...
Leave a Comment