> 文章列表 > 实验手册 - 第2周Spark RDD

实验手册 - 第2周Spark RDD

实验手册 - 第2周Spark RDD

目录标题

  • 1 实验内容
    • 实验1
    • 实验2
    • 实验3
    • 实验4
    • 实验5
    • 实验6
  • 2 实验总结
    • 2.1 Spark应用开发步骤
    • 2.2 字符串的split()方法列表解析式
    • 2.3 常用的Action操作
    • 2.4 常用的Transformation操作
    • 2.5 RDD间的Transformation操作

1 实验内容

查看当前工作目录

import os
os.getcwd()
'D:\\\\juniortwo\\\\spark'

导入numpy包

import numpy as np

实验1

实验1:已知:list01 = [“My name is John”, “How are you”]

(1)计算list01中各个元素的长度。输出格式:[15, 11]

(2)计算list01中各个元素中各个单词的长度。输出格式:
[2, 4, 2, 4, 3, 3, 3]

(3)计算list01中各个元素中各个单词的长度。输出格式:
[(“My”, 2), (“name”, 4), (“is”, 2), (“John”, 4), (“How”, 3), (“are”, 3), (“you”, 3)]

  • 导包创建SparkContext对象
import findspark
findspark.init()
from pyspark import SparkContext
sc = SparkContext()
list01 = ["My name is John", "How are you"]
  • parallelize内存式创建rdd
rdd1 = sc.parallelize(list01)
rdd1.map(lambda x:len(x)).collect()
[15, 11]
rdd1.flatMap(lambda x:x.split(' ')).map(lambda x:len(x)).collect()
[2, 4, 2, 4, 3, 3, 3]
rdd1.flatMap(lambda x:x.split(' ')).map(lambda x:(x,len(x))).collect()
[('My', 2),('name', 4),('is', 2),('John', 4),('How', 3),('are', 3),('you', 3)]

实验2

实验2:已知:numList = [[1, 3], [2, 4], [3, 5], [4, 6]]

请编程输出: [[1, 30], [2, 40], [3, 50], [4, 60]]

numList = [[1, 3], [2, 4], [3, 5], [4, 6]]
rdd2 = sc.parallelize(numList)
# rdd2.map(lambda x:len(x)).collect()
rdd2.map(lambda x:[x[0],x[1]*10]).collect()
[[1, 30], [2, 40], [3, 50], [4, 60]]
list01 = [1, 2, 3, 'a', 4, 'b']

实验3

实验3: 已知:list01 = [1, 2, 3, ‘a’, 4, ‘b’],将其数字保持原样,非数字转换为0。

编程输出:[1, 2, 3, 0, 4, 0]

rdd3 = sc.parallelize(list01)
  • 方法一:if语句判断
rdd3.map(lambda x:0 if x in ('a','b') else x).collect()
  • 方法二:str(x).isdigit() 判断
# 方法一
sc.parallelize([1, 2, 3, 'a', 4, 'b']).map(lambda x : x if str(x).isdigit() else 0).collect()
  • 方法三: isinstance() 函数来判断一个对象是否是一个已知的类型
# 方法二
sc.parallelize([1, 2, 3, 'a', 4, 'b']).map(lambda x : x if isinstance(x, int) else 0).collect()
  • 方法四:自定义函数convertToZero()
# 方法三
def convertToZero(x):try:return int(x)except:return 0sc.parallelize([1, 2, 3, 'a', 4, 'b']).map(convertToZero).collect()
## 等价于
sc.parallelize([1, 2, 3, 'a', 4, 'b']).map(lambda x : convertToZero(x)).collect()
[1, 2, 3, 0, 4, 0]

实验4

实验4: Others\\nasa_19950801.tsv和Others\\nasa_19950701.tsv文件 (tsv表示Tab Separated File),是某网站其中两天的访问日志文件。每一行代表一条访问记录。

请编程:找出这两天均访问该网站的主机名(host)

log1 = sc.textFile(r"D:\\juniortwo\\spark\\Spark2023-02-20\\Others\\nasa_19950801.tsv")
firstLine = log1.first()
log01 = log1.filter(lambda x:x!=firstLine).map(lambda x:x.split('\\t')[0])
log2 = sc.textFile(r"D:\\juniortwo\\spark\\Spark2023-02-20\\Others\\nasa_19950701.tsv")
firstLine = log2.first()
log02 = log2.filter(lambda x:x!=firstLine).map(lambda x:x.split('\\t')[0])
# log2.collect()
  • 两表取交集
log01.intersection(log02).collect()
['www-d3.proxy.aol.com','www-d4.proxy.aol.com','piweba1y.prodigy.com','www-d1.proxy.aol.com','www-a1.proxy.aol.com','hella.stm.it','alpha2.csd.uwm.edu','bettong.client.uq.oz.au','beglinger.dial-up.bdt.com','disarray.demon.co.uk','vagrant.vf.mmc.com','piweba2y.prodigy.com','www-b5.proxy.aol.com','www-a2.proxy.aol.com','wwwproxy.info.au','palona1.cns.hp.com','pm206-52.smartlink.net','hitiij.hitachi.co.jp','magicall.dacom.co.kr','netcom3.netcom.com','piweba4y.prodigy.com','www-b3.proxy.aol.com','www-b2.proxy.aol.com','koala.melbpc.org.au','alyssa.prodigy.com','www-d2.proxy.aol.com','freenet.edmonton.ab.ca','ntigate.nt.com','dd08-021.compuserve.com','piweba3y.prodigy.com','columbia.acc.brad.ac.uk','reggae.iinet.net.au','server.elysian.net','ottgate2.bnr.ca','srv1.freenet.calgary.ab.ca','ccn.cs.dal.ca','spectrum.xerox.com']

实验5

实验5:在Flights\\airlines.csv文件中

(1)计算总行数(不含表头)

(2)返回前10行(不含表头)

(3)找到Description中以A开头的数据,并将code和description构成元祖返回(不含表头)

rdd5 = sc.textFile(r"D:\\juniortwo\\spark\\Spark2023-02-20\\Flights\\airlines.csv")
  • 去表头统计总行数
