File size: 1,529 Bytes
3c9e74a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/usr/bin/env python3
"""
Add output/input price multiple to the quadrants CSV.
This calculates how many times more expensive output tokens are compared to input tokens.
"""

import pandas as pd

# Read the CSV
df = pd.read_csv('quadrants.csv')

# Calculate output/input multiple
# Handle edge cases where input price might be 0 (shouldn't happen, but be safe)
df['output_input_multiple'] = df.apply(
    lambda row: row['output_price_usd_per_m'] / row['input_price_usd_per_m']
    if row['input_price_usd_per_m'] > 0 else 0,
    axis=1
)

# Save updated CSV
df.to_csv('quadrants.csv', index=False)

# Calculate and display statistics
median_multiple = df['output_input_multiple'].median()
mean_multiple = df['output_input_multiple'].mean()
min_multiple = df['output_input_multiple'].min()
max_multiple = df['output_input_multiple'].max()

print(f"Output/Input Price Multiple Statistics:")
print(f"  Median: {median_multiple:.2f}x")
print(f"  Mean: {mean_multiple:.2f}x")
print(f"  Min: {min_multiple:.2f}x")
print(f"  Max: {max_multiple:.2f}x")
print(f"\nTotal models: {len(df)}")
print(f"\nModels by output/input multiple:")
print(f"  1x (equal pricing): {len(df[df['output_input_multiple'] == 1])}")
print(f"  <2x: {len(df[df['output_input_multiple'] < 2])}")
print(f"  2-5x: {len(df[(df['output_input_multiple'] >= 2) & (df['output_input_multiple'] < 5)])}")
print(f"  5-10x: {len(df[(df['output_input_multiple'] >= 5) & (df['output_input_multiple'] < 10)])}")
print(f"  10x+: {len(df[df['output_input_multiple'] >= 10])}")