diff --git a/utils/cloud_txt_param.py b/utils/cloud_txt_param.py new file mode 100644 index 0000000000000000000000000000000000000000..abbd286de54ae663138e14727bfa2cdb879568ea --- /dev/null +++ b/utils/cloud_txt_param.py @@ -0,0 +1,34 @@ +import pandas as pd +import argparse + +# Define the command-line arguments +parser = argparse.ArgumentParser(description='Read a CSV file into a pandas DataFrame and find the max values.') +parser.add_argument('file_path', help='The path to the CSV file') + +# Parse the command-line arguments +args = parser.parse_args() + +# Read the CSV file into a pandas DataFrame +df = pd.read_csv(args.file_path) + +# print the max value for each column +print('Max value for each column:') +print(df.max()) + +# print the min value for each column +print('Min value for each column:') +print(df.min()) + +# find the box dimensions only for x, y, and z +print('Box dimensions:') +print(df[['x', 'y', 'z']].max() - df[['x', 'y', 'z']].min()) + +# compute a middle point for the box +print('Middle point:') +print(df[['x', 'y', 'z']].mean()) + +# round the x, y, and z values to two decimal places and save the contents to a new CSV file +df[['x', 'y', 'z']] = df[['x', 'y', 'z']].round(2) +df.to_csv('rounded.csv', index=False) + +