firstLine = rdd5.first()
rdd5.filter(lambda x : x != firstLine).count()
1579
rdd5.filter(lambda x : x != firstLine).take(10)
['"19031","Mackey International Inc.: MAC"','"19032","Munz Northern Airlines Inc.: XY"','"19033","Cochise Airlines Inc.: COC"','"19034","Golden Gate Airlines Inc.: GSA"','"19035","Aeromech Inc.: RZZ"','"19036","Golden West Airlines Co.: GLW"','"19037","Puerto Rico Intl Airlines: PRN"','"19038","Air America Inc.: STZ"','"19039","Swift Aire Lines Inc.: SWT"','"19040","American Central Airlines: TSF"']
noHeader = rdd5.filter(lambda x : x != firstLine)
# noHeader.collect()
# noHeader.map(lambda x:x.split(',')[1]).take(5)
  • filter和startswith(‘"A’),文本本身自带了双引号——"
noHeader.filter(lambda x :x.split(',')[1].startswith('"A')).map(lambda x:(x.split(',')[0],x.split(',')[1])).collect()
## 如果觉得引号太多,不好看,可以:
noHeaderRDD.filter(lambda x : x.split(',')[1].startswith('"A')) \\.map(lambda x : (x.split(',')[0], x.split(',')[1])) \\.map(lambda x : (x[0].replace('"', ""), x[1].replace('"', ""))) \\.collect()
[('"19035"', '"Aeromech Inc.: RZZ"'),('"19038"', '"Air America Inc.: STZ"'),('"19040"', '"American Central Airlines: TSF"'),('"19043"', '"Altair Airlines Inc.: AAR"'),('"19050"', '"Alaska Aeronautical Indust.: AAZ"'),('"19065"', '"Air Micronesia Inc.: AJ"'),('"19069"', '"Air Cargo Express Inc.: ACG"'),('"19070"', '"Associated Aviation Act.: AAA"'),('"19071"', '"Antilles Air Boats Inc.: AAB"'),('"19072"', '"AAA Airlines: AAE"'),('"19073"', '"Argosy Air Lines Inc.: AAL"'),('"19074"', '"Air Bahia: ABH"'),('"19075"', '"Airbama Incorporated: ABI"'),('"19076"', '"Aeronaves Boringuena Inc.: ABO"'),('"19077"', '"Alaska Central Airways Inc.: ACA"'),('"19079"', '"AAA-Action Air Carrier Inc.: ACI"'),('"19080"', '"Air Cargo Enterprises Inc.: ACO"'),('"19081"', '"Air Chaparral Inc.: ACP"'),('"19082"', '"Alamo Commuter Airlines: ACS"'),('"19083"', '"Air Central Inc. (1): ACT"'),('"19084"', '"Air Central Inc.: ACK"'),('"19085"', '"Astec Air East Inc.: AEC"'),('"19086"', '"American Flag Airlines Inc.: AFA"'),('"19087"', '"Air Cargo America Inc.: AGA"'),('"19088"', '"All Island Air: AIA"'),('"19089"', '"Air Express Inc.: AIE"'),('"19090"', '"Air Mont. Inc.: AIM"'),('"19091"', '"Air Indiana: AIN"'),('"19092"', '"Air-Lift Associates Inc.: ALE"'),('"19094"', '"All Seasons Air Pacific: ALL"'),('"19096"', '"American Inter-Island Inc.: AMI"'),('"19097"', '"Air Nebraska Inc.: ANB"'),('"19098"', '"Airways Of New Mexico Inc.: ANM"'),('"19100"', '"Air North/Nenana: ANT"'),('"19102"', '"Arizona Pacific Inc.: API"'),('"19103"', '"Appalachian Flying Service: APL"'),('"19104"', '"Air Polynesia Inc.: APY"'),('"19105"', '"Arizona Aero Corp.: ARI"'),('"19106"', '"Arnold Aviation: ARN"'),('"19107"', '"Air Oregon: ARO"'),('"19108"', '"Arrowhead Airways Inc.: ARR"'),('"19109"', '"Amistad Airlines: ASD"'),('"19110"', '"Alpine Air Services Inc.: ASI"'),('"19111"', '"Asap Air Inc.: ASP"'),('"19112"', '"Astro Airways: AST"'),('"19113"', '"Air Atlantic Airlines Inc.: ATN"'),('"19115"', '"Atlantis Airlines Inc.: ATS"'),('"19116"', '"Aerotransit Inc.: ATT"'),('"19117"', '"Air Carolina: ATX"'),('"19118"', '"Air Vectors Airways: AVA"'),('"19119"', '"Aero Virgin Islands Corp.: AVI"'),('"19120"', '"Aviation Services: AVS"'),('"19141"', '"Air Virginia: CAV"'),('"19185"', '"Air Pacific Inc.: EKA"'),('"19230"', '"Air Chico: JCM"'),('"19240"', '"Aero Commuter: LOS"'),('"19255"', '"Arkansas Traveler Airline: MTA"'),('"19276"', '"Air Kentucky Air Lines: OWS"'),('"19282"', '"Air Pennsylvania: PER"'),('"19300"', '"Aerosun International Airlines Inc.: RED"'),('"19309"', '"Air Rovers Inc.: RWG"'),('"19312"', '"Air Cortez International: SAS"'),('"19313"', '"Air Americana: SAX"'),('"19345"', '"Air Colorado: TAC"'),('"19365"', '"Air U.S.: USA"'),('"19371"', '"Air East Airlines: WAC"'),('"19381"', '"Air New Mexico: ZIA"'),('"19389"', '"Air Florida Inc.: QH"'),('"19390"', '"Air California Inc.: OC"'),('"19404"', '"Academy Airlines: ACD"'),('"19407"', '"Airgo Inc.: AIG"'),('"19408"', '"American Air Transport: AMT"'),('"19417"', '"Air Freight Express: RRT"'),('"19419"', '"Aero Union Corp: XAA"'),('"19420"', '"Air Express International Airlines: XAC"'),('"19427"', '"Aeronaves De Puerto Rico: XBQ"'),('"19428"', '"Allstates Air Cargo Inc.: XBR"'),('"19435"', '"Amerford Airways Inc.: XAE"'),('"19436"', '"Astro-Wing Airlines Inc.: XAF"'),('"19448"', '"Air Caravane Inc.: AEQ"'),('"19449"', '"Argo S. A.: AGQ"'),('"19451"', '"Alberta Northern Airlines: ALQ"'),('"19452"', '"Aviacion Y Comercio S.A.: AO"'),('"19453"', '"Air Bvi Limited: BLQ"'),('"19457"', '"Aerolineas Dominicanas S A: DOQ"'),('"19460"', '"Aero Trades (Western) Ltd.: ERQ"'),('"19467"', '"Aerlinte Eireann Teoranta: IN"'),('"19470"', '"Allarco Developments Ltd.: JXQ"'),('"19482"', '"Air Niugini: NUQ"'),('"19490"', '"Aerotransportes Entre Rios: RSQ"'),('"19498"', '"Air Manila Inc.: UMQ"'),('"19499"', '"Avalon Aviation Ltd.: VOQ"'),('"19505"', '"Air Europe Limited: AE"'),('"19509"', '"Air Haiti S. A.: HJ"'),('"19512"', '"Aerolineas El Salvador S A: SZQ"'),('"19514"', '"Aeronaves Del Peru: ADQ"'),('"19520"', '"Andes: ED"'),('"19522"', '"Aviateca: GU"'),('"19526"', '"Air Nauru: ON"'),('"19527"', '"Aero Peru: PL"'),('"19530"', '"Air Afrique: RK"'),('"19531"', '"Air Canada: AC"'),('"19534"', '"Aeromexico: AM"'),('"19535"', '"Aerolineas Argentinas: AR"'),('"19537"', '"Aerovias Nacl De Colombia: AV"'),('"19543"', '"Air China: CA"'),('"19549"', '"Air Jamaica Limited: JM"'),('"19568"', '"Alia-(The) Royal Jordanian: RJ"'),('"19573"', '"Aeroflot Russian Airlines: SU"'),('"19581"', '"Altus Airlines: ALT"'),('"19582"', '"Atlantic Air: ANC"'),('"19583"', '"Aero International Airlines: BAA"'),('"19589"', '"Air East Of Delaware Inc.: AED"'),('"19590"', '"Atlanta Express: ALX"'),('"19591"', '"Air New Orleans: AOR"'),('"19592"', '"Air Vermont Inc.: AVR"'),('"19599"', '"Air Molakai: TRO"'),('"19609"', '"Aerocondor: OD (1)"'),('"19614"', '"Aeroservicios Ecuatorianos: EOQ"'),('"19615"', '"Arista International Airlines Inc.: RAQ"'),('"19620"', '"Aer Turas Teoranta: QTQ"'),('"19621"', '"Aero B Venezuela C.A.: AFQ"'),('"19622"', '"Air Ontario Limited: GX"'),('"19623"', '"Aer Lingus Plc: EI"'),('"19625"', '"Air Polynesia d/b/a DHL Cargo: XAB"'),('"19626"', '"Air Natl Aircraft Sal & Ser: XBZ"'),('"19627"', '"A/S Conair: CIQ"'),('"19629"', '"Air Resorts Airlines: ARA"'),('"19636"', '"Air One Inc.: CB"'),('"19638"', '"Arcata Flying Service: AFS"'),('"19645"', '"All Star Airlines Inc.: EP"'),('"19646"', '"Aeron International Airlines Inc.: AXQ"'),('"19649"', '"Alaska Island Air Inc.: LSZ"'),('"19650"', '"Air Sunshine Inc.: AAT"'),('"19653"', '"Air National: AHQ"'),('"19655"', '"Aviation Associates: SNA"'),('"19656"', '"Airmarc Airlines Inc.: ARM"'),('"19659"', '"Audi Air Inc.: AAI"'),('"19665"', '"Air Sedona: ARS"'),('"19669"', '"Aermediterranea S.P.A.: AWQ"'),('"19671"', '"Air Tungaru Corporation: VK"'),('"19673"', '"Alpine Air: AAV"'),('"19674"', '"Americair Inc.: AME"'),('"19675"', '"Airspur Helicopters Inc.: ARP"'),('"19678"', '"Aloha Airlines Inc.: AQ"'),('"19679"', '"Air Spirit Inc.: APS"'),('"19683"', '"Airmark Corporation: MKQ"'),('"19685"', '"Aerial Transit Company: TPQ"'),('"19698"', '"Air Charter (Safa): AQQ"'),('"19700"', '"Alpha Air: APH"'),('"19709"', '"AvAir: AMR"'),('"19710"', '"Armstrong Air Service Inc.: AAP"'),('"19713"', '"Alliance Airlines: ACN"'),('"19714"', '"Astor Air: ASR"'),('"19726"', '"AAR Western Skyways: WSK"'),('"19732"', '"Action Airlines: AON"'),('"19742"', '"Atlantic Gulf Airlines: ZY"'),('"19760"', '"Air Hawaii: AHC"'),('"19761"', '"Aerotal: XK"'),('"19762"', '"Air L.A.: ALS"'),('"19763"', '"Aero Coach: AEO"'),('"19764"', '"Air Link Airways: ALK"'),('"19774"', '"Airways International: AIT"'),('"19777"', '"Airpac Inc.: XYZ"'),('"19778"', '"Aerovias Venezolanas-Avensa: VE"'),('"19788"', '"Air Puerto Rico Airlines: FD"'),('"19791"', '"All Nippon Airways Co.: NH"'),('"19793"', '"Anglo Airlines Ltd.: AZQ"'),('"19800"', '"Air Cape: APE"'),('"19805"', '"American Airlines Inc.: AA"'),('"19806"', '"Air Charter Systems (Acs): WAQ"'),('"19811"', '"Aero Tranportes Panamenos: ATQ"'),('"19813"', '"Air Caribe International: ARB"'),('"19814"', '"Air South (1): ASU"'),('"19815"', '"Air South: ASH"'),('"19823"', '"Air Train Inc.: XDE"'),('"19828"', '"Air America: GM"'),('"19833"', '"Aleutian Air: ALU"'),('"19840"', '"Aerolineas Mundo: MUQ"'),('"19853"', '"Airlift International: ARD"'),('"19862"', '"Aerovias S.A.: AOQ"'),('"19863"', '"Alas De Transporte International: APQ"'),('"19870"', '"Aero Freight: AEF"'),('"19873"', '"Austrian Airlines: OS"'),('"19874"', '"Air Transport International: 8C"'),('"19875"', '"Aero California: JR"'),('"19886"', '"Aruba Cargo: IPQ"'),('"19890"', '"Aeroejecutivos C.A.: EJQ"'),('"19891"', '"Aeropuma: PUQ"'),('"19892"', '"Aeronautica De Cancun: ACQ"'),('"19893"', '"Aerovias Colombianas Arca: ARQ"'),('"19900"', '"Air Marshall Islands Inc.: CW"'),('"19904"', '"Air Southeast: ATH"'),('"19909"', '"Air Belgium: BEQ"'),('"19910"', '"Aerolineas Latinas: LNQ"'),('"19911"', '"Air Aruba: FQ"'),('"19914"', '"Air Liberte: LRQ"'),('"19919"', '"Adirondack Airlines: ADR"'),('"19927"', '"Aerosur (1): ASQ"'),('"19930"', '"Alaska Airlines Inc.: AS"'),('"19932"', '"Apa International Air S.A.: 7P"'),('"19933"', '"Air New Zealand: NZ"'),('"19943"', '"Allied Airlines: ALD"'),('"19944"', '"Airvantage: AVG"'),('"19955"', '"Affretair: ZL"'),('"19961"', '"Air Transat: TS"'),('"19968"', '"Arizona Pacific Airways: AZP"'),('"19972"', '"Av Atlantic: HCQ"'),('"19973"', '"Aerotour Dominicano Cxa: RTQ"'),('"19974"', '"Aero Uruguay (1): ROQ"'),('"19975"', '"Aero Uruguay: URQ"'),('"19976"', '"Air North: 4N"'),('"19978"', '"Air Alpha: AHA"'),('"19979"', '"Alliance Air: AIY"'),('"19987"', '"Advantage Airlines: ADV"'),('"19988"', '"Air West Airlines: AWA"'),('"19991"','"America West Airlines Inc.: HP (Merged with US Airways 9/05.Stopped reporting 10/07.)"'),('"19993"', '"Airmark Airlines Inc.: AKQ"'),('"19995"', '"Aces Airlines: VX (1)"'),('"20007"', '"Atlas Air Inc.: 5Y"'),('"20010"', '"Aero Transcolombiana: CLQ"'),('"20011"', '"Air Casino: ASN"'),('"20028"', '"Aerochago S.A.: G3 (1)"'),('"20030"', '"Aerolineas Uruguayas S.A.: UYQ"'),('"20032"', '"Air Europe S.P.A.: PE"'),('"20035"', '"Air Florida Express: AFE"'),('"20036"', '"American Flight Group: AFG"'),('"20037"', '"Aviation Sales: AVL"'),('"20043"', '"Air Ukraine: 6U"'),('"20044"', '"Aeromonterrey S.A.: 7M"'),('"20046"', '"Air Wisconsin Airlines Corp: ZW"'),('"20056"', '"Antigua Paradise Airways: PDQ"'),('"20058"', '"Air Pacific Ltd. (1): FJ (1)"'),('"20059"', '"Air Pacific Ltd.: FJ"'),('"20060"', '"Air South Inc. (1): WV (1)"'),('"20061"', '"Air South Inc.: ASC"'),('"20066"', '"Advance Air Charters: AAQ"'),('"20075"', '"Aeromar C. Por A.: BQ"'),('"20084"', '"Aspen Airways Inc.: APN"'),('"20085"', '"Aeromexpress: QO"'),('"20110"', '"Antonov Company: ADB"'),('"20114"', '"Air Caribbean (1): XC"'),('"20115"', '"Air Caribbean: AIC"'),('"20118"', '"Air Illinois Inc.: UX (1)"'),('"20119"', '"Air Europa: UX"'),('"20121"', '"Air Atlantic Dominicana: LU"'),('"20123"', '"Aeroejecutivo S.A.: SX (1)"'),('"20139"', '"Air Atlanta Inc.: CC (1)"'),('"20140"', '"Air Atlanta Icelandic: CC"'),('"20141"', '"Austin Express Inc.: AUX"'),('"20151"', '"Amerijet International: M6"'),('"20152"', '"Aviacsa Airlines: 6A"'),('"20154"', '"Airbus Transport Internat\\'l: BGQ"'),('"20155"', '"Aeropostal Alas De Venezuel: VH"'),('"20156"', '"ABSA-Aerolinhas Brasileiras: M3"'),('"20158"', '"Av Center Inc.: AVC"'),('"20162"', '"Air Tahiti Nui: TN"'),('"20164"', '"Accessair Holdings: ZA"'),('"20171"', '"American International Airways Inc.: NI (1)"'),('"20174"', '"Air Ketchum Idaho Inc.: AIK"'),('"20177"', '"Asia Pacific: PFQ"'),('"20189"', '"Aero Continente: N6"'),('"20194"', '"Arrow Air Inc.: JW"'),('"20196"', '"Air Malta: KM"'),('"20201"', '"Ameristar Air Cargo: AMQ"'),('"20205"', '"Aeromaritime: OV"'),('"20209"', '"Air Japan Co: NQ"'),('"20214"', '"Avia Leasing Company: AD"'),('"20216"', '"Air Liberte Aka Aom Minerve: IW"'),('"20217"', '"Air Excursions LLC (1): AEX"'),('"20220"', '"Air 21: A7 (1)"'),('"20221"', '"Air Comet S.A.: A7"'),('"20239"', '"All Canada Express: CEQ"'),('"20246"', '"Atlantic Coast Jet Inc.: ACJ"'),('"20250"', '"Aerolitoral: 5D"'),('"20256"', '"Arizona Airways: ARZ"'),('"20269"', '"Allegheny Airlines: HRZ"'),('"20277"', '"Asiana Airlines Inc.: OZ"'),('"20279"', '"Air-Serve: RSV"'),('"20290"', '"Air St. Thomas: ZP"'),('"20291"', '"Air Midwest Inc.: ZV"'),('"20292"', '"Airbc Ltd.: ZX (1)"'),('"20293"', '"Air Georgian: ZX"'),('"20296"', '"Aero Costa Rica: ML"'),('"20309"', '"Aerosvit Ukranian Airlines: VV"'),('"20312"', '"ATA Airlines d/b/a ATA: TZ"'),('"20325"', '"Arctic Circle Air Service: 5F"'),('"20330"', '"Arctic Transportation: 7S"'),('"20337"', '"Alaska Seaplane Service: J5"'),('"20341"', '"Alaska Central Express: KO"'),('"20343"', '"Airlift International Inc.: RD (1)"'),('"20354"', '"Aerodynamics Inc.: AJQ"'),('"20357"', '"Astar USA'),('"20365"', '"Aviation Concepts: CZQ"'),('"20368"', '"Allegiant Air: G4"'),('"20381"', '"Air Atlanta Europe: EUQ"'),('"20385"', '"Air Panama Internacional: OP (1)"'),('"20411"', '"Arizona Express: K7"'),('"20419"', '"Aerolineas Nicaraguenses: RL (1)"'),('"20429"', '"Aero Laguna S.A. De C.V.: AVQ"'),('"20430"', '"Aerodan S.A. De C.V.: AYQ"'),('"20431"', '"Aero Rentas De Coahuila S.A. De C.V.: BAQ"'),('"20432"', '"Aerotaxis De Aguascalientes S.A. De C.V.: BDQ"'),('"20437"', '"AirTran Airways Corporation: FL"'),('"20438"', '"Air Club International: HB (1)"'),('"20446"', '"Aerotransportes Mas De Crga: M7"'),('"20449"', '"Aero-Services-Corporate: WEQ"'),('"20453"', '"ABX Air'),('"20456"', '"Air Foyle Limited: GS"'),('"21007"', '"Abaco Air'),('"21061"', '"Aerounion Aerotransporte de Carga Union SA de CV: 6R"'),('"21074"', '"Arrow Panama: WAP"'),('"21126"', '"ANA & JP Express Co. Ltd.: 9N"'),('"21142"', '"Avior Airlines'),('"21196"', '"ACM AIR CHARTER GmbH: 0CQ"'),('"21294"', '"Aeromexico Travel: TRA"'),('"21312"', '"Air Greco'),('"21323"', '"Aerosur: 5L"'),('"21342"', '"Aeroenlaces Nacionales'),('"21352"', '"Avjet Corporation: 0WQ"'),('"21361"', '"Air Berlin PLC and CO: AB"'),('"21373"', '"Aeroservices Executive: BES"'),('"21386"', '"Air Excursions LLC: X4"'),('"21406"', '"Acropolis Aviation Ltd.: CRV"'),('"21427"', '"AeroLogic GmbH: 3S"'),('"21440"', '"Air Alsie A/S: 15Q"'),('"21447"', '"Albinati Aeronautics SA: 17Q"'),('"21463"', '"Aerovias de Intergracian Regional: 4C"'),('"21467"', '"Arik Air International: W3"'),('"21487"', '"AirBridgeCargo Airlines Limited: RU"'),('"21507"', '"Aerolineas Galapagos S A Aerogal: 2K"'),('"21522"', '"Alsek Air: 1FQ"'),('"21532"', '"Air Finland Ltd.: OF"'),('"21569"', '"Amira Air GmbH: XPE"'),('"21574"', '"Air Company Yakutia: R3"'),('"21578"', '"ABC Aerolineas SA de CV dba Interjet: 4O"'),('"21610"', '"Air Canada rouge LP: RV"'),('"21615"', '"Air Charter'),('"21634"', '"Aloha Air Cargo: KH"')]
# taiburongyile 

实验6

实验6:Stack Overflow网站在2016年做了一个在线问卷调查,来自世界各地的人参加了这项调查。
调查结果已经保存在Others\\2016-stack-overflow-survey-responses.csv文件中。

请编程计算:

(1)有多少来自中国的参与者(不含表头)?(country列记录了参与者所在的国家)

(2)过滤掉2016-stack-overflow-survey-responses.csv中任何字段为空的数据条目。

textFile这里采用文本创建rdd,绝对路径不容易出错,前面要加上r,避免形成转义字符

rdd6 = sc.textFile(r"D:\\juniortwo\\spark\\Spark2023-02-20\\Others\\2016-stack-overflow-survey-responses.csv")
firstLine1 = rdd6.first()
rdd6.filter(lambda x : x != firstLine1).filter(lambda x:x.split(',')[1]=='China').count()
21
rdd6.take(10)
['No,country,un_subregion,so_region,age_range,gender,salary,desktop_os','1888,Afghanistan,Southern Asia,Central Asia,20-24,Male,,','4637,Afghanistan,Southern Asia,Central Asia,30-34,Male,45000,Mac OS X','11164,Afghanistan,Southern Asia,Central Asia,,,,','21378,Afghanistan,Southern Asia,Central Asia,,Female,5000,Other Linux','30280,Afghanistan,Southern Asia,Central Asia,> 60,Prefer not to disclose,,','31355,Afghanistan,Southern Asia,Central Asia,20-24,Prefer not to disclose,,','31743,Afghanistan,Southern Asia,Central Asia,,Other,210000,Windows 10','51301,Afghanistan,Southern Asia,Central Asia,25-29,Male,5000,Windows 8','13017,Albania,Southern Europe,Eastern Europe,25-29,Other,,']
  • 方法一:这种方法过滤空值,改变了原有数据结构
rdd6.map(lambda x:x.split(',')).take(5)
[['No','country','un_subregion','so_region','age_range','gender','salary','desktop_os'],['1888','Afghanistan','Southern Asia','Central Asia','20-24','Male','',''],['4637','Afghanistan','Southern Asia','Central Asia','30-34','Male','45000','Mac OS X'],['11164', 'Afghanistan', 'Southern Asia', 'Central Asia', '', '', '', ''],['21378','Afghanistan','Southern Asia','Central Asia','','Female','5000','Other Linux']]
noHeader = rdd6.filter(lambda x : x != firstLine1)
  • is not等价于!=
# x is not None
noHeader.flatMap(lambda x:x.split(',')).filter(lambda x:x is not '').collect()

实验手册 - 第2周Spark RDD

  • 方法二:
rdd = sc.textFile(r"Others\\2016-stack-overflow-survey-responses.csv")
header = rdd.first()
noHeaderRDD = rdd.filter(lambda x  : x != header)
noHeaderRDD.take(5)
# (1) 
noHeaderRDD.filter(lambda x : x.split(',')[1] == "China").count()
# (2)
splitRDD = noHeaderRDD.map(lambda x : x.split(","))
splitRDD.take(5)
splitRDD.filter(lambda x : "" not in x).collect()
[['4637','Afghanistan','Southern Asia','Central Asia','30-34','Male','45000','Mac OS X'],['51301','Afghanistan','Southern Asia','Central Asia','25-29','Male','5000','Windows 8'],['24487','Albania','Southern Europe','Eastern Europe','20-24','Male','5000','Windows 10'],['49685','Albania','Southern Europe','Eastern Europe','20-24','Male','15000','Windows 10'],['50525','Albania','Southern Europe','Eastern Europe','25-29','Female','5000','Windows 10'],['50541','Albania','Southern Europe','Eastern Europe','25-29','Male','5000','Mac OS X'],['51884','Albania','Southern Europe','Eastern Europe','20-24','Male','15000','Windows 7'],['27219','Algeria','Northern Africa','Africa','25-29','Male','15000','Ubuntu'],['29553','Algeria','Northern Africa','Africa','20-24','Male','95000','Windows 10'],['31646','Algeria','Northern Africa','Africa','20-24','Male','5000','Mac OS X'],['52957','Algeria','Northern Africa','Africa','20-24','Male','5000','Mac OS X'],['348','Andorra','Southern Europe','Western Europe','40-49','Male','45000','Windows 10'],['34171','Andorra','Southern Europe','Western Europe','20-24','Female','35000','Windows 10'],['24573','Argentina','South America','South America','25-29','Male','15000','Ubuntu'],['28900','Argentina','South America','South America','25-29','Male','35000','Ubuntu'],['29315','Argentina','South America','South America','20-24','Male','15000','Mint'],['30889','Argentina','South America','South America','< 20','Male','5000','Windows 10'],['31035','Argentina','South America','South America','20-24','Male','15000','Ubuntu'],['31148','Argentina','South America','South America','30-34','Male','25000','Windows 7'],['31165','Argentina','South America','South America','35-39','Male','15000','Ubuntu'],['31252','Argentina','South America','South America','25-29','Male','15000','Ubuntu'],['31277','Argentina','South America','South America','20-24','Female','15000','Ubuntu'],['31422','Argentina','South America','South America','25-29','Male','5000','Debian'],['31541','Argentina','South America','South America','25-29','Male','75000','Mac OS X'],['31978','Argentina','South America','South America','30-34','Male','95000','Ubuntu'],['32168','Argentina','South America','South America','20-24','Male','25000','Windows 7'],['32183','Argentina','South America','South America','30-34','Male','210000','Ubuntu'],['32294','Argentina','South America','South America','25-29','Male','35000','Windows 7'],['32492','Argentina','South America','South America','35-39','Male','25000','Windows 10'],['32506','Argentina','South America','South America','30-34','Male','35000','Mac OS X'],['32835','Argentina','South America','South America','< 20','Male','5000','Windows 7'],['32970','Argentina','South America','South America','30-34','Male','15000','Windows 7'],['32991','Argentina','South America','South America','25-29','Female','5000','Mac OS X'],['33306','Argentina','South America','South America','25-29','Male','25000','Mac OS X'],['33345','Argentina','South America','South America','25-29','Male','15000','Windows 8'],['33620','Argentina','South America','South America','35-39','Male','15000','Windows 7'],['33764','Argentina','South America','South America','30-34','Male','15000','Windows 10'],['33820','Argentina','South America','South America','35-39','Male','85000','Windows 10'],['35266','Argentina','South America','South America','35-39','Male','45000','Ubuntu'],['35338','Argentina','South America','South America','20-24','Male','5000','Mint'],['35375','Argentina','South America','South America','40-49','Male','25000','Windows 7'],['35431','Argentina','South America','South America','30-34','Male','15000','Ubuntu'],['35446','Argentina','South America','South America','25-29','Male','15000','Ubuntu'],['35628','Argentina','South America','South America','40-49','Male','5000','Ubuntu'],['35750','Argentina','South America','South America','20-24','Male','15000','Windows 8'],['35760','Argentina','South America','South America','30-34','Male','25000','Debian'],['36103','Argentina','South America','South America','35-39','Male','5000','Debian'],['36123','Argentina','South America','South America','30-34','Male','15000','Mac OS X'],['36390','Argentina','South America','South America','25-29','Male','25000','Mac OS X'],['36493','Argentina','South America','South America','30-34','Male','25000','Ubuntu'],['36495','Argentina','South America','South America','30-34','Male','15000','Windows 10'],['36546','Argentina','South America','South America','40-49','Male','45000','Debian'],['36662','Argentina','South America','South America','25-29','Male','35000','Fedora'],['36693','Argentina','South America','South America','25-29','Male','5000','Other Linux'],['36753','Argentina','South America','South America','20-24','Male','15000','Windows 7'],['36754','Argentina','South America','South America','35-39','Male','25000','Windows 7'],['36761','Argentina','South America','South America','20-24','Female','35000','Ubuntu'],['36987','Argentina','South America','South America','40-49','Male','55000','Ubuntu'],['37250','Argentina','South America','South America','25-29','Male','15000','Ubuntu'],['37268','Argentina','South America','South America','20-24','Male','45000','Mac OS X'],['38200','Argentina','South America','South America','40-49','Male','15000','Windows 7'],['41768','Argentina','South America','South America','20-24','Male','5000','Windows 7'],['42038','Argentina','South America','South America','20-24','Male','5000','Windows 10'],['42306','Argentina','South America','South America','35-39','Male','55000','Mac OS X'],['42345','Argentina','South America','South America','30-34','Male','15000','Windows 7'],['42991','Argentina','South America','South America','25-29','Male','25000','Mint'],['43299','Argentina','South America','South America','30-34','Male','15000','Windows 8'],['44276','Argentina','South America','South America','35-39','Female','35000','Windows 7'],['45382','Argentina','South America','South America','30-34','Male','35000','Windows 10'],['45695','Argentina','South America','South America','35-39','Female','15000','Windows 8'],['46042','Argentina','South America','South America','30-34','Male','25000','Debian'],['46055','Argentina','South America','South America','40-49','Male','5000','Ubuntu'],['46184','Argentina','South America','South America','25-29','Male','25000','Ubuntu'],['46268','Argentina','South America','South America','40-49','Male','15000','Ubuntu'],['46362','Argentina','South America','South America','25-29','Male','15000','Mac OS X'],['46383','Argentina','South America','South America','30-34','Male','55000','Debian'],['46495','Argentina','South America','South America','25-29','Male','45000','Windows 10'],['46516','Argentina','South America','South America','25-29','Male','25000','Ubuntu'],['46676','Argentina','South America','South America','30-34','Male','85000','Mac OS X'],['46738','Argentina','South America','South America','35-39','Male','5000','Mint'],['46790','Argentina','South America','South America','25-29','Male','5000','Windows 8'],['46852','Argentina','South America','South America','35-39','Male','25000','Windows 7'],['46896','Argentina','South America','South America','20-24','Male','5000','Windows 7'],['46921','Argentina','South America','South America','35-39','Male','15000','Windows 8'],['46926','Argentina','South America','South America','30-34','Female','5000','Windows 10'],['46930','Argentina','South America','South America','25-29','Male','75000','Mac OS X'],['47849','Argentina','South America','South America','30-34','Male','15000','Other Linux'],['47856','Argentina','South America','South America','25-29','Male','15000','Mac OS X'],['47881','Argentina','South America','South America','30-34','Male','15000','Windows 10'],['47887','Argentina','South America','South America','25-29','Male','15000','Ubuntu'],['47935','Argentina','South America','South America','30-34','Male','25000','Windows 10'],['47960','Argentina','South America','South America','35-39','Male','35000','Mint'],['48012','Argentina','South America','South America','30-34','Male','5000','Windows 8'],['48025','Argentina','South America','South America','40-49','Male','25000','Windows 7'],['48183','Argentina','South America','South America','30-34','Male','25000','Mac OS X'],['48450','Argentina','South America','South America','35-39','Male','15000','Ubuntu'],['48505','Argentina','South America','South America','40-49','Male','5000','Other Linux'],['48604','Argentina','South America','South America','25-29','Male','15000','Windows 7'],['49241','Argentina','South America','South America','30-34','Male','65000','Windows 10'],['49500','Argentina','South America','South America','25-29','Male','25000','Mac OS X'],['49552','Argentina','South America','South America','25-29','Male','5000','Windows 10'],['49602','Argentina','South America','South America','25-29','Male','15000','Windows 7'],['49686','Argentina','South America','South America','25-29','Male','25000','Mac OS X'],['49697','Argentina','South America','South America','25-29','Male','25000','Windows 7'],['49835','Argentina','South America','South America','25-29','Male','15000','Windows 8'],['49901','Argentina','South America','South America','25-29','Male','15000','Windows 10'],['50049','Argentina','South America','South America','30-34','Male','35000','Ubuntu'],['50115','Argentina','South America','South America','40-49','Male','25000','Ubuntu'],['50369','Argentina','South America','South America','25-29','Male','15000','Windows 10'],['50407','Argentina','South America','South America','25-29','Male','15000','Windows 7'],['50432','Argentina','South America','South America','25-29','Male','45000','Mac OS X'],['50479','Argentina','South America','South America','40-49','Male','145000','Windows 7'],['50546','Argentina','South America','South America','30-34','Male','15000','Windows 7'],['50550','Argentina','South America','South America','30-34','Male','15000','Windows 10'],['50609','Argentina','South America','South America','30-34','Male','55000','Mac OS X'],['51202','Argentina','South America','South America','35-39','Male','25000','Mac OS X'],['51261','Argentina','South America','South America','30-34','Male','35000','Windows 7'],['51312','Argentina','South America','South America','20-24','Male','15000','Windows 7'],['51466','Argentina','South America','South America','35-39','Male','25000','Debian'],['51575','Argentina','South America','South America','30-34','Male','15000','Windows 10'],['51579','Argentina','South America','South America','35-39','Male','15000','Ubuntu'],['51603','Argentina','South America','South America','40-49','Male','75000','Mac OS X'],['51624','Argentina','South America','South America','25-29','Male','15000','Windows 8'],['51643','Argentina','South America','South America','25-29','Male','15000','Windows 7'],['51945','Argentina','South America','South America','25-29','Male','15000','Debian'],['52959','Argentina','South America','South America','20-24','Male','5000','Windows 8'],['53020','Argentina','South America','South America','30-34','Male','35000','Other Linux'],['53083','Argentina','South America','South America','30-34','Male','25000','Ubuntu'],['2498','Armenia','Western Asia','Eastern Europe','< 20','Male','5000','Windows 10'],['28436','Armenia','Western Asia','Eastern Europe','20-24','Male','135000','Mac OS X'],['34101','Armenia','Western Asia','Eastern Europe','20-24','Male','15000','Windows 7'],['52574','Armenia','Western Asia','Eastern Europe','< 20','Male','5000','Windows 10'],['52880','Armenia','Western Asia','Eastern Europe','25-29','Male','25000','Windows 7'],['53075','Armenia','Western Asia','Eastern Europe','20-24','Male','15000','Windows 7'],['1019','Australia','Australia and New Zealand','Oceania','40-49','Male','75000','Windows 10'],['1024','Australia','Australia and New Zealand','Oceania','50-59','Male','105000','Windows 7'],['2753','Australia','Australia and New Zealand','Oceania','> 60','Male','55000','Mint'],['4020','Australia','Australia and New Zealand','Oceania','25-29','Male','75000','Mac OS X'],['20108','Australia','Australia and New Zealand','Oceania','25-29','Female','5000','Windows 10'],['25993','Australia','Australia and New Zealand','Oceania','20-24','Male','65000','Fedora'],['26002','Australia','Australia and New Zealand','Oceania','20-24','Male','45000','Windows 10'],['26469','Australia','Australia and New Zealand','Oceania','30-34','Male','55000','Windows 8'],['27081','Australia','Australia and New Zealand','Oceania','30-34','Male','65000','Mac OS X'],['29088','Australia','Australia and New Zealand','Oceania','25-29','Male','15000','Mac OS X'],['30010','Australia','Australia and New Zealand','Oceania','20-24','Male','45000','Windows 10'],['30369','Australia','Australia and New Zealand','Oceania','20-24','Male','35000','Windows 7'],['30424','Australia','Australia and New Zealand','Oceania','20-24','Male','55000','Windows 7'],['31023','Australia','Australia and New Zealand','Oceania','35-39','Female','75000','Ubuntu'],['31480','Australia','Australia and New Zealand','Oceania','20-24','Male','5000','Windows 7'],['31948','Australia','Australia and New Zealand','Oceania','35-39','Male','65000','Fedora'],['35376','Australia','Australia and New Zealand','Oceania','30-34','Male','65000','Windows 8'],['35791','Australia','Australia and New Zealand','Oceania','35-39','Male','75000','Mac OS X'],['36011','Australia','Australia and New Zealand','Oceania','25-29','Male','55000','Mac OS X'],['42758','Australia','Australia and New Zealand','Oceania','> 60','Male','95000','Windows 7'],['46778','Australia','Australia and New Zealand','Oceania','35-39','Male','115000','Windows 10'],['47455','Australia','Australia and New Zealand','Oceania','25-29','Male','35000','Other Linux'],['47924','Australia','Australia and New Zealand','Oceania','35-39','Male','95000','Mac OS X'],['48826','Australia','Australia and New Zealand','Oceania','50-59','Male','5000','Mac OS X'],['49424','Australia','Australia and New Zealand','Oceania','30-34','Male','105000','Fedora'],['50501','Australia','Australia and New Zealand','Oceania','30-34','Male','65000','Windows 10'],['50634','Australia','Australia and New Zealand','Oceania','25-29','Male','115000','Ubuntu'],['50940','Australia','Australia and New Zealand','Oceania','35-39','Female','105000','Windows 7'],['51187','Australia','Australia and New Zealand','Oceania','30-34','Male','105000','Windows 8'],['51409','Australia','Australia and New Zealand','Oceania','20-24','Male','5000','Ubuntu'],['51468','Australia','Australia and New Zealand','Oceania','25-29','Male','55000','Mac OS X'],['51569','Australia','Australia and New Zealand','Oceania','> 60','Male','165000','Windows 8'],['51656','Australia','Australia and New Zealand','Oceania','40-49','Female','105000','Ubuntu'],['312','Austria','Western Europe','Western Europe','35-39','Male','35000','Other Linux'],['1453','Austria','Western Europe','Western Europe','35-39','Male','15000','Windows 7'],['2264','Austria','Western Europe','Western Europe','25-29','Male','25000','Mac OS X'],['2908','Austria','Western Europe','Western Europe','25-29','Male','35000','Ubuntu'],['3080','Austria','Western Europe','Western Europe','25-29','Female','5000','Ubuntu'],['3493','Austria','Western Europe','Western Europe','35-39','Male','185000','Windows 7'],['3913','Austria','Western Europe','Western Europe','35-39','Male','55000','Windows 8'],['4018','Austria','Western Europe','Western Europe','25-29','Male','45000','Windows 10'],['4137','Austria','Western Europe','Western Europe','25-29','Male','5000','Windows 10'],['4145','Austria','Western Europe','Western Europe','20-24','Female','5000','Mac OS X'],['4209','Austria','Western Europe','Western Europe','30-34','Male','45000','Mac OS X'],['4836','Austria','Western Europe','Western Europe','30-34','Male','55000','Debian'],['4903','Austria','Western Europe','Western Europe','50-59','Male','15000','Windows 10'],['4938','Austria','Western Europe','Western Europe','25-29','Male','55000','Windows 7'],['5031','Austria','Western Europe','Western Europe','35-39','Male','55000','Windows 8'],['5078','Austria','Western Europe','Western Europe','30-34','Male','35000','Windows 10'],['5288','Austria','Western Europe','Western Europe','35-39','Male','35000','Mac OS X'],['5404','Austria','Western Europe','Western Europe','20-24','Male','5000','Windows 7'],['6529','Austria','Western Europe','Western Europe','25-29','Male','35000','Mac OS X'],['6611','Austria','Western Europe','Western Europe','40-49','Male','85000','Windows 8'],['7082','Austria','Western Europe','Western Europe','20-24','Male','25000','Windows 7'],['7508','Austria','Western Europe','Western Europe','35-39','Male','135000','Debian'],['7551','Austria','Western Europe','Western Europe','40-49','Male','55000','Mac OS X'],['8905','Austria','Western Europe','Western Europe','30-34','Male','65000','Windows 7'],['8956','Austria','Western Europe','Western Europe','< 20','Male','15000','Windows 10'],['9613','Austria','Western Europe','Western Europe','35-39','Male','135000','Other Linux'],['10418','Austria','Western Europe','Western Europe','30-34','Male','55000','Mac OS X'],['10563','Austria','Western Europe','Western Europe','25-29','Male','35000','Windows 7'],['10585','Austria','Western Europe','Western Europe','30-34','Male','75000','Mac OS X'],['11445','Austria','Western Europe','Western Europe','30-34','Male','45000','Windows 10'],['11975','Austria','Western Europe','Western Europe','30-34','Male','15000','Windows 7'],['12915','Austria','Western Europe','Western Europe','25-29','Male','45000','Windows 10'],['13166','Austria','Western Europe','Western Europe','20-24','Male','15000','Ubuntu'],['13365','Austria','Western Europe','Western Europe','25-29','Male','45000','Windows 7'],['15083','Austria','Western Europe','Western Europe','20-24','Male','75000','Mac OS X'],['15527','Austria','Western Europe','Western Europe','25-29','Male','105000','Mac OS X'],['15576','Austria','Western Europe','Western Europe','40-49','Male','75000','Windows 8'],['16838','Austria','Western Europe','Western Europe','30-34','Male','65000','Mac OS X'],['17101','Austria','Western Europe','Western Europe','20-24','Male','5000','Windows 10'],['18713','Austria','Western Europe','Western Europe','25-29','Male','35000','Mac OS X'],['18744','Austria','Western Europe','Western Europe','50-59','Male','5000','Windows 10'],['18759','Austria','Western Europe','Western Europe','20-24','Male','5000','Other Linux'],['19121','Austria','Western Europe','Western Europe','40-49','Male','135000','Mac OS X'],['19493','Austria','Western Europe','Western Europe','25-29','Male','35000','Windows 10'],['19689','Austria','Western Europe','Western Europe','20-24','Male','35000','Mac OS X'],['20309','Austria','Western Europe','Western Europe','25-29','Male','5000','Mac OS X'],['20796','Austria','Western Europe','Western Europe','25-29','Male','65000','Windows 10'],['21371','Austria','Western Europe','Western Europe','30-34','Male','45000','Debian'],['22287','Austria','Western Europe','Western Europe','40-49','Male','75000','Windows 7'],['22482','Austria','Western Europe','Western Europe','25-29','Male','65000','Mac OS X'],['22720','Austria','Western Europe','Western Europe','30-34','Male','35000','Ubuntu'],['22899','Austria','Western Europe','Western Europe','50-59','Male','125000','Windows 10'],['23617','Austria','Western Europe','Western Europe','20-24','Male','5000','Windows 7'],['23705','Austria','Western Europe','Western Europe','30-34','Male','55000','Mac OS X'],['24754','Austria','Western Europe','Western Europe','< 20','Male','5000','Windows 7'],['25443','Austria','Western Europe','Western Europe','< 20','Male','5000','Windows 7'],['25935','Austria','Western Europe','Western Europe','25-29','Male','45000','Windows 7'],['26056','Austria','Western Europe','Western Europe','20-24','Male','35000','Mac OS X'],['26299','Austria','Western Europe','Western Europe','25-29','Male','35000','Windows 7'],['27000','Austria','Western Europe','Western Europe','30-34','Male','45000','Mac OS X'],['27381','Austria','Western Europe','Western Europe','35-39','Female','5000','Mint'],['27665','Austria','Western Europe','Western Europe','30-34','Male','55000','Mac OS X'],['27687','Austria','Western Europe','Western Europe','20-24','Male','145000','Windows 10'],['27743','Austria','Western Europe','Western Europe','25-29','Male','45000','Windows 10'],['28069','Austria','Western Europe','Western Europe','25-29','Male','35000','Ubuntu'],['28347','Austria','Western Europe','Western Europe','30-34','Male','85000','Mac OS X'],['28643','Austria','Western Europe','Western Europe','25-29','Male','5000','Mac OS X'],['29070','Austria','Western Europe','Western Europe','20-24','Male','15000','Windows 8'],['29578','Austria','Western Europe','Western Europe','20-24','Male','25000','Other Linux'],['30169','Austria','Western Europe','Western Europe','30-34','Female','15000','Windows 10'],['30203','Austria','Western Europe','Western Europe','20-24','Male','5000','Other Linux'],['30245','Austria','Western Europe','Western Europe','30-34','Male','55000','Mac OS X'],['31853','Austria','Western Europe','Western Europe','25-29','Male','35000','Windows 10'],['48815','Austria','Western Europe','Western Europe','30-34','Female','55000','Windows 8'],['50631','Austria','Western Europe','Western Europe','20-24','Male','45000','Windows 10'],['52371','Austria','Western Europe','Western Europe','25-29','Male','45000','Windows 8'],['52419','Austria','Western Europe','Western Europe','30-34','Male','65000','Windows 10'],['52956','Austria','Western Europe','Western Europe','30-34','Male','25000','Windows 10'],['53116','Austria','Western Europe','Western Europe','20-24','Male','35000','Mac OS X'],['51000','Azerbaijan','Western Asia','Central Asia','25-29','Male','15000','Windows 7'],['3062','Bahamas','Caribbean','Caribbean','> 60','Male','95000','Windows 7'],['48366','Bahrain','Western Asia','Middle East','Prefer not to disclose','Prefer not to disclose','45000','Windows 10'],['7268','Bangladesh','Southern Asia','South Asia','20-24','Prefer not to disclose','5000','Windows 10'],['27882','Bangladesh','Southern Asia','South Asia','25-29','Male','5000','Mint'],['28184','Bangladesh','Southern Asia','South Asia','25-29','Male','5000','Windows 8'],['28999','Bangladesh','Southern Asia','South Asia','20-24','Male','5000','Mac OS X'],['29001','Bangladesh','Southern Asia','South Asia','25-29','Male','5000','Windows 7'],['30896','Bangladesh','Southern Asia','South Asia','20-24','Male','15000','Windows 10'],['31370','Bangladesh','Southern Asia','South Asia','30-34','Male','15000','Windows 8'],['49975','Bangladesh','Southern Asia','South Asia','20-24','Male','5000','Windows 10'],['51115','Bangladesh','Southern Asia','South Asia','20-24','Male','5000','Windows 10'],['52892','Bangladesh','Southern Asia','South Asia','30-34','Male','15000','Windows 8'],['52997','Bangladesh','Southern Asia','South Asia','20-24','Male','5000','Windows 7'],['37138','Belarus','Eastern Europe','Eastern Europe','25-29','Male','5000','Windows 10'],['47737','Belarus','Eastern Europe','Eastern Europe','30-34','Male','15000','Ubuntu'],['111','Belgium','Western Europe','Western Europe','30-34','Male','85000','Windows 10'],['1090','Belgium','Western Europe','Western Europe','35-39','Male','85000','Mac OS X'],['1227','Belgium','Western Europe','Western Europe','20-24','Male','45000','Windows 8'],['1569','Belgium','Western Europe','Western Europe','30-34','Male','85000','Mac OS X'],['1633','Belgium','Western Europe','Western Europe','30-34','Male','45000','Mac OS X'],['1960','Belgium','Western Europe','Western Europe','30-34','Male','55000','Mac OS X'],['2216','Belgium','Western Europe','Western Europe','< 20','Male','5000','Windows 10'],['2640','Belgium','Western Europe','Western Europe','30-34','Male','65000','Windows 10'],['2814','Belgium','Western Europe','Western Europe','35-39','Male','55000','Mac OS X'],['2872','Belgium','Western Europe','Western Europe','< 20','Male','5000','Windows 10'],['2903','Belgium','Western Europe','Western Europe','25-29','Male','5000','Mac OS X'],['3362','Belgium','Western Europe','Western Europe','25-29','Male','35000','Mac OS X'],['4245','Belgium','Western Europe','Western Europe','35-39','Male','45000','Windows 10'],['4373','Belgium','Western Europe','Western Europe','25-29','Male','35000','Windows 8'],['4623','Belgium','Western Europe','Western Europe','20-24','Male','5000','Mac OS X'],['4843','Belgium','Western Europe','Western Europe','20-24','Male','5000','Windows 8'],['5214','Belgium','Western Europe','Western Europe','25-29','Male','65000','Mac OS X'],['5706','Belgium','Western Europe','Western Europe','20-24','Male','35000','Windows 10'],['8447','Belgium','Western Europe','Western Europe','35-39','Male','75000','Windows 8'],['10448','Belgium','Western Europe','Western Europe','< 20','Male','5000','Mac OS X'],['10722','Belgium','Western Europe','Western Europe','30-34','Male','35000','Windows 8'],['11766','Belgium','Western Europe','Western Europe','35-39','Male','125000','Mac OS X'],['12440','Belgium','Western Europe','Western Europe','35-39','Male','125000','Mac OS X'],['14104','Belgium','Western Europe','Western Europe','25-29','Male','35000','Windows 7'],['14360','Belgium','Western Europe','Western Europe','20-24','Male','5000','Windows 10'],['14408','Belgium','Western Europe','Western Europe','30-34','Male','35000','Windows 10'],['14992','Belgium','Western Europe','Western Europe','20-24','Female','5000','Debian'],['15620','Belgium','Western Europe','Western Europe','20-24','Male','5000','Windows 10'],['16076','Belgium','Western Europe','Western Europe','< 20','Male','5000','Windows 10'],['16791','Belgium','Western Europe','Western Europe','20-24','Male','25000','Debian'],['18048','Belgium','Western Europe','Western Europe','30-34','Male','55000','Ubuntu'],['18919','Belgium','Western Europe','Western Europe','20-24','Male','25000','Mac OS X'],['19336','Belgium','Western Europe','Western Europe','20-24','Male','5000','Windows 8'],['19640','Belgium','Western Europe','Western Europe','35-39','Male','45000','Other Linux'],['20351','Belgium','Western Europe','Western Europe','30-34','Male','15000','Mac OS X'],['20397','Belgium','Western Europe','Western Europe','40-49','Male','45000','Windows 8'],['20508','Belgium','Western Europe','Western Europe','20-24','Male','25000','Mac OS X'],['20983','Belgium','Western Europe','Western Europe','25-29','Male','55000','Windows 7'],['21358','Belgium','Western Europe','Western Europe','25-29','Male','45000','Windows 10'],['21410','Belgium','Western Europe','Western Europe','35-39','Female','165000','Windows 10'],['21783','Belgium','Western Europe','Western Europe','25-29','Male','65000','Windows 7'],['22639','Belgium','Western Europe','Western Europe','40-49','Male','55000','Other Linux'],['22654','Belgium','Western Europe','Western Europe','20-24','Male','65000','Windows 10'],['22730','Belgium','Western Europe','Western Europe','30-34','Male','45000','Ubuntu'],['22826','Belgium','Western Europe','Western Europe','35-39','Male','95000','Windows 7'],['22988','Belgium','Western Europe','Western Europe','25-29','Male','25000','Mac OS X'],['23745','Belgium','Western Europe','Western Europe','25-29','Male','15000','Windows 7'],['25108','Belgium','Western Europe','Western Europe','30-34','Male','35000','Mac OS X'],['25133','Belgium','Western Europe','Western Europe','40-49','Male','25000','Windows 10'],['26759','Belgium','Western Europe','Western Europe','25-29','Male','45000','Windows 10'],['26941','Belgium','Western Europe','Western Europe','25-29','Male','5000','Windows 7'],['27068','Belgium','Western Europe','Western Europe','20-24','Male','65000','Windows 8'],['27772','Belgium','Western Europe','Western Europe','25-29','Male','75000','Fedora'],['27787','Belgium','Western Europe','Western Europe','20-24','Male','25000','Windows 7'],['27805','Belgium','Western Europe','Western Europe','20-24','Male','25000','Windows 10'],['28006','Belgium','Western Europe','Western Europe','< 20','Male','5000','Windows 10'],['28137','Belgium','Western Europe','Western Europe','20-24','Male','5000','Mac OS X'],['28213','Belgium','Western Europe','Western Europe','20-24','Male','15000','Windows 10'],['28228','Belgium','Western Europe','Western Europe','30-34','Male','105000','Windows 8'],['28985','Belgium','Western Europe','Western Europe','30-34','Male','65000','Windows 7'],['29038','Belgium','Western Europe','Western Europe','20-24','Male','25000','Windows 10'],['29186','Belgium','Western Europe','Western Europe','30-34','Male','25000','Windows 10'],['29227','Belgium','Western Europe','Western Europe','25-29','Male','25000','Mac OS X'],['29290','Belgium','Western Europe','Western Europe','40-49','Male','65000','Windows 10'],['29338','Belgium','Western Europe','Western Europe','25-29','Male','145000','Mac OS X'],['29921','Belgium','Western Europe','Western Europe','25-29','Female','45000','Mac OS X'],['30054','Belgium','Western Europe','Western Europe','20-24','Male','45000','Ubuntu'],['30096','Belgium','Western Europe','Western Europe','30-34','Male','65000','Mac OS X'],['30148','Belgium','Western Europe','Western Europe','25-29','Male','45000','Windows 7'],['30173','Belgium','Western Europe','Western Europe','35-39','Male','125000','Windows 7'],['30648','Belgium','Western Europe','Western Europe','25-29','Male','35000','Windows 8'],['31463','Belgium','Western Europe','Western Europe','20-24','Male','25000','Mac OS X'],['31702','Belgium','Western Europe','Western Europe','20-24','Male','25000','Mac OS X'],['31780','Belgium','Western Europe','Western Europe','40-49','Male','35000','Windows 10'],['32094','Belgium','Western Europe','Western Europe','25-29','Male','35000','Mac OS X'],['32254','Belgium','Western Europe','Western Europe','40-49','Male','45000','Windows 7'],['32613','Belgium','Western Europe','Western Europe','30-34','Male','75000','Windows 10'],['50410','Belgium','Western Europe','Western Europe','20-24','Male','35000','Other Linux'],['52987','Belgium','Western Europe','Western Europe','20-24','Male','35000','Windows 10'],['53148','Belgium','Western Europe','Western Europe','40-49','Male','75000','Mint'],['2204','Belize','Central America','Central America','40-49','Male','125000','Windows 10'],['25631','Bolivia','South America','South America','20-24','Male','5000','Windows 8'],['25236','Bosnia Herzegovina','Southern Europe','Eastern Europe','25-29','Male','5000','Windows 8'],['29720','Bosnia Herzegovina','Southern Europe','Eastern Europe','20-24','Male','5000','Windows 10'],['31398','Bosnia Herzegovina','Southern Europe','Eastern Europe','35-39','Male','35000','Windows 10'],['31762','Bosnia Herzegovina','Southern Europe','Eastern Europe','20-24','Male','5000','Windows 7'],['31789','Bosnia Herzegovina','Southern Europe','Eastern Europe','20-24','Male','5000','Windows 7'],['2873','Brazil','South America','South America','25-29','Male','5000','Windows 10'],['3055','Brazil','South America','South America','30-34','Male','65000','Windows 8'],['4645','Brazil','South America','South America','30-34','Male','15000','Mac OS X'],['6360','Brazil','South America','South America','40-49','Male','105000','Windows 10'],['21050','Brazil','South America','South America','20-24','Male','35000','Windows 10'],['23770','Brazil','South America','South America','20-24','Male','25000','Mac OS X'],['24030','Brazil','South America','South America','25-29','Male','15000','Mac OS X'],['26603','Brazil','South America','South America','20-24','Male','15000','Mac OS X'],['26893','Brazil','South America','South America','20-24','Female','15000','Mac OS X'],['28674','Brazil','South America','South America','20-24','Male','35000','Ubuntu'],['28827','Brazil','South America','South America','20-24','Male','5000','Ubuntu'],['29096','Brazil','South America','South America','20-24','Male','5000','Mac OS X'],['31409','Brazil','South America','South America','< 20','Male','5000','Other Linux'],['33501','Brazil','South America','South America','35-39','Male','25000','Windows 10'],['33587','Brazil','South America','South America','25-29','Male','25000','Other Linux'],['33639','Brazil','South America','South America','< 20','Male','15000','Ubuntu'],['33676','Brazil','South America','South America','35-39','Male','35000','Mac OS X'],['33705','Brazil','South America','South America','30-34','Male','25000','Windows 7'],['33756','Brazil','South America','South America','20-24','Male','5000','Mac OS X'],['33903','Brazil','South America','South America','25-29','Male','45000','Mint'],['34111','Brazil','South America','South America','20-24','Male','15000','Mac OS X'],['35188','Brazil','South America','South America','35-39','Male','5000','Mac OS X'],['35424','Brazil','South America','South America','25-29','Male','75000','Mac OS X'],['35427','Brazil','South America','South America','35-39','Male','5000','Ubuntu'],['35521','Brazil','South America','South America','20-24','Male','15000','Windows 10'],['35525','Brazil','South America','South America','20-24','Male','35000','Mac OS X'],['35530','Brazil','South America','South America','20-24','Male','15000','Windows 10'],['35540','Brazil','South America','South America','20-24','Male','5000','Windows 10'],['35621','Brazil','South America','South America','30-34','Male','65000','Windows 10'],['35624','Brazil','South America','South America','20-24','Male','5000','Fedora'],['35634','Brazil','South America','South America','30-34','Male','25000','Ubuntu'],['35649','Brazil','South America','South America','25-29','Male','25000','Windows 10'],['35690','Brazil','South America','South America','20-24','Male','25000','Fedora'],['35753','Brazil','South America','South America','30-34','Male','15000','Windows 10'],['35947','Brazil','South America','South America','30-34','Male','45000','Mac OS X'],['35994','Brazil','South America','South America','25-29','Male','15000','Windows 8'],['36158','Brazil','South America','South America','25-29','Male','5000','Ubuntu'],['36159','Brazil','South America','South America','25-29','Male','25000','Mac OS X'],['36194','Brazil','South America','South America','25-29','Male','45000','Mac OS X'],['36233','Brazil','South America','South America','20-24','Male','5000','Windows 7'],['36235','Brazil','South America','South America','25-29','Male','15000','Windows 8'],['36368','Brazil','South America','South America','20-24','Male','15000','Mac OS X'],['36441','Brazil','South America','South America','25-29','Male','15000','Mac OS X'],['36455','Brazil','South America','South America','30-34','Male','25000','Mac OS X'],['37222','Brazil','South America','South America','25-29','Female','5000','Windows 8'],['37227','Brazil','South America','South America','30-34','Male','45000','Mac OS X'],['37269','Brazil','South America','South America','50-59','Male','15000','Mac OS X'],['37406','Brazil','South America','South America','25-29','Male','15000','Windows 8'],['37641','Brazil','South America','South America','30-34','Male','15000','Mac OS X'],['37789','Brazil','South America','South America','30-34','Male','25000','Windows 7'],['38325','Brazil','South America','South America','30-34','Male','45000','Mac OS X'],['38368','Brazil','South America','South America','25-29','Male','55000','Mac OS X'],['38560','Brazil','South America','South America','25-29','Male','15000','Mint'],['38730','Brazil','South America','South America','20-24','Male','15000','Windows 10'],['38783','Brazil','South America','South America','30-34','Male','25000','Windows 10'],['38784','Brazil','South America','South America','30-34','Male','15000','Ubuntu'],['38960','Brazil','South America','South America','20-24','Male','5000','Windows 10'],['39102','Brazil','South America','South America','40-49','Male','35000','Mac OS X'],['39178','Brazil','South America','South America','25-29','Male','15000','Windows 10'],['40924','Brazil','South America','South America','20-24','Male','5000','Windows 10'],['41181','Brazil','South America','South America','30-34','Male','35000','Mac OS X'],['41290','Brazil','South America','South America','30-34','Male','15000','Windows 10'],['41562','Brazil','South America','South America','25-29','Male','15000','Ubuntu'],['41715','Brazil','South America','South America','20-24','Male','25000','Windows 10'],['41726','Brazil','South America','South America','20-24','Male','25000','Windows 10'],['41772','Brazil','South America','South America','25-29','Male','25000','Mac OS X'],['41857','Brazil','South America','South America','20-24','Male','5000','Mint'],['41864','Brazil','South America','South America','30-34','Male','35000','Mac OS X'],['41877','Brazil','South America','South America','20-24','Male','15000','Windows 10'],['41991','Brazil','South America','South America','25-29','Male','25000','Windows 10'],['42143','Brazil','South America','South America','25-29','Male','15000','Windows 7'],['42363','Brazil','South America','South America','20-24','Male','5000','Windows 8'],['42373','Brazil','South America','South America','20-24','Male','55000','Mac OS X'],['42457','Brazil','South America','South America','20-24','Male','25000','Windows 10'],['42477','Brazil','South America','South America','25-29','Male','5000','Mac OS X'],['42524','Brazil','South America','South America','25-29','Male','55000','Windows 7'],['42858','Brazil','South America','South America','25-29','Male','5000','Ubuntu'],['43029','Brazil','South America','South America','20-24','Male','15000','Ubuntu'],['44608','Brazil','South America','South America','20-24','Male','25000','Mac OS X'],['44727','Brazil','South America','South America','< 20','Male','5000','Mac OS X'],['45254','Brazil','South America','South America','20-24','Male','25000','Windows 7'],['45528','Brazil','South America','South America','20-24','Male','5000','Ubuntu'],['45572','Brazil','South America','South America','25-29','Male','15000','Mac OS X'],['45610','Brazil','South America','South America','25-29','Male','25000','Windows 7'],['45855','Brazil','South America','South America','20-24','Male','15000','Windows 8'],['46035','Brazil','South America','South America','20-24','Male','15000','Windows 8'],['46091','Brazil','South America','South America','35-39','Male','35000','Mint'],['46104','Brazil','South America','South America','20-24','Male','5000','Debian'],['46124','Brazil','South America','South America','35-39','Male','35000','Windows 10'],['46153','Brazil','South America','South America','25-29','Male','5000','Windows 10'],['46288','Brazil','South America','South America','20-24','Male','15000','Other Linux'],['46290','Brazil','South America','South America','30-34','Male','25000','Ubuntu'],['46363','Brazil','South America','South America','30-34','Male','25000','Mac OS X'],['46366','Brazil','South America','South America','40-49','Male','25000','Windows 8'],['46419','Brazil','South America','South America','30-34','Male','5000','Windows 7'],['46474','Brazil','South America','South America','30-34','Male','35000','Mac OS X'],['46582','Brazil','South America','South America','40-49','Male','55000','Ubuntu'],['46667','Brazil','South America','South America','25-29','Male','25000','Ubuntu'],['46751','Brazil','South America','South America','25-29','Male','15000','Windows 10'],['47210','Brazil','South America','South America','35-39','Male','25000','Windows 8'],['47751','Brazil','South America','South America','50-59','Male','15000','Ubuntu'],['47811','Brazil','South America','South America','20-24','Male','15000','Mac OS X'],['47860','Brazil','South America','South America','< 20','Male','15000','Windows 10'],['47870','Brazil','South America','South America','20-24','Male','15000','Windows 10'],['47896','Brazil','South America','South America','20-24','Male','15000','Mac OS X'],['47903','Brazil','South America','South America','20-24','Male','15000','Mac OS X'],['47932','Brazil','South America','South America','30-34','Male','15000','Ubuntu'],['47969','Brazil','South America','South America','20-24','Male','15000','Windows 10'],['48022','Brazil','South America','South America','25-29','Male','25000','Fedora'],['48069','Brazil','South America','South America','50-59','Male','25000','Debian'],['48081','Brazil','South America','South America','> 60','Male','15000','Windows 10'],['48089','Brazil','South America','South America','< 20','Male','5000','Ubuntu'],['48106','Brazil','South America','South America','25-29','Male','15000','Ubuntu'],['48108','Brazil','South America','South America','< 20','Female','15000','Ubuntu'],['48115','Brazil','South America','South America','30-34','Male','45000','Mac OS X'],['48119','Brazil','South America','South America','25-29','Male','25000','Mac OS X'],['48125','Brazil','South America','South America','25-29','Male','5000','Fedora'],['48127','Brazil','South America','South America','20-24','Male','5000','Windows 10'],['48216','Brazil','South America','South America','25-29','Male','5000','Mac OS X'],['48235','Brazil','South America','South America','30-34','Male','65000','Windows 7'],['48251','Brazil','South America','South America','30-34','Female','15000','Mac OS X'],['48329','Brazil','South America','South America','20-24','Male','15000','Windows 7'],['48359','Brazil','South America','South America','40-49','Male','15000','Debian'],['48368','Brazil','South America','South America','30-34','Male','55000','Mac OS X'],['48425','Brazil','South America','South America','40-49','Male','15000','Ubuntu'],['48436','Brazil','South America','South America','20-24','Male','75000','Windows 8'],['48439','Brazil','South America','South America','25-29','Male','5000','Mac OS X'],['48504','Brazil','South America','South America','35-39','Male','65000','Windows 10'],['48591','Brazil','South America','South America','20-24','Male','5000','Ubuntu'],['48672','Brazil','South America','South America','30-34','Male','25000','Windows 10'],['48691','Brazil','South America','South America','25-29','Male','5000','Windows 7'],['48692','Brazil','South America','South America','20-24','Female','5000','Ubuntu'],['48807','Brazil','South America','South America','25-29','Male','25000','Mac OS X'],['48821','Brazil','South America','South America','30-34','Male','25000','Mint'],['48833','Brazil','South America','South America','25-29','Male','15000','Mac OS X'],['48841','Brazil','South America','South America','20-24','Male','15000','Windows 8'],['48963','Brazil','South America','South America','30-34','Male','15000','Ubuntu'],['49148','Brazil','South America','South America','40-49','Male','55000','Fedora'],['49226','Brazil','South America','South America','30-34','Male','15000','Mac OS X'],['49413','Brazil','South America','South America','20-24','Male','5000','Mac OS X'],['49459','Brazil','South America','South America','20-24','Male','15000','Windows 7'],['49461','Brazil','South America','South America','20-24','Male','5000','Mac OS X'],['49538','Brazil','South America','South America','< 20','Male','25000','Mac OS X'],['49556','Brazil','South America','South America','25-29','Male','5000','Other Linux'],['49576','Brazil','South America','South America','25-29','Male','25000','Debian'],['49583','Brazil','South America','South America','35-39','Male','5000','Windows 7'],['49625','Brazil','South America','South America','25-29','Male','25000','Windows 7'],['49703','Brazil','South America','South America','20-24','Male','15000','Windows 10'],['49739','Brazil','South America','South America','20-24','Male','65000','Windows 7'],['49769','Brazil','South America','South America','20-24','Male','15000','Windows 8'],['49772','Brazil','South America','South America','30-34','Male','35000','Windows 10'],['49792','Brazil','South America','South America','25-29','Male','15000','Mac OS X'],['49796','Brazil','South America','South America','20-24','Male','5000','Windows 7'],['49891','Brazil','South America','South America','20-24','Male','15000','Ubuntu'],['49919','Brazil','South America','South America','25-29','Male','15000','Ubuntu'],['49930','Brazil','South America','South America','20-24','Male','5000','Ubuntu'],['49942','Brazil','South America','South America','25-29','Male','5000','Windows 10'],['50004','Brazil','South America','South America','25-29','Male','15000','Other Linux'],['50234','Brazil','South America','South America','20-24','Male','5000','Windows 10'],['50240','Brazil','South America','South America','20-24','Male','5000','Windows 7'],['50247','Brazil','South America','South America','25-29','Male','35000','Windows 10'],['50352','Brazil','South America','South America','30-34','Male','15000','Windows 10'],['50353','Brazil','South America','South America','20-24','Male','25000','Mac OS X'],['50425','Brazil','South America','South America','30-34','Male','155000','Mac OS X'],['50448','Brazil','South America','South America','25-29','Male','45000','Other Linux'],['50462','Brazil','South America','South America','25-29','Male','5000','Mac OS X'],['50509','Brazil','South America','South America','30-34','Male','15000','Windows 10'],['50511','Brazil','South America','South America','40-49','Male','55000','Windows 10'],['50528','Brazil','South America','South America','20-24','Male','15000','Windows 10'],['50533','Brazil','South America','South America','< 20','Male','5000','Mac OS X'],['50542','Brazil','South America','South America','35-39','Male','25000','Mint'],['50594','Brazil','South America','South America','35-39','Male','35000','Mac OS X'],['50696','Brazil','South America','South America','25-29','Male','15000','Ubuntu'],['50704','Brazil','South America','South America','25-29','Male','15000','Mac OS X'],['50859','Brazil','South America','South America','30-34','Male','35000','Mac OS X'],['51219','Brazil','South America','South America','30-34','Male','135000','Windows 10'],['51223','Brazil','South America','South America','25-29','Male','25000','Mac OS X'],['51271','Brazil','South America','South America','30-34','Other','25000','Ubuntu'],['51340','Brazil','South America','South America','25-29','Male','35000','Mac OS X'],['51374','Brazil','South America','South America','35-39','Male','45000','Ubuntu'],['51417','Brazil','South America','South America','25-29','Male','15000','Ubuntu'],['51496','Brazil','South America','South America','25-29','Male','25000','Windows 8'],['51506','Brazil','South America','South America','35-39','Male','135000','Mac OS X'],['51524','Brazil','South America','South America','40-49','Male','15000','Ubuntu'],['51675','Brazil','South America','South America','25-29','Male','5000','Windows 10'],['51684','Brazil','South America','South America','50-59','Male','55000','Windows 10'],['51730','Brazil','South America','South America','20-24','Male','5000','Other Linux'],['51869','Brazil','South America','South America','30-34','Male','115000','Mac OS X'],['51924','Brazil','South America','South America','20-24','Male','5000','Mint'],['51986','Brazil','South America','South America','25-29','Male','5000','Fedora'],['52044','Brazil','South America','South America','25-29','Male','15000','Ubuntu'],['52125','Brazil','South America','South America','25-29','Male','15000','Other Linux'],['52204','Brazil','South America','South America','35-39','Male','25000','Mac OS X'],['52323','Brazil','South America','South America','30-34','Male','25000','Ubuntu'],['52618','Brazil','South America','South America','20-24','Male','25000','Mint'],['52965','Brazil','South America','South America','20-24','Male','5000','Mac OS X'],['53044','Brazil','South America','South America','25-29','Male','25000','Windows 8'],['53155','Brazil','South America','South America','25-29','Male','15000','Mac OS X'],['435','Bulgaria','Eastern Europe','Eastern Europe','35-39','Male','195000','Windows 8'],['2715','Bulgaria','Eastern Europe','Eastern Europe','40-49','Male','15000','Windows XP'],['2943','Bulgaria','Eastern Europe','Eastern Europe','< 20','Male','45000','Ubuntu'],['4480','Bulgaria','Eastern Europe','Eastern Europe','20-24','Male','5000','Windows 10'],['5223','Bulgaria','Eastern Europe','Eastern Europe','20-24','Male','35000','Mac OS X'],['23372','Bulgaria','Eastern Europe','Eastern Europe','30-34','Male','15000','Windows 10'],['27514','Bulgaria','Eastern Europe','Eastern Europe','20-24','Male','5000','Ubuntu'],['27549','Bulgaria','Eastern Europe','Eastern Europe','25-29','Male','85000','Mac OS X'],['29082','Bulgaria','Eastern Europe','Eastern Europe','25-29','Male','15000','Windows 7'],['29407','Bulgaria','Eastern Europe','Eastern Europe','20-24','Male','5000','Windows 10'],['31695','Bulgaria','Eastern Europe','Eastern Europe','20-24','Male','25000','Windows 7'],['31901','Bulgaria','Eastern Europe','Eastern Europe','30-34','Male','15000','Fedora'],['40145','Bulgaria','Eastern Europe','Eastern Europe','30-34','Male','35000','Ubuntu'],['50811','Bulgaria','Eastern Europe','Eastern Europe','30-34','Male','5000','Windows 8'],['50981','Bulgaria','Eastern Europe','Eastern Europe','20-24','Male','15000','Windows 8'],['51204','Bulgaria','Eastern Europe','Eastern Europe','20-24','Male','15000','Mac OS X'],['51738','Bulgaria','Eastern Europe','Eastern Europe','20-24','Male','25000','Debian'],['52207','Bulgaria','Eastern Europe','Eastern Europe','35-39','Male','5000','Windows 7'],['52494','Bulgaria','Eastern Europe','Eastern Europe','25-29','Male','15000','Mint'],['52776','Bulgaria','Eastern Europe','Eastern Europe','25-29','Male','15000','Windows 10'],['52876','Bulgaria','Eastern Europe','Eastern Europe','20-24','Male','15000','Windows 10'],['52993','Bulgaria','Eastern Europe','Eastern Europe','< 20','Male','5000','Ubuntu'],['37713','Cambodia','South-Eastern Asia','Southeast Asia','25-29','Female','5000','Ubuntu'],['51555','Cambodia','South-Eastern Asia','Southeast Asia','20-24','Male','5000','Mac OS X'],['1357','Canada','North America','North America','40-49','Male','85000','Windows 7'],['2237','Canada','North America','North America','50-59','Male','65000','Windows 7'],['2537','Canada','North America','North America','50-59','Male','75000','Windows 8'],['2725','Canada','North America','North America','40-49','Male','105000','Windows 10'],['17980','Canada','North America','North America','30-34','Male','125000','Mac OS X'],['22430','Canada','North America','North America','30-34','Male','75000','Mac OS X'],['25045','Canada','North America','North America','35-39','Male','65000','Ubuntu'],['26563','Canada','North America','North America','25-29','Male','45000','Mac OS X'],['26601','Canada','North America','North America','35-39','Male','35000','Windows 8'],['26811','Canada','North America','North America','30-34','Male','25000','Windows 10'],['27562','Canada','North America','North America','25-29','Male','55000','Windows 10'],['27783','Canada','North America','North America','< 20','Male','5000','Windows 8'],['27962','Canada','North America','North America','20-24','Male','5000','Mac OS X'],['28785','Canada','North America','North America','25-29','Male','35000','Windows 10'],['30679','Canada','North America','North America','30-34','Male','5000','Windows 8'],['31058','Canada','North America','North America','20-24','Male','35000','Windows 10'],['31364','Canada','North America','North America','20-24','Male','35000','Windows 10'],['31831','Canada','North America','North America','20-24','Male','75000','Windows 10'],['31884','Canada','North America','North America','40-49','Male','115000','Windows 10'],['31899','Canada','North America','North America','20-24','Male','35000','Windows 10'],['35243','Canada','North America','North America','35-39','Male','65000','Windows 7'],['35372','Canada','North America','North America','< 20','Male','5000','Windows 10'],['35412','Canada','North America','North America','25-29','Other','35000','Other Linux'],['35426','Canada','North America','North America','30-34','Male','75000','Windows 10'],['35506','Canada','North America','North America','25-29','Male','45000','Mac OS X'],['36375','Canada','North America','North America','25-29','Male','55000','Mac OS X'],['36423','Canada','North America','North America','30-34','Male','95000','Mac OS X'],['36647','Canada','North America','North America','25-29','Male','45000','Windows 10'],['37159','Canada','North America','North America','30-34','Male','155000','Mac OS X'],['41219','Canada','North America','North America','30-34','Male','45000','Windows 10'],['44014','Canada','North America','North America','25-29','Male','75000','Windows 7'],['47962','Canada','North America','North America','20-24','Male','45000','Windows 7'],['48169','Canada','North America','North America','25-29','Male','65000','Windows 8'],['48573','Canada','North America','North America','40-49','Male','75000','Mac OS X'],['49357','Canada','North America','North America','30-34','Male','5000','Windows 10'],['49407','Canada','North America','North America','30-34','Male','35000','Mac OS X'],['49417','Canada','North America','North America','30-34','Male','35000','Windows 10'],['49561','Canada','North America','North America','25-29','Male','35000','Windows 10'],['49573','Canada','North America','North America','40-49','Male','125000','Mac OS X'],['49593','Canada','North America','North America','40-49','Male','65000','Ubuntu'],['49742','Canada','North America','North America','30-34','Male','75000','Mac OS X'],['50263','Canada','North America','North America','25-29','Male','35000','Windows 8'],['50303','Canada','North America','North America','35-39','Male','5000','Mac OS X'],['50338','Canada','North America','North America','40-49','Male','105000','Windows 8'],['50363','Canada','North America','North America','30-34','Male','55000','Windows 7'],['50391','Canada','North America','North America','20-24','Male','15000','Windows 8'],['51349','Canada','North America','North America','< 20','Male','5000','Windows 10'],['51440','Canada','North America','North America','30-34','Male','55000','Mac OS X'],['51460','Canada','North America','North America','40-49','Male','85000','Ubuntu'],['51736','Canada','North America','North America','< 20','Male','5000','Windows 10'],['52012','Canada','North America','North America','30-34','Male','5000','Mac OS X'],['52439','Canada','North America','North America','25-29','Male','55000','Mac OS X'],['52541','Canada','North America','North America','20-24','Male','45000','Mac OS X'],['52871','Canada','North America','North America','20-24','Male','5000','Ubuntu'],['52937','Canada','North America','North America','25-29','Male','75000','Mac OS X'],['53042','Canada','North America','North America','25-29','Male','35000','Windows 10'],['1247','Chile','South America','South America','30-34','Male','95000','Windows 7'],['28980','Chile','South America','South America','30-34','Male','35000','Windows 8'],['29027','Chile','South America','South America','25-29','Male','35000','Windows 7'],['48530','Chile','South America','South America','25-29','Male','35000','Mac OS X'],['49702','Chile','South America','South America','25-29','Male','25000','Ubuntu'],['51493','Chile','South America','South America','30-34','Male','25000','Ubuntu'],['1461','China','Eastern Asia','East Asia','40-49','Male','15000','Windows 7'],['16631','China','Eastern Asia','East Asia','20-24','Male','35000','Mac OS X'],['16754','China','Eastern Asia','East Asia','25-29','Male','35000','Mac OS X'],['30951','China','Eastern Asia','East Asia','20-24','Male','55000','Mac OS X'],['33338','China','Eastern Asia','East Asia','25-29','Male','55000','Windows 7'],['35488','China','Eastern Asia','East Asia','30-34','Male','45000','Mac OS X'],['38821','China','Eastern Asia','East Asia','30-34','Male','65000','Windows 8'],['40210','China','Eastern Asia','East Asia','30-34','Male','25000','Windows 7'],['47875','China','Eastern Asia','East Asia','25-29','Male','25000','Windows 7'],['49365','China','Eastern Asia','East Asia','20-24','Male','210000','Fedora'],['49506','China','Eastern Asia','East Asia','30-34','Male','55000','Windows 7'],['49514','China','Eastern Asia','East Asia','35-39','Male','55000','Windows 10'],['50500','China','Eastern Asia','East Asia','20-24','Male','25000','Ubuntu'],['51107','China','Eastern Asia','East Asia','30-34','Male','105000','Windows 10'],['4094','Colombia','South America','South America','20-24','Male','5000','Windows 7'],['7827','Colombia','South America','South America','30-34','Male','15000','Windows 8'],['8393','Colombia','South America','South America','30-34','Male','25000','Mac OS X'],['9246','Colombia','South America','South America','30-34','Male','55000','Windows 8'],['28297','Colombia','South America','South America','25-29','Male','15000','Mint'],['28713','Colombia','South America','South America','25-29','Male','15000','Mac OS X'],['32466','Colombia','South America','South America','40-49','Male','105000','Mac OS X'],['27848','Costa Rica','Central America','Central America','30-34','Male','45000','Mac OS X'],['27920','Costa Rica','Central America','Central America','30-34','Female','25000','Mint'],['28657','Costa Rica','Central America','Central America','30-34','Male','35000','Windows 10'],['28693','Costa Rica','Central America','Central America','25-29','Male','25000','Windows 7'],['28701','Costa Rica','Central America','Central America','25-29','Male','25000','Windows 7'],['28733','Costa Rica','Central America','Central America','25-29','Male','35000','Windows 8'],['53109','Costa Rica','Central America','Central America','25-29','Male','35000','Windows 7'],['53120','Costa Rica','Central America','Central America','20-24','Male','15000','Windows 10'],['15161','Croatia','Southern Europe','Eastern Europe','25-29','Male','15000','Ubuntu'],['18209','Croatia','Southern Europe','Eastern Europe','25-29','Male','25000','Ubuntu'],['20518','Croatia','Southern Europe','Eastern Europe','30-34','Female','15000','Windows 8'],['20542','Croatia','Southern Europe','Eastern Europe','30-34','Male','25000','Debian'],['28933','Croatia','Southern Europe','Eastern Europe','30-34','Male','15000','Ubuntu'],['31112','Croatia','Southern Europe','Eastern Europe','25-29','Male','15000','Windows 10'],['31611','Croatia','Southern Europe','Eastern Europe','25-29','Male','15000','Windows 10'],['31627','Croatia','Southern Europe','Eastern Europe','20-24','Male','15000','Windows 7'],['31721','Croatia','Southern Europe','Eastern Europe','20-24','Male','5000','Windows 10'],['52973','Croatia','Southern Europe','Eastern Europe','< 20','Male','15000','Mac OS X'],['53063','Croatia','Southern Europe','Eastern Europe','20-24','Male','5000','Windows 8'],['53122','Croatia','Southern Europe','Eastern Europe','20-24','Male','5000','Windows 7'],['23013','Cyprus','Western Asia','Middle East','25-29','Female','5000','Windows 10'],['31732','Cyprus','Western Asia','Middle East','25-29','Male','5000','Windows 10'],['50763','Cyprus','Western Asia','Middle East','35-39','Male','35000','Windows 10'],['224','Czech Republic','Eastern Europe','Eastern Europe','35-39','Male','25000','Windows 10'],['1231','Czech Republic','Eastern Europe','Eastern Europe','< 20','Male','5000','Windows 8'],['2708','Czech Republic','Eastern Europe','Eastern Europe','< 20','Male','5000','Windows 10'],['3924','Czech Republic','Eastern Europe','Eastern Europe','30-34','Male','25000','Mac OS X'],['25143','Czech Republic','Eastern Europe','Eastern Europe','20-24','Male','25000','Fedora'],['27121','Czech Republic','Eastern Europe','Eastern Europe','20-24','Male','5000','Windows 7'],['27817','Czech Republic','Eastern Europe','Eastern Europe','20-24','Male','65000','Windows 10'],['28402','Czech Republic','Eastern Europe','Eastern Europe','< 20','Male','5000','Windows 10'],['28522','Czech Republic','Eastern Europe','Eastern Europe','< 20','Male','5000','Ubuntu'],['29051','Czech Republic','Eastern Europe','Eastern Europe','20-24','Male','25000','Mac OS X'],['30224','Czech Republic','Eastern Europe','Eastern Europe','25-29','Male','25000','Windows 7'],['31375','Czech Republic','Eastern Europe','Eastern Europe','30-34','Male','45000','Mac OS X'],['31581','Czech Republic','Eastern Europe','Eastern Europe','20-24','Male','5000','Ubuntu'],['31841','Czech Republic','Eastern Europe','Eastern Europe','30-34','Male','5000','Windows 7'],['49854','Czech Republic','Eastern Europe','Eastern Europe','< 20','Male','5000','Windows 7'],['50657','Czech Republic','Eastern Europe','Eastern Europe','20-24','Male','25000','Windows 10'],['50784','Czech Republic','Eastern Europe','Eastern Europe','30-34','Male','35000','Mac OS X'],['51121','Czech Republic','Eastern Europe','Eastern Europe','25-29','Female','15000','Windows 7'],['51343','Czech Republic','Eastern Europe','Eastern Europe','20-24','Male','35000','Debian'],['51602','Czech Republic','Eastern Europe','Eastern Europe','20-24','Male','15000','Ubuntu'],['52209','Czech Republic','Eastern Europe','Eastern Europe','25-29','Male','15000','Windows 8'],['52708','Czech Republic','Eastern Europe','Eastern Europe','< 20','Male','5000','Windows 10'],['326','Denmark','Northern Europe','Western Europe','20-24','Male','210000','Mac OS X'],['1230','Denmark','Northern Europe','Western Europe','25-29','Male','45000','Windows 10'],['1370','Denmark','Northern Europe','Western Europe','40-49','Male','65000','Windows 10'],['1561','Denmark','Northern Europe','Western Europe','< 20','Male','5000','Windows 10'],['1917','Denmark','Northern Europe','Western Europe','20-24','Male','35000','Windows 10'],['2014','Denmark','Northern Europe','Western Europe','50-59','Male','115000','Windows 10'],['2038','Denmark','Northern Europe','Western Europe','35-39','Male','35000','Windows 10'],['2074','Denmark','Northern Europe','Western Europe','40-49','Male','95000','Mac OS X'],['2175','Denmark','Northern Europe','Western Europe','25-29','Male','15000','Mac OS X'],['2218','Denmark','Northern Europe','Western Europe','30-34','Male','75000','Mac OS X'],['2604','Denmark','Northern Europe','Western Europe','35-39','Male','95000','Windows 10'],['2654','Denmark','Northern Europe','Western Europe','20-24','Male','55000','Other Linux'],['2707','Denmark','Northern Europe','Western Europe','40-49','Male','145000','Windows 7'],['2960','Denmark','Northern Europe','Western Europe','20-24','Male','5000','Windows 7'],['2993','Denmark','Northern Europe','Western Europe','40-49','Male','85000','Windows 10'],['3539','Denmark','Northern Europe','Western Europe','30-34','Male','65000','Windows 10'],['3627','Denmark','Northern Europe','Western Europe','25-29','Male','105000','Mac OS X'],['3804','Denmark','Northern Europe','Western Europe','30-34','Male','75000','Mac OS X'],['3833','Denmark','Northern Europe','Western Europe','25-29','Male','35000','Mac OS X'],['4206','Denmark','Northern Europe','Western Europe','25-29','Male','95000','Mac OS X'],['4647','Denmark','Northern Europe','Western Europe','30-34','Male','95000','Windows 10'],['4913','Denmark','Northern Europe','Western Europe','< 20','Prefer not to disclose','5000','Ubuntu'],['5178','Denmark','Northern Europe','Western Europe','35-39','Male','95000','Mac OS X'],['5655','Denmark','Northern Europe','Western Europe','20-24','Male','5000','Windows 8'],['6999','Denmark','Northern Europe','Western Europe','25-29','Male','65000','Mac OS X'],['7073','Denmark','Northern Europe','Western Europe','25-29','Male','85000','Mac OS X'],['7680','Denmark','Northern Europe','Western Europe','30-34','Male','45000','Mac OS X'],['8212','Denmark','Northern Europe','Western Europe','30-34','Male','55000','Mac OS X'],['9338','Denmark','Northern Europe','Western Europe','20-24','Male','45000','Mac OS X'],['9754','Denmark','Northern Europe','Western Europe','35-39','Male','75000','Windows 10'],['10218','Denmark','Northern Europe','Western Europe','20-24','Male','5000','Windows 7'],['11038','Denmark','Northern Europe','Western Europe','25-29','Male','55000','Windows 7'],['11124','Denmark','Northern Europe','Western Europe','< 20','Male','5000','Windows 10'],['12031','Denmark','Northern Europe','Western Europe','30-34','Male','85000','Windows 8'],['14344','Denmark','Northern Europe','Western Europe','20-24','Male','5000','Windows 10'],['14347','Denmark','Northern Europe','Western Europe','40-49','Male','85000','Ubuntu'],['14404','Denmark','Northern Europe','Western Europe','20-24','Female','15000','Windows 10'],['14569','Denmark','Northern Europe','Western Europe','25-29','Male','75000','Ubuntu'],['14606','Denmark','Northern Europe','Western Europe','20-24','Male','5000','Windows 10'],['15056','Denmark','Northern Europe','Western Europe','30-34','Male','55000','Mac OS X'],['15182','Denmark','Northern Europe','Western Europe','25-29','Male','105000','Mac OS X'],['15363','Denmark','Northern Europe','Western Europe','30-34','Male','35000','Windows 10'],['15675','Denmark','Northern Europe','Western Europe','< 20','Male','5000','Windows 7'],['15696','Denmark','Northern Europe','Western Europe','40-49','Male','75000','Ubuntu'],['15853','Denmark','Northern Europe','Western Europe','30-34','Male','95000','Windows 10'],['15968','Denmark','Northern Europe','Western Europe','20-24','Male','25000','Mac OS X'],['16909','Denmark','Northern Europe','Western Europe','50-59','Male','105000','Windows 10'],['17035','Denmark','Northern Europe','Western Europe','35-39','Male','135000','Windows 10'],['17051','Denmark','Northern Europe','Western Europe','30-34','Male','75000','Mac OS X'],['17113','Denmark','Northern Europe','Western Europe','25-29','Male','55000','Windows 10'],['17627','Denmark','Northern Europe','Western Europe','40-49','Male','105000','Windows 10'],['18181','Denmark','Northern Europe','Western Europe','25-29','Male','15000','Windows 10'],['18342','Denmark','Northern Europe','Western Europe','30-34','Male','185000','Mac OS X'],['18609','Denmark','Northern Europe','Western Europe','35-39','Male','95000','Windows 7'],['18816','Denmark','Northern Europe','Western Europe','50-59','Male','95000','Windows 7'],['19718','Denmark','Northern Europe','Western Europe','20-24','Male','65000','Windows 10'],['19917','Denmark','Northern Europe','Western Europe','50-59','Male','95000','Mac OS X'],['20259','Denmark','Northern Europe','Western Europe','35-39','Male','75000','Mac OS X'],['21022','Denmark','Northern Europe','Western Europe','25-29','Male','55000','Mac OS X'],['21077','Denmark','Northern Europe','Western Europe','25-29','Male','65000','Mac OS X'],['21243','Denmark','Northern Europe','Western Europe','40-49','Male','95000','Mac OS X'],['21479','Denmark','Northern Europe','Western Europe','35-39','Male','105000','Mac OS X'],['21704','Denmark','Northern Europe','Western Europe','25-29','Male','85000','Windows 7'],['21805','Denmark','Northern Europe','Western Europe','50-59','Male','85000','Mac OS X'],['22563','Denmark','Northern Europe','Western Europe','20-24','Female','5000','Windows XP'],['22592','Denmark','Northern Europe','Western Europe','35-39','Male','115000','Mac OS X'],['22981','Denmark','Northern Europe','Western Europe','30-34','Female','15000','Windows 8'],['23691','Denmark','Northern Europe','Western Europe','30-34','Male','105000','Mac OS X'],['23716','Denmark','Northern Europe','Western Europe','25-29','Male','55000','Mac OS X'],['24038','Denmark','Northern Europe','Western Europe','20-24','Male','15000','Fedora'],['24574','Denmark','Northern Europe','Western Europe','40-49','Male','75000','Windows 10'],['24584','Denmark','Northern Europe','Western Europe','25-29','Male','5000','Windows 10'],['25499','Denmark','Northern Europe','Western Europe','25-29','Male','55000','Mac OS X'],['25659','Denmark','Northern Europe','Western Europe','20-24','Male','45000','Windows 10'],['26286','Denmark','Northern Europe','Western Europe','30-34','Male','55000','Windows 8'],['26355','Denmark','Northern Europe','Western Europe','40-49','Male','95000','Windows 10'],['27150','Denmark','Northern Europe','Western Europe','30-34','Male','65000','Mac OS X'],['27169','Denmark','Northern Europe','Western Europe','35-39','Male','75000','Mac OS X'],['27247','Denmark','Northern Europe','Western Europe','25-29','Male','55000','Mac OS X'],['28010','Denmark','Northern Europe','Western Europe','20-24','Male','105000','Windows 7'],['28113','Denmark','Northern Europe','Western Europe','30-34','Male','115000','Windows 10'],['28286','Denmark','Northern Europe','Western Europe','50-59','Male','95000','Ubuntu'],['28424','Denmark','Northern Europe','Western Europe','20-24','Male','25000','Mac OS X'],['29239','Denmark','Northern Europe','Western Europe','30-34','Male','105000','Mac OS X'],['29287','Denmark','Northern Europe','Western Europe','40-49','Male','95000','Windows 10'],['30296','Denmark','Northern Europe','Western Europe','30-34','Male','75000','Windows 8'],['30305','Denmark','Northern Europe','Western Europe','25-29','Male','5000','Windows 10'],['31096','Denmark','Northern Europe','Western Europe','20-24','Male','5000','Windows 10'],['31372','Denmark','Northern Europe','Western Europe','40-49','Male','125000','Mint'],['31376','Denmark','Northern Europe','Western Europe','30-34','Male','210000','Windows 10'],['31425','Denmark','Northern Europe','Western Europe','25-29','Female','5000','Windows 7'],['31430','Denmark','Northern Europe','Western Europe','40-49','Male','135000','Mac OS X'],['31454','Denmark','Northern Europe','Western Europe','25-29','Male','55000','Mac OS X'],['31456','Denmark','Northern Europe','Western Europe','30-34','Male','55000','Mac OS X'],['31494','Denmark','Northern Europe','Western Europe','20-24','Male','35000','Windows 10'],['31496','Denmark','Northern Europe','Western Europe','25-29','Male','55000','Mac OS X'],['31686','Denmark','Northern Europe','Western Europe','35-39','Male','45000','Windows 7'],['31690','Denmark','Northern Europe','Western Europe','25-29','Male','55000','Windows 8'],['31779','Denmark','Northern Europe','Western Europe','30-34','Male','105000','Windows 8'],['31882','Denmark','Northern Europe','Western Europe','30-34','Male','75000','Windows 8'],['31915','Denmark','Northern Europe','Western Europe','25-29','Male','25000','Mac OS X'],['31941','Denmark','Northern Europe','Western Europe','30-34','Male','45000','Mac OS X'],['32198','Denmark','Northern Europe','Western Europe','30-34','Male','55000','Mac OS X'],['34948','Denmark','Northern Europe','Western Europe','30-34','Male','55000','Windows 10'],['35167','Denmark','Northern Europe','Western Europe','25-29','Male','105000','Mac OS X'],['35591','Denmark','Northern Europe','Western Europe','25-29','Male','25000','Mac OS X'],['35964','Denmark','Northern Europe','Western Europe','30-34','Male','115000','Mac OS X'],['36057','Denmark','Northern Europe','Western Europe','35-39','Male','75000','Windows 10'],['42796','Denmark','Northern Europe','Western Europe','25-29','Male','75000','Mac OS X'],['42981','Denmark','Northern Europe','Western Europe','20-24','Male','5000','Windows 10'],['46457','Denmark','Northern Europe','Western Europe','40-49','Male','165000','Mac OS X'],['47062','Denmark','Northern Europe','Western Europe','30-34','Male','115000','Windows 7'],['47546','Denmark','Northern Europe','Western Europe','30-34','Male','85000','Windows 7'],['48222','Denmark','Northern Europe','Western Europe','30-34','Male','105000','Mac OS X'],['48225','Denmark','Northern Europe','Western Europe','40-49','Male','75000','Windows 10'],['48458','Denmark','Northern Europe','Western Europe','20-24','Male','5000','Other Linux'],['48603','Denmark','Northern Europe','Western Europe','> 60','Male','95000','Mac OS X'],['49140','Denmark','Northern Europe','Western Europe','30-34','Male','155000','Windows 7'],['49227','Denmark','Northern Europe','Western Europe','25-29','Male','75000','Mac OS X'],['49766','Denmark','Northern Europe','Western Europe','20-24','Male','5000','Mac OS X'],['51274','Denmark','Northern Europe','Western Europe','30-34','Male','45000','Windows 7'],['53060','Denmark','Northern Europe','Western Europe','20-24','Male','15000','Windows 10'],['53065','Denmark','Northern Europe','Western Europe','30-34','Male','75000','Windows 7'],['13857','Dominican Republic','Caribbean','Caribbean','30-34','Male','15000','Windows 10'],['15580','Dominican Republic','Caribbean','Caribbean','25-29','Male','85000','Mac OS X'],['17966','Dominican Republic','Caribbean','Caribbean','< 20','Male','5000','Windows 7'],['18992','Dominican Republic','Caribbean','Caribbean','30-34','Male','15000','Windows 10'],['19180','Dominican Republic','Caribbean','Caribbean','30-34','Male','5000','Mac OS X'],['19388','Dominican Republic','Caribbean','Caribbean','30-34','Male','15000','Mac OS X'],['19902','Dominican Republic','Caribbean','Caribbean','25-29','Male','25000','Windows 10'],['20123','Dominican Republic','Caribbean','Caribbean','20-24','Male','5000','Mac OS X'],['20145','Dominican Republic','Caribbean','Caribbean','20-24','Male','25000','Windows 10'],['20280','Dominican Republic','Caribbean','Caribbean','20-24','Male','5000','Mac OS X'],['20289','Dominican Republic','Caribbean','Caribbean','30-34','Male','45000','Ubuntu'],['20379','Dominican Republic','Caribbean','Caribbean','20-24','Male','15000','Windows 10'],['20584','Dominican Republic','Caribbean','Caribbean','20-24','Male','5000','Mac OS X'],['21275','Dominican Republic','Caribbean','Caribbean','20-24','Male','5000','Windows 10'],['21384','Dominican Republic','Caribbean','Caribbean','25-29','Male','15000','Windows 7'],['21403','Dominican Republic','Caribbean','Caribbean','30-34','Male','35000','Mint'],['21504','Dominican Republic','Caribbean','Caribbean','25-29','Male','15000','Ubuntu'],['22047','Dominican Republic','Caribbean','Caribbean','25-29','Male','55000','Windows 10'],['22119','Dominican Republic','Caribbean','Caribbean','20-24','Male','5000','Windows 7'],['22166','Dominican Republic','Caribbean','Caribbean','25-29','Male','15000','Ubuntu'],['22173','Dominican Republic','Caribbean','Caribbean','20-24','Male','5000','Windows 7'],['22183','Dominican Republic','Caribbean','Caribbean','25-29','Male','25000','Windows 10'],['22187','Dominican Republic','Caribbean','Caribbean','20-24','Male','5000','Windows 7'],['22195','Dominican Republic','Caribbean','Caribbean','< 20','Male','15000','Ubuntu'],['22197','Dominican Republic','Caribbean','Caribbean','25-29','Male','15000','Windows 10'],['22214','Dominican Republic','Caribbean','Caribbean','25-29','Male','15000','Mac OS X'],['22215','Dominican Republic','Caribbean','Caribbean','20-24','Male','5000','Windows 10'],['22235','Dominican Republic','Caribbean','Caribbean','35-39','Male','210000','Mac OS X'],['22246','Dominican Republic','Caribbean','Caribbean','30-34','Male','65000','Windows 10'],['22249','Dominican Republic','Caribbean','Caribbean','< 20','Male','5000','Windows 8'],['22280','Dominican Republic','Caribbean','Caribbean','25-29','Male','5000','Windows 10'],['22285','Dominican Republic','Caribbean','Caribbean','20-24','Male','15000','Ubuntu'],['22286','Dominican Republic','Caribbean','Caribbean','20-24','Male','5000','Windows 10'],['22301','Dominican Republic','Caribbean','Caribbean','< 20','Male','5000','Windows 10'],['22305','Dominican Republic','Caribbean','Caribbean','35-39','Male','15000','Mac OS X'],['22332','Dominican Republic','Caribbean','Caribbean','20-24','Male','15000','Windows 7'],['22353','Dominican Republic','Caribbean','Caribbean','< 20','Male','5000','Mac OS X'],['22375','Dominican Republic','Caribbean','Caribbean','25-29','Male','5000','Windows 10'],['22377','Dominican Republic','Caribbean','Caribbean','20-24','Male','15000','Ubuntu'],['22379','Dominican Republic','Caribbean','Caribbean','20-24','Male','5000','Windows 10'],['22383','Dominican Republic','Caribbean','Caribbean','25-29','Male','15000','Windows 10'],['22408','Dominican Republic','Caribbean','Caribbean','30-34','Male','25000','Windows 10'],['22428','Dominican Republic','Caribbean','Caribbean','25-29','Male','45000','Mac OS X'],['22439','Dominican Republic','Caribbean','Caribbean','25-29','Male','45000','Mac OS X'],['22467','Dominican Republic','Caribbean','Caribbean','25-29','Male','25000','Windows 10'],['35320','Ecuador','South America','South America','25-29','Male','45000','Other Linux'],['49477','Ecuador','South America','South America','30-34','Male','35000','Ubuntu'],['6080','Egypt','Northern Africa','Middle East','25-29','Male','5000','Windows 10'],['7481','Egypt','Northern Africa','Middle East','30-34','Male','85000','Ubuntu'],['7585','Egypt','Northern Africa','Middle East','25-29','Male','5000','Windows 7'],['7630','Egypt','Northern Africa','Middle East','25-29','Male','55000','Mac OS X'],['8370','Egypt','Northern Africa','Middle East','25-29','Male','35000','Ubuntu'],['8409','Egypt','Northern Africa','Middle East','30-34','Male','15000','Windows 10'],['8584','Egypt','Northern Africa','Middle East','25-29','Male','15000','Windows 10'],['9459','Egypt','Northern Africa','Middle East','25-29','Male','5000','Windows 8'],['9628','Egypt','Northern Africa','Middle East','20-24','Male','5000','Windows 7'],['9811','Egypt','Northern Africa','Middle East','50-59','Male','75000','Windows 8'],['9968','Egypt','Northern Africa','Middle East','30-34','Male','25000','Windows 7'],['9990','Egypt','Northern Africa','Middle East','20-24','Male','5000','Fedora'],['10021','Egypt','Northern Africa','Middle East','30-34','Male','15000','Ubuntu'],['10042','Egypt','Northern Africa','Middle East','25-29','Male','15000','Ubuntu'],['10046','Egypt','Northern Africa','Middle East','20-24','Female','5000','Windows 10'],['19883','Egypt','Northern Africa','Middle East','30-34','Male','15000','Ubuntu'],['27574','Egypt','Northern Africa','Middle East','< 20','Male','5000','Ubuntu'],['28203','Egypt','Northern Africa','Middle East','< 20','Other','5000','Ubuntu'],['28296','Egypt','Northern Africa','Middle East','20-24','Male','5000','Windows 10'],['29126','Egypt','Northern Africa','Middle East','25-29','Male','5000','Windows 10'],['29141','Egypt','Northern Africa','Middle East','30-34','Male','5000','Windows XP'],['30490','Egypt','Northern Africa','Middle East','20-24','Male','5000','Windows 8'],['50562','Egypt','Northern Africa','Middle East','30-34','Male','5000','Mac OS X'],['52247','Egypt','Northern Africa','Middle East','< 20','Male','5000','Fedora'],['2995','Estonia','Northern Europe','Eastern Europe','30-34','Male','45000','Windows 7'],['15350','Estonia','Northern Europe','Eastern Europe','25-29','Male','85000','Mac OS X'],['29140','Estonia','Northern Europe','Eastern Europe','30-34','Male','25000','Windows 7'],['1212','Finland','Northern Europe','Western Europe','30-34','Male','45000','Mac OS X'],['1965','Finland','Northern Europe','Western Europe','30-34','Female','45000','Mac OS X'],['2002','Finland','Northern Europe','Western Europe','50-59','Male','25000','Windows 7'],['2714','Finland','Northern Europe','Western Europe','35-39','Male','65000','Mac OS X'],['4204','Finland','Northern Europe','Western Europe','25-29','Male','65000','Mac OS X'],['4447','Finland','Northern Europe','Western Europe','25-29','Male','35000','Ubuntu'],['4828','Finland','Northern Europe','Western Europe','35-39','Male','75000','Windows 10'],['5193','Finland','Northern Europe','Western Europe','25-29','Male','45000','Windows 10'],['5386','Finland','Northern Europe','Western Europe','30-34','Male','35000','Mac OS X'],['5521','Finland','Northern Europe','Western Europe','25-29','Female','35000','Mac OS X'],['8324','Finland','Northern Europe','Western Europe','20-24','Male','75000','Ubuntu'],['9555','Finland','Northern Europe','Western Europe','30-34','Male','45000','Windows 10'],['10961','Finland','Northern Europe','Western Europe','35-39','Male','65000','Ubuntu'],['10980','Finland','Northern Europe','Western Europe','25-29','Male','65000','Mac OS X'],['11120','Finland','Northern Europe','Western Europe','30-34','Male','45000','Mac OS X'],['11668','Finland','Northern Europe','Western Europe','30-34','Male','35000','Windows 10'],['12342','Finland','Northern Europe','Western Europe','30-34','Male','65000','Mac OS X'],['14542','Finland','Northern Europe','Western Europe','40-49','Male','65000','Windows 7'],['15336','Finland','Northern Europe','Western Europe','30-34','Male','45000','Windows 10'],['16206','Finland','Northern Europe','Western Europe','25-29','Male','35000','Windows 7'],['17978','Finland','Northern Europe','Western Europe','25-29','Male','25000','Windows 8'],['18327','Finland','Northern Europe','Western Europe','25-29','Male','15000','Mac OS X'],['18412','Finland','Northern Europe','Western Europe','25-29','Male','55000','Mac OS X'],['18608','Finland','Northern Europe','Western Europe','25-29','Male','45000','Mac OS X'],['18772','Finland','Northern Europe','Western Europe','20-24','Female','25000','Windows 8'],['19031','Finland','Northern Europe','Western Europe','35-39','Male','45000','Fedora'],['19704','Finland','Northern Europe','Western Europe','25-29','Male','25000','Windows 10'],['20299','Finland','Northern Europe','Western Europe','20-24','Male','25000','Ubuntu'],['20467','Finland','Northern Europe','Western Europe','35-39','Male','55000','Mac OS X'],['21890','Finland','Northern Europe','Western Europe','25-29','Male','35000','Windows 10'],['21893','Finland','Northern Europe','Western Europe','25-29','Male','45000','Windows 7'],['21911','Finland','Northern Europe','Western Europe','25-29','Female','45000','Windows 7'],['23016','Finland','Northern Europe','Western Europe','25-29','Male','65000','Windows 10'],['23251','Finland','Northern Europe','Western Europe','25-29','Male','25000','Windows 10'],['23274','Finland','Northern Europe','Western Europe','35-39','Male','95000','Windows 10'],['23292','Finland','Northern Europe','Western Europe','30-34','Male','55000','Windows 7'],['25031','Finland','Northern Europe','Western Europe','30-34','Male','55000','Mac OS X'],['25505','Finland','Northern Europe','Western Europe','30-34','Male','65000','Mac OS X'],['25649','Finland','Northern Europe','Western Europe','25-29','Male','25000','Windows 10'],['25741','Finland','Northern Europe','Western Europe','30-34','Male','55000','Other Linux'],['25934','Finland','Northern Europe','Western Europe','20-24','Male','5000','Windows 10'],['26291','Finland','Northern Europe','Western Europe','20-24','Male','5000','Windows 7'],['27893','Finland','Northern Europe','Western Europe','35-39','Male','85000','Windows 7'],['28457','Finland','Northern Europe','Western Europe','25-29','Female','5000','Windows 10'],['29492','Finland','Northern Europe','Western Europe','25-29','Male','25000','Mac OS X'],['29884','Finland','Northern Europe','Western Europe','20-24','Male','15000','Windows 7'],['30228','Finland','Northern Europe','Western Europe','35-39','Female','5000','Mac OS X'],['31158','Finland','Northern Europe','Western Europe','30-34','Male','75000','Mac OS X'],['31839','Finland','Northern Europe','Western Europe','25-29','Male','45000','Windows 7'],['31995','Finland','Northern Europe','Western Europe','35-39','Male','105000','Mac OS X'],['32422','Finland','Northern Europe','Western Europe','25-29','Male','35000','Other Linux'],['34508','Finland','Northern Europe','Western Europe','35-39','Male','65000','Mac OS X'],['34509','Finland','Northern Europe','Western Europe','30-34','Male','45000','Windows 10'],['34840','Finland','Northern Europe','Western Europe','30-34','Male','35000','Ubuntu'],['35098','Finland','Northern Europe','Western Europe','50-59','Male','75000','Windows 7'],['36167','Finland','Northern Europe','Western Europe','30-34','Male','95000','Mac OS X'],['36224','Finland','Northern Europe','Western Europe','25-29','Male','15000','Mac OS X'],['36331','Finland','Northern Europe','Western Europe','20-24','Prefer not to disclose','5000','Windows 8'],['37989','Finland','Northern Europe','Western Europe','25-29','Male','25000','Ubuntu'],['38295','Finland','Northern Europe','Western Europe','25-29','Male','35000','Mac OS X'],['39480','Finland','Northern Europe','Western Europe','35-39','Male','55000','Windows 10'],['39485','Finland','Northern Europe','Western Europe','30-34','Male','55000','Windows 10'],['40818','Finland','Northern Europe','Western Europe','25-29','Male','55000','Other Linux'],['43624','Finland','Northern Europe','Western Europe','25-29','Male','35000','Windows 7'],['43657','Finland','Northern Europe','Western Europe','25-29','Male','35000','Mac OS X'],['44062','Finland','Northern Europe','Western Europe','30-34','Female','45000','Windows 8'],['45298','Finland','Northern Europe','Western Europe','30-34','Male','5000','Mac OS X'],['45316','Finland','Northern Europe','Western Europe','25-29','Male','45000','Mac OS X'],['46845','Finland','Northern Europe','Western Europe','20-24','Male','5000','Windows 7'],['48330','Finland','Northern Europe','Western Europe','25-29','Male','55000','Mac OS X'],['48351','Finland','Northern Europe','Western Europe','40-49','Male','55000','Windows 7'],['48747','Finland','Northern Europe','Western Europe','40-49','Male','105000','Fedora'],['48764','Finland','Northern Europe','Western Europe','20-24','Male','45000','Windows 7'],['48873','Finland','Northern Europe','Western Europe','25-29','Male','25000','Windows 10'],['49141','Finland','Northern Europe','Western Europe','35-39','Male','65000','Debian'],['49192','Finland','Northern Europe','Western Europe','25-29','Male','75000','Mac OS X'],['49298','Finland','Northern Europe','Western Europe','30-34','Male','75000','Other Linux'],['49384','Finland','Northern Europe','Western Europe','40-49','Male','75000','Windows 8'],['49839','Finland','Northern Europe','Western Europe','30-34','Male','65000','Mac OS X'],['49863','Finland','Northern Europe','Western Europe','30-34','Male','65000','Mac OS X'],['50553','Finland','Northern Europe','Western Europe','25-29','Male','65000','Windows 10'],['50762','Finland','Northern Europe','Western Europe','25-29','Male','55000','Ubuntu'],['50830','Finland','Northern Europe','Western Europe','20-24','Male','5000','Mac OS X'],['50858','Finland','Northern Europe','Western Europe','25-29','Male','45000','Mac OS X'],['50884','Finland','Northern Europe','Western Europe','20-24','Male','25000','Windows 10'],['51226','Finland','Northern Europe','Western Europe','25-29','Male','35000','Mac OS X'],['52031','Finland','Northern Europe','Western Europe','35-39','Male','55000','Mac OS X'],['52124','Finland','Northern Europe','Western Europe','20-24','Male','25000','Windows 10'],['52432','Finland','Northern Europe','Western Europe','35-39','Male','65000','Windows 10'],['84','France','Western Europe','Western Europe','25-29','Male','45000','Windows 7'],['260','France','Western Europe','Western Europe','30-34','Male','45000','Windows 7'],['1105','France','Western Europe','Western Europe','20-24','Male','5000','Fedora'],['1116','France','Western Europe','Western Europe','25-29','Male','5000','Mac OS X'],['1415','France','Western Europe','Western Europe','40-49','Male','105000','Windows 7'],['1421','France','Western Europe','Western Europe','40-49','Male','35000','Windows 10'],['1478','France','Western Europe','Western Europe','25-29','Male','45000','Ubuntu'],['1587','France','Western Europe','Western Europe','50-59','Male','45000','Windows 7'],['2130','France','Western Europe','Western Europe','35-39','Male','55000','Windows 7'],['2141','France','Western Europe','Western Europe','25-29','Male','55000','Mac OS X'],['2353','France','Western Europe','Western Europe','20-24','Male','5000','Debian'],['2394','France','Western Europe','Western Europe','25-29','Male','35000','Mint'],['2651','France','Western Europe','Western Europe','20-24','Male','95000','Mac OS X'],['2659','France','Western Europe','Western Europe','20-24','Male','5000','Windows 10'],['2679','France','Western Europe','Western Europe','20-24','Male','35000','Ubuntu'],...

2 实验总结

2.1 Spark应用开发步骤

1. 通过findspark找到并导入pyspark

import findspark
findspark.init()
from pyspark import SparkContext

2. 创建SparkContext对象

sc = SparkContext()

3. 读取数据源,生成RDD对象

(1)从内存读取数据源

sc.parallelize(list)

(2)从文件读取数据源

sc.textFile(r’文件路径’)

4. 对RDD进行Tranformation操作

mapRdd = rdd.map(lambda x:len(x))

5. 对RDD进行Action操作

mapRdd.collect()

2.2 字符串的split()方法列表解析式

- 以空格为分隔符

“What is your name”

split(‘ ’) —>

结果:[“What”, “is”, “your”, “name”]

[ len(x) for x in [“Spark”, “Hadoop”, “Java”] ]

结果:[5, 6, 4]

[ x for x in [“Spark”, “Hadoop”, “Java”] if len(x) > 4]

结果:[‘Spark’, ‘Hadoop’]

2.3 常用的Action操作

  1. count():返回RDD行数
  2. first():返回RDD第一行的数据
  3. take(n):以列表形式返回前n行数据
  4. collect():以列表形式返回RDD中所有的数据

2.4 常用的Transformation操作

  1. map():一对一映射,不改变RDD的行数
  2. flatMap():一对多映射,会增加RDD的函数
  3. filter(n):过滤,会减少RDD的行数

2.5 RDD间的Transformation操作

1. union:并集。不去重

实验手册 - 第2周Spark RDD

2. intersection:交集。去重

实验手册 - 第2周Spark RDD

4. subtract:差集。不去重

实验手册 - 第2周Spark RDD

重点:

实验手册 - 第2周Spark RDD