Advertisement
UF6

Improved Summary Statistics That Can Take Any Column

UF6
Nov 8th, 2023
1,290
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.72 KB | Source Code | 0 0
  1. import pandas as pd
  2.  
  3. # Replace 'Line Plot.csv' with the actual CSV file path
  4. file_path = 'B5 segmentSummary (1).csv'
  5.  
  6. # Define the range of column positions you want to analyze (columns 6 through 10)
  7. start_column_position = 6  # Corresponds to column 6
  8. end_column_position = 9    # Corresponds to column 10
  9.  
  10. # Read the CSV file into a Pandas DataFrame
  11. df = pd.read_csv(file_path)
  12.  
  13. # Select columns 6 through 10 for analysis
  14. selected_columns = df.iloc[:, start_column_position:end_column_position + 1]
  15.  
  16. # Calculate summary statistics for the selected columns
  17. summary_statistics = selected_columns.describe()
  18.  
  19. # Print summary statistics
  20. print("Summary Statistics for the Selected Columns:")
  21. print(summary_statistics)
  22.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement