Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import pandas as pd
- import seaborn as sns
- import matplotlib.pyplot as plt
- import numpy as np
- # Replace 'B5 segmentSummary (1).csv' with the actual CSV file path
- file_path = 'B5 segmentSummary (1).csv'
- # Define the range of column positions you want to analyze (columns 6 through 10)
- start_column_position = 6 # Corresponds to column 6
- end_column_position = 9 # Corresponds to column 10
- # Read the CSV file into a Pandas DataFrame
- df = pd.read_csv(file_path)
- # Select columns 6 through 10 for analysis
- selected_columns = df.iloc[:, start_column_position:end_column_position + 1]
- # Apply a log10 transformation to the data
- log_selected_columns = np.log10(selected_columns)
- # Create a violin plot to visualize log10-transformed data
- plt.figure(figsize=(10, 6))
- sns.violinplot(data=log_selected_columns, inner="stick")
- plt.title('Violin Plot for Log10-Transformed Selected Columns')
- plt.ylabel('Log10(Values)')
- plt.xticks(rotation=45)
- plt.tight_layout()
- # Show the plot
- plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement