Commit 277daa70 authored by Иван Бегтин's avatar Иван Бегтин

Первоначальный импорт

parent 6dc91507
Pipeline #23 failed with stages
filename region
0503317-3_fo_001-2582480.xls
0503317-3_fo_002-2578483.xls
0503317-3_fo_003-2622844.xls
0503317-3_fo_004-2586781.xls -
0503317-3_fo_005-2582358.xls
0503317-3_fo_006-2595010.xls
0503317-3_fo_007-2580361.xls
0503317-3_fo_008-2554128.xls
0503317-3_fo_009-2547732.xls
0503317-3_fo_010-2577291.xls -
0503317-3_fo_011-2590573.xls ()
0503317-3_fo_012-2563872.xls
0503317-3_fo_013-2546190.xls
0503317-3_fo_014-2586589.xls
0503317-3_fo_015-2548644.xls -
0503317-3_fo_016-2578245.xls ()
0503317-3_fo_017-2565733.xls
0503317-3_fo_018-2574675.xls
0503317-3_fo_019-2573892.xls
0503317-3_fo_020-2559383.xls
0503317-3_fo_021-2560688.xls
0503317-3_fo_022-2514627.xls
0503317-3_fo_023-2599111.xls
0503317-3_fo_024-2542181.xls
0503317-3_fo_025-2560444.xls
0503317-3_fo_026-2562259.xls
0503317-3_fo_027-2561588.xls
0503317-3_fo_028-2619462.xls
0503317-3_fo_029-2570627.xls
0503317-3_fo_030-2545287.xls
0503317-3_fo_031-2526055.xls
0503317-3_fo_032-2595456.xls
0503317-3_fo_033-2542734.xls
0503317-3_fo_034-2596390.xls
0503317-3_fo_035-2557940.xls
0503317-3_fo_036-2561136.xls
0503317-3_fo_037-2607410.xls
0503317-3_fo_038-2594168.xls
0503317-3_fo_039-2554223.xls
0503317-3_fo_040-2560260.xls
0503317-3_fo_041-2597042.xls
0503317-3_fo_042-2532142.xls
0503317-3_fo_043-2589048.xls
0503317-3_fo_044-2542924.xls
0503317-3_fo_045-2635043.xls
0503317-3_fo_046-2545977.xls
0503317-3_fo_047-2573054.xls
0503317-3_fo_048-2571411.xls
0503317-3_fo_049-2542863.xls
0503317-3_fo_050-2590923.xls
0503317-3_fo_051-2559254.xls
0503317-3_fo_052-2555830.xls
0503317-3_fo_053-2546088.xls
0503317-3_fo_054-2553249.xls
0503317-3_fo_055-2586799.xls
0503317-3_fo_056-2563585.xls
0503317-3_fo_057-2553565.xls
0503317-3_fo_058-2577607.xls
0503317-3_fo_059-2515141.xls
0503317-3_fo_060-2596298.xls
0503317-3_fo_061-2592314.xls
0503317-3_fo_062-2594807.xls
0503317-3_fo_063-2545143.xls
0503317-3_fo_064-2590738.xls
0503317-3_fo_065-2555875.xls
0503317-3_fo_066-2559205.xls
0503317-3_fo_067-2576499.xls
0503317-3_fo_068-2590389.xls
0503317-3_fo_069-2585028.xls
0503317-3_fo_071-2562695.xls
0503317-3_fo_072-2575887.xls .-
0503317-3_fo_073-2580800.xls .
0503317-3_fo_074-2597133.xls .
0503317-3_fo_075-2597181.xls
0503317-3_fo_076-2584138.xls ()
0503317-3_fo_077-2544943.xls
0503317-3_fo_078-2555583.xls
0503317-3_fo_079-2573667.xls -
0503317-3_fo_080-2590348.xls
0503317-3_fo_084-2538986.xls
0503317-3_fo_087-2562535.xls - -
0503317-3_fo_088-2572869.xls
0503317-3_fo_090-2554306.xls -
0503317-3_fo_091-2573748.xls
0503317-3_fo_094-2524612.xls
0503317-3_fo_096-2552679.xls .
0503317_svod_01012017_y.xls
import sys, os
import xlrd
def run():
files = os.listdir()
print('filename\tregion\ttotal\tmedia\tmediashare\ttelevision\ttelshare')
for name in files:
name = name.lower()
if name[-4:] == '.xls':
wb = xlrd.open_workbook(name)
sheet = wb.sheet_by_index(1)
reg = sheet.cell(4, 3)
sheet = wb.sheet_by_index(2)
tel = 0
total = 0
media = 0
for row in sheet.get_rows():
if row[1].value == '200':
total = row[6].value
if row[3].value == '1200' and row[5].value == '000':
media = row[6].value
if row[3].value == '1201' and row[5].value == '000':
tel = row[6].value
break
print('%s\t%s\t%f\t%f\t%f\t%f\t%f' % (name, reg.value, total / 1000000, media / 1000000, ((media * 100) / total) if total > 0 else 0, tel / 1000000, ((tel * 100) / media) if media > 0 else 0 ) )
pass
if __name__ == '__main__':
run()
\ No newline at end of file
filename region total media mediashare television telshare
0503317-3_fo_001-2582480.xls 233160.167857 1001.303697 0.429449 730.859408 72.990783
0503317-3_fo_002-2578483.xls 70839.571597 96.665248 0.136457 0.775100 0.801839
0503317-3_fo_003-2622844.xls 126798.238393 523.356124 0.412747 82.082202 15.683814
0503317-3_fo_004-2586781.xls - 43706.227849 391.022805 0.894662 115.123049 29.441518
0503317-3_fo_005-2582358.xls 16208.821967 55.552470 0.342730 13.266000 23.880126
0503317-3_fo_006-2595010.xls 53135.760744 68.936485 0.129737 1.797700 2.607763
0503317-3_fo_007-2580361.xls 96107.273567 203.983233 0.212245 109.168729 53.518482
0503317-3_fo_008-2554128.xls 35542.191103 79.669616 0.224155 33.021117 41.447567
0503317-3_fo_009-2547732.xls 56550.954507 201.613200 0.356516 33.022400 16.379086
0503317-3_fo_010-2577291.xls - 35667.111252 81.264000 0.227840 5.798000 7.134771
0503317-3_fo_011-2590573.xls () 297937.832131 1300.144039 0.436381 691.817450 53.210831
0503317-3_fo_012-2563872.xls 30242.840596 46.195748 0.152749 12.510300 27.081064
0503317-3_fo_013-2546190.xls 100673.321988 276.183858 0.274337 105.682110 38.265129
0503317-3_fo_014-2586589.xls 35446.700855 165.195900 0.466040 106.900000 64.711049
0503317-3_fo_015-2548644.xls - 63145.601605 144.340638 0.228584 68.374665 47.370350
0503317-3_fo_016-2578245.xls () 230979.509856 996.615586 0.431474 456.747904 45.829898
0503317-3_fo_017-2565733.xls 123090.405919 272.896678 0.221704 5.859200 2.147040
0503317-3_fo_018-2574675.xls 319599.262208 1036.283055 0.324245 610.920612 58.953064
0503317-3_fo_019-2573892.xls 291780.611278 700.642653 0.240127 202.645800 28.922847
0503317-3_fo_020-2559383.xls 138460.246960 397.853606 0.287341 194.306558 48.838707
0503317-3_fo_021-2560688.xls 133433.216780 238.185959 0.178506 150.458439 63.168476
0503317-3_fo_022-2514627.xls 129362.758497 402.635723 0.311245 78.376100 19.465759
0503317-3_fo_023-2599111.xls 70622.093402 98.591752 0.139605 69.256192 70.245422
0503317-3_fo_024-2542181.xls 103389.497346 111.373675 0.107722 0.000000 0.000000
0503317-3_fo_025-2560444.xls 50937.023590 107.702402 0.211442 32.799630 30.453945
0503317-3_fo_026-2562259.xls 103043.569876 247.414431 0.240107 152.524209 61.647256
0503317-3_fo_027-2561588.xls 69407.212453 73.800592 0.106330 18.224300 24.693975
0503317-3_fo_028-2619462.xls 76352.519789 69.523410 0.091056 17.474311 25.134427
0503317-3_fo_029-2570627.xls 137201.422322 200.838641 0.146382 6.782401 3.377040
0503317-3_fo_030-2545287.xls 77415.882275 262.626689 0.339241 1.358984 0.517458
0503317-3_fo_031-2526055.xls 129200.045696 355.408300 0.275084 85.000000 23.916155
0503317-3_fo_032-2595456.xls 209323.441775 417.053852 0.199239 191.402160 45.893872
0503317-3_fo_033-2542734.xls 49100.307334 96.182038 0.195889 5.392434 5.606488
0503317-3_fo_034-2596390.xls 189368.105600 228.673146 0.120756 12.618562 5.518165
0503317-3_fo_035-2557940.xls 100127.031185 129.860125 0.129695 0.000000 0.000000
0503317-3_fo_036-2561136.xls 77565.343336 219.738795 0.283295 8.853662 4.029175
0503317-3_fo_037-2607410.xls 74429.846118 345.231559 0.463835 189.963317 55.024899
0503317-3_fo_038-2594168.xls 84790.326769 99.113060 0.116892 38.065800 38.406442
0503317-3_fo_039-2554223.xls 175592.231238 172.280774 0.098114 78.731789 45.699696
0503317-3_fo_040-2560260.xls 73019.054301 65.616500 0.089862 0.000000 0.000000
0503317-3_fo_041-2597042.xls 39125.358861 172.854500 0.441797 88.576500 51.243387
0503317-3_fo_042-2532142.xls 214200.841394 482.822448 0.225406 127.886808 26.487337
0503317-3_fo_043-2589048.xls 53600.443360 30.586868 0.057065 0.000000 0.000000
0503317-3_fo_044-2542924.xls 66418.791894 126.259017 0.190095 45.756081 36.239852
0503317-3_fo_045-2635043.xls 160752.950025 307.790718 0.191468 158.385722 51.458901
0503317-3_fo_046-2545977.xls 75650.286807 348.591029 0.460793 115.133497 33.028244
0503317-3_fo_047-2573054.xls 38446.932015 217.937464 0.566853 0.000000 0.000000
0503317-3_fo_048-2571411.xls 702632.881062 3771.627733 0.536785 368.801068 9.778300
0503317-3_fo_049-2542863.xls 86062.895338 164.673843 0.191341 4.912883 2.983402
0503317-3_fo_050-2590923.xls 40006.478951 106.084010 0.265167 0.004000 0.003771
0503317-3_fo_051-2559254.xls 181503.719092 445.063982 0.245209 43.390439 9.749259
0503317-3_fo_052-2555830.xls 110635.540889 325.305716 0.294034 172.433764 53.006681
0503317-3_fo_053-2546088.xls 115772.862068 153.402794 0.132503 49.836339 32.487244
0503317-3_fo_054-2553249.xls 45309.947194 90.937850 0.200702 34.176541 37.582306
0503317-3_fo_055-2586799.xls 70792.748429 139.438917 0.196968 0.000000 0.000000
0503317-3_fo_056-2563585.xls 170891.634335 36.055532 0.021098 12.055169 33.435006
0503317-3_fo_057-2553565.xls 40199.752207 107.441926 0.267270 2.802305 2.608204
0503317-3_fo_058-2577607.xls 229707.314640 415.617134 0.180933 62.746900 15.097284
0503317-3_fo_059-2515141.xls 63743.169984 171.510401 0.269065 58.627600 34.183116
0503317-3_fo_060-2596298.xls 120802.848177 129.596046 0.107279 43.691732 33.713785
0503317-3_fo_061-2592314.xls 183225.166154 333.191443 0.181848 120.350154 36.120422
0503317-3_fo_062-2594807.xls 303771.951092 739.803248 0.243539 193.444283 26.148072
0503317-3_fo_063-2545143.xls 56191.894064 71.943329 0.128032 5.691300 7.910810
0503317-3_fo_064-2590738.xls 64843.986225 158.281144 0.244095 53.455514 33.772509
0503317-3_fo_065-2555875.xls 87185.076360 136.408838 0.156459 72.357625 53.044675
0503317-3_fo_066-2559205.xls 99207.181994 185.826692 0.187312 8.181700 4.402866
0503317-3_fo_067-2576499.xls 170079.427642 477.693861 0.280865 125.009000 26.169271
0503317-3_fo_068-2590389.xls 70244.185292 209.725848 0.298567 74.765613 35.649212
0503317-3_fo_069-2585028.xls 201178.417473 217.324676 0.108026 137.771922 63.394514
0503317-3_fo_071-2562695.xls 89121.219788 129.632803 0.145457 0.001750 0.001350
0503317-3_fo_072-2575887.xls .- 578632.290197 1724.686736 0.298063 741.072700 42.968539
0503317-3_fo_073-2580800.xls . 2023827.473776 13567.123087 0.670370 8085.254367 59.594465
0503317-3_fo_074-2597133.xls . 33396.808334 68.110300 0.203943 57.235500 84.033546
0503317-3_fo_075-2597181.xls 157007.606940 639.817667 0.407507 393.037880 61.429670
0503317-3_fo_076-2584138.xls () 22049.435838 164.693470 0.746928 24.917869 15.129846
0503317-3_fo_077-2544943.xls 21679.331900 46.938712 0.216514 0.200000 0.426088
0503317-3_fo_078-2555583.xls 15359.697663 31.203412 0.203151 2.604700 8.347485
0503317-3_fo_079-2573667.xls - 26122.409583 80.206864 0.307042 28.067339 34.993688
0503317-3_fo_080-2590348.xls 45826.134359 199.876090 0.436162 99.967800 50.014887
0503317-3_fo_084-2538986.xls 20486.393123 179.575800 0.876561 103.131400 57.430567
0503317-3_fo_087-2562535.xls - - 289474.078653 1241.903477 0.429021 612.994671 49.359285
0503317-3_fo_088-2572869.xls 32288.607600 163.795700 0.507286 83.045700 50.700782
0503317-3_fo_090-2554306.xls - 171297.988156 2673.642294 1.560814 1596.389278 59.708409
0503317-3_fo_091-2573748.xls 70997.547530 35.351461 0.049793 1.379103 3.901120
0503317-3_fo_094-2524612.xls 86412.688755 591.507678 0.684515 276.749772 46.787182
0503317-3_fo_096-2552679.xls . 3861.294706 7.176000 0.185844 0.000000 0.000000
0503317_svod_01012017_y.xls 12062779.271830 43800.608619 0.363105 19004.254885 43.388107
File added
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment