python3 --version Python 3.12.3 published: python3 ctr.py file videos.csv run: python3 ctr.py file videos.csv Short A: CTR = 8.0000% Long B: CTR = 3.0000% Talk C: CTR = 4.5000% Pooled CTR (all clicks / all impressions) = 3.2234% Plain average of the row CTRs = 5.1667% exit=0 published: python3 ctr.py file videos.csv run: python3 ctr.py file edge-crlf-nonascii.csv edge: Windows line breaks and a non-ASCII label Короткий ролик é: CTR = 8.0000% Long B: CTR = 3.0000% Talk C: CTR = 4.5000% Pooled CTR (all clicks / all impressions) = 3.2234% Plain average of the row CTRs = 5.1667% exit=0 published: python3 ctr.py file videos.csv run: python3 ctr.py file no-such-file.csv edge: missing file error: file not found: no-such-file.csv exit=1 published: python3 ctr.py file videos.csv run: python3 ctr.py file edge-empty.csv edge: empty file error: no data rows in edge-empty.csv exit=1 published: python3 ctr.py file videos.csv run: python3 ctr.py file . edge: a directory instead of a file error: cannot read as a file: . exit=1 published: python3 ctr.py file videos.csv run: python3 ctr.py file edge-zero.csv edge: a row with 0 impressions Short A: CTR = 8.0000% error: row 2: impressions must be greater than 0 exit=1 published: python3 ctr.py file videos.csv run: python3 ctr.py file edge-text.csv edge: text in the clicks cell Short A: CTR = 8.0000% error: row 2: clicks is not a number: 'abc' exit=1 published: python3 ctr.py file videos.csv run: python3 ctr.py file edge-semicolon.csv edge: semicolons instead of commas error: row 1 needs exactly 3 comma-separated columns: label,impressions,clicks exit=1 published: python3 ctr.py file videos.csv run: python3 ctr.py file edge-four-columns.csv edge: four columns error: row 1 needs exactly 3 comma-separated columns: label,impressions,clicks exit=1 published: python3 ctr.py file videos.csv run: python3 ctr.py file edge-quoted-comma.csv edge: quoted thousands separators, no header Short A: CTR = 8.0000% B: CTR = 5.0000% Pooled CTR (all clicks / all impressions) = 6.2857% Plain average of the row CTRs = 6.5000% exit=0 published: python3 ctr.py file videos.csv run: python3 ctr.py file edge-over.csv edge: a row with more clicks than impressions: computed, with a warning, and it is in the pooled figure A: CTR = 150.0000% (more clicks than impressions: check that both come from the same report) B: CTR = 10.0000% Pooled CTR (all clicks / all impressions) = 80.0000% Plain average of the row CTRs = 80.0000% exit=0 published: python3 ctr.py ctr 450 10000 run: python3 ctr.py ctr 450 10000 CTR = 4.5000% exit=0 published: python3 ctr.py ctr 450 10000 run: python3 ctr.py ctr 1 3 edge: repeating decimal, shown to 4 places CTR = 33.3333% exit=0 published: python3 ctr.py ctr 450 10000 run: python3 ctr.py ctr 1,876 58,200 edge: numbers typed with thousands separators CTR = 3.2234% exit=0 published: python3 ctr.py ctr 450 10000 run: python3 ctr.py ctr 120 100 edge: more clicks than impressions: computed, with a warning CTR = 120.0000% (more clicks than impressions: check that both come from the same report) exit=0 published: python3 ctr.py ctr 450 10000 run: python3 ctr.py ctr 5 0 edge: zero impressions error: impressions must be greater than 0 exit=1 published: python3 ctr.py ctr 450 10000 run: python3 ctr.py ctr -5 1000 edge: negative clicks error: clicks must not be negative exit=1 published: python3 ctr.py ctr 450 10000 run: python3 ctr.py ctr abc 5 edge: text instead of a number error: clicks is not a number: 'abc' exit=1 published: python3 ctr.py ctr 450 10000 run: python3 ctr.py ctr 2.5 100 edge: fractional clicks are refused error: clicks must be a whole number: '2.5' exit=1 published: python3 ctr.py ctr 450 10000 run: python3 ctr.py ctr 4,5 100 edge: a decimal comma is refused, not read as 45 error: comma only as a thousands separator, like 1,500: '4,5' exit=1 published: python3 ctr.py range 9 200 run: python3 ctr.py range 9 200 CTR = 4.5000%, 95% Wilson interval 2.3853% to 8.3297% exit=0 published: python3 ctr.py range 9 200 run: python3 ctr.py range 50 100 edge: control: 50 of 100, hand calculation about 40.38% to 59.62% CTR = 50.0000%, 95% Wilson interval 40.3832% to 59.6168% exit=0 published: python3 ctr.py range 9 200 run: python3 ctr.py range 0 200 edge: no clicks: lower end is 0 CTR = 0.0000%, 95% Wilson interval 0.0000% to 1.8845% exit=0 published: python3 ctr.py range 9 200 run: python3 ctr.py range 200 200 edge: every impression clicked: upper end is 100 CTR = 100.0000%, 95% Wilson interval 98.1155% to 100.0000% exit=0 published: python3 ctr.py range 9 200 run: python3 ctr.py range 120 100 edge: more clicks than impressions: refused for an interval error: clicks cannot be more than impressions for an interval exit=1 published: python3 ctr.py range 9 200 run: python3 ctr.py range 5 0 edge: zero impressions error: impressions must be greater than 0 exit=1