index
int64
0
731k
package
stringlengths
2
98
name
stringlengths
1
76
docstring
stringlengths
0
281k
code
stringlengths
4
8.19k
signature
stringlengths
2
42.8k
embed_func_code
listlengths
768
768
39,340
pyspark.sql.dataframe
__getattr__
Returns the :class:`Column` denoted by ``name``. .. versionadded:: 1.3.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Parameters ---------- name : str Column name to return as :class:`Column`. Returns ------- :class:`Column` Requested column. Examples -------- >>> df = spark.createDataFrame([ ... (2, "Alice"), (5, "Bob")], schema=["age", "name"]) Retrieve a column instance. >>> df.select(df.age).show() +---+ |age| +---+ | 2| | 5| +---+
def __getattr__(self, name: str) -> Column: """Returns the :class:`Column` denoted by ``name``. .. versionadded:: 1.3.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Parameters ---------- name : str Column name to return as :class:`Column`. Returns ------- :class:`Column` Requested column. Examples -------- >>> df = spark.createDataFrame([ ... (2, "Alice"), (5, "Bob")], schema=["age", "name"]) Retrieve a column instance. >>> df.select(df.age).show() +---+ |age| +---+ | 2| | 5| +---+ """ if name not in self.columns: raise AttributeError( "'%s' object has no attribute '%s'" % (self.__class__.__name__, name) ) jc = self._jdf.apply(name) return Column(jc)
(self, name: str) -> pyspark.sql.column.Column
[ 0.0863034799695015, -0.05586673319339752, 0.04927510768175125, 0.016659164801239967, 0.05511031672358513, -0.024709593504667282, 0.04787033423781395, 0.04167492687702179, -0.0070193614810705185, 0.00013535571633838117, -0.01889239437878132, 0.05719946697354317, 0.024421434849500656, 0.03041873499751091, 0.009536245837807655, 0.04354795813560486, 0.03254390507936478, 0.031535349786281586, 0.05100405961275101, 0.04664565995335579, 0.013750564306974411, -0.026132376864552498, 0.010445746593177319, 0.014434941112995148, -0.010526791214942932, 0.06008105352520943, 0.006325980182737112, 0.03490320220589638, 0.062170203775167465, -0.03609185665845871, -0.042179204523563385, -0.03330032154917717, -0.007573166396468878, -0.0061773983761668205, -0.0656641274690628, 0.03011256642639637, 0.0021015312522649765, -0.03636200353503227, 0.07665016502141953, -0.07218371331691742, 0.03738857060670853, -0.00273300358094275, 0.027807297185063362, -0.07294012606143951, 0.0007704863674007356, -0.0342908650636673, -0.025249890983104706, -0.015173347666859627, 0.007253490388393402, -0.05057182163000107, 0.024421434849500656, 0.020009007304906845, 0.028833862394094467, -0.001695182640105486, -0.03717245161533356, -0.00802791677415371, -0.0028500680346041918, 0.06660064309835434, -0.003307069418951869, 0.06278254091739655, -0.023556958884000778, -0.011058083735406399, -0.04574516788125038, -0.0121746975928545, 0.0008430888410657644, 0.016641154885292053, 0.028869882225990295, -0.0017863577231764793, -0.05222873389720917, 0.0048941923305392265, 0.010481766425073147, 0.013435391709208488, -0.00929311290383339, 0.061161648482084274, -0.02213417738676071, -0.024511484429240227, -0.04873481020331383, -0.018162991851568222, 0.03954975679516792, -0.0013766323681920767, -0.00046544356155209243, -0.025520039722323418, -0.047366056591272354, -0.06541198492050171, -0.03160738945007324, 0.0037595683243125677, 0.012714995071291924, -0.021719949319958687, -0.07924359291791916, 0.04264746233820915, -0.042179204523563385, 0.01239081658422947, -0.019144531339406967, 0.07477714121341705, -0.025826208293437958, -0.07196759432554245, 0.04358397796750069, 0.03717245161533356, 0.0423232838511467, 0.06022513285279274, 0.03335434943437576, 0.04448447376489639, 0.00288608786650002, 0.008262045681476593, -0.01285006944090128, -0.006384512409567833, -0.027807297185063362, -0.04027015343308449, -0.012922109104692936, -0.04160288721323013, 0.0068212528713047504, 0.05903647840023041, -0.01019360776990652, -0.007253490388393402, 0.002201711293309927, -0.00833858735859394, -0.00024524430045858026, -0.012165692634880543, -0.04812247306108475, 0.022422336041927338, 0.04077443107962608, 0.009959478862583637, 0.06465557217597961, -0.04531292989850044, -0.0014846917474642396, 0.05049978196620941, -0.03182350844144821, -0.07059884071350098, 0.039081498980522156, 0.027609188109636307, 0.05485817790031433, -0.037640709429979324, 0.02278253436088562, 0.048698790371418, 0.0005954525549896061, 0.052660971879959106, 0.06951824575662613, 0.036776233464479446, 0.009896444156765938, 0.048158492892980576, 0.006334985140711069, -0.031481318175792694, 0.0406663715839386, -0.011616390198469162, -0.018478166311979294, -0.001682800822891295, 0.012075643055140972, 0.01154435146600008, -0.049022968858480453, -0.011616390198469162, -0.06026115268468857, 0.019738858565688133, 0.02155786007642746, -0.04635750129818916, 0.0009460829896852374, 0.0026789738330990076, -0.01959477923810482, -0.01894642412662506, -0.018361100926995277, -0.047366056591272354, -0.0067537156865000725, 0.021197661757469177, -0.08118866384029388, 0.020927513018250465, 0.0013507431140169501, -0.0005231315735727549, 0.02260243520140648, -0.01680324412882328, -0.026132376864552498, 0.012714995071291924, 0.011796489357948303, 0.03112112171947956, 0.051652416586875916, 0.014975238591432571, -0.032579924911260605, 0.0706348568201065, 0.005664116237312555, 0.05402972549200058, 0.06209816411137581, -0.0736965462565422, 0.016046827659010887, -0.03731653094291687, -0.06530392915010452, -0.0077487630769610405, 0.026996852830052376, 0.03290410339832306, -0.005997299216687679, 0.01745160110294819, 0.041386768221855164, 0.04743809625506401, 0.01455200556665659, -0.046285465359687805, 0.029860427603125572, -0.006582621484994888, -0.016740210354328156, -0.040306173264980316, -0.007996398955583572, 0.04765421524643898, -0.020171096548438072, 0.0841422900557518, 0.032399825751781464, 0.04228726401925087, -0.006235930602997541, 0.03603782504796982, 0.013111213222146034, -0.04891490936279297, 0.019216571003198624, -0.017217472195625305, -0.009932463988661766, -0.07286808639764786, 0.009189555421471596, 0.005330932792276144, 0.005002251826226711, 0.00916704349219799, 0.015740659087896347, 0.016857273876667023, -0.0363980233669281, -0.038469161838293076, 0.05802792310714722, 0.008275552652776241, 0.05132823809981346, 0.01837010681629181, 0.0217379592359066, 0.047366056591272354, 0.05874831974506378, -0.0706348568201065, 0.013084198348224163, -0.05986493453383446, -0.02137776091694832, -0.04358397796750069, -0.024025216698646545, -0.024817653000354767, 0.04171094670891762, -0.033714547753334045, -0.029266100376844406, 0.01806393824517727, -0.016181902959942818, 0.04286358132958412, -0.014317876659333706, -0.04974336549639702, -0.02474561333656311, 0.06843765079975128, -0.011751464568078518, 0.04905898869037628, 0.01605583354830742, -0.03592976555228233, 0.020171096548438072, 0.06908600777387619, -0.05658712983131409, 0.0006016434635967016, 0.010355697013437748, -0.010652860626578331, 0.02431337535381317, 0.024997752159833908, 0.021269701421260834, -0.09040974080562592, -0.06202612444758415, 0.026348495855927467, -0.01068888045847416, 0.011310222558677197, -0.035065289586782455, -0.042575422674417496, 0.016551105305552483, 0.013840613886713982, 0.0003804592997767031, -0.040558312088251114, -0.009284107945859432, 0.01232778187841177, -0.0027104911860078573, 0.015506531111896038, 0.015542550943791866, 0.002800540765747428, 0.013318327255547047, -0.025988297536969185, 0.012048628181219101, -0.06065737083554268, -0.030923012644052505, -0.022512385621666908, -0.03998199477791786, -0.029608288779854774, -0.014281856827437878, -0.01589374430477619, -0.05179649591445923, 0.06343089789152145, -0.07171545177698135, 0.0178478192538023, -0.011598380282521248, -0.03962179645895958, -0.04329581931233406, 0.022674474865198135, 0.03814498335123062, 0.01324628759175539, -0.006803242955356836, -0.007010356523096561, 0.03495723009109497, 0.01885637454688549, -0.0008149483473971486, 0.03232778608798981, 0.010580820962786674, 0.0030504281166940928, 0.012120667845010757, -0.012832059524953365, 0.00012360706750769168, 0.058496180921792984, -0.03438091278076172, -0.01479513943195343, -0.02832958474755287, -0.008734805509448051, -0.03321027010679245, 0.052913110703229904, 0.026078347116708755, 0.01801891252398491, -0.027158942073583603, 0.01318325288593769, -0.014443946070969105, 0.0109950490295887, -0.04927510768175125, 0.02038721553981304, 0.004315624013543129, 0.035551559180021286, 0.0008898020023480058, -0.033318329602479935, -0.04581720754504204, 0.03202161565423012, 0.010643855668604374, 0.022494375705718994, -0.030688883736729622, -0.005101306363940239, -0.011355247348546982, 0.0041985600255429745, 0.024637553840875626, 0.01701936312019825, 0.020459255203604698, 0.0022219724487513304, -0.019540749490261078, -0.028959931805729866, -0.006483566947281361, 0.041566867381334305, 0.014903198927640915, 0.042179204523563385, 0.009626295417547226, -0.009009456261992455, 0.019702838733792305, -0.04063035175204277, 0.0038000906351953745, -0.004997749347239733, 0.02348491922020912, 0.020693384110927582, 0.014281856827437878, -0.008009906858205795, 0.02038721553981304, -0.07250788807868958, -0.05424584448337555, 0.0004933026502840221, -0.012733004987239838, 0.004624044056981802, 0.006960829254239798, 0.01889239437878132, -0.010058533400297165, -0.0020857725758105516, 0.05089600011706352, -0.05770374462008476, 0.009266098029911518, -0.05417380481958389, -0.019180551171302795, 0.0002481990377418697, -0.05280505120754242, -0.0022039625328034163, -0.011337237432599068, -0.02701486274600029, -0.0046960837207734585, -0.006429537199437618, 0.007478614337742329, -0.002917604986578226, 0.006204413250088692, -0.013165242969989777, -0.006587123963981867, 0.0015409727348014712, 0.002546150702983141, -0.000554367492441088, -0.004000450950115919, -0.07441694289445877, 0.010184602811932564, 0.01396668329834938, 0.01746060512959957, -0.0029018463101238012, -0.03171544894576073, -0.06411527097225189, -0.006276452913880348, -0.0024673573207110167, -0.08176498115062714, -0.01186852902173996, -0.04923908784985542, -0.00713642593473196, -0.013165242969989777, -0.026258446276187897, 0.009743359871208668, -0.014038722962141037, 0.032976143062114716, -0.005065286532044411, -0.04552904888987541, -0.0019000453175976872, -0.0019822155591100454, 0.020171096548438072, -0.03149932995438576, 0.040306173264980316, 0.03980189561843872, 0.05089600011706352, -0.034272853285074234, -0.025772178545594215, 0.006316975224763155, 0.021575869992375374, -0.03839712217450142, -0.006627646274864674, 0.010049528442323208, 0.03146331012248993, 0.07492122054100037, -0.033588480204343796, 0.012579920701682568, 0.023106712847948074, -0.03749663010239601, -0.030130576342344284, 0.0034106264356523752, 0.00031207792926579714, -0.05327330902218819, -0.005078793969005346, 0.0022095905151218176, 0.036722201853990555, -0.01802791841328144, 0.03987393528223038, -0.06267447769641876, -0.018298067152500153, -0.03203962743282318, 0.000001921467173815472, 0.048158492892980576, 0.003003152087330818, 0.004880684893578291, -0.06292662024497986, -0.03756866976618767, 0.014687079936265945, 0.023070693016052246, 0.006564611569046974, 0.026600634679198265, -0.018262047320604324, -0.06166592612862587, -0.06015309318900108, -0.01193156372755766, 0.03461504355072975, -0.0008436516509391367, -0.055398475378751755, 0.04470059275627136, 0.08090050518512726, 0.06490770727396011, 0.0008464657003059983, 0.0037640708032995462, -0.007933364249765873, -0.041134629398584366, -0.07578569650650024, 0.053489428013563156, 0.052480872720479965, -0.041386768221855164, 0.0021735706832259893, 0.011904548853635788, -0.04830257222056389, -0.06263846158981323, 0.026600634679198265, -0.015497526153922081, -0.03582170605659485, -0.0057586682960391045, 0.006046826485544443, 0.0706348568201065, -0.015209367498755455, 0.017901849001646042, -0.08868078887462616, 0.01657812111079693, -0.021179651841521263, -0.0979018583893776, -0.019450699910521507, 0.006019811611622572, -0.018874384462833405, -0.06649257987737656, 0.011706439778208733, 0.010499776341021061, -0.017397571355104446, 0.03020261600613594, 0.011112113483250141, 0.00279378704726696, -0.004826655145734549, 0.03171544894576073, -0.0879603922367096, -0.02296263352036476, 0.12542100250720978, 0.08226925879716873, -0.009635300375521183, -0.0008194508263841271, 0.01771274395287037, 0.014497975818812847, -0.00006739645323250443, -0.015479516237974167, 0.021791988983750343, -0.01485817413777113, -0.0053264303132891655, -0.020531294867396355, 0.010346692055463791, -0.015605585649609566, -0.05882035940885544, 0.05114813894033432, 0.008640252985060215, 0.0011796490289270878, -0.07556957751512527, -0.011787484399974346, 0.01763170026242733, -0.02901396155357361, -0.013525441288948059, 0.0068302578292787075, 0.010004503652453423, 0.0014261596370488405, 0.01433588657528162, 0.014353896491229534, 0.030436744913458824, 0.023809097707271576, -0.03281405195593834, -0.03490320220589638, -0.01056281104683876, -0.078018918633461, 0.04931112751364708, 0.04747411608695984, -0.0026632151566445827, 0.0009640929056331515, 0.041963085532188416, -0.04246736317873001, 0.016289962455630302, -0.034939222037792206, 0.03792886435985565, 0.028815852478146553, 0.06728501617908478, -0.07297614961862564, 0.050607841461896896, -0.06490770727396011, 0.020927513018250465, 0.019180551171302795, -0.01571364514529705, 0.025646109133958817, 0.009410177357494831, -0.06523188948631287, -0.08061234652996063, -0.04970734566450119, -0.00172332301735878, 0.11281406134366989, 0.0019011709373444319, 0.0016906801611185074, 0.05982891470193863, -0.025285910815000534, -0.022008107975125313, 0.04455651342868805, -0.0032327785156667233, -0.03490320220589638, -0.020963532850146294, -0.0050382716581225395, -0.0081584881991148, 0.006924809422343969, -0.023052683100104332, 0.10950023680925369, 0.0017863577231764793, -0.018162991851568222, 0.07945971190929413, 0.018298067152500153, -0.0007271500071510673, 0.021089602261781693, -0.09422783553600311, 0.04225124418735504, 0.02959027886390686, 0.045240890234708786, -0.019576769322156906, 0.017055382952094078, -0.004786132834851742, 0.01898244209587574, 0.031697437167167664, -0.015497526153922081, 0.004813147708773613, -0.0041985600255429745, 0.012660965323448181, -0.06479965150356293, 0.030868982896208763, -0.11713644117116928, -0.028725802898406982, -0.02692481316626072, 0.010959029197692871, 0.04574516788125038, -0.058676280081272125, 0.006267447955906391, -0.07953175157308578, 0.0024335887283086777, 0.012102657929062843, 0.061954084783792496, 0.02561008930206299, -0.06541198492050171, 0.02060333453118801, 0.007541649043560028, -0.03342638909816742, -0.007145430892705917, 0.001977713080123067, 0.005511031951755285, -0.018784334883093834, -0.00728951022028923, 0.02928411029279232, -0.041386768221855164, 0.013264297507703304, -0.02570013888180256, 0.016740210354328156, -0.015542550943791866, 0.0052498881705105305, -0.02906799130141735, 0.08443044871091843, 0.0164160318672657, -0.006510581821203232, -0.031265199184417725, -0.0009106259676627815, -0.021053582429885864, -0.03657812252640724, -0.054786138236522675, 0.01232778187841177, 0.03998199477791786, 0.019360650330781937, -0.022926613688468933, -0.003331833053380251, 0.015731655061244965, -0.02168392948806286, -0.029338140040636063, 0.03864926099777222, 0.015740659087896347, -0.04790635406970978, 0.048158492892980576, -0.05593877285718918, -0.002982890931889415, -0.0330842025578022, 0.008698785677552223, -0.0340387262403965, -0.005727150943130255, 0.051040079444646835, 0.03486718237400055, 0.04769023507833481, -0.006681676022708416, -0.01614588312804699, -0.0017525891307741404, -0.0054795145988464355, -0.01171544473618269, -0.02980639785528183, 0.009635300375521183, -0.03922557830810547, -0.07297614961862564, -0.04160288721323013, 0.01719045639038086, 0.009162540547549725, 0.05655110999941826, -0.06433138996362686, -0.08118866384029388, -0.012255742214620113, 0.012399821542203426, -0.008014408871531487, 0.0004933026502840221, -0.04419631510972977, -0.010733905248343945, -0.013381361961364746, 0.0013394869165495038, -0.018352096900343895, -0.029788387939333916, -0.030310675501823425, 0.02348491922020912, 0.031319230794906616, 0.06814949214458466, 0.03335434943437576, 0.01239081658422947, -0.05565061420202255, -0.018784334883093834, 0.012796039693057537, 0.00704637635499239, -0.02793336659669876, 0.06220622360706329, 0.0007310896762646735, 0.026852773502469063, 0.03954975679516792, -0.012255742214620113, 0.07013057917356491, -0.013390366919338703, -0.03818100318312645, 0.060765430331230164, -0.028347594663500786, 0.02226024679839611, -0.07953175157308578, -0.0017390816938132048, -0.004588024225085974, -0.017865829169750214, 0.06699685752391815, -0.023286810144782066, -0.02334083989262581, 0.02278253436088562, 0.0008492797496728599, 0.015812698751688004, 0.07297614961862564, 0.0164160318672657, 0.03922557830810547, -0.010499776341021061, 0.043836116790771484, 0.02946420945227146, 0.038289062678813934, 0.030778933316469193, 0.029230080544948578, 0.03574966639280319, -0.028095455840229988, -0.038901399821043015, 0.03130121901631355, 0.020783433690667152, 0.022512385621666908, 0.07463306188583374, 0.028419634327292442, -0.014506980776786804, 0.009851419366896152, -0.025015762075781822, 0.06706889718770981, 0.025682128965854645, -0.03041873499751091, 0.043728057295084, 0.015650609508156776, -0.03256191313266754, 0.028815852478146553, -0.04707789793610573, -0.029734358191490173, -0.014515985734760761, 0.02395317703485489, 0.004997749347239733, 0.006123368628323078, 0.051436297595500946, 0.03692031279206276, 0.018748315051198006, -0.02744709886610508, 0.030652863904833794, 0.0047411080449819565, 0.005799190141260624, 0.05741558596491814, -0.07909951359033585, 0.04459253326058388, 0.030959032475948334, 0.00947321206331253, -0.021017562597990036, 0.009464207105338573, -0.045493029057979584, 0.042611442506313324, 0.02517785131931305, 0.06814949214458466, 0.02775326743721962, -0.019234580919146538, -0.022494375705718994, 0.03189554810523987, 0.04531292989850044, -0.029824407771229744, -0.034362904727458954, 0.0003683588874991983, 0.0054660071618855, -0.05903647840023041, -0.03322828188538551, 0.06141378730535507, -0.0718955546617508, 0.003264295868575573, -0.007564161438494921, -0.01858622580766678, 0.014164792373776436, 0.05957677587866783 ]
39,341
sparkypandy._dataframe
__getitem__
null
def __getitem__(self, item: str) -> Columny: if not isinstance(item, str): raise TypeError(f"Expected a string key, not {item}") col = super().__getitem__(item=item) return Columny.from_spark(col=col, df_sparky=self)
(self, item: str) -> sparkypandy._column.Columny
[ 0.058901213109493256, -0.034126706421375275, -0.02239234186708927, 0.01187552884221077, 0.034444328397512436, -0.026556717231869698, 0.020027823746204376, 0.08420509099960327, 0.0503254197537899, -0.03266211599111557, -0.002020427957177162, 0.06377141177654266, 0.02429807372391224, 0.01898672990500927, 0.018863210454583168, 0.0019707996398210526, 0.005417217500507832, 0.037832293659448624, 0.04556109383702278, 0.027315480634570122, -0.010366825386881828, 0.0018241200596094131, 0.06920627504587173, 0.03582068905234337, 0.007062675431370735, 0.024598048999905586, 0.024739215150475502, 0.03167396038770676, 0.05399571731686592, -0.06617122143507004, -0.025127418339252472, -0.05519562214612961, -0.01618107035756111, 0.06168922409415245, -0.023468727245926857, -0.012607824057340622, -0.035026635974645615, -0.014769417233765125, 0.04976075887680054, -0.022374697029590607, 0.01566934585571289, 0.019216123968362808, 0.023768702521920204, -0.058195386081933975, 0.01498116459697485, 0.008716955780982971, -0.020874815061688423, -0.0029027110431343317, 0.012704875320196152, -0.01232549361884594, -0.00772438757121563, -0.04234958440065384, 0.01544877514243126, 0.0022343816235661507, -0.04598458856344223, 0.0038666052278131247, -0.011240284889936447, 0.06292442232370377, 0.024280427023768425, 0.05216056853532791, 0.0071200234815478325, -0.00684651592746377, -0.02535681240260601, 0.0018417657120153308, 0.04312599077820778, -0.025409750640392303, 0.00041108872392214835, 0.0244921762496233, -0.018933793529868126, -0.034867823123931885, 0.008805183693766594, -0.023451082408428192, -0.006070106755942106, 0.01863381639122963, -0.040337976068258286, -0.031585730612277985, -0.0818052813410759, -0.009652175940573215, 0.046972744166851044, -0.004671688191592693, 0.009096337482333183, 0.02484508790075779, -0.049478430300951004, -0.04093793034553528, -0.0708649680018425, 0.021545350551605225, 0.025215648114681244, 0.013684209436178207, -0.044714100658893585, 0.06299500167369843, -0.03836166486144066, -0.004140113014727831, -0.04114967957139015, 0.08794596791267395, 0.01663985662162304, -0.056042615324258804, 0.049831341952085495, -0.05988936871290207, 0.020098406821489334, 0.0369500108063221, 0.03874986991286278, -0.011337336152791977, 0.05466625466942787, -0.00988156907260418, -0.05667785927653313, -0.0268037561327219, -0.02262173593044281, -0.0363500602543354, -0.012431367300450802, -0.04457293450832367, -0.051666490733623505, 0.05177236348390579, -0.012766635045409203, -0.01013743132352829, -0.0363500602543354, 0.027103733271360397, 0.002191370353102684, -0.0311798807233572, -0.003127693198621273, 0.01737215183675289, 0.038573410362005234, -0.0024748037103563547, -0.020804231986403465, 0.03202687203884125, 0.029521187767386436, 0.02165122516453266, -0.0514194518327713, -0.01843971386551857, 0.046937454491853714, 0.008086123503744602, 0.02805659919977188, -0.03543248400092125, -0.01609284244477749, 0.025833245366811752, 0.013172484934329987, 0.007817027159035206, 0.04965488612651825, 0.04746682569384575, -0.025992056354880333, 0.07125317305326462, 0.029168276116251945, 0.007045029662549496, 0.018686752766370773, -0.026362614706158638, -0.0031056359875947237, -0.008580202236771584, 0.000903788604773581, 0.04552580043673515, -0.03733821585774422, -0.020998334512114525, -0.06504189968109131, 0.027050796896219254, 0.002503477968275547, 0.010172722861170769, -0.01357833482325077, -0.006277443375438452, -0.05403101071715355, -0.005774542223662138, 0.0675828754901886, -0.006956801284104586, 0.019939595833420753, -0.04750211536884308, -0.06363024562597275, 0.04122025892138481, -0.035573650151491165, 0.021704161539673805, -0.01609284244477749, -0.024562757462263107, 0.005509857088327408, 0.0011888763401657343, 0.039208654314279556, -0.0002619277511257678, -0.037797003984451294, 0.004034238867461681, -0.005143709946423769, 0.04577283933758736, -0.041432008147239685, 0.05960703641176224, 0.06744170933961868, -0.04718449339270592, 0.025145065039396286, -0.012378429993987083, -0.03474430367350578, -0.02805659919977188, 0.03624418377876282, 0.046161044389009476, -0.008853709325194359, 0.06020699068903923, 0.021668870002031326, 0.07594691962003708, 0.01895143836736679, -0.023468727245926857, 0.009078691713511944, -0.005315755028277636, 0.013198953121900558, -0.012546064332127571, 0.021263020113110542, 0.005739250686019659, -0.08815771341323853, 0.09443957358598709, 0.008906646631658077, 0.021704161539673805, -0.0026909629814326763, 0.05632494390010834, -0.04894905909895897, -0.029432959854602814, 0.01992194913327694, 0.012687229551374912, -0.037832293659448624, -0.036738261580467224, -0.03276798874139786, 0.017160404473543167, -0.026115575805306435, -0.0013057788601145148, 0.05081950128078461, -0.032326847314834595, -0.07587633281946182, -0.012519595213234425, 0.061265729367733, 0.0031188703142106533, 0.1176612600684166, 0.02773897722363472, 0.04919609799981117, 0.030915195122361183, 0.0839933380484581, -0.06493602693080902, 0.023098168894648552, -0.056007321923971176, -0.04044385254383087, 0.030685802921652794, -0.0380440428853035, -0.03949098661541939, 0.06730054318904877, -0.008739013224840164, -0.0003818630939349532, -0.0437612347304821, 0.006383317522704601, 0.009678644128143787, 0.008090535178780556, -0.03442668169736862, -0.019833721220493317, 0.07068851590156555, -0.04302011802792549, 0.014557668939232826, -0.009872746653854847, 0.0064759571105241776, 0.03973802551627159, 0.09069868922233582, -0.07714682072401047, 0.010013911873102188, 0.09154567867517471, 0.03380908444523811, 0.028180118650197983, 0.027650749310851097, 0.00294461939483881, -0.03285621851682663, -0.08406392484903336, 0.004645220004022121, -0.0152546726167202, -0.04665512219071388, -0.08547557145357132, 0.003968067467212677, 0.024598048999905586, 0.034903112798929214, -0.04647866636514664, -0.011919642798602581, 0.009581592865288258, 0.07672332972288132, 0.031038714572787285, 0.037055883556604385, -0.055689699947834015, 0.017945636063814163, 0.030562281608581543, 0.03352675214409828, 0.02175709791481495, 0.012378429993987083, -0.01644575409591198, -0.023309916257858276, -0.034356098622083664, -0.03375614807009697, 0.005258406512439251, -0.008659607730805874, -0.01609284244477749, 0.031744539737701416, 0.042173124849796295, -0.012007871642708778, 0.014425327070057392, -0.022145302966237068, -0.02191590890288353, 0.02609793096780777, -0.039596859365701675, -0.006118632387369871, -0.016745731234550476, 0.05184294655919075, -0.005059892777353525, 0.02844480238854885, -0.008293460123240948, 0.028974173590540886, 0.028762424364686012, -0.0034056121949106455, 0.026733174920082092, 0.024051034823060036, -0.022727608680725098, 0.047607988119125366, -0.005029012914747, 0.0025718549732118845, -0.005081949755549431, 0.00003262034442741424, -0.04146730154752731, 0.00303284777328372, 0.013234244659543037, 0.04863143712282181, -0.09429840743541718, 0.04245545715093613, -0.040373269468545914, 0.028621260076761246, -0.09048694372177124, 0.04277307912707329, -0.006123044062405825, 0.06200684607028961, -0.031709250062704086, -0.08589906990528107, -0.03395025059580803, 0.0020105023868381977, 0.026239095255732536, 0.05826596915721893, 0.018457360565662384, -0.041749630123376846, -0.027103733271360397, 0.05438392236828804, 0.08872237801551819, 0.02098068967461586, -0.005104007199406624, -0.019004374742507935, -0.0011491735931485891, -0.05011367425322533, -0.03292680159211159, 0.03980860859155655, 0.019604327157139778, -0.005703959614038467, -0.009263970889151096, -0.026044992730021477, 0.047219786792993546, -0.010887372307479382, 0.009643352590501308, -0.05943058058619499, -0.018033863976597786, -0.015889916568994522, 0.03121517226099968, 0.03340323269367218, 0.03043876215815544, -0.06730054318904877, -0.009405136108398438, -0.008311105892062187, 0.031850416213274, -0.007040617987513542, -0.018227966502308846, 0.006030404008924961, -0.04330245032906532, 0.000614840944763273, 0.08759305626153946, -0.05650140345096588, 0.017557431012392044, -0.014813531190156937, -0.024950962513685226, 0.019163185730576515, -0.011399095878005028, -0.0028784482274204493, 0.03153279423713684, -0.012219619005918503, 0.003848959458991885, -0.0233981441706419, 0.007256777491420507, 0.005624554120004177, -0.004309952259063721, -0.0031960702035576105, 0.008231700398027897, 0.017610367387533188, -0.03769112750887871, -0.04817264899611473, 0.020098406821489334, -0.06444194912910461, 0.03712646663188934, 0.05177236348390579, 0.0031916587613523006, 0.012916622683405876, -0.001921171206049621, -0.025409750640392303, 0.014478263445198536, -0.02989174798130989, -0.04986663535237312, 0.011734363622963428, -0.00423054676502943, 0.029203565791249275, -0.017222164198756218, -0.06274796277284622, 0.020539548248052597, -0.05110182985663414, 0.013463638722896576, 0.025145065039396286, -0.012096099555492401, -0.05950116366147995, -0.02796837128698826, 0.025215648114681244, 0.00771556468680501, -0.0037717598024755716, 0.018104447051882744, 0.05918354168534279, -0.057101354002952576, 0.022762900218367577, 0.05283110588788986, -0.006471545435488224, -0.03991448134183884, -0.034638430923223495, -0.02368047460913658, -0.011637312360107899, 0.04647866636514664, -0.01634870283305645, -0.008924292400479317, 0.05501916632056236, -0.014725303277373314, -0.03945569321513176, -0.02191590890288353, 0.006445077247917652, -0.015978144481778145, 0.0015462009469047189, -0.012846040539443493, -0.0077949701808393, 0.03363262861967087, 0.010719737969338894, -0.07411176711320877, -0.05120770260691643, -0.013569512404501438, -0.0181750301271677, 0.02484508790075779, -0.0015616408782079816, 0.0024174554273486137, -0.04277307912707329, 0.000027261165087111294, 0.01828090287744999, 0.012475481256842613, -0.013684209436178207, 0.035256028175354004, 0.021121853962540627, -0.03458549454808235, -0.01976313814520836, -0.046196337789297104, 0.05085479095578194, 0.008328751660883427, -0.052054695785045624, 0.022004136815667152, 0.04718449339270592, 0.028956526890397072, 0.021510059013962746, 0.03790287673473358, -0.021580642089247704, -0.06380670517683029, -0.02355695515871048, 0.06730054318904877, 0.030756384134292603, -0.03305032104253769, 0.014178287237882614, -0.0025255349464714527, -0.05840713158249855, -0.01773388870060444, 0.02203942835330963, -0.05593674257397652, -0.02062777616083622, 0.01214903686195612, 0.035026635974645615, -0.0358559787273407, -0.007464114110916853, 0.028180118650197983, -0.07210016250610352, 0.022198239341378212, 0.00039289164124056697, -0.00346737215295434, 0.014910582453012466, 0.00822287704795599, -0.02750958316028118, -0.053854554891586304, -0.0075479308143258095, -0.018139738589525223, -0.018422069028019905, 0.01882791891694069, 0.0011954933870583773, -0.0013399672461673617, -0.021033626049757004, -0.0034431093372404575, 0.017257455736398697, -0.02031015418469906, 0.1190023273229599, 0.03980860859155655, 0.03079167567193508, 0.040337976068258286, 0.023521663621068, -0.00580983329564333, 0.005774542223662138, -0.019480807706713676, 0.025250939652323723, 0.0340384766459465, 0.007693507708609104, -0.041749630123376846, -0.018069155514240265, 0.014654720202088356, -0.05696018785238266, 0.026697883382439613, 0.020186634734272957, -0.04849027097225189, -0.11956699192523956, -0.012801925651729107, -0.016304589807987213, 0.03716176003217697, -0.019427871331572533, 0.0029402079526335, 0.026733174920082092, -0.015501711517572403, 0.03566187620162964, -0.01004038006067276, 0.04093793034553528, 0.011407919228076935, -0.047255076467990875, -0.0089948745444417, -0.05004309117794037, -0.005580439697951078, 0.014972342178225517, 0.05847771465778351, -0.020874815061688423, 0.0013443786883726716, 0.0459492988884449, -0.03562658652663231, 0.03273269906640053, 0.005059892777353525, 0.04319657385349274, 0.010693269781768322, 0.0809582844376564, 0.013445992954075336, 0.057066064327955246, -0.014434149488806725, 0.006312734913080931, 0.01498116459697485, -0.001514218165539205, 0.06814754009246826, -0.07030031085014343, 0.005046658683568239, -0.027633102610707283, -0.026592008769512177, 0.012501949444413185, 0.016657503321766853, 0.013331295922398567, -0.0640537440776825, 0.009237502701580524, -0.04136142507195473, -0.017451556399464607, -0.0036548571661114693, -0.03331500664353371, -0.039949774742126465, -0.01513997558504343, -0.04298482835292816, 0.011407919228076935, 0.004422443453222513, -0.014866468496620655, 0.10552104562520981, 0.04125555232167244, 0.01406359113752842, 0.04661983251571655, -0.0369500108063221, -0.01396653987467289, 0.01933964341878891, -0.03562658652663231, 0.00294461939483881, -0.03949098661541939, 0.009687467478215694, 0.02168651483952999, -0.01992194913327694, -0.031091652810573578, -0.013031319715082645, -0.013719500042498112, -0.06158335134387016, -0.02786249667406082, -0.04976075887680054, 0.09225150942802429, -0.0004166029975749552, 0.0739000216126442, -0.04849027097225189, -0.047607988119125366, 0.01357833482325077, 0.04312599077820778, -0.059712912887334824, -0.0273507721722126, 0.024756859987974167, -0.06634768098592758, -0.003919542301446199, 0.037408798933029175, 0.08025246113538742, -0.027050796896219254, -0.023486372083425522, -0.018704399466514587, 0.014522377401590347, -0.06130102276802063, -0.008836064487695694, 0.03460313752293587, -0.00782143883407116, 0.008606670424342155, 0.03758525475859642, 0.005611319560557604, 0.02008076012134552, 0.046196337789297104, -0.029044754803180695, -0.04312599077820778, -0.027986016124486923, 0.03015643171966076, -0.028233055025339127, 0.08258168399333954, -0.02039838209748268, -0.03426787257194519, -0.034444328397512436, 0.008897824212908745, 0.002741694450378418, -0.08611081540584564, -0.054595671594142914, 0.03966744244098663, 0.013551866635680199, 0.037726420909166336, -0.025480331853032112, -0.040232103317976, 0.034320808947086334, -0.015166444703936577, 0.008597848005592823, -0.07114730030298233, 0.024315718561410904, -0.01992194913327694, 0.07054734975099564, -0.001282618846744299, -0.020645420998334885, 0.022286467254161835, 0.011743186041712761, -0.011654958128929138, 0.021986491978168488, 0.06437136977910995, 0.006343614775687456, 0.018033863976597786, 0.003968067467212677, 0.030738739296793938, 0.0008850400918163359, -0.019798429682850838, -0.0049010817892849445, -0.035891272127628326, 0.010675624012947083, -0.008566968142986298, -0.047572698444128036, -0.005712782498449087, -0.0299623291939497, -0.0089948745444417, 0.044361189007759094, 0.003846753854304552, -0.03121517226099968, -0.07799381762742996, -0.032803282141685486, -0.03024465963244438, 0.016145778819918633, -0.009193388745188713, -0.051242996007204056, -0.0013719500275328755, -0.0169574785977602, -0.032609179615974426, 0.033650271594524384, -0.02992703951895237, 0.022745255380868912, 0.02149241417646408, 0.05392513424158096, -0.035061925649642944, -0.0503254197537899, -0.0662418082356453, 0.025409750640392303, -0.03151514753699303, 0.011769655160605907, 0.008637550286948681, 0.050501879304647446, -0.025886181741952896, 0.03102106973528862, -0.03343852609395981, -0.028374221175909042, 0.07262953370809555, -0.022833483293652534, -0.0057701305486261845, 0.027615457773208618, -0.02622145041823387, 0.004206283949315548, -0.11420270800590515, 0.015854625031352043, 0.00041632726788520813, -0.026697883382439613, -0.0106050418689847, -0.018863210454583168, -0.06310088187456131, -0.004283484071493149, -0.01544877514243126, 0.015184090472757816, 0.05064304172992706, -0.02821541018784046, 0.04086734727025032, 0.010013911873102188, 0.02288641966879368, 0.04824323207139969, -0.012351961806416512, 0.002410838147625327, 0.028956526890397072, 0.01612813211977482, -0.03079167567193508, -0.00347178359515965, -0.01340187806636095, -0.02387457713484764, -0.01206963136792183, 0.02922121249139309, 0.013066611252725124, -0.009475719183683395, -0.008117003366351128, -0.021827680990099907, 0.025250939652323723, 0.04309070110321045, -0.05113712325692177, 0.002651260467246175, 0.05696018785238266, 0.0036261831410229206, -0.021245373412966728, -0.036985304206609726, 0.004751093685626984, -0.03460313752293587, 0.038467537611722946, 0.027439000084996223, -0.004892258904874325, 0.015854625031352043, 0.01512232981622219, 0.03331500664353371, -0.030174078419804573, -0.008853709325194359, -0.015369369648396969, 0.019816076382994652, 0.05473683774471283, -0.03839695453643799, 0.0714649185538292, -0.007711153011769056, -0.004462146200239658, -0.014698834158480167, 0.021774744614958763, -0.02039838209748268, 0.04986663535237312, 0.006317146122455597, 0.0005417768843472004, 0.03790287673473358, 0.034867823123931885, -0.04277307912707329, 0.08166411519050598, 0.03137398138642311, -0.03027995117008686, -0.004290101118385792, 0.041396718472242355, -0.00038269025390036404, -0.028656551614403725, -0.025445040315389633, 0.020927751436829567, -0.004338626749813557, -0.013031319715082645, -0.03754996508359909, -0.03324442356824875, 0.01654280535876751, 0.06705350428819656 ]
39,342
pyspark.sql.dataframe
__init__
null
def __init__( self, jdf: JavaObject, sql_ctx: Union["SQLContext", "SparkSession"], ): from pyspark.sql.context import SQLContext self._sql_ctx: Optional["SQLContext"] = None if isinstance(sql_ctx, SQLContext): assert not os.environ.get("SPARK_TESTING") # Sanity check for our internal usage. assert isinstance(sql_ctx, SQLContext) # We should remove this if-else branch in the future release, and rename # sql_ctx to session in the constructor. This is an internal code path but # was kept with a warning because it's used intensively by third-party libraries. warnings.warn("DataFrame constructor is internal. Do not directly use it.") self._sql_ctx = sql_ctx session = sql_ctx.sparkSession else: session = sql_ctx self._session: "SparkSession" = session self._sc: SparkContext = sql_ctx._sc self._jdf: JavaObject = jdf self.is_cached = False # initialized lazily self._schema: Optional[StructType] = None self._lazy_rdd: Optional[RDD[Row]] = None # Check whether _repr_html is supported or not, we use it to avoid calling _jdf twice # by __repr__ and _repr_html_ while eager evaluation opens. self._support_repr_html = False
(self, jdf: py4j.java_gateway.JavaObject, sql_ctx: Union[ForwardRef('SQLContext'), ForwardRef('SparkSession')])
[ 0.04426520690321922, -0.07898227125406265, 0.024290485307574272, 0.019058100879192352, 0.0012221627403050661, -0.008755650371313095, 0.021597906947135925, 0.07317699491977692, -0.020222974941134453, -0.003962480928748846, 0.027078544721007347, 0.029847506433725357, 0.005289673339575529, 0.04147714748978615, -0.02304922603070736, 0.01472324226051569, 0.031279727816581726, 0.01980285532772541, 0.0721839889883995, 0.012317108921706676, -0.024366870522499084, -0.02148333005607128, 0.015277034603059292, 0.09196774661540985, -0.03143249824643135, 0.012403042055666447, -0.016422811895608902, -0.01385436113923788, 0.07080905884504318, 0.004468532744795084, 0.0017998256953433156, 0.02746046893298626, -0.00760032469406724, 0.03194809705018997, -0.03567187488079071, -0.00813024677336216, 0.002117301570251584, -0.02343115210533142, 0.0405605286359787, -0.02236175909638405, 0.010044650174677372, -0.003671262413263321, 0.0002146841143257916, -0.0827251449227333, -0.049535784870386124, 0.023889463394880295, -0.022304469719529152, -0.050223249942064285, 0.028128840029239655, -0.053851548582315445, 0.005795725155621767, 0.020375745370984077, -0.043730512261390686, 0.0435013547539711, -0.06943412125110626, 0.011992472223937511, -0.028434380888938904, 0.04617483541369438, -0.006951050832867622, -0.021502425894141197, -0.02564632147550583, 0.024061329662799835, 0.010321546345949173, 0.07088544219732285, -0.007557358127087355, 0.009199638850986958, -0.036397535353899, 0.008388047106564045, -0.036435727030038834, -0.030458588153123856, 0.003275014227256179, 0.027956973761320114, 0.018561597913503647, 0.07951696217060089, -0.04353955015540123, -0.0001468027476221323, -0.045983873307704926, -0.08769018203020096, -0.05243842303752899, -0.015792634338140488, 0.06744810938835144, -0.011858798563480377, -0.021865256130695343, -0.05339323729276657, 0.03156617283821106, 0.015534834936261177, 0.053813353180885315, 0.043654125183820724, -0.038116201758384705, 0.030191238969564438, -0.016671063378453255, 0.03580554947257042, -0.020872248336672783, 0.0133578572422266, 0.01450363453477621, -0.015678057447075844, -0.011896991170942783, -0.01607907935976982, -0.018972167745232582, 0.022972840815782547, -0.003043471835553646, 0.027250410988926888, -0.012116597965359688, 0.011228620074689388, -0.01227891631424427, 0.02698306180536747, -0.016289137303829193, -0.018561597913503647, 0.03796343132853508, -0.05213288217782974, -0.008769972249865532, 0.07615602016448975, 0.0007292397203855217, 0.02524529956281185, 0.022896455600857735, 0.005805273074656725, -0.028606247156858444, -0.029771121218800545, -0.014446346089243889, -0.012574909254908562, -0.00931899156421423, -0.01441770140081644, -0.0061633288860321045, -0.022075315937399864, 0.00832598377019167, 0.002821477362886071, 0.03618747740983963, -0.025703610852360725, 0.03987305983901024, 0.02339295856654644, 0.07447554171085358, 0.004411243833601475, 0.030687743797898293, 0.042699310928583145, 0.005523602943867445, -0.011562805622816086, 0.0037858402356505394, 0.022858263924717903, -0.04743519425392151, 0.04033137112855911, 0.02148333005607128, -0.05392793193459511, 0.028568055480718613, 0.007027436047792435, -0.006688476540148258, 0.018580693751573563, -0.015076523646712303, -0.020184781402349472, -0.04781711846590042, -0.005528376903384924, 0.02369849942624569, -0.010732117109000683, -0.0061919731087982655, -0.015429805032908916, 0.00803953967988491, -0.04258473217487335, 0.01863798312842846, -0.01578308641910553, 0.04869554936885834, -0.02131146378815174, 0.00503664743155241, -0.0296565443277359, -0.0416681133210659, 0.03213906288146973, -0.04873374104499817, 0.049306631088256836, -0.020604901015758514, -0.07417000085115433, -0.05950405076146126, 0.008641072548925877, 0.06370523571968079, 0.015553930774331093, 0.0349271185696125, 0.03299839422106743, -0.05434805154800415, 0.09326629340648651, 0.043730512261390686, 0.0593130886554718, -0.017912322655320168, -0.017883678898215294, 0.02178887091577053, 0.015401160344481468, -0.053889740258455276, 0.043310392647981644, -0.009996909648180008, 0.01085624285042286, -0.031203342601656914, 0.011400487273931503, 0.09708555787801743, 0.04323400929570198, -0.02339295856654644, -0.027307698503136635, -0.0021435588132590055, -0.015267486684024334, 0.003191468073055148, -0.040445949882268906, 0.0024896792601794004, -0.01236484944820404, -0.09135666489601135, 0.09540507942438126, -0.00013710542407352477, 0.023946750909090042, 0.029904795810580254, -0.03061135858297348, -0.011677383445203304, 0.03718048334121704, -0.08692632615566254, 0.048771932721138, 0.004797943867743015, -0.03561458736658096, -0.01785503514111042, -0.06030609458684921, -0.03425874933600426, 0.042011845856904984, 0.05175095424056053, 0.0028787662740796804, -0.036340247839689255, 0.02602824755012989, -0.026257403194904327, -0.028873596340417862, 0.05702153220772743, 0.009075513109564781, -0.06045886501669884, 0.01949731633067131, 0.012727679684758186, -0.037734273821115494, 0.05377516150474548, -0.03952932730317116, -0.0037237771321088076, -0.04747338593006134, -0.03502260148525238, -0.04483809694647789, 0.062330301851034164, -0.06305596232414246, -0.009409698657691479, -0.02295374497771263, -0.0017699876334518194, 0.018828945234417915, -0.04052233323454857, -0.04514363780617714, -0.003926675301045179, 0.02507343329489231, 0.05950405076146126, -0.030859610065817833, 0.00832598377019167, 0.036168377846479416, 0.011180879548192024, 0.05457720533013344, 0.002025400521233678, -0.01565895974636078, -0.03168075159192085, -0.03868909180164337, -0.011180879548192024, -0.011534160934388638, -0.0029097977094352245, -0.06511835753917694, 0.009910976514220238, 0.04774073138833046, -0.00996826495975256, 0.03540452942252159, 0.009462213143706322, -0.05492093786597252, -0.01221207994967699, 0.04418882355093956, -0.04124799370765686, 0.0007220786064863205, -0.01780729368329048, -0.019688278436660767, -0.01561122015118599, 0.01286135334521532, 0.13818077743053436, 0.0049316175282001495, 0.0564868338406086, 0.012450783513486385, -0.013959390111267567, -0.04453255608677864, -0.09425930678844452, -0.01573534496128559, -0.014665952883660793, 0.002254556166008115, 0.02776600979268551, -0.07531578093767166, 0.026868484914302826, 0.051483605057001114, -0.026257403194904327, -0.020643092691898346, -0.012259820476174355, -0.026868484914302826, 0.011209524236619473, -0.03592012822628021, -0.04613664373755455, 0.03628295660018921, 0.0255508404225111, 0.024806084111332893, -0.0038097104988992214, -0.002433583838865161, 0.015181553550064564, -0.019573701545596123, -0.02944648452103138, 0.04808446764945984, -0.02236175909638405, -0.0007739966385997832, 0.09647447615861893, 0.08348899334669113, 0.003967254888266325, -0.05950405076146126, -0.0452200211584568, -0.05236203595995903, 0.02759414352476597, 0.03311297297477722, 0.025264395400881767, 0.012460331432521343, 0.02654384821653366, 0.009739109314978123, -0.060038745403289795, -0.03135611489415169, -0.015133812092244625, -0.05793815478682518, 0.032845623791217804, 0.00634474353864789, -0.01463730912655592, -0.03853632137179375, -0.008851132355630398, 0.006774410139769316, -0.02935100346803665, 0.02507343329489231, 0.04716784507036209, -0.026486558839678764, 0.024385966360569, 0.01015922799706459, 0.0034349458292126656, 0.03968209773302078, 0.02520710788667202, -0.012288465164601803, 0.01024516113102436, -0.0370086170732975, -0.023068321868777275, -0.059733204543590546, -0.04388328269124031, -0.007003565784543753, 0.042661119252443314, -0.04919205233454704, 0.007227947004139423, -0.0373714454472065, -0.010226065292954445, -0.051483605057001114, 0.013863909058272839, -0.0552646741271019, 0.0319862924516201, 0.0373714454472065, -0.014952397905290127, 0.013892553746700287, -0.003914739936590195, 0.038937341421842575, 0.006521384231746197, -0.01773090846836567, -0.05228565260767937, 0.049917709082365036, -0.016241397708654404, -0.009476535953581333, 0.0729096457362175, -0.02031845599412918, -0.047893501818180084, -0.0028167031705379486, -0.012469879351556301, 0.018819397315382957, -0.013567916117608547, -0.040751490741968155, -0.044341593980789185, -0.008664943277835846, 0.00707040261477232, -0.038288068026304245, -0.015448900870978832, -0.010216516442596912, 0.022285373881459236, -0.00979639869183302, -0.04690049588680267, 0.021807966753840446, -0.027422277256846428, 0.013777975924313068, -0.00353520130738616, -0.07069447636604309, 0.04739699885249138, -0.025264395400881767, -0.04590748995542526, -0.023832174018025398, -0.048199042677879333, -0.010837146081030369, 0.006807828787714243, 0.024958854541182518, -0.04094245284795761, 0.008173213340342045, 0.019039005041122437, -0.00018186235683970153, 0.026181017979979515, 0.03095509111881256, -0.01785503514111042, 0.03225363790988922, 0.042431965470314026, 0.021464234218001366, -0.02136875130236149, -0.03849812597036362, 0.012078405357897282, 0.0022020412143319845, -0.03000027686357498, 0.05182734131813049, 0.04575471952557564, -0.014933301135897636, -0.01135274674743414, 0.0037500346079468727, 0.04285208135843277, -0.04606026038527489, -0.08249598741531372, 0.027002159506082535, -0.04285208135843277, 0.04216461628675461, 0.04655676335096359, -0.014045323245227337, 0.05079613998532295, 0.07485747337341309, -0.030382202938199043, 0.057441651821136475, 0.02360301837325096, -0.010808502323925495, -0.04162991791963577, -0.004365889821201563, -0.008755650371313095, 0.0017449237639084458, 0.000809802208095789, 0.02780420333147049, -0.037638794630765915, 0.025455359369516373, -0.03998763859272003, -0.003960093948990107, 0.007056080270558596, 0.051903724670410156, 0.016967056319117546, 0.0061919731087982655, -0.021731581538915634, 0.026314692571759224, 0.042011845856904984, -0.03009575791656971, 0.055493827909231186, 0.009557695128023624, -0.032845623791217804, -0.0032559179235249758, -0.014770982787013054, 0.05033782869577408, -0.08058635890483856, 0.00010144905536435544, 0.11450137197971344, 0.06057344377040863, -0.00810637604445219, 0.004306213930249214, -0.08990535140037537, -0.020222974941134453, 0.02845347672700882, -0.03091689944267273, 0.01959279738366604, 0.07562132179737091, 0.0199747234582901, 0.00489819934591651, 0.017616329714655876, -0.008655395358800888, -0.04319581389427185, 0.008154117502272129, 0.003325141966342926, -0.0017473108600825071, -0.03748602420091629, -0.03190990537405014, 0.05327865853905678, 0.02927461825311184, 0.01511471625417471, -0.0627504214644432, -0.0024443254806101322, 0.02312561124563217, -0.06779184192419052, -0.06672244518995285, 0.011247716844081879, 0.026391077786684036, -0.0741318091750145, -0.006793506443500519, 0.031107861548662186, -0.022323567420244217, 0.0019144034013152122, -0.050223249942064285, -0.0044947899878025055, -0.052209265530109406, 0.02681119553744793, -0.015353419817984104, -0.06966327875852585, 0.10250890254974365, 0.015038331039249897, -0.04850458353757858, 0.026753906160593033, 0.027212217450141907, 0.04560194909572601, 0.08723186701536179, -0.013797071762382984, -0.004043640103191137, 0.012345753610134125, -0.029561061412096024, -0.039491135627031326, 0.028701728209853172, 0.0019764662720263004, -0.0786767303943634, 0.06244488060474396, -0.003344238270074129, -0.019296804443001747, -0.027555951848626137, -0.011620094068348408, 0.0193636417388916, -0.020051108673214912, 0.014589567668735981, -0.026601135730743408, 0.003656940069049597, -0.05327865853905678, 0.01850430853664875, 0.0004765121848322451, 0.013539272360503674, -0.005590439774096012, -0.026601135730743408, 0.04655676335096359, -0.017587685957551003, -0.036340247839689255, 0.007113369181752205, 0.06847930699586868, 0.050261445343494415, 0.05652502924203873, 0.006526158191263676, -0.06672244518995285, -0.03796343132853508, -0.01121907215565443, 0.004640399478375912, -0.009853687137365341, 0.021254174411296844, 0.007194528356194496, 0.012918642722070217, -0.006153780501335859, -0.03964390605688095, 0.0020886571146547794, 0.05113987252116203, 0.006421128753572702, -0.039414748549461365, -0.02369849942624569, -0.02746046893298626, -0.01065573189407587, 0.058434657752513885, 0.035041697323322296, -0.018427923321723938, 0.024443255737423897, 0.03164255619049072, 0.04479990527033806, 0.014847368001937866, 0.0319862924516201, 0.02196073718369007, 0.052514806389808655, 0.02257181890308857, 0.043386779725551605, -0.043730512261390686, 0.0011791960569098592, -0.02161700464785099, 0.04854277893900871, -0.0704653188586235, 0.05492093786597252, 0.021426040679216385, 0.04590748995542526, 0.020375745370984077, -0.059083931148052216, -0.06015332415699959, 0.016422811895608902, -0.0059580435045063496, 0.04907747358083725, -0.0014811562141403556, -0.014627760276198387, -0.042050037533044815, -0.04961216822266579, 0.0823432132601738, -0.019879240542650223, 0.01327192410826683, -0.02667752094566822, 0.03246369957923889, -0.01574489288032055, 0.03221544623374939, -0.03905192017555237, -0.0015539608430117369, -0.024615122005343437, 0.017835937440395355, 0.041400764137506485, -0.032883815467357635, -0.020070204511284828, -0.04785531014204025, -0.004862393718212843, -0.029694736003875732, 0.018695270642638206, 0.06439270079135895, -0.03194809705018997, -0.027517758309841156, 0.0370086170732975, -0.055111903697252274, -0.023946750909090042, 0.05602852627635002, -0.019821953028440475, -0.05935128033161163, 0.020299360156059265, 0.007184980437159538, -0.036855846643447876, 0.061337292194366455, -0.022170796990394592, 0.008144568651914597, -0.006483191624283791, 0.03800162300467491, 0.04945939779281616, -0.018065093085169792, -0.011199976317584515, -0.03152798116207123, -0.04059872031211853, -0.01422673836350441, -0.015458449721336365, -0.032616470009088516, -0.05362239107489586, 0.036302052438259125, 0.05113987252116203, 0.009132802486419678, -0.027555951848626137, 0.008598105981945992, 0.033972304314374924, -0.07237495481967926, -0.011037657968699932, 0.02818612940609455, 0.043386779725551605, -0.023507537320256233, 0.055799368768930435, -0.028396187350153923, 0.03706590458750725, -0.013959390111267567, -0.02278187870979309, -0.02896907739341259, 0.02136875130236149, 0.037944335490465164, -0.032062675803899765, 0.017072085291147232, 0.013692041859030724, 0.0018666626419872046, -0.01412170846015215, -0.06805919110774994, 0.015926308929920197, -0.016021789982914925, 0.01812238246202469, 0.012068857438862324, -0.04124799370765686, -0.003795388387516141, 0.0036617142613977194, -0.026868484914302826, 0.03926197811961174, 0.0741318091750145, -0.0851694643497467, -0.018408827483654022, 0.06534751504659653, 0.0193636417388916, -0.010063746944069862, -0.029389195144176483, -0.03402959555387497, 0.0024311968591064215, 0.0007346105412580073, 0.01959279738366604, 0.007891543209552765, -0.012240723706781864, 0.03441151976585388, 0.02178887091577053, -0.016594678163528442, 0.08089189976453781, 0.018876686692237854, -0.02818612940609455, 0.015553930774331093, 0.017568590119481087, -0.016241397708654404, -0.0422791950404644, 0.04606026038527489, -0.05591394752264023, 0.0147041454911232, 0.0676390677690506, -0.005843465682119131, -0.011744220741093159, -0.053546007722616196, -0.014303123578429222, 0.030764129012823105, -0.00959588773548603, 0.00014381896471604705, -0.08967619389295578, -0.043081238865852356, 0.027040351182222366, -0.001989595126360655, 0.018427923321723938, -0.02814793586730957, -0.056448642164468765, 0.01617456041276455, -0.038154393434524536, 0.013481982983648777, 0.018743012100458145, -0.016881123185157776, 0.03389592096209526, -0.014026227407157421, 0.026257403194904327, 0.00415105652064085, 0.05453901365399361, -0.009414472617208958, 0.02599005587399006, 0.030993284657597542, -0.05606671795248985, 0.0008402368985116482, 0.04136257246136665, 0.01433176826685667, -0.012145242653787136, -0.03706590458750725, 0.05591394752264023, 0.004828975070267916, -0.010789405554533005, 0.008650620467960835, -0.021426040679216385, 0.043004851788282394, -0.029847506433725357, 0.007008339744061232, 0.030076662078499794, -0.037734273821115494, 0.017406271770596504, -0.02961835078895092, -0.015974048525094986, 0.04426520690321922, -0.025627225637435913, -0.007433232385665178, 0.057708997279405594, -0.0211395975202322, -0.039452940225601196, -0.0075191655196249485, -0.08066274225711823, 0.010989916510879993, -0.025092529132962227, 0.008493076078593731, 0.033361222594976425, -0.005557021126151085, 0.0027068995404988527, -0.030153047293424606, 0.04132437705993652, -0.0010258289985358715, 0.01928725652396679, 0.013014123775064945, -0.00014135733363218606, 0.03183352202177048, 0.030191238969564438, -0.0038049365393817425, -0.00996826495975256, -0.03147068992257118, 0.033571284264326096, 0.03853632137179375, 0.022896455600857735, -0.03454519435763359, 0.04002583026885986, 0.0007023855578154325, -0.07405542582273483, -0.07699625194072723, 0.03930016979575157, -0.028548957780003548, 0.0016005081124603748, 0.008144568651914597, 0.0014071580953896046, 0.028529861941933632, -0.005523602943867445 ]
39,343
pyspark.sql.dataframe
__repr__
null
def __repr__(self) -> str: if not self._support_repr_html and self.sparkSession._jconf.isReplEagerEvalEnabled(): vertical = False return self._jdf.showString( self.sparkSession._jconf.replEagerEvalMaxNumRows(), self.sparkSession._jconf.replEagerEvalTruncate(), vertical, ) else: return "DataFrame[%s]" % (", ".join("%s: %s" % c for c in self.dtypes))
(self) -> str
[ 0.04113107547163963, -0.06137749180197716, 0.0615193210542202, 0.0001934944448294118, 0.05439230054616928, 0.00030554670956917107, 0.00794255267828703, -0.04148565232753754, 0.005012849811464548, -0.015158219262957573, 0.003091478953137994, -0.013092800974845886, -0.0342877134680748, 0.02466091513633728, -0.024448169395327568, -0.022888025268912315, -0.003572375513613224, -0.07417776435613632, 0.054711420089006424, 0.0307596605271101, -0.028118053451180458, 0.023969488218426704, -0.0074106850661337376, -0.03336581215262413, -0.013358734548091888, 0.007774127647280693, 0.0006687123677693307, -0.03333035483956337, -0.009547018446028233, 0.049960073083639145, -0.04776168614625931, -0.0442868210375309, -0.049995530396699905, -0.016789278015494347, -0.030032776296138763, 0.006794605404138565, -0.024270879104733467, -0.021345609799027443, 0.05088197439908981, -0.039925508201122284, -0.03939364105463028, -0.03559965267777443, -0.004751348402351141, -0.0865170881152153, -0.07708530873060226, -0.026735197752714157, 0.043861325830221176, -0.037798039615154266, -0.0016543290112167597, -0.04949912056326866, 0.02934134751558304, 0.07010011374950409, -0.04836447164416313, 0.041414737701416016, -0.07793629169464111, -0.006564129609614611, 0.003000618191435933, 0.02705431915819645, 0.006572993937879801, -0.023739011958241463, -0.043648578226566315, 0.028827209025621414, 0.020618723705410957, 0.013287818990647793, 0.03476639464497566, 0.011683352291584015, -0.02978457137942314, 0.02701885998249054, -0.0396418459713459, -0.020654181018471718, -0.01987410895526409, -0.014688403345644474, -0.03068874590098858, 0.05818628519773483, -0.05676797404885292, -0.05070468783378601, -0.038897231221199036, -0.04400315880775452, -0.021256964653730392, -0.03935818374156952, 0.04932183027267456, 0.012773680500686169, 0.03804624453186989, -0.01950180158019066, 0.049853697419166565, -0.0625830590724945, 0.005234460812062025, 0.06290217489004135, -0.021327881142497063, -0.0025551794096827507, 0.012676171958446503, 0.005074901040643454, -0.0019025338115170598, 0.006364678964018822, -0.04691069945693016, 0.005012849811464548, -0.01600920595228672, -0.035032328218221664, 0.03568829968571663, -0.032461635768413544, 0.03217797353863716, 0.04095378518104553, 0.017436383292078972, 0.000046434510295512155, -0.05885998532176018, 0.03815261647105217, 0.004330286756157875, 0.03974821791052818, -0.034979142248630524, -0.014475655741989613, -0.008833429776132107, 0.09197758883237839, 0.017941657453775406, -0.044925060123205185, 0.06453323364257812, 0.027923034504055977, -0.048754505813121796, -0.00862954743206501, 0.04453502595424652, 0.005890430882573128, -0.016390377655625343, 0.02106194570660591, -0.013757634907960892, -0.026611095294356346, -0.06623521447181702, 0.06311492621898651, -0.004210616461932659, -0.014573165215551853, 0.01045119296759367, -0.03935818374156952, 0.073397696018219, -0.0023623774759471416, -0.04581150785088539, 0.06822085380554199, 0.07346861064434052, 0.02459000051021576, 0.03084830567240715, 0.01617763191461563, 0.03783349692821503, 0.0618739016354084, -0.024182235822081566, -0.0542859248816967, 0.010362548753619194, 0.06797264516353607, -0.021593814715743065, 0.014103349298238754, -0.001970125362277031, 0.04453502595424652, -0.0065198070369660854, -0.03730162978172302, 0.016665177419781685, -0.0027834391221404076, 0.004587356001138687, -0.05549149215221405, 0.04570513218641281, 0.029075413942337036, 0.004137484822422266, -0.008407936431467533, 0.02935907617211342, -0.047300733625888824, -0.026522452011704445, -0.0470525287091732, -0.01420085784047842, -0.0034704343415796757, -0.02474956028163433, 0.0185267124325037, 0.012020201422274113, -0.06159023940563202, -0.014617486856877804, 0.0865170881152153, 0.05534965917468071, -0.0056732515804469585, 0.016895651817321777, 0.029039956629276276, -0.020069127902388573, 0.10282768309116364, 0.007641160860657692, 0.0933959037065506, -0.014688403345644474, -0.01836715266108513, 0.02583102323114872, -0.03235526382923126, -0.07829087227582932, 0.018154405057430267, 0.02957182377576828, -0.039996422827243805, -0.02333124727010727, -0.056129731237888336, 0.04772622883319855, 0.05162658914923668, -0.01857989840209484, -0.009015151299536228, -0.007211234420537949, 0.0038316608406603336, 0.005433911457657814, -0.056023359298706055, 0.009706579148769379, -0.013810821808874607, -0.0448186881840229, -0.0067281220108270645, -0.009236762300133705, 0.037691663950681686, 0.025387801229953766, -0.015282321721315384, 0.004769077058881521, -0.01717044971883297, -0.04414498805999756, -0.007344201672822237, 0.019058579578995705, -0.03198295459151268, 0.0004983486142009497, 0.00011731553240679204, -0.009210169315338135, 0.003743016393855214, 0.044995978474617004, 0.018065759912133217, -0.055987901985645294, -0.005730870645493269, -0.04903816804289818, -0.021168319508433342, 0.05538512021303177, -0.05329310894012451, -0.019076308235526085, 0.0154684754088521, -0.023987216874957085, -0.034996870905160904, 0.030032776296138763, -0.0033463318832218647, 0.026451535522937775, -0.00987500324845314, -0.028082596138119698, -0.021558355540037155, -0.010912144556641579, 0.004489846993237734, -0.0014172048540785909, 0.05907273292541504, -0.01729455217719078, 0.029376806691288948, 0.018118947744369507, 0.0016820305027067661, -0.06034921482205391, 0.04329400137066841, 0.023863114416599274, -0.012410237453877926, 0.0029208380728960037, -0.041201990097761154, 0.02092011459171772, 0.07871636748313904, -0.007809585426002741, 0.013394192792475224, 0.037762582302093506, -0.06751169264316559, -0.015503932721912861, -0.013234632089734077, 0.030440540984272957, -0.01713499240577221, -0.014954336918890476, 0.03854265436530113, 0.002592853270471096, 0.02459000051021576, 0.02467864379286766, -0.03439408913254738, -0.03666338697075844, 0.05534965917468071, 0.010220717638731003, -0.008434529416263103, -0.05807991325855255, -0.012374780140817165, 0.03083057701587677, 0.009520425461232662, 0.07283036410808563, 0.04035100340843201, -0.05510145425796509, -0.006023397669196129, -0.024944577366113663, -0.05804445594549179, -0.023012125864624977, -0.0016310598002746701, -0.03242617845535278, -0.04297488182783127, -0.015016388148069382, -0.059888262301683426, -0.007796288933604956, 0.007397388108074665, 0.006958597805351019, -0.01346510834991932, -0.017489571124315262, -0.06591609120368958, 0.013979246839880943, 0.012605255469679832, 0.01735660433769226, 0.03129152953624725, -0.012392508797347546, 0.02944772131741047, 0.023189416155219078, -0.012365915812551975, 0.08077292144298553, -0.02590193971991539, -0.02107967622578144, 0.05304490402340889, -0.037620749324560165, -0.04389678314328194, 0.1033950075507164, 0.07215666770935059, -0.021593814715743065, -0.042655762284994125, -0.009555882774293423, -0.013553752563893795, 0.012002472765743732, 0.007672186475247145, -0.01588510535657406, 0.00858079269528389, 0.01982092298567295, 0.04790351912379265, -0.0040754335932433605, 0.007237827870994806, -0.030422812327742577, -0.0011191375087946653, 0.008421232923865318, 0.026682011783123016, -0.022923482581973076, -0.018243050202727318, -0.00710042892023921, 0.03224888816475868, 0.010149802081286907, -0.02359718084335327, 0.005469369236379862, -0.024111319333314896, 0.041450195014476776, 0.03462456539273262, 0.008248375728726387, -0.052371203899383545, 0.046236999332904816, 0.03825899213552475, 0.057477131485939026, 0.0006814550142735243, 0.010052292607724667, 0.0022183300461620092, -0.038897231221199036, -0.020069127902388573, 0.04035100340843201, -0.0026305271312594414, 0.02476728893816471, -0.012658442370593548, -0.005659955088049173, -0.018225321546196938, 0.0031690429896116257, -0.00708270026370883, 0.036344267427921295, 0.015184812247753143, -0.03311760723590851, 0.010983060114085674, -0.036131519824266434, 0.0033973027020692825, -0.024182235822081566, -0.0010620725806802511, -0.017959387972950935, 0.09878548979759216, -0.042478471994400024, 0.0494636632502079, 0.0591081902384758, -0.010663940571248531, -0.014262909069657326, 0.031114239245653152, -0.03338354080915451, 0.01363353244960308, -0.02591966837644577, -0.004272667691111565, 0.0008748109685257077, 0.0172768235206604, -0.04467685520648956, -0.018845831975340843, 0.00585497310385108, -0.06456869840621948, -0.0644623190164566, 0.041450195014476776, -0.04542146995663643, -0.018987663090229034, -0.017861878499388695, -0.07325585931539536, 0.02441271021962166, -0.044889602810144424, 0.02219659648835659, -0.0016576532507315278, -0.021647000685334206, 0.024341795593500137, -0.06212210655212402, -0.0058461083099246025, -0.0439322404563427, -0.014989794231951237, -0.05290307104587555, -0.013252360746264458, 0.004844424780458212, 0.05556240677833557, -0.033986322581768036, -0.024111319333314896, 0.002945215441286564, 0.011373096145689487, -0.020246416330337524, 0.03192976862192154, 0.024111319333314896, 0.008399072103202343, 0.005026146303862333, -0.010761449113488197, -0.014511113986372948, 0.020281873643398285, 0.059498224407434464, -0.014005839824676514, -0.019253598526120186, -0.012374780140817165, 0.05591698735952377, -0.030422812327742577, -0.0841059535741806, 0.02324260212481022, 0.03329489380121231, 0.04230118170380592, -0.013349870219826698, -0.005912591703236103, 0.03425225615501404, 0.024926848709583282, -0.02109740488231182, 0.02201930806040764, 0.03715979680418968, 0.041272904723882675, -0.021877476945519447, 0.03730162978172302, -0.03338354080915451, 0.020122313871979713, 0.023792199790477753, 0.06272488832473755, -0.02568919211626053, 0.010114343836903572, -0.025050951167941093, 0.0010831257095560431, 0.04712344706058502, -0.057370755821466446, 0.01736546866595745, -0.042584843933582306, -0.016877923160791397, 0.03439408913254738, 0.05325764790177345, -0.02934134751558304, 0.01873946003615856, 0.010814636014401913, -0.0034660021774470806, -0.008079951629042625, 0.0006232820451259613, -0.010584159754216671, -0.0594627670943737, 0.009538154117763042, 0.0633985847234726, -0.0036410752218216658, 0.001781755592674017, 0.006129771005362272, -0.02976684272289276, 0.0034504893701523542, 0.025334613397717476, -0.012507746927440166, -0.02081374265253544, 0.019147224724292755, -0.0006088772788643837, -0.00322887790389359, -0.01302188541740179, 0.02813578210771084, 0.012454560026526451, -0.01409448403865099, 0.0006709285080432892, -0.022994397208094597, -0.0844605341553688, -0.009671120904386044, 0.0208491999655962, -0.0023069744929671288, -0.012126575224101543, -0.05889544263482094, 0.00198009773157537, 0.0718730092048645, -0.026770655065774918, 0.0006598479230888188, -0.0018515631090849638, -0.016567667946219444, -0.11984743922948837, -0.05017281696200371, -0.028047136962413788, -0.03584785759449005, 0.008345885202288628, 0.0033418997190892696, -0.006333653349429369, 0.018845831975340843, 0.024270879104733467, -0.027355710044503212, 0.002189520513638854, 0.08268763870000839, -0.0416983999311924, 0.011479469947516918, 0.025228241458535194, 0.029820028692483902, 0.03255028277635574, -0.020335061475634575, -0.028047136962413788, 0.03217797353863716, 0.043754953891038895, 0.009910461492836475, -0.01054870244115591, 0.027603914961218834, 0.04418044537305832, -0.04719436168670654, 0.09935282170772552, 0.059746429324150085, -0.029873214662075043, -0.0442868210375309, 0.022728463634848595, -0.03701796755194664, 0.010282768867909908, 0.030351895838975906, -0.03336581215262413, -0.03554646670818329, 0.03549328073859215, -0.0024953442625701427, 0.0023025423288345337, 0.03797532618045807, -0.01966136321425438, -0.03471320867538452, -0.07073835283517838, 0.0077076442539691925, -0.03444727510213852, 0.04301033914089203, 0.04414498805999756, 0.04921545833349228, -0.02209022268652916, 0.05329310894012451, -0.0037452324759215117, 0.019200410693883896, 0.049889154732227325, -0.0030892628710716963, -0.039925508201122284, 0.06460415571928024, -0.03570602834224701, 0.05066922679543495, 0.020565537735819817, -0.0002253510756418109, -0.007388523779809475, -0.009564748033881187, -0.013376463204622269, -0.04098924249410629, -0.019962754100561142, -0.04588242247700691, 0.03712433949112892, 0.03331262245774269, 0.06765352189540863, -0.02591966837644577, -0.0007839502650313079, 0.02716069109737873, 0.06190935894846916, -0.012702764943242073, -0.010991925373673439, 0.08190757036209106, 0.058611780405044556, 0.05148475989699364, 0.02120377868413925, -0.02336670458316803, -0.002267084550112486, -0.04918000102043152, 0.10431691259145737, -0.04354220628738403, 0.04081195220351219, 0.07201483845710754, 0.027816662564873695, 0.04077649489045143, -0.06758260726928711, -0.08275856077671051, 0.0029474315233528614, -0.003989004995673895, 0.0420529767870903, -0.0446413978934288, -0.0140856197103858, -0.03974821791052818, 0.010052292607724667, 0.07495784014463425, -0.02230297029018402, 0.013660126365721226, -0.047407109290361404, 0.021576084196567535, 0.008332588709890842, -0.006590722594410181, -0.053505852818489075, 0.024909120053052902, -0.039925508201122284, -0.005819515325129032, 0.020388247445225716, -0.04113107547163963, -0.009573612362146378, -0.04960549250245094, 0.01045119296759367, -0.0323198065161705, 0.07258216291666031, 0.04407407343387604, -0.05315127596259117, 0.037620749324560165, 0.0348195806145668, 0.017427518963813782, -0.002524153795093298, 0.04570513218641281, 0.02219659648835659, -0.03900360316038132, 0.02822442725300789, -0.02572464942932129, 0.02721387892961502, 0.0672280341386795, -0.014342688955366611, 0.01549506839364767, -0.026096956804394722, 0.06063287705183029, -0.01709953509271145, -0.062299393117427826, -0.04847084358334541, -0.042372096329927444, -0.032621197402477264, -0.01980319432914257, -0.047407109290361404, -0.03129152953624725, -0.0105575667694211, 0.05024373531341553, -0.0017739991890266538, -0.0031978522893041372, 0.0011811887379735708, 0.01586737483739853, -0.024341795593500137, -0.01350056566298008, 0.02721387892961502, -0.03684067726135254, 0.031326986849308014, -0.01363353244960308, 0.021487440913915634, -0.028011679649353027, -0.050066445022821426, -0.016877923160791397, -0.020370518788695335, 0.021540626883506775, -0.02583102323114872, 0.04843538627028465, 0.024217693135142326, -0.01477704755961895, -0.045102350413799286, -0.023685825988650322, -0.002838841872289777, -0.01746297813951969, -0.00383830931968987, -0.042584843933582306, 0.022781651467084885, -0.01725909486413002, -0.057477131485939026, -0.0110273826867342, 0.03588331490755081, -0.036237895488739014, -0.016931110993027687, 0.0741068497300148, -0.03793986886739731, -0.003036075970157981, 0.008642843924462795, -0.004210616461932659, -0.011080569587647915, -0.06254760175943375, -0.0518747940659523, -0.027905305847525597, 0.0868716686964035, 0.03559965267777443, -0.006763579789549112, 0.03921635076403618, 0.054924167692661285, -0.03318852186203003, -0.002767926314845681, 0.04673340916633606, -0.01290664728730917, -0.03492595627903938, -0.028047136962413788, 0.011594708077609539, -0.03329489380121231, -0.003142449539154768, 0.02597285434603691, -0.04839992895722389, -0.0024798314552754164, 0.01717044971883297, -0.05066922679543495, -0.05659068375825882, -0.03618470951914787, -0.008040061220526695, -0.021168319508433342, 0.03329489380121231, -0.0005094291991554201, -0.0722275823354721, -0.0295540951192379, -0.006054423283785582, 0.011931557208299637, 0.01467067375779152, 0.03184112533926964, -0.06070379167795181, 0.06960370391607285, -0.06378862261772156, 0.019998211413621902, 0.027745746076107025, -0.0011263398919254541, 0.05868269503116608, 0.012162033468484879, 0.004498711321502924, 0.06878817826509476, 0.06793718785047531, 0.039996422827243805, 0.020725097507238388, -0.009954784065485, -0.027586186304688454, -0.006963029969483614, 0.11736539006233215, 0.007295446936041117, -0.009945918805897236, -0.0494636632502079, 0.02453681267797947, 0.016744956374168396, -0.007698779925704002, -0.013846280053257942, 0.003920305520296097, -0.00855419971048832, 0.03184112533926964, 0.017711183056235313, 0.06144840642809868, -0.007472736295312643, 0.11431601643562317, -0.07254670560359955, -0.005172410048544407, 0.0035790239926427603, -0.006945300847291946, 0.034872766584157944, 0.03662792965769768, 0.02324260212481022, -0.019129496067762375, 0.010194123722612858, -0.046166084706783295, -0.002807816257700324, -0.005979075096547604, -0.006785740610212088, -0.0052920798771083355, -0.007716508582234383, 0.006537536159157753, 0.0022825973574072123, 0.011435147374868393, 0.04230118170380592, -0.013137123547494411, 0.014865691773593426, 0.06159023940563202, 0.005199003033339977, 0.0470525287091732, 0.041166532784700394, 0.002739116782322526, -0.0368761345744133, 0.004299261141568422, 0.03317079320549965, 0.014271773397922516, -0.00916584674268961, 0.036379724740982056, -0.0021518466528505087, -0.0648168995976448, -0.020600995048880577, 0.020175501704216003, -0.0046937293373048306, 0.03292258828878403, -0.06141294911503792, -0.004910908639431, -0.012525475583970547, -0.024040402844548225 ]
39,344
pyspark.sql.pandas.conversion
_collect_as_arrow
Returns all records as a list of ArrowRecordBatches, pyarrow must be installed and available on driver and worker Python environments. This is an experimental feature. :param split_batches: split batches such that each column is in its own allocation, so that the selfDestruct optimization is effective; default False. .. note:: Experimental.
def _collect_as_arrow(self, split_batches: bool = False) -> List["pa.RecordBatch"]: """ Returns all records as a list of ArrowRecordBatches, pyarrow must be installed and available on driver and worker Python environments. This is an experimental feature. :param split_batches: split batches such that each column is in its own allocation, so that the selfDestruct optimization is effective; default False. .. note:: Experimental. """ from pyspark.sql.dataframe import DataFrame assert isinstance(self, DataFrame) with SCCallSiteSync(self._sc): ( port, auth_secret, jsocket_auth_server, ) = self._jdf.collectAsArrowToPython() # Collect list of un-ordered batches where last element is a list of correct order indices try: batch_stream = _load_from_socket((port, auth_secret), ArrowCollectSerializer()) if split_batches: # When spark.sql.execution.arrow.pyspark.selfDestruct.enabled, ensure # each column in each record batch is contained in its own allocation. # Otherwise, selfDestruct does nothing; it frees each column as its # converted, but each column will actually be a list of slices of record # batches, and so no memory is actually freed until all columns are # converted. import pyarrow as pa results = [] for batch_or_indices in batch_stream: if isinstance(batch_or_indices, pa.RecordBatch): batch_or_indices = pa.RecordBatch.from_arrays( [ # This call actually reallocates the array pa.concat_arrays([array]) for array in batch_or_indices ], schema=batch_or_indices.schema, ) results.append(batch_or_indices) else: results = list(batch_stream) finally: with unwrap_spark_exception(): # Join serving thread and raise any exceptions from collectAsArrowToPython jsocket_auth_server.getResult() # Separate RecordBatches from batch order indices in results batches = results[:-1] batch_order = results[-1] # Re-order the batch list using the correct order return [batches[i] for i in batch_order]
(self, split_batches: bool = False) -> List[ForwardRef('pa.RecordBatch')]
[ -0.0024625875521451235, -0.02700437419116497, -0.08749032765626907, 0.049857184290885925, -0.017298175022006035, -0.01091707032173872, 0.0040914989076554775, 0.03997800499200821, -0.022602949291467667, -0.012666108086705208, -0.024890152737498283, -0.01126303430646658, 0.005607491824775934, 0.009297769516706467, 0.01641404628753662, 0.03646070882678032, 0.007952355779707432, -0.0076256124302744865, 0.06419544667005539, 0.04055460914969444, -0.01157055702060461, -0.04658975079655647, -0.007342114578932524, 0.02183414064347744, -0.026197126135230064, 0.07357490807771683, 0.009840739890933037, -0.005972675513476133, 0.025197675451636314, 0.022410746663808823, 0.023813821375370026, -0.005521000828593969, -0.02014276385307312, 0.004105913918465376, 0.014645787887275219, -0.005396069493144751, 0.012608448043465614, -0.016471706330776215, 0.04140029847621918, 0.0040266308933496475, 0.005770863499492407, -0.0016072887228801847, 0.0036926798056811094, -0.03955516219139099, -0.025082353502511978, 0.03897855430841446, -0.0012937593273818493, -0.003238602774217725, 0.0034956729505211115, 0.00462245661765337, 0.020065883174538612, 0.0010186702711507678, -0.013857760466635227, 0.08349252492189407, 0.024236666038632393, 0.014078792184591293, -0.01706753298640251, -0.0175864789634943, -0.022506847977638245, -0.019479667767882347, -0.024678729474544525, -0.03936295956373215, 0.014732278883457184, 0.030021943151950836, 0.060620494186878204, -0.031578779220581055, -0.033270157873630524, -0.044437091797590256, -0.07545848190784454, -0.024159785360097885, -0.014568907208740711, -0.009441920556128025, -0.02825368568301201, 0.05366278439760208, -0.0666171982884407, 0.010782529599964619, 0.04397580400109291, -0.01317544374614954, -0.0018967929063364863, -0.06077425554394722, 0.0580834299325943, 0.024159785360097885, -0.030329467728734016, -0.00588137935847044, 0.048896174877882004, -0.00040542599163018167, 0.0683470144867897, 0.04362984001636505, -0.08095546066761017, -0.0073709446005523205, 0.005400874651968479, 0.03190552443265915, -0.002988740336149931, 0.048165809363126755, -0.014511247165501118, -0.08095546066761017, -0.0992530882358551, -0.026946712285280228, -0.0832618847489357, 0.03267433121800423, 0.0012294917833060026, -0.005732423160225153, 0.03415428474545479, -0.0003588770632632077, 0.024813272058963776, -0.052932415157556534, 0.009374650195240974, -0.0463591106235981, 0.02196868322789669, -0.019460447132587433, -0.045090578496456146, 0.06592527031898499, -0.003430804703384638, 0.00682797422632575, -0.045090578496456146, 0.052586451172828674, 0.025447538122534752, -0.03196318447589874, -0.07803399115800858, -0.00377676822245121, 0.010580717585980892, 0.028503548353910446, 0.017115583643317223, -0.03903621435165405, -0.028964832425117493, 0.03246290981769562, 0.0690004974603653, -0.015606798231601715, 0.011195763014256954, 0.03997800499200821, 0.024294326081871986, -0.024582628160715103, -0.05158700421452522, -0.006188902538269758, 0.020411847159266472, 0.0063186390325427055, 0.03849805146455765, 0.013271544128656387, -0.04735856130719185, -0.03465401008725166, -0.003543723374605179, -0.028926393017172813, 0.04620534926652908, 0.020258085802197456, 0.017086753621697426, -0.014443975873291492, 0.02200712263584137, -0.0031160740181803703, -0.025082353502511978, -0.01948927715420723, -0.0033467162866145372, -0.008975830860435963, -0.0349038727581501, -0.042861033231019974, -0.03532671928405762, 0.022641388699412346, -0.04370672255754471, 0.023909922689199448, 0.017211684957146645, -0.0337698832154274, -0.05362434312701225, 0.011416795663535595, -0.0411696583032608, 0.015203174203634262, -0.060582052916288376, 0.04901149496436119, 0.03180942311882973, -0.001431904500350356, -0.07049967348575592, -0.0035172956995666027, 0.04701259732246399, 0.036749012768268585, 0.020853910595178604, -0.016125744208693504, -0.07957160472869873, 0.0981767550110817, -0.0013550237054005265, 0.03649915009737015, 0.03767158091068268, 0.0012372999917715788, -0.010023331269621849, -0.03273199126124382, -0.014405535534024239, 0.004348569083958864, 0.04070837050676346, 0.0281768050044775, -0.016077693551778793, -0.035749562084674835, 0.10594171285629272, 0.00862025748938322, -0.051894526928663254, 0.015481866896152496, -0.00647720554843545, 0.01875890977680683, -0.023563958704471588, -0.045474980026483536, -0.02227620594203472, 0.008615451864898205, -0.07176820933818817, 0.04151562228798866, -0.031886301934719086, 0.016942601650953293, 0.02994506247341633, -0.06088957563042641, -0.04224598780274391, 0.020853910595178604, -0.0480889268219471, 0.017336616292595863, 0.019912121817469597, 0.01532810553908348, -0.0005279547185637057, -0.019777581095695496, 0.008615451864898205, 0.04393736645579338, 0.06492581963539124, -0.029848963022232056, -0.026773730292916298, 0.04163094237446785, 0.07911032438278198, 0.0036278117913752794, 0.041131217032670975, -0.02096923254430294, -0.05904443934559822, 0.009956060908734798, 0.021776480600237846, -0.0019844851922243834, 0.049472782760858536, -0.019297074526548386, 0.0005249515525065362, -0.06704004108905792, -0.011724318377673626, -0.06584838777780533, 0.0018139058956876397, -0.031002173200249672, 0.03859414905309677, 0.035749562084674835, -0.03665291145443916, 0.0004525755066424608, 0.016250673681497574, 0.011455236002802849, -0.020911572501063347, 0.015818219631910324, 0.025159234181046486, -0.023294875398278236, -0.03542282059788704, 0.02769630029797554, 0.0059150150045752525, 0.045474980026483536, 0.027407998219132423, 0.02982974238693714, 0.0071451072581112385, -0.03221304714679718, 0.006554086226969957, -0.040477730333805084, -0.004113121889531612, -0.07111471891403198, 0.006198512855917215, -0.004408631939440966, -0.0014931688783690333, 0.03680667281150818, -0.0010450980626046658, 0.02825368568301201, -0.02075781114399433, 0.00846169050782919, 0.013060122728347778, 0.007241208106279373, 0.0037407304625958204, -0.0046560922637581825, 0.018557097762823105, 0.06504113972187042, 0.05077975243330002, 0.04120809584856033, -0.03559580072760582, -0.006991345901042223, -0.035403598099946976, -0.011839640326797962, -0.0543547086417675, 0.007005760911852121, -0.029157035052776337, -0.03321249783039093, 0.00520867295563221, 0.0024157383013516665, -0.007668857462704182, -0.009917620569467545, -0.041823145002126694, -0.012512346729636192, -0.021641939878463745, -0.032270707190036774, -0.028099924325942993, 0.0031232815235853195, -0.014443975873291492, -0.0011610198998823762, 0.029445338994264603, -0.029983503744006157, -0.0186147578060627, 0.042438190430402756, 0.021046113222837448, -0.031405799090862274, -0.03993956372141838, 0.00020691740792244673, -0.023237215355038643, 0.0055113909766077995, 0.06880829483270645, 0.09902244061231613, -0.016481317579746246, -0.041861582547426224, -0.02631244622170925, -0.03190552443265915, 0.008673112839460373, 0.011512896977365017, -0.003425999777391553, -0.0214497372508049, 0.026677630841732025, -0.004843489266932011, -0.03294341266155243, -0.018134253099560738, 0.000460383715108037, 0.043437641113996506, 0.013973081484436989, 0.029579879716038704, -0.029483778402209282, 0.032789651304483414, 0.03907465562224388, 0.04028552770614624, -0.023756161332130432, 0.027965383604168892, 0.02852276898920536, -0.008601036854088306, 0.013482966460287571, 0.0034620375372469425, 0.013137003406882286, -0.00839922484010458, -0.01741349697113037, 0.008937390521168709, -0.0008000406087376177, 0.012877530418336391, -0.004576808772981167, -0.021930241957306862, 0.012675718404352665, -0.027273455634713173, -0.00671745790168643, 0.009422700852155685, 0.052548013627529144, 0.011436015367507935, -0.0155875775963068, 0.0058861845172941685, -0.012512346729636192, 0.031194375827908516, -0.018787739798426628, 0.04190002381801605, 0.04597470536828041, -0.056930217891931534, -0.03361612185835838, 0.11739695072174072, 0.030271805822849274, -0.005838134326040745, -0.026889052242040634, -0.015635628253221512, 0.005376849323511124, 0.022814370691776276, 0.03165566176176071, -0.03480777144432068, 0.046474430710077286, -0.01653897762298584, 0.06000544875860214, -0.01749037764966488, -0.035615019500255585, -0.07572756707668304, -0.013502187095582485, -0.003750340547412634, -0.020027441903948784, -0.018605148419737816, 0.0346347913146019, -0.008298318833112717, -0.010407735593616962, 0.004992445465177298, -0.019470056518912315, 0.038613371551036835, -0.009571656584739685, 0.11516740918159485, -0.0038992969784885645, -0.060236088931560516, 0.05108727887272835, 0.019412396475672722, 0.03738327696919441, 0.035307496786117554, -0.0374986007809639, -0.06999994814395905, -0.0031641244422644377, -0.004567198920994997, 0.007784178946167231, 0.04370672255754471, -0.005352823995053768, -0.017605697736144066, -0.014146063476800919, -0.015683678910136223, -0.003995398059487343, 0.0323091484606266, 0.060274530202150345, -0.03238602727651596, -0.03997800499200821, -0.024082904681563377, -0.05735306069254875, 0.04524433985352516, -0.0523558109998703, 0.027792401611804962, 0.030098825693130493, -0.07142224162817001, -0.01421333383768797, 0.004353374242782593, 0.07023058831691742, -0.02152661792933941, 0.000987437553703785, 0.03694121539592743, 0.012992851436138153, 0.08410757035017014, -0.045129016041755676, 0.037921443581581116, 0.08280059695243835, 0.07265233248472214, 0.03788300231099129, 0.033789101988077164, -0.0021298378705978394, -0.004187599755823612, -0.00034296035300940275, -0.03632616624236107, -0.008937390521168709, 0.01993134245276451, -0.034923095256090164, -0.01736544631421566, 0.008831679821014404, -0.02048872783780098, -0.08333876729011536, -0.03669135272502899, -0.02052716724574566, 0.07134535908699036, 0.031847864389419556, 0.06919270008802414, 0.0019196169450879097, 0.023467857390642166, 0.025063134729862213, 0.02166115865111351, 0.017442326992750168, -0.03746015951037407, 0.07957160472869873, 0.02569740079343319, -0.06292691826820374, 0.027811622247099876, -0.07349802553653717, 0.008966220542788506, 0.03703731670975685, -0.02118065394461155, 0.021776480600237846, -0.029579879716038704, -0.030675429850816727, 0.01724051497876644, 0.06242719292640686, -0.04293791577219963, -0.047204796224832535, 0.03865181282162666, 0.10255895555019379, -0.0037287177983671427, -0.0015808610478416085, -0.01749037764966488, 0.014616957865655422, -0.028964832425117493, -0.04320699721574783, 0.0560845285654068, -0.008591427467763424, -0.011032391339540482, 0.04605158790946007, -0.008480911143124104, 0.013088952749967575, -0.04324543848633766, 0.04628222808241844, 0.03434648737311363, -0.019066432490944862, 0.005405679810792208, 0.015059022232890129, -0.0021899009589105844, -0.044168006628751755, -0.05447003245353699, -0.013579067774116993, -0.02496703341603279, -0.00042764932732097805, -0.009240108542144299, 0.004764205776154995, -0.02162271924316883, 0.01650053635239601, -0.0013502186629921198, -0.04086213558912277, 0.07814931124448776, -0.00149797392077744, 0.019518107175827026, 0.054239388555288315, 0.03936295956373215, 0.046820394694805145, 0.06638655066490173, 0.06907738000154495, -0.0092256935313344, 0.019777581095695496, 0.003690277459099889, -0.05028003081679344, -0.010647987946867943, 0.015789389610290527, -0.03519217669963837, 0.0618121474981308, 0.01343491580337286, -0.07249857485294342, -0.0221801046282053, -0.058621592819690704, 0.019258635118603706, -0.03963204100728035, 0.024544188752770424, -0.04366828128695488, -0.015568357892334461, 0.008240658789873123, 0.02404446341097355, -0.0024349584709852934, 0.008586621843278408, 0.006136047188192606, 0.009278548881411552, -0.032789651304483414, -0.0005546828033402562, -0.07549692690372467, -0.022506847977638245, -0.022026343271136284, 0.016817670315504074, 0.02652386948466301, 0.0015075840055942535, -0.06258095055818558, 0.05304773896932602, 0.053163059055805206, -0.030444787815213203, 0.04858865216374397, 0.01181080937385559, -0.022948913276195526, 0.023198774084448814, 0.01421333383768797, -0.016615858301520348, -0.010215533897280693, 0.05397030711174011, -0.04001644626259804, -0.03799832612276077, -0.08280059695243835, 0.023448636755347252, 0.009148812852799892, 0.027965383604168892, 0.036614470183849335, -0.020738590508699417, 0.03007960505783558, 0.03519217669963837, 0.06415700912475586, 0.00406987639144063, -0.01050383597612381, -0.028292126953601837, 0.021584277972579002, -0.04428332671523094, 0.005713202990591526, -0.03769080340862274, -0.005352823995053768, -0.0031833448447287083, 0.010715258307754993, -0.06534866243600845, 0.0014691436663269997, 0.014905260875821114, 0.024025242775678635, 0.0690004974603653, 0.00785625446587801, -0.053893424570560455, 0.023333316668868065, 0.006376299541443586, -0.021199874579906464, -0.051856085658073425, 0.012320145033299923, -0.002099806210026145, -0.022756710648536682, 0.02052716724574566, -0.0125892274081707, -0.02742721699178219, 0.02656230889260769, 0.03252056986093521, -0.011714708991348743, 0.011858860030770302, -0.00462245661765337, 0.0129544110968709, -0.03601864352822304, -0.0052567231468856335, 0.06730911880731583, 0.008211827836930752, 0.007260428741574287, 0.050856634974479675, 0.0021634730510413647, -0.024544188752770424, 0.001577257178723812, -0.004651287104934454, -0.03180942311882973, 0.01922980509698391, -0.06696315854787827, -0.009552436880767345, -0.020546387881040573, 0.051202598959207535, 0.01624106429517269, -0.03465401008725166, 0.033962082117795944, -0.04140029847621918, -0.08864353597164154, 0.026850612834095955, 0.015183953568339348, 0.07453591376543045, -0.07488188147544861, 0.057622142136096954, 0.032751210033893585, -0.021295975893735886, 0.0011321896454319358, -0.01724051497876644, -0.06204278767108917, -0.059621043503284454, 0.03380832076072693, -0.028984053060412407, -0.02652386948466301, -0.00918244756758213, 0.014357485808432102, 0.003053608350455761, -0.04735856130719185, 0.003750340547412634, -0.005626711994409561, -0.03763313964009285, 0.00344521994702518, 0.058621592819690704, -0.014203723520040512, -0.04524433985352516, 0.08149362355470657, -0.011099662631750107, 0.0732673853635788, -0.040439289063215256, -0.04151562228798866, 0.006482010707259178, 0.035749562084674835, -0.052509572356939316, 0.014770719222724438, -0.01031163427978754, -0.00658772187307477, -0.0543547086417675, -0.0050597162917256355, -0.07042279094457626, 0.019306685775518417, -0.013348424807190895, 0.03086763247847557, 0.05577700585126877, -0.02052716724574566, 0.049203697592020035, -0.05466223508119583, 0.029195476323366165, -0.00047810233081690967, 0.10917070508003235, -0.058198750019073486, 0.01579900085926056, -0.005890989676117897, -0.012637278065085411, 0.008014821447432041, -0.03155956044793129, -0.02965676039457321, -0.005472950637340546, -0.017211684957146645, -0.010475005954504013, -0.00019400383462198079, 0.06999994814395905, 0.021122993901371956, 0.012368195690214634, -0.013723218813538551, 0.0011730324476957321, -0.032539788633584976, -0.012550787068903446, 0.015895100310444832, -0.0071739377453923225, -0.017913222312927246, -0.05550792068243027, -0.028753411024808884, -0.04120809584856033, -0.0024697950575500727, 0.03269354999065399, -0.04320699721574783, 0.04032396897673607, -0.04270727187395096, -0.046128466725349426, 0.05477755516767502, 0.008649087511003017, 0.009446725249290466, -0.07949472218751907, 0.04339919984340668, 0.06842388957738876, 0.031155936419963837, 0.0423613078892231, -0.08987362682819366, -0.029272357001900673, 0.03359689936041832, -0.07476655393838882, -0.007246013265103102, 0.04566718265414238, -0.002556285820901394, -0.02925313636660576, -0.009389065206050873, 0.01605847291648388, 0.030406348407268524, 0.05535415932536125, -0.05616140738129616, -0.00454797875136137, -0.024813272058963776, 0.01641404628753662, 0.03822896629571915, 0.013876980170607567, -0.03759470209479332, -0.0022956118918955326, -0.01953732781112194, 0.008802848868072033, -0.003365936689078808, 0.011685878038406372, -0.01562601886689663, 0.07430527359247208, -0.02800382301211357, 0.022256985306739807, 0.07576600462198257, -0.0010619157692417502, -0.03169409930706024, 0.016337165609002113, 0.01944122649729252, 0.020565608516335487, 0.016856111586093903, 0.013040902093052864, 0.02417900413274765, -0.003397169290110469, -0.03586488217115402, 0.048165809363126755, 0.036479927599430084, -0.019681479781866074, 0.013963471166789532, -0.03167488053441048, -0.008327149786055088, 0.00197607628069818, -0.001437910832464695, -0.0783415138721466, -0.029579879716038704, 0.010388514958322048, -0.08433821052312851, -0.01866280846297741, 0.03613396733999252, -0.01914331316947937, 0.0029719225130975246, -0.031021393835544586, 0.01521278452128172, -0.006799143739044666, -0.03365455940365791, -0.006851999554783106, 0.023429417982697487, 0.020853910595178604, -0.034096624702215195, -0.010388514958322048, -0.06761664152145386, -0.04958810284733772, -0.0340389646589756, 0.08049417287111282, -0.06819324940443039, 0.021718820556998253, 0.03313561528921127, -0.02414056472480297, 0.023294875398278236, 0.019345125183463097 ]
39,345
pyspark.sql.dataframe
_ipython_key_completions_
Returns the names of columns in this :class:`DataFrame`. Examples -------- >>> df = spark.createDataFrame([(2, "Alice"), (5, "Bob")], ["age", "name"]) >>> df._ipython_key_completions_() ['age', 'name'] Would return illegal identifiers. >>> df = spark.createDataFrame([(2, "Alice"), (5, "Bob")], ["age 1", "name?1"]) >>> df._ipython_key_completions_() ['age 1', 'name?1']
def _ipython_key_completions_(self) -> List[str]: """Returns the names of columns in this :class:`DataFrame`. Examples -------- >>> df = spark.createDataFrame([(2, "Alice"), (5, "Bob")], ["age", "name"]) >>> df._ipython_key_completions_() ['age', 'name'] Would return illegal identifiers. >>> df = spark.createDataFrame([(2, "Alice"), (5, "Bob")], ["age 1", "name?1"]) >>> df._ipython_key_completions_() ['age 1', 'name?1'] """ return self.columns
(self) -> List[str]
[ 0.018596826121211052, -0.04841587692499161, -0.0032776016741991043, -0.03316790238022804, 0.05286914110183716, 0.035786423832178116, 0.04453263059258461, -0.004448809660971165, 0.03402293100953102, -0.03662363439798355, -0.03026437573134899, -0.011427072808146477, -0.013805115595459938, -0.0011968144681304693, -0.029231218621134758, -0.052299123257398605, 0.05190723389387131, 0.013110406696796417, 0.015319225378334522, -0.01425934862345457, -0.0028077824972569942, 0.015871429815888405, 0.019273722544312477, -0.060172490775585175, -0.025472665205597878, 0.06334321200847626, 0.02851869724690914, 0.004693739581853151, 0.07046843320131302, -0.0019137898925691843, -0.0914878398180008, -0.006034171674400568, -0.015622046776115894, -0.009993122890591621, -0.062452562153339386, -0.044782012701034546, 0.054116055369377136, -0.012558202259242535, 0.12661518156528473, -0.046919580549001694, -0.011373634450137615, -0.017893211916089058, 0.009895150549709797, -0.07730864733457565, -0.05219224467873573, -0.018774958327412605, 0.014508731663227081, -0.046955205500125885, 0.05507795885205269, -0.025205468758940697, 0.004014616832137108, -0.03003280609846115, 0.010269224643707275, -0.025098590180277824, -0.029623106122016907, 0.00835432205349207, 0.026755204424262047, -0.041682541370391846, -0.03088783286511898, 0.018774958327412605, -0.057536158710718155, 0.0071385810151696205, -0.02011093683540821, -0.014312787912786007, 0.04887901619076729, -0.02027125470340252, 0.04371323063969612, 0.021642858162522316, -0.07695239037275314, -0.023958556354045868, -0.021696297451853752, -0.04645644128322601, -0.02492045983672142, 0.06939965486526489, -0.010937213897705078, -0.06868713349103928, -0.07566984742879868, -0.014099030755460262, -0.010224692523479462, -0.016851147636771202, 0.0023624561727046967, -0.014820459298789501, -0.03801305592060089, -0.011631923727691174, 0.017047090455889702, -0.014107937924563885, -0.0031996695324778557, 0.043855734169483185, 0.0019093365408480167, 0.046064555644989014, -0.029943741858005524, 0.004404277075082064, 0.011453792452812195, 0.04364197701215744, -0.03669488802552223, -0.02119753323495388, -0.012193034403026104, 0.016076279804110527, 0.006194489076733589, -0.0031261907424777746, -0.0032018960919231176, 0.05016155540943146, 0.10552452504634857, 0.056716758757829666, -0.034860145300626755, -0.04086314141750336, -0.0577499158680439, -0.009984215721487999, -0.03662363439798355, -0.04617143049836159, -0.04086314141750336, 0.015007496811449528, 0.046100180596113205, -0.0350738987326622, 0.05546984449028969, -0.007192019838839769, 0.004894135985523462, 0.03092345967888832, 0.03968748077750206, -0.01544391643255949, -0.0063904328271746635, 0.00427735922858119, -0.00832314882427454, -0.0534747838973999, -0.007027249317616224, 0.019059965386986732, -0.015203440561890602, 0.01707381010055542, -0.01825837977230549, 0.008835273794829845, 0.008425573818385601, -0.006555203348398209, -0.022337567061185837, 0.0697559118270874, 0.038084305822849274, 0.0011233356781303883, 0.08521763980388641, 0.009797179140150547, 0.04285820573568344, 0.042110055685043335, -0.00939638540148735, -0.01298571564257145, 0.0003893821849487722, 0.0441763699054718, 0.004101455211639404, 0.00013839907478541136, 0.047810234129428864, 0.043926987797021866, 0.03751428797841072, -0.06640706211328506, -0.030780954286456108, 0.008434480056166649, -0.028572136536240578, -0.026060495525598526, 0.019273722544312477, 0.03708677366375923, -0.025508292019367218, -0.02178536355495453, 0.0019393961410969496, -0.03651675954461098, 0.03332822024822235, -0.035786423832178116, -0.06188254430890083, 0.031956616789102554, 0.035911113023757935, 0.005263756960630417, 0.027075840160250664, -0.037300530821084976, 0.020217815414071083, 0.04549453780055046, 0.008826367557048798, 0.0228719599545002, 0.009921870194375515, 0.005927293095737696, 0.010402822867035866, 0.05693051591515541, -0.050090305507183075, 0.04927090182900429, 0.014677955769002438, -0.033541977405548096, 0.0036895284429192543, -0.03975873440504074, -0.07816367596387863, 0.01532813161611557, 0.01664629764854908, 0.028981836512684822, 0.013644798658788204, 0.00516578508540988, 0.01591596193611622, 0.006782319862395525, -0.07452981173992157, -0.04706208407878876, -0.006991622969508171, 0.04848713055253029, -0.03975873440504074, -0.00876847468316555, -0.016993653029203415, -0.00594955962151289, -0.011943651363253593, -0.06797461211681366, 0.025258908048272133, 0.021179718896746635, -0.01668192446231842, 0.030050620436668396, 0.024599825963377953, -0.005027734208852053, -0.026951149106025696, -0.05956684798002243, 0.019950618967413902, -0.04667019844055176, 0.050125930458307266, -0.019861552864313126, -0.015933776274323463, -0.007249912247061729, -0.011916931718587875, 0.024795768782496452, -0.02508077770471573, -0.020093122497200966, 0.03457513451576233, 0.04154003784060478, 0.11072593182325363, 0.017251942306756973, 0.005058906972408295, 0.02581111341714859, 0.052299123257398605, -0.030531572178006172, 0.0422525592148304, 0.0017968916799873114, -0.01117769069969654, -0.042110055685043335, -0.02561516873538494, -0.021607233211398125, -0.037692420184612274, 0.01836525648832321, -0.05871182307600975, 0.06391323357820511, -0.004520061891525984, -0.0011979277478531003, -0.009601235389709473, -0.021304409950971603, -0.06369947642087936, 0.06480388343334198, 0.03648113086819649, 0.042537569999694824, -0.014090124517679214, -0.039046213030815125, 0.010322663933038712, 0.06056438013911247, -0.031564727425575256, 0.01980811357498169, 0.029249032959342003, -0.05949559435248375, 0.014134657569229603, 0.000784330943133682, -0.020609701052308083, -0.004622487351298332, -0.050945330411195755, 0.0418606735765934, -0.012896650470793247, 0.014134657569229603, -0.03192099183797836, 0.02429700456559658, -0.03502046316862106, 0.04645644128322601, 0.02053844928741455, 0.0012881063157692552, 0.022497884929180145, 0.022604763507843018, -0.03272257745265961, -0.010527513921260834, 0.04093439504504204, 0.012273193337023258, -0.04848713055253029, 0.009244974702596664, 0.004217240028083324, -0.01934497430920601, -0.0006802359712310135, 0.03872557729482651, -0.09647548943758011, -0.01803571544587612, 0.03776367008686066, -0.01498077716678381, -0.04200317710638046, 0.04047125577926636, -0.021482542157173157, -0.006644268520176411, -0.04848713055253029, -0.04595767706632614, -0.00618112925440073, -0.019291535019874573, 0.005490873474627733, 0.01498077716678381, 0.025864552706480026, 0.020413758233189583, 0.04592204838991165, 0.03081658110022545, 0.01720740832388401, -0.03332822024822235, 0.01710943691432476, 0.021874427795410156, 0.021714111790060997, 0.03655238449573517, -0.024190125986933708, -0.007592813577502966, -0.044283248484134674, -0.02089470997452736, -0.025704234838485718, 0.021055027842521667, -0.025205468758940697, -0.026381131261587143, 0.016468167304992676, 0.027147091925144196, -0.01356463972479105, 0.0019149031722918153, -0.016726456582546234, -0.03430793806910515, -0.017216315492987633, 0.04952028766274452, -0.021250972524285316, 0.05732240155339241, -0.015310319140553474, -0.04506702348589897, 0.01298571564257145, -0.010295944288372993, 0.005945106502622366, 0.03600018098950386, 0.025508292019367218, -0.04510264843702316, 0.004858510103076696, -0.005072266794741154, 0.004117041826248169, -0.030317815020680428, 0.0018291778396815062, -0.004684832878410816, -0.031725045293569565, -0.019790301099419594, 0.015568607486784458, 0.0596737265586853, 0.03243757039308548, 0.023584481328725815, -0.017091624438762665, -0.03421887382864952, 0.07581235468387604, 0.014508731663227081, -0.016200970858335495, -0.05611111596226692, 0.01023359876126051, 0.02066314034163952, 0.021019402891397476, -0.016949119046330452, 0.028500884771347046, -0.03639206662774086, -0.011533951386809349, -0.023281659930944443, 0.0666564404964447, 0.009209347888827324, -0.01845432259142399, 0.04403386637568474, -0.021500354632735252, 0.0732472687959671, 0.09633298963308334, -0.07631111890077591, -0.0044733029790222645, -0.033933866769075394, -0.02050282433629036, 0.0007080688374117017, -0.005490873474627733, -0.026683952659368515, 0.03352416679263115, -0.0387612022459507, -0.02185661531984806, 0.018347444012761116, 0.01654832623898983, -0.017296474426984787, -0.07431605458259583, -0.02554391697049141, 0.028500884771347046, 0.0271292794495821, -0.06049312651157379, -0.04414074495434761, 0.04927090182900429, -0.09398166835308075, 0.06248818710446358, 0.042181309312582016, -0.07574109733104706, 0.019736861810088158, -0.049235276877880096, -0.04268007352948189, -0.003916644956916571, 0.05201411247253418, -0.03316790238022804, -0.024207938462495804, -0.02406543493270874, 0.0666564404964447, 0.015452822670340538, -0.029516227543354034, 0.010340477339923382, -0.052299123257398605, 0.002562853042036295, -0.01701146550476551, 0.02386949025094509, -0.01067892462015152, 0.003513624658808112, -0.007459215819835663, 0.03603580594062805, 0.025401413440704346, 0.04442575201392174, -0.020413758233189583, -0.007628439925611019, -0.05700176954269409, 0.011427072808146477, -0.003353307256475091, 0.006719973869621754, -0.02794867940247059, 0.019986245781183243, 0.031992241740226746, -0.028429631143808365, -0.016566138714551926, 0.016441447660326958, 0.02224850282073021, -0.02577548660337925, -0.056217994540929794, -0.00984171126037836, 0.07445856183767319, -0.04196755215525627, 0.030941272154450417, -0.03293633460998535, -0.0014773700386285782, 0.04542328417301178, -0.046028926968574524, -0.06939965486526489, 0.0315825417637825, 0.010857055895030499, 0.00457350118085742, -0.018418695777654648, -0.03258007392287254, -0.0064394185319542885, -0.013529013842344284, 0.023780426010489464, 0.0488433912396431, 0.0017312060808762908, 0.013279630802571774, 0.02096596360206604, 0.003912191838026047, 0.021535981446504593, 0.013074780814349651, 0.004121494945138693, 0.06964903324842453, -0.03690864518284798, 0.042965084314346313, 0.08471887558698654, 0.05614674091339111, 0.023780426010489464, -0.05244162678718567, 0.06972029060125351, 0.06772522628307343, -0.06031499430537224, 0.05244162678718567, -0.031065963208675385, -0.01945185288786888, 0.021678484976291656, 0.08272381871938705, 0.0009858411503955722, -0.007695238571614027, 0.012798678129911423, 0.018614640459418297, -0.051764730364084244, -0.03975873440504074, -0.00904903095215559, 0.058355558663606644, -0.014669048599898815, 0.0015497355489060283, -0.010206879116594791, -0.07118095457553864, -0.02000405825674534, 0.011516138911247253, -0.011400354094803333, 0.05739365518093109, -0.009770459495484829, -0.027895240113139153, -0.06031499430537224, -0.08208254724740982, -0.016868960112333298, -0.03491358458995819, 0.04114815220236778, 0.0042127869091928005, -0.028037745505571365, -0.03972310572862625, -0.04499576985836029, -0.07460106164216995, 0.01941622793674469, 0.058034926652908325, -0.0035759704187512398, 0.01670864410698414, 0.06352134793996811, 0.0036472224164754152, 0.07467231899499893, -0.0063325404189527035, -0.0354657880961895, 0.047845859080553055, 0.03421887382864952, 0.01691349409520626, 0.024635450914502144, 0.01568439230322838, 0.023816050961613655, -0.07460106164216995, 0.06035062298178673, 0.000542184803634882, -0.06010124087333679, -0.10338695347309113, 0.0140455923974514, -0.047881484031677246, 0.040364377200603485, -0.04902151972055435, -0.011195503175258636, -0.005379541777074337, -0.022729454562067986, 0.009405291639268398, 0.026808643713593483, 0.10274568945169449, -0.02716490440070629, -0.023156968876719475, -0.021731924265623093, -0.008180644363164902, -0.008910979144275188, 0.07029030472040176, 0.047026459127664566, 0.012139595113694668, -0.01891746185719967, 0.07937496155500412, -0.031689420342445374, 0.01707381010055542, 0.04453263059258461, 0.013867461122572422, -0.062773197889328, 0.0740310475230217, -0.01925591006875038, 0.0028144624084234238, -0.047382719814777374, 0.042074430733919144, 0.007922355085611343, 0.04189629852771759, 0.007521561346948147, -0.03754991665482521, 0.03437919169664383, 0.004827337339520454, -0.07716614007949829, -0.02620300091803074, -0.027147091925144196, 0.003103924449533224, 0.0006295800558291376, -0.0029102074913680553, 0.006706614512950182, -0.04556578770279884, -0.062773197889328, 0.010572046972811222, 0.03639206662774086, -0.0018570107640698552, -0.03108377754688263, -0.02069876715540886, 0.012994621880352497, -0.018240565434098244, 0.056716758757829666, -0.047382719814777374, -0.015604234300553799, 0.041718170046806335, 0.019238097593188286, -0.004021296743303537, -0.015907056629657745, -0.03804868087172508, -0.019540918990969658, 0.01608518697321415, 0.06402011215686798, -0.03922434151172638, -0.020289067178964615, -0.028625575825572014, 0.014811553061008453, 0.030976898968219757, -0.029712172225117683, -0.03701552376151085, 0.0003938354493584484, 0.04994779825210571, 0.03550141304731369, 0.018418695777654648, -0.040756262838840485, 0.007241006009280682, -0.015764551237225533, -0.004849603399634361, 0.006817945744842291, -0.02709365263581276, -0.03466419875621796, -0.06459012627601624, 0.01922028325498104, -0.035715170204639435, 0.04909277334809303, 0.046100180596113205, -0.0515509732067585, 0.005499780178070068, 0.02367354743182659, -0.0476677268743515, 0.028198061510920525, 0.016102999448776245, -0.005851587746292353, 0.00046174772433005273, 0.03252663463354111, -0.010224692523479462, 0.023887302726507187, 0.08678518980741501, -0.01767054758965969, -0.000192464460269548, -0.07214286178350449, -0.010759083554148674, 0.029872488230466843, 0.001933829509653151, -0.04973404109477997, 0.02429700456559658, 0.07873369008302689, -0.043000709265470505, 0.03345291316509247, -0.016468167304992676, -0.07531358301639557, -0.01343104150146246, 0.03596455231308937, 0.0023824956733733416, 0.04895026981830597, -0.03386261314153671, -0.012317725457251072, 0.04239506646990776, -0.00778875732794404, -0.020360318943858147, -0.011516138911247253, -0.011694269254803658, 0.04841587692499161, -0.021963493898510933, 0.02949841506779194, 0.04499576985836029, -0.01902434043586254, -0.0480596162378788, -0.07071781903505325, 0.024011995643377304, -0.015158907510340214, 0.006706614512950182, 0.02522328309714794, 0.012958995997905731, 0.012700706720352173, 0.020556261762976646, -0.04057813435792923, 0.01044735498726368, 0.044675134122371674, -0.05522046238183975, -0.03562610596418381, 0.029017463326454163, -0.005228131078183651, -0.014927337877452374, -0.029747797176241875, -0.013992153108119965, -0.06398448348045349, -0.057073019444942474, 0.000029172351787565276, -0.05016155540943146, 0.01934497430920601, -0.04150441288948059, -0.02620300091803074, -0.037728045135736465, 0.004085869062691927, -0.009227161295711994, -0.0012168542016297579, -0.0176349226385355, 0.015087655745446682, 0.07007654756307602, 0.04716896265745163, -0.006132143549621105, -0.0016755402320995927, -0.06220318004488945, -0.012798678129911423, 0.040756262838840485, 0.024475134909152985, 0.009654674679040909, 0.03612487018108368, -0.01819603331387043, 0.008300882764160633, -0.03297195956110954, 0.007316711358726025, -0.011587390676140785, -0.005214771255850792, -0.011400354094803333, 0.056609880179166794, 0.028394006192684174, 0.009601235389709473, -0.06491076201200485, 0.014695768244564533, 0.003206349443644285, 0.034699827432632446, 0.033933866769075394, 0.019558731466531754, -0.004413183778524399, 0.00712076760828495, -0.009351852349936962, 0.006969356909394264, -0.011453792452812195, -0.004321891814470291, 0.06309383362531662, 0.04941340908408165, 0.0189887136220932, 0.03872557729482651, 0.01984374038875103, 0.03131534531712532, 0.040400002151727676, -0.03829806298017502, 0.0033911599311977625, -0.01523016020655632, -0.02689770981669426, -0.006639815401285887, 0.019540918990969658, 0.02132222428917885, -0.037229280918836594, -0.0057981484569609165, -0.03320353105664253, 0.07688113301992416, 0.02367354743182659, 0.09013404697179794, 0.00022962137882132083, 0.01067892462015152, 0.06483951210975647, 0.01379620935767889, 0.032152559608221054, -0.07128783315420151, -0.010661112144589424, -0.04093439504504204, 0.027574606239795685, 0.02386949025094509, -0.01615643873810768, -0.02837619185447693, 0.044354502111673355, 0.053617287427186966, -0.03776367008686066, 0.023317286744713783, 0.0005112902726978064, -0.024706704542040825, 0.04617143049836159, -0.04709771275520325, 0.018178220838308334, 0.014464198611676693, 0.015800178050994873, 0.023424163460731506, -0.0057046301662921906, 0.0013960979413241148, 0.0010910495184361935, 0.03975873440504074, 0.04004374146461487, -0.01344885490834713, 0.048273373395204544, -0.024136686697602272, -0.04848713055253029, 0.008563624694943428, 0.03297195956110954, -0.020983776077628136, 0.024172311648726463, -0.0024359349627047777, -0.0056734574027359486, -0.032882895320653915, -0.004130401648581028, 0.005045547150075436, 0.006662081461399794, 0.004544555209577084, -0.061561908572912216, 0.01888183504343033, 0.0259714312851429 ]
39,346
pyspark.sql.dataframe
_jcols
Return a JVM Seq of Columns from a list of Column or column names If `cols` has only one list in it, cols[0] will be used as the list.
def _jcols(self, *cols: "ColumnOrName") -> JavaObject: """Return a JVM Seq of Columns from a list of Column or column names If `cols` has only one list in it, cols[0] will be used as the list. """ if len(cols) == 1 and isinstance(cols[0], list): cols = cols[0] return self._jseq(cols, _to_java_column)
(self, *cols: 'ColumnOrName') -> py4j.java_gateway.JavaObject
[ 0.014380748383700848, -0.023214388638734818, -0.023770838975906372, -0.00026531892945058644, -0.05272361636161804, -0.024327287450432777, 0.055471085011959076, 0.07101690024137497, 0.026570476591587067, 0.024292510002851486, -0.00004391415495774709, 0.04695044830441475, -0.0022051495034247637, 0.01694563403725624, 0.008242412470281124, 0.010642101988196373, 0.06211370602250099, 0.02065819688141346, 0.023127444088459015, 0.0346737764775753, 0.006629577372223139, -0.006338310427963734, 0.04816768318414688, 0.03536933660507202, -0.02144070528447628, 0.023805616423487663, 0.06336572021245956, -0.01388516090810299, 0.01519803423434496, -0.010581240057945251, -0.05154116079211235, 0.004712434019893408, -0.027718154713511467, 0.010824686847627163, -0.006642619147896767, 0.037386469542980194, 0.021649373695254326, -0.010920326225459576, 0.04771556705236435, -0.061452921479940414, -0.0008286971715278924, -0.040377385914325714, 0.027196481823921204, -0.07199069112539291, -0.008559762500226498, -0.01561537105590105, 0.043437860906124115, -0.02926578000187874, -0.0052254111506044865, -0.03867325931787491, 0.009903066791594028, -0.012711399234831333, 0.03147418797016144, -0.0369691327214241, -0.04507243260741234, 0.03356087580323219, 0.02326655574142933, 0.10210853070020676, -0.023823006078600883, 0.05373217910528183, -0.011824557557702065, -0.02217104472219944, -0.00695996917784214, 0.01658046431839466, 0.03634312376379967, 0.03046562522649765, -0.0032952260226011276, -0.01772814244031906, -0.048689354211091995, 0.007281666621565819, -0.043437860906124115, -0.011050744913518429, -0.023005720227956772, 0.08833640068769455, 0.030917739495635033, 0.010946409776806831, -0.06712175160646439, 0.002330133458599448, -0.003534325398504734, -0.032134972512722015, 0.019475741311907768, 0.006568715441972017, -0.04169895499944687, -0.046776559203863144, 0.0645829513669014, 0.0029191875364631414, -0.031056853011250496, 0.043020524084568024, -0.028674552217125893, 0.026170527562499046, -0.05665354058146477, 0.01146808173507452, -0.04437686875462532, 0.04914147034287453, -0.016310933977365494, -0.014389443211257458, -0.012963540852069855, 0.03804725408554077, -0.019806133583188057, 0.05449729785323143, 0.036621350795030594, -0.053210508078336716, 0.027544263750314713, -0.005012395326048136, 0.0014389443676918745, -0.022849218919873238, -0.0263444185256958, -0.035195447504520416, 0.00010691551869967952, -0.009468340314924717, -0.022710105404257774, 0.06590452045202255, 0.029248390346765518, -0.044585537165403366, 0.005677526351064444, 0.013606935739517212, -0.014911115169525146, -0.02250143699347973, -0.03943837806582451, 0.020049581304192543, -0.010607323609292507, 0.022675327956676483, 0.02135375887155533, 0.00687302416190505, -0.015502342954277992, -0.005794902797788382, -0.011311580426990986, -0.007068650797009468, 0.015919679775834084, -0.0012041920563206077, 0.05814899876713753, -0.05188893899321556, -0.010172597132623196, -0.010459516197443008, 0.020153915509581566, -0.004012524615973234, 0.04069038853049278, -0.03084818460047245, 0.05004569888114929, -0.03769947215914726, 0.008820598013699055, -0.0034539010375738144, 0.03846459090709686, 0.006294838152825832, -0.01959746517241001, -0.011676750145852566, 0.07178202271461487, 0.02408384159207344, -0.052445389330387115, 0.03749080374836922, -0.10141296684741974, -0.024222953245043755, -0.04096861556172371, -0.05943578854203224, -0.025440188124775887, -0.00658610463142395, -0.02330133318901062, -0.029996119439601898, -0.009468340314924717, -0.015910984948277473, 0.009311839006841183, -0.03898626193404198, -0.059644460678100586, 0.07762474566698074, 0.0323784202337265, 0.028796276077628136, -0.003684306051582098, -0.01956268772482872, -0.036308348178863525, 0.012207116931676865, 0.045315876603126526, 0.021197257563471794, 0.059192344546318054, -0.029422281309962273, -0.022257991135120392, 0.022310158237814903, -0.035473670810461044, 0.05220194160938263, 0.02437945455312729, -0.006294838152825832, 0.021666763350367546, -0.012085393071174622, -0.013267848640680313, -0.0062557123601436615, 0.05595798045396805, 0.042324960231781006, -0.03048301301896572, -0.005673179402947426, 0.00806852150708437, -0.004108164459466934, -0.0315263569355011, 0.006642619147896767, 0.0406208336353302, 0.05609709024429321, -0.03714302182197571, -0.023231778293848038, -0.031752415001392365, 0.028448494151234627, -0.032900091260671616, 0.032204531133174896, -0.010285626165568829, -0.00884668156504631, -0.005421037785708904, 0.012746177613735199, 0.01488503161817789, 0.006725217215716839, 0.0009009704226627946, -0.03507372364401817, 0.01911057159304619, -0.06830421090126038, 0.0398557148873806, -0.021597206592559814, -0.0282572153955698, -0.07303403317928314, 0.03124813176691532, 0.010998577810823917, -0.0751207172870636, -0.024153398349881172, 0.029439670965075493, 0.01353737898170948, 0.08458036184310913, 0.010468211024999619, -0.02335350029170513, 0.025822747498750687, 0.0540451817214489, -0.035212837159633636, -0.009111864492297173, -0.025405408814549446, -0.009529202245175838, 0.0013117868220433593, -0.06406127661466599, -0.015424092300236225, 0.021214647218585014, -0.0210755355656147, -0.033995602279901505, 0.02891799807548523, -0.008046785369515419, 0.0062774489633738995, 0.03842981159687042, 0.012494035996496677, -0.039299264550209045, 0.0636439397931099, 0.0034886791836470366, 0.02034519426524639, 0.07783341407775879, 0.032882701605558395, 0.025318464264273643, 0.03582145273685455, -0.022449269890785217, 0.06319182366132736, -0.012059309519827366, 0.007512071635574102, 0.04816768318414688, -0.012763566337525845, -0.00786854699254036, 0.028361549600958824, 0.03126551955938339, 0.012328839860856533, -0.0037212579045444727, 0.0025648856535553932, 0.011546332389116287, -0.048341572284698486, 0.03957748785614967, 0.046463556587696075, 0.00040809938218444586, 0.0017888990696519613, 0.022797051817178726, 0.006677397061139345, -0.016267461702227592, 0.03234364092350006, 0.01481547486037016, 0.011015966534614563, -0.026553086936473846, -0.026100970804691315, 0.056966543197631836, 0.0017269505187869072, 0.010494294576346874, -0.06437428295612335, -0.06211370602250099, 0.013389572501182556, 0.04437686875462532, -0.01147677656263113, 0.002151895547285676, 0.05088037624955177, 0.0022388407960534096, 0.021997155621647835, -0.040794722735881805, -0.03298703581094742, -0.09577891230583191, -0.013511295430362225, 0.029996119439601898, 0.03609967976808548, 0.018623678013682365, -0.004660266917198896, 0.033230483531951904, 0.033665210008621216, 0.04542021080851555, 0.017771614715456963, 0.038568925112485886, 0.009807427413761616, -0.010363876819610596, -0.0019323587184771895, 0.04395953193306923, 0.018206341192126274, -0.03870803490281105, -0.06079213693737984, -0.06792164593935013, -0.014224247075617313, -0.017554251477122307, 0.013059180229902267, 0.01539800874888897, -0.02138853818178177, -0.07637272775173187, -0.0019975677132606506, -0.07000833749771118, 0.004260318353772163, -0.0624614842236042, 0.018293285742402077, 0.005855764262378216, 0.006894760299474001, -0.004512459971010685, -0.09835249930620193, 0.007638142444193363, -0.022310158237814903, -0.009259671904146671, 0.03041345812380314, 0.012328839860856533, -0.00809025764465332, -0.017180386930704117, -0.005421037785708904, 0.02297094091773033, 0.0025388021022081375, 0.036656126379966736, 0.03354348614811897, 0.056549206376075745, -0.04799379035830498, -0.015276284888386726, -0.00957267452031374, 0.009320533834397793, 0.023023109883069992, -0.001154198544099927, -0.09417912364006042, -0.009337922558188438, 0.021997155621647835, 0.01501544937491417, -0.024501178413629532, -0.0010004140203818679, 0.026535697281360626, 0.060305241495370865, 0.018171561881899834, 0.027648597955703735, -0.0263444185256958, 0.011563722044229507, 0.016302239149808884, -0.004747211933135986, 0.05046303942799568, -0.01998002454638481, -0.018936680629849434, 0.020206082612276077, -0.014285109005868435, 0.11755001544952393, -0.011250718496739864, 0.03338698670268059, -0.022449269890785217, 0.012833123095333576, 0.04841113090515137, -0.027996378019452095, -0.03749080374836922, 0.02745731733739376, -0.0008542373543605208, 0.01769336313009262, 0.03762991353869438, 0.040342606604099274, 0.027874656021595, -0.036273568868637085, -0.017910726368427277, -0.02220582403242588, 0.04437686875462532, -0.01879756897687912, -0.0594010129570961, -0.06733042001724243, -0.11706312000751495, 0.04507243260741234, -0.005773166194558144, -0.03130029886960983, 0.04691566899418831, -0.0018399794353172183, -0.06284404546022415, -0.04135117307305336, 0.017910726368427277, -0.007590322755277157, 0.025440188124775887, -0.039090596139431, -0.01876278966665268, -0.02331872284412384, -0.02213626727461815, 0.01996263489127159, 0.04399431124329567, 0.04023827239871025, -0.029544005170464516, -0.0412120595574379, -0.02036258392035961, -0.030743848532438278, 0.03710824251174927, -0.1080903634428978, -0.014606806449592113, 0.04778512194752693, -0.0014758961042389274, -0.008638013154268265, 0.011355052702128887, 0.0503934808075428, -0.004271186888217926, -0.003382171271368861, -0.034760721027851105, 0.026970423758029938, 0.028309382498264313, -0.020797310397028923, -0.04225540533661842, 0.05574931204319, 0.000745555735193193, -0.014050356112420559, -0.021249424666166306, -0.0033104412723332644, 0.05376695841550827, -0.006833898834884167, -0.0244316216558218, -0.04507243260741234, 0.007346875965595245, 0.014241635799407959, -0.037421245127916336, -0.03194369375705719, 0.009929150342941284, -0.013224376365542412, -0.058044664561748505, 0.03846459090709686, 0.05720999091863632, 0.007559891790151596, -0.0248141810297966, 0.058496780693531036, -0.007255583070218563, -0.008759736083447933, 0.03658657148480415, -0.01614573784172535, -0.010050874203443527, 0.007577280979603529, -0.0413859523832798, -0.01985830068588257, 0.0025627119466662407, -0.058844562619924545, -0.032134972512722015, 0.04994136467576027, 0.052410613745450974, 0.04969792068004608, -0.07310358434915543, 0.08910151571035385, -0.0010226938175037503, -0.029422281309962273, 0.01573709398508072, 0.038881927728652954, 0.01165066659450531, 0.0712951272726059, -0.04799379035830498, 0.07247757911682129, -0.04594188183546066, -0.047541677951812744, 0.007399043068289757, -0.059192344546318054, -0.051680270582437515, 0.019354017451405525, -0.004105990752577782, 0.011763695627450943, 0.029526615515351295, 0.024570735171437263, -0.05971401557326317, -0.002432294189929962, -0.0074251266196370125, 0.015145867131650448, 0.02109292335808277, -0.03491722419857979, 0.001797593547962606, -0.033995602279901505, -0.04239451512694359, 0.016067486256361008, -0.046463556587696075, -0.002825721399858594, 0.018223728984594345, -0.014328581281006336, -0.06983444839715958, 0.010216070339083672, -0.03839503228664398, -0.018206341192126274, 0.06819987297058105, 0.037421245127916336, -0.01128549687564373, 0.06367871910333633, -0.00007662052667001262, 0.03822114318609238, -0.017432527616620064, -0.0311437975615263, 0.061139918863773346, 0.014085134491324425, -0.002145374659448862, -0.021666763350367546, -0.004034260753542185, -0.009529202245175838, -0.11908025294542313, 0.10753391683101654, -0.0266400333493948, -0.07679006457328796, -0.054288629442453384, -0.030552569776773453, 0.004319006577134132, -0.04896757751703262, -0.01843239925801754, 0.006512200925499201, -0.014737224206328392, -0.015354535542428493, 0.01844978705048561, -0.03749080374836922, 0.03199586272239685, -0.002886583097279072, -0.004482029005885124, -0.01318090409040451, 0.027648597955703735, -0.041107725352048874, 0.058427225798368454, 0.0002153254026779905, 0.00881190411746502, 0.027648597955703735, 0.04284663125872612, -0.03571711853146553, 0.000115338341856841, -0.005121076945215464, 0.005234105512499809, -0.021179869771003723, 0.04987180978059769, 0.01485894713550806, 0.046393997967243195, -0.00886407122015953, 0.03721257671713829, 0.022675327956676483, 0.03469116613268852, 0.013424350880086422, 0.010085651651024818, -0.06312227249145508, -0.01799767278134823, -0.0345868319272995, -0.030204787850379944, 0.04587232694029808, 0.013050485402345657, -0.014372054487466812, 0.016310933977365494, -0.002458377741277218, 0.04131639376282692, -0.016484824940562248, -0.016702188178896904, -0.030639514327049255, -0.038499366492033005, 0.0006635011523030698, -0.0266400333493948, 0.023057887330651283, -0.011155079118907452, 0.06454817205667496, 0.01848456636071205, -0.0653480663895607, 0.06353960931301117, 0.024970682337880135, -0.011224634945392609, -0.008685832843184471, -0.03156113624572754, 0.0176325011998415, 0.01808461733162403, -0.015224117785692215, -0.011928891763091087, 0.03863848000764847, -0.05234105512499809, -0.0026170527562499046, 0.033699989318847656, -0.043368302285671234, 0.005547108594328165, -0.022310158237814903, 0.05759255215525627, -0.029248390346765518, -0.022414492443203926, -0.028326770290732384, 0.018554121255874634, -0.03427382931113243, -0.0020986415911465883, 0.03232625499367714, 0.005003700498491526, 0.015511036850512028, -0.019371407106518745, -0.021545039489865303, 0.01921490579843521, 0.012294062413275242, 0.013667797669768333, -0.04496809467673302, 0.054288629442453384, -0.05376695841550827, -0.06576540321111679, -0.013519990257918835, 0.01430249772965908, 0.029109278693795204, 0.0037582095246762037, 0.0248141810297966, -0.027196481823921204, -0.025266297161579132, 0.025735801085829735, 0.03010045364499092, 0.07470338046550751, -0.03354348614811897, 0.028761496767401695, -0.025840135291218758, 0.059227120131254196, -0.049419693648815155, 0.0025279338005930185, -0.023231778293848038, 0.00405382364988327, -0.0037234313786029816, -0.00810764729976654, -0.06312227249145508, -0.0191627386957407, 0.07185157388448715, 0.013285238295793533, -0.02590969204902649, -0.03310875967144966, -0.061139918863773346, -0.01999741420149803, 0.028831053525209427, -0.008503247983753681, 0.014606806449592113, 0.006803467869758606, 0.08771039545536041, -0.013346100226044655, 0.0014411179581657052, 0.017128219828009605, -0.06242670863866806, -0.08325879275798798, -0.007546850014477968, 0.02823982574045658, 0.01109421718865633, 0.03413471579551697, 0.012833123095333576, 0.0073338341899216175, -0.02147548273205757, -0.0001918230118462816, -0.02745731733739376, 0.003166981739923358, -0.00022524260566569865, -0.03083079494535923, -0.016997801139950752, 0.027596430853009224, -0.005286272615194321, 0.015893597155809402, -0.007472946308553219, 0.023127444088459015, -0.05978357046842575, -0.01145938690751791, -0.0032561004627496004, 0.008972752839326859, 0.04931535944342613, -0.04388997331261635, 0.013798215426504612, -0.09591802954673767, -0.026257473975419998, 0.02217104472219944, 0.027300816029310226, 0.02250143699347973, 0.03575189784169197, 0.06660008430480957, -0.0023953423369675875, -0.019632242619991302, 0.04326396808028221, -0.052445389330387115, 0.04555932432413101, -0.010859465226531029, 0.034447718411684036, -0.04361175000667572, 0.027300816029310226, -0.038881927728652954, -0.007212110795080662, -0.03460421785712242, -0.026118360459804535, 0.040446940809488297, -0.04910669103264809, -0.000030838404200039804, 0.03463899716734886, 0.05154116079211235, -0.019806133583188057, -0.0824241191148758, 0.04879368841648102, 0.011902808211743832, 0.04402908682823181, 0.03804725408554077, 0.0016736965626478195, 0.0429161861538887, -0.012111476622521877, -0.03686479851603508, 0.004375521093606949, 0.0865974947810173, -0.013563462533056736, 0.018588900566101074, -0.028274603188037872, 0.05860111489892006, 0.03936881944537163, 0.050567373633384705, 0.08117210865020752, 0.030917739495635033, 0.019736576825380325, -0.02406645193696022, -0.041838064789772034, 0.05835766717791557, 0.0015161082847043872, -0.005355828907340765, 0.026257473975419998, -0.005173244047909975, 0.029248390346765518, 0.003401733934879303, 0.017762919887900352, -0.004266839474439621, 0.015606677159667015, 0.017076052725315094, 0.022344935685396194, -0.04145550727844238, -0.044550757855176926, -0.014772002585232258, -0.0758858397603035, 0.014545944519340992, 0.016693493351340294, 0.001883452059701085, -0.020814698189496994, 0.005942709743976593, 0.04166417568922043, 0.036621350795030594, -0.0639917254447937, -0.07769429683685303, -0.003216975135728717, -0.010094346478581429, -0.03808202967047691, 0.05028914660215378, -0.1310439258813858, 0.014937198720872402, 0.05289750546216965, 0.048272017389535904, -0.038116808980703354, -0.04670700058341026, -0.024970682337880135, -0.002464898629114032, 0.009746565483510494, -0.004995006136596203, 0.013685186393558979, 0.03262186795473099, -0.02024086005985737, 0.009468340314924717, 0.02364911511540413, -0.04145550727844238, -0.029787451028823853, 0.023805616423487663, -0.007368612103164196, -0.05227150022983551, -0.07672051340341568, 0.08499769866466522, -0.04239451512694359, 0.007233846932649612, 0.0045472378842532635, -0.016693493351340294, 0.04051649942994118, 0.02968311682343483 ]
39,347
pyspark.sql.dataframe
_jmap
Return a JVM Scala Map from a dict
def _jmap(self, jm: Dict) -> JavaObject: """Return a JVM Scala Map from a dict""" return _to_scala_map(self.sparkSession._sc, jm)
(self, jm: Dict) -> py4j.java_gateway.JavaObject
[ 0.09265948832035065, -0.042193807661533356, -0.003972676116973162, 0.03669736906886101, -0.01553697232156992, -0.006181229837238789, 0.019482437521219254, 0.07880047708749771, 0.03784019127488136, -0.009038290940225124, 0.002913749311119318, 0.05561746284365654, 0.04560414329171181, 0.02788129262626171, -0.001397919375449419, -0.0074238246306777, -0.005741333123296499, 0.04843399301171303, 0.007931746542453766, 0.012171989306807518, -0.011518945917487144, -0.03446613997220993, 0.09708566963672638, 0.06940391659736633, -0.032307468354701996, -0.039871878921985626, 0.03208978846669197, 0.017949601635336876, 0.06472378224134445, -0.02548680268228054, -0.09360277652740479, -0.012580140493810177, -0.001412658137269318, 0.08242849260568619, 0.039799321442842484, 0.027917571365833282, 0.011437315493822098, 0.023854196071624756, -0.03950908035039902, -0.04386269673705101, 0.009192481637001038, 0.005972619168460369, -0.013124343007802963, -0.030493462458252907, 0.049667518585920334, 0.017423540353775024, 0.002911481773480773, -0.022910911589860916, 0.09672287106513977, -0.05692354962229729, -0.0031200924422591925, -0.036515966057777405, 0.0053739966824650764, 0.04756326973438263, -0.08351689577102661, 0.021387146785855293, -0.0169428288936615, 0.0658484622836113, -0.04603950306773186, 0.040742602199316025, -0.04288313165307045, -0.020915504544973373, -0.02350953407585621, 0.002032821998000145, 0.024652358144521713, 0.010711712762713432, -0.04578554257750511, 0.011255915276706219, -0.002316260477527976, -0.05090104416012764, -0.012326179072260857, -0.008893170394003391, -0.008666419424116611, 0.03680620715022087, -0.02116946503520012, 0.02824409306049347, -0.014031345956027508, -0.028461774811148643, -0.04669254645705223, 0.0003511804679874331, 0.040742602199316025, -0.06051528453826904, -0.04320965334773064, -0.04353617504239082, -0.03776763007044792, 0.01647118665277958, 0.05881011486053467, 0.003367251018062234, -0.10093136876821518, 0.008507694117724895, -0.04016212001442909, 0.043608736246824265, -0.046511147171258926, 0.07916327565908432, -0.02583146281540394, -0.041685886681079865, 0.009378417395055294, 0.002028286922723055, -0.04618462547659874, 0.017078878358006477, 0.03871091455221176, 0.020081060007214546, 0.010294491425156593, -0.0198270995169878, 0.005700517911463976, -0.012235479429364204, -0.02213088795542717, -0.013577844947576523, -0.008022447116672993, 0.008512228727340698, -0.05844731628894806, 0.0913534089922905, -0.026575205847620964, 0.0047390940599143505, 0.010630082339048386, 0.05815707519650459, 0.029622739180922508, -0.029604598879814148, -0.03765879198908806, 0.045023661106824875, -0.072306327521801, 0.021967628970742226, 0.03816671296954155, -0.03524615988135338, 0.014729739166796207, -0.02174994722008705, 0.055472344160079956, 0.002072503324598074, 0.007940816693007946, 0.02361837401986122, 0.05122756585478783, -0.03216234967112541, 0.017804481089115143, 0.03740483149886131, 0.023745356127619743, -0.008943055756390095, -0.006643801461905241, -0.019536858424544334, 0.0012618688633665442, 0.05039312317967415, 0.05978967994451523, 0.000763016811106354, -0.009514467790722847, 0.016516536474227905, -0.011591506190598011, -0.08061448484659195, 0.004233439452946186, 0.040234681218862534, -0.012144778855144978, -0.023781634867191315, -0.019536858424544334, 0.0029863095842301846, 0.0026144380681216717, 0.01487485971301794, -0.05224341154098511, -0.01716957800090313, 0.08250105381011963, -0.02828037366271019, 0.03669736906886101, -0.03998072072863579, 0.01701538823544979, -0.01973639987409115, -0.02974971942603588, -0.0330149307847023, -0.017087949439883232, 0.019028935581445694, 0.03375867381691933, -0.024761199951171875, -0.012543860822916031, -0.021514127030968666, -0.03490149974822998, -0.00382982287555933, 0.01792239211499691, -0.00016241034609265625, 0.058229632675647736, 0.047381870448589325, -0.004550890997052193, 0.05383973568677902, 0.04132308438420296, 0.044044096022844315, 0.013605054467916489, 0.025178421288728714, -0.06788015365600586, 0.041286807507276535, -0.0105665922164917, 0.016326066106557846, 0.0026665907353162766, 0.055399782955646515, 0.04375385493040085, 0.01464810874313116, 0.05975339934229851, -0.023672794923186302, -0.0022686428856104612, -0.0072152139618992805, -0.006281000096350908, -0.03535500168800354, -0.019065216183662415, -0.01582721434533596, -0.08968452364206314, 0.11812815070152283, -0.030765563249588013, 0.005972619168460369, -0.0027731636073440313, 0.03433915600180626, -0.012906662188470364, -0.0040429686196148396, 0.0014432695461437106, 0.0557263046503067, 0.04538646340370178, -0.026629626750946045, 0.00011103708675364032, -0.04339105263352394, -0.02218530885875225, -0.01820356398820877, 0.07041976600885391, -0.06066040322184563, 0.010403331369161606, 0.02124202437698841, -0.045023661106824875, -0.023400694131851196, 0.019010797142982483, 0.0375499501824379, -0.008965730667114258, 0.011736626736819744, 0.015010910108685493, -0.07480966299772263, -0.020026640966534615, -0.004884214606136084, 0.013360163196921349, -0.044515740126371384, 0.009156201966106892, -0.02263881079852581, 0.02403559722006321, -0.05877383425831795, 0.02501516044139862, -0.03484708070755005, 0.002291318029165268, -0.055907703936100006, -0.012834101915359497, 0.00018862841534428298, 0.040234681218862534, 0.0576491504907608, 0.016951898112893105, 0.042193807661533356, 0.006308210548013449, 0.03569966182112694, 0.029405057430267334, 0.08155776560306549, 0.010094950906932354, 0.040379803627729416, 0.06403445452451706, -0.024307698011398315, -0.023690935224294662, 0.03345029428601265, -0.019681978970766068, 0.002419432159513235, 0.024652358144521713, 0.025668203830718994, -0.04295569285750389, 0.011401035822927952, 0.031835827976465225, -0.00008892887126421556, 0.014076696708798409, 0.021115044131875038, 0.01856636442244053, 0.02213088795542717, 0.027591051533818245, 0.06548566371202469, -0.005904593504965305, 0.017931461334228516, 0.13111644983291626, -0.018221702426671982, 0.03250700980424881, -0.009047361090779305, -0.006639266852289438, -0.03542756289243698, -0.04277429357171059, -0.04001700133085251, 0.006525891367346048, 0.05235224962234497, -0.0031767801847308874, -0.04948611930012703, -0.030547883361577988, -0.0017199056455865502, -0.01626257598400116, -0.00016963802045211196, 0.01342365425080061, 0.006498680915683508, 0.00965958833694458, -0.06051528453826904, -0.035572681576013565, 0.020969923585653305, -0.04204868897795677, 0.008543974719941616, -0.035173602402210236, -0.03199908882379532, -0.011074514128267765, -0.011038234457373619, 0.012235479429364204, 0.04476970061659813, -0.006643801461905241, -0.015954194590449333, 0.05220713093876839, 0.08424250036478043, 0.0029545642901211977, -0.00821745302528143, -0.01573651283979416, 0.013378303498029709, -0.03867463394999504, 0.06704571098089218, -0.03969047963619232, -0.004108726512640715, -0.006027039140462875, 0.0258496031165123, -0.12103056907653809, -0.009786569513380527, -0.020824803039431572, 0.00990447960793972, 0.042665451765060425, 0.029604598879814148, -0.028443634510040283, -0.05177176743745804, -0.006072389427572489, -0.0020691021345555782, 0.01882939599454403, -0.047817230224609375, 0.024724919348955154, -0.028606895357370377, 0.09193389117717743, -0.03118278458714485, 0.01273433119058609, 0.033667974174022675, 0.025758903473615646, 0.00814035814255476, 0.028643174096941948, -0.0010152772301808, -0.0021280571818351746, -0.018294263631105423, -0.06704571098089218, 0.02211274951696396, -0.006140414625406265, -0.060551561415195465, -0.036515966057777405, -0.02965901978313923, 0.00394319836050272, 0.00360307190567255, -0.015419062227010727, -0.00038122496334835887, 0.015609532594680786, -0.053005293011665344, -0.007532665040344, 0.047418151050806046, 0.008616534993052483, 0.048760514706373215, -0.02352767437696457, 0.01203593797981739, 0.025758903473615646, -0.032289329916238785, -0.020008500665426254, 0.007369404658675194, 0.0576491504907608, -0.03337773308157921, -0.015709303319454193, -0.07698646932840347, 0.003625747049227357, 0.02639380656182766, -0.007927211932837963, -0.01775006204843521, 0.046366024762392044, -0.04749071225523949, 0.006244719959795475, -0.033178191632032394, -0.053948577493429184, 0.04059748351573944, -0.008394318632781506, 0.03856579586863518, -0.03296051174402237, 0.026774747297167778, -0.0489056371152401, 0.03813043236732483, -0.0146299684420228, -0.0574677512049675, 0.0005359824863262475, -0.018439384177327156, 0.012652700766921043, 0.032706551253795624, 0.03352285549044609, -0.011564296670258045, -0.03577222302556038, -0.0016065301606431603, -0.03709644824266434, 0.008376178331673145, 0.008058727718889713, 0.019119637086987495, 0.02965901978313923, 0.0198270995169878, -0.01011309027671814, -0.005854708608239889, 0.0422663688659668, 0.03308749198913574, -0.0008497490198351443, -0.011727557517588139, -0.03112836554646492, 0.009777499362826347, -0.04749071225523949, -0.0024035596288740635, -0.031273484230041504, 0.014947419986128807, 0.023382553830742836, -0.01988152042031288, 0.050647083669900894, -0.006494145840406418, -0.06294605135917664, -0.04284685105085373, -0.040307242423295975, 0.0489056371152401, 0.02073410339653492, -0.01975454017519951, 0.013795525766909122, 0.013305743224918842, 0.01892009563744068, -0.021514127030968666, -0.004355885088443756, -0.031908389180898666, -0.001412658137269318, -0.05423881858587265, 0.003099684836342931, -0.014112976379692554, -0.02450723759829998, 0.051626648753881454, -0.008997475728392601, -0.034611258655786514, 0.0003891612577717751, -0.06066040322184563, 0.042629171162843704, 0.08003400266170502, -0.011455455794930458, -0.03626200556755066, 0.016652585938572884, 0.00787732657045126, -0.04252032935619354, 0.03256143257021904, 0.024616079404950142, -0.007813836447894573, 0.04625718668103218, 0.012688981369137764, -0.03403077647089958, 0.01720585860311985, 0.018176352605223656, -0.03063858300447464, 0.03163628652691841, 0.02120574563741684, 0.04480598121881485, -0.031273484230041504, 0.05090104416012764, -0.03687876835465431, -0.019210336729884148, -0.05978967994451523, 0.05340437591075897, 0.03379495441913605, 0.021858787164092064, -0.08475042134523392, 0.014176466502249241, -0.011183355003595352, -0.021060625091195107, 0.06751734763383865, 0.0074737099930644035, 0.031200924888253212, -0.011328475549817085, -0.02740965038537979, 0.02033502236008644, 0.041758447885513306, 0.032742831856012344, -0.08061448484659195, -0.016616307199001312, 0.027990132570266724, 0.0012641362845897675, 0.01647118665277958, 0.03223491087555885, 0.023709075525403023, -0.025341682136058807, -0.030856264755129814, 0.04320965334773064, -0.03286981210112572, -0.017369119450449944, 0.0036098745185881853, 0.020588982850313187, -0.04614834487438202, 0.03900115564465523, -0.028661314398050308, -0.04063376411795616, 0.09120828658342361, 0.021895067766308784, 0.005423881579190493, 0.021786227822303772, -0.001221053651534021, 0.003773135133087635, 0.04865167662501335, 0.02075224369764328, -0.007813836447894573, -0.017586801201105118, 0.006997533142566681, -0.09316741675138474, -0.0017267081420868635, -0.0296952985227108, -0.05978967994451523, 0.02118760533630848, -0.005832033231854439, -0.02646636590361595, 0.00406564399600029, -0.01839403435587883, -0.00393412820994854, -0.013722965493798256, -0.001814007293432951, 0.02349139377474785, -0.001715370686724782, -0.048869356513023376, -0.020933644846081734, -0.04582182317972183, -0.004226637072861195, 0.008670954965054989, -0.039436519145965576, 0.037876471877098083, 0.011337545700371265, -0.055399782955646515, -0.020171761512756348, -0.006779852323234081, 0.00845327414572239, -0.0016779567813500762, 0.035554543137550354, -0.08583882451057434, -0.07836511731147766, -0.06312745064496994, -0.008412458933889866, -0.030910683795809746, 0.0212238859385252, 0.060624122619628906, -0.0035577218513935804, -0.015137890353798866, 0.008702700026333332, 0.007854651659727097, 0.002045293105766177, 0.032779112458229065, 0.0006246987613849342, 0.004562228452414274, 0.05282389372587204, -0.03914627805352211, -0.010231001302599907, -0.013976925984025002, 0.000528613047208637, -0.00473002390936017, 0.014702528715133667, -0.003099684836342931, 0.023854196071624756, -0.008965730667114258, -0.005582607351243496, 0.03252515196800232, -0.09062780439853668, -0.027699891477823257, -0.027663610875606537, 0.031908389180898666, 0.018666135147213936, 0.03250700980424881, -0.00405203877016902, -0.031835827976465225, 0.05993480235338211, -0.028878996148705482, 0.03921883925795555, -0.0836620181798935, -0.03733227029442787, 0.044515740126371384, -0.016879336908459663, 0.0675899088382721, -0.004491935484111309, 0.009967969730496407, 0.007378474809229374, -0.0169428288936615, 0.03921883925795555, 0.021514127030968666, 0.01033984124660492, -0.05949943885207176, 0.06936763972043991, 0.007931746542453766, 0.06664662808179855, -0.0074238246306777, 0.011373825371265411, -0.06936763972043991, 0.00516538554802537, 0.02592216432094574, -0.010076810605823994, -0.015264871530234814, 0.010675433091819286, -0.019065216183662415, 0.03306935355067253, 0.01059380266815424, -0.022276008501648903, -0.01510161068290472, 0.04676510766148567, -0.009414697997272015, -0.020988063886761665, -0.004711884073913097, 0.011528016068041325, -0.0037300523836165667, -0.042738012969493866, 0.011364755220711231, -0.0011354552116245031, -0.04204868897795677, 0.024815618991851807, 0.0021450635977089405, 0.02218530885875225, -0.07110908627510071, -0.05706866830587387, 0.026575205847620964, -0.0144122876226902, 0.04005328193306923, -0.032216768711805344, -0.014956490136682987, -0.019174056127667427, 0.029876699671149254, -0.0387834757566452, -0.02916923724114895, -0.012117568403482437, 0.04284685105085373, -0.024235136806964874, 0.025704482570290565, -0.002843456342816353, -0.017913321033120155, -0.0004231738857924938, 0.00968679878860712, -0.000721067888662219, -0.05373089388012886, -0.01935545727610588, 0.08583882451057434, -0.022802071645855904, 0.03550012409687042, 0.006507751066237688, 0.0001225163578055799, -0.013215042650699615, -0.011074514128267765, 0.07647854834794998, -0.03577222302556038, -0.0066755469888448715, 0.008525834418833256, -0.014793229289352894, 0.01892009563744068, -0.03539128229022026, 0.06345397233963013, 0.03740483149886131, 0.038928594440221786, 0.0014319319743663073, -0.004126866348087788, -0.035627104341983795, -0.040234681218862534, 0.0321442075073719, 0.035137321799993515, 0.007051953114569187, -0.06555822491645813, -0.012879451736807823, -0.026194265112280846, -0.028098972514271736, -0.05198944732546806, 0.0045418208464980125, -0.12661771476268768, -0.0840248167514801, 0.01697910763323307, -0.015246731229126453, -0.02679288759827614, 0.02396303601562977, 0.05706866830587387, 0.012181058526039124, 0.05975339934229851, 0.0006275331252254546, 0.03345029428601265, -0.04727302864193916, 0.000572829507291317, -0.0015498424181714654, 0.02788129262626171, 0.004643858410418034, 0.03676992654800415, -0.03914627805352211, -0.0016156001947820187, 0.04614834487438202, -0.034266598522663116, 0.090845488011837, -0.056306786835193634, -0.0216592475771904, 0.005718657746911049, 0.001031716587021947, -0.009274112060666084, -0.040343523025512695, -0.0007822906482033432, 0.004571298137307167, 0.03250700980424881, 0.016135593876242638, -0.03495591878890991, 0.017949601635336876, 0.010784273035824299, -0.03914627805352211, 0.016951898112893105, 0.05815707519650459, -0.028878996148705482, -0.037477388978004456, -0.018593573942780495, -0.02967715822160244, 0.013097132556140423, 0.01820356398820877, -0.002114452188834548, 0.021115044131875038, 0.07085512578487396, -0.055436063557863235, -0.019990360364317894, 0.04146820679306984, 0.04603950306773186, 0.0010050734272226691, 0.0006229981081560254, 0.06693686544895172, -0.017423540353775024, 0.001978401793166995, 0.00719707366079092, -0.00754173519089818, -0.002904679160565138, -0.03252515196800232, 0.027155689895153046, 0.06120460480451584, 0.009868199937045574, -0.008308153599500656, -0.04963123798370361, -0.04723674803972244, -0.030039960518479347, 0.04291941225528717, -0.0454227440059185, -0.01036705169826746, -0.08598394691944122, -0.04393525794148445, -0.05888267606496811, -0.055907703936100006, -0.018031232059001923, -0.016217224299907684, -0.011745696887373924, 0.05093732476234436, -0.04894191771745682, 0.01675235666334629, 0.004226637072861195, 0.024743059650063515, 0.015972334891557693, -0.028389213606715202, 0.03736855089664459, 0.0056551676243543625, 0.02167738787829876, 0.02742779068648815, 0.04389897733926773, 0.032724689692258835, -0.0717984065413475, 0.00528783118352294, 0.009541678242385387, 0.003421671222895384, -0.031872108578681946, 0.011174284853041172, 0.015972334891557693, -0.017459820955991745, -0.05518210306763649, 0.053513213992118835, -0.06033388152718544, -0.037513669580221176, -0.01853008382022381, -0.014974630437791348, 0.03542756289243698, -0.017269348725676537 ]
39,348
pyspark.sql.dataframe
_joinAsOf
Perform an as-of join. This is similar to a left-join except that we match on the nearest key rather than equal keys. Parameters ---------- other : :class:`DataFrame` Right side of the join leftAsOfColumn : str or :class:`Column` a string for the as-of join column name, or a Column rightAsOfColumn : str or :class:`Column` a string for the as-of join column name, or a Column on : str, list or :class:`Column`, optional a string for the join column name, a list of column names, a join expression (Column), or a list of Columns. If `on` is a string or a list of strings indicating the name of the join column(s), the column(s) must exist on both sides, and this performs an equi-join. how : str, optional default ``inner``. Must be one of: ``inner`` and ``left``. tolerance : :class:`Column`, optional an asof tolerance within this range; must be compatible with the merge index. allowExactMatches : bool, optional default ``True``. direction : str, optional default ``backward``. Must be one of: ``backward``, ``forward``, and ``nearest``. Examples -------- The following performs an as-of join between ``left`` and ``right``. >>> left = spark.createDataFrame([(1, "a"), (5, "b"), (10, "c")], ["a", "left_val"]) >>> right = spark.createDataFrame([(1, 1), (2, 2), (3, 3), (6, 6), (7, 7)], ... ["a", "right_val"]) >>> left._joinAsOf( ... right, leftAsOfColumn="a", rightAsOfColumn="a" ... ).select(left.a, 'left_val', 'right_val').sort("a").collect() [Row(a=1, left_val='a', right_val=1), Row(a=5, left_val='b', right_val=3), Row(a=10, left_val='c', right_val=7)] >>> from pyspark.sql import functions as sf >>> left._joinAsOf( ... right, leftAsOfColumn="a", rightAsOfColumn="a", tolerance=sf.lit(1) ... ).select(left.a, 'left_val', 'right_val').sort("a").collect() [Row(a=1, left_val='a', right_val=1)] >>> left._joinAsOf( ... right, leftAsOfColumn="a", rightAsOfColumn="a", how="left", tolerance=sf.lit(1) ... ).select(left.a, 'left_val', 'right_val').sort("a").collect() [Row(a=1, left_val='a', right_val=1), Row(a=5, left_val='b', right_val=None), Row(a=10, left_val='c', right_val=None)] >>> left._joinAsOf( ... right, leftAsOfColumn="a", rightAsOfColumn="a", allowExactMatches=False ... ).select(left.a, 'left_val', 'right_val').sort("a").collect() [Row(a=5, left_val='b', right_val=3), Row(a=10, left_val='c', right_val=7)] >>> left._joinAsOf( ... right, leftAsOfColumn="a", rightAsOfColumn="a", direction="forward" ... ).select(left.a, 'left_val', 'right_val').sort("a").collect() [Row(a=1, left_val='a', right_val=1), Row(a=5, left_val='b', right_val=6)]
def _joinAsOf( self, other: "DataFrame", leftAsOfColumn: Union[str, Column], rightAsOfColumn: Union[str, Column], on: Optional[Union[str, List[str], Column, List[Column]]] = None, how: Optional[str] = None, *, tolerance: Optional[Column] = None, allowExactMatches: bool = True, direction: str = "backward", ) -> "DataFrame": """ Perform an as-of join. This is similar to a left-join except that we match on the nearest key rather than equal keys. Parameters ---------- other : :class:`DataFrame` Right side of the join leftAsOfColumn : str or :class:`Column` a string for the as-of join column name, or a Column rightAsOfColumn : str or :class:`Column` a string for the as-of join column name, or a Column on : str, list or :class:`Column`, optional a string for the join column name, a list of column names, a join expression (Column), or a list of Columns. If `on` is a string or a list of strings indicating the name of the join column(s), the column(s) must exist on both sides, and this performs an equi-join. how : str, optional default ``inner``. Must be one of: ``inner`` and ``left``. tolerance : :class:`Column`, optional an asof tolerance within this range; must be compatible with the merge index. allowExactMatches : bool, optional default ``True``. direction : str, optional default ``backward``. Must be one of: ``backward``, ``forward``, and ``nearest``. Examples -------- The following performs an as-of join between ``left`` and ``right``. >>> left = spark.createDataFrame([(1, "a"), (5, "b"), (10, "c")], ["a", "left_val"]) >>> right = spark.createDataFrame([(1, 1), (2, 2), (3, 3), (6, 6), (7, 7)], ... ["a", "right_val"]) >>> left._joinAsOf( ... right, leftAsOfColumn="a", rightAsOfColumn="a" ... ).select(left.a, 'left_val', 'right_val').sort("a").collect() [Row(a=1, left_val='a', right_val=1), Row(a=5, left_val='b', right_val=3), Row(a=10, left_val='c', right_val=7)] >>> from pyspark.sql import functions as sf >>> left._joinAsOf( ... right, leftAsOfColumn="a", rightAsOfColumn="a", tolerance=sf.lit(1) ... ).select(left.a, 'left_val', 'right_val').sort("a").collect() [Row(a=1, left_val='a', right_val=1)] >>> left._joinAsOf( ... right, leftAsOfColumn="a", rightAsOfColumn="a", how="left", tolerance=sf.lit(1) ... ).select(left.a, 'left_val', 'right_val').sort("a").collect() [Row(a=1, left_val='a', right_val=1), Row(a=5, left_val='b', right_val=None), Row(a=10, left_val='c', right_val=None)] >>> left._joinAsOf( ... right, leftAsOfColumn="a", rightAsOfColumn="a", allowExactMatches=False ... ).select(left.a, 'left_val', 'right_val').sort("a").collect() [Row(a=5, left_val='b', right_val=3), Row(a=10, left_val='c', right_val=7)] >>> left._joinAsOf( ... right, leftAsOfColumn="a", rightAsOfColumn="a", direction="forward" ... ).select(left.a, 'left_val', 'right_val').sort("a").collect() [Row(a=1, left_val='a', right_val=1), Row(a=5, left_val='b', right_val=6)] """ if isinstance(leftAsOfColumn, str): leftAsOfColumn = self[leftAsOfColumn] left_as_of_jcol = leftAsOfColumn._jc if isinstance(rightAsOfColumn, str): rightAsOfColumn = other[rightAsOfColumn] right_as_of_jcol = rightAsOfColumn._jc if on is not None and not isinstance(on, list): on = [on] # type: ignore[assignment] if on is not None: if isinstance(on[0], str): on = self._jseq(cast(List[str], on)) else: assert isinstance(on[0], Column), "on should be Column or list of Column" on = reduce(lambda x, y: x.__and__(y), cast(List[Column], on)) on = on._jc if how is None: how = "inner" assert isinstance(how, str), "how should be a string" if tolerance is not None: assert isinstance(tolerance, Column), "tolerance should be Column" tolerance = tolerance._jc jdf = self._jdf.joinAsOf( other._jdf, left_as_of_jcol, right_as_of_jcol, on, how, tolerance, allowExactMatches, direction, ) return DataFrame(jdf, self.sparkSession)
(self, other: pyspark.sql.dataframe.DataFrame, leftAsOfColumn: Union[str, pyspark.sql.column.Column], rightAsOfColumn: Union[str, pyspark.sql.column.Column], on: Union[str, List[str], pyspark.sql.column.Column, List[pyspark.sql.column.Column], NoneType] = None, how: Optional[str] = None, *, tolerance: Optional[pyspark.sql.column.Column] = None, allowExactMatches: bool = True, direction: str = 'backward') -> pyspark.sql.dataframe.DataFrame
[ -0.014448664151132107, -0.01422172226011753, 0.045312825590372086, 0.0804888978600502, -0.0002653570845723152, -0.027592409402132034, -0.012339991517364979, 0.019148262217640877, -0.017569122835993767, 0.00849615503102541, -0.015507728792726994, -0.015224050730466843, 0.06066926196217537, 0.07299979776144028, -0.0272141732275486, 0.05874025076627731, -0.0015271330485120416, 0.0029407949186861515, 0.0679314136505127, 0.059648022055625916, -0.021672997623682022, -0.06399775296449661, -0.0022540579084306955, -0.0009893268579617143, -0.01519568357616663, -0.004855621140450239, -0.07250808924436569, 0.014164986088871956, -0.02250511944293976, -0.02524733915925026, 0.017796063795685768, -0.051213327795267105, -0.026268579065799713, 0.0081746531650424, 0.032301463186740875, -0.005834310315549374, 0.015186226926743984, -0.01980072259902954, 0.06085838004946709, -0.047279659658670425, -0.036121662706136703, 0.012926259078085423, 0.017890624701976776, -0.05174286291003227, -0.06074490770697594, 0.01607508398592472, -0.005673559382557869, -0.02197558619081974, 0.02382894977927208, 0.005106203258037567, -0.008160469122231007, -0.0409252755343914, 0.002404170809313655, 0.027138525620102882, -0.036008190363645554, 0.05026773735880852, -0.023810038343071938, -0.024906925857067108, 0.015507728792726994, -0.019952017813920975, 0.027932824566960335, 0.008675817400217056, -0.022902267053723335, 0.01497819647192955, -0.02339397557079792, 0.025663400068879128, 0.006623880472034216, 0.00972069799900055, 0.00022191890457179397, -0.003569614375010133, -0.03606492653489113, 0.03615948557853699, 0.0013852940173819661, 0.044329408556222916, -0.03649989888072014, 0.009928728453814983, -0.004077870864421129, -0.012699317187070847, 0.008349588140845299, -0.06119879335165024, 0.020141135901212692, -0.006656976416707039, -0.035573218017816544, -0.050116442143917084, 0.0033213961869478226, -0.018127022311091423, -0.004326088819652796, 0.0647163987159729, -0.01911989413201809, -0.11347118765115738, -0.022126881405711174, 0.005011644214391708, -0.054806582629680634, -0.005285866092890501, -0.018987512215971947, -0.017758240923285484, 0.015120035968720913, -0.025209516286849976, -0.018221581354737282, 0.016528969630599022, 0.03322814777493477, -0.03184758126735687, -0.007016301620751619, 0.03746440261602402, 0.029899658635258675, -0.0340791791677475, -0.0439133495092392, -0.06577546149492264, -0.026060549542307854, -0.06615370512008667, -0.07209202647209167, -0.023091387003660202, -0.0404713898897171, -0.03290664404630661, -0.018212124705314636, 0.0024278105702251196, 0.048036135733127594, -0.02547428198158741, -0.014146074652671814, 0.0002151224616682157, 0.06774229556322098, 0.0018888224149122834, 0.00857653096318245, -0.1177830919623375, 0.05223457142710686, -0.04190869256854057, -0.026722464710474014, -0.05181850865483284, -0.0326986126601696, 0.016500601544976234, 0.058210719376802444, 0.01902533508837223, -0.015885965898633003, 0.09228990226984024, 0.048906080424785614, 0.022713148966431618, -0.06812053918838501, 0.0395636223256588, 0.018079742789268494, 0.041492629796266556, 0.005054195877164602, -0.08222878724336624, 0.035157155245542526, -0.062144387513399124, -0.021256934851408005, 0.013446335680782795, -0.011763179674744606, -0.024547599256038666, -0.004259897395968437, 0.03627295792102814, 0.007720768917351961, 0.00947957206517458, -0.009692330844700336, 0.0009497302235104144, -0.02590925432741642, -0.0809427797794342, 0.020746314898133278, -0.006595512852072716, 0.04281646013259888, 0.0005283502396196127, 0.012434550561010838, -0.04387552663683891, -0.01318156998604536, 0.04535065218806267, -0.005853222217410803, 0.004668866749852896, 0.01295462716370821, 0.005162938963621855, 0.027403291314840317, -0.043459463864564896, 0.05336927995085716, -0.008344859816133976, 0.01660461723804474, -0.007091949228197336, -0.08215314149856567, -0.013049186207354069, -0.04221128299832344, 0.004248077515512705, 0.011734811589121819, -0.08457385748624802, 0.007451274432241917, -0.006382754072546959, 0.0007547016139142215, -0.0298429224640131, -0.009739610366523266, 0.014609415084123611, -0.013928588479757309, -0.041379161179065704, 0.01202794536948204, 0.0022067781537771225, -0.0021370407193899155, -0.07190290838479996, 0.0018923684256151319, 0.0503055602312088, 0.009602499194443226, -0.02940795011818409, 0.006642792373895645, 0.01333286426961422, -0.07265938073396683, 0.08472515642642975, -0.04255169630050659, 0.0381830558180809, 0.009162798523902893, 0.017067957669496536, 0.024509776383638382, -0.01582922972738743, 0.017436739057302475, 0.020840873941779137, 0.023904597386717796, -0.04058486223220825, -0.008415780030190945, -0.04538847506046295, -0.05972366780042648, 0.03402244299650192, -0.001241091056726873, 0.011838827282190323, -0.04501023888587952, 0.018855128437280655, 0.06305215507745743, 0.016216924414038658, -0.012982995249330997, 0.007583657745271921, -0.03926103189587593, -0.012264343909919262, 0.04489676654338837, -0.009304637089371681, 0.031015457585453987, 0.06384645402431488, 0.06407339870929718, -0.042362578213214874, -0.027081789448857307, -0.04852784425020218, -0.010637924075126648, -0.024528687819838524, -0.04043356701731682, -0.01557392068207264, -0.022788796573877335, -0.014864725060760975, -0.026174020022153854, -0.049586907029151917, -0.009106062352657318, 0.0409252755343914, 0.00047988854930736125, -0.053520575165748596, 0.027251996099948883, -0.0880536437034607, -0.03638642653822899, 0.0031677372753620148, 0.01776769757270813, -0.025531016290187836, 0.007460730616003275, -0.01765422523021698, 0.022107969969511032, -0.007418178953230381, -0.0091486144810915, -0.04852784425020218, -0.005399337504059076, -0.021011080592870712, -0.03375767916440964, 0.005285866092890501, 0.002763496246188879, -0.03027789480984211, 0.005380425602197647, -0.03171519562602043, -0.05752989277243614, 0.003945487551391125, -0.03037245385348797, 0.006505681201815605, 0.011763179674744606, -0.014675606973469257, -0.019611602649092674, -0.0653972253203392, -0.002626385074108839, 0.003973855637013912, 0.017900079488754272, 0.06645629554986954, -0.03165845945477486, -0.014685062691569328, 0.007555289659649134, -0.006146355997771025, 0.009758521802723408, 0.008562346920371056, -0.05752989277243614, 0.0016867019003257155, 0.00048166155465878546, 0.03621622174978256, 0.011819914914667606, 0.01673700101673603, 0.03615948557853699, -0.027081789448857307, -0.035478658974170685, 0.010344790294766426, 0.0747775137424469, 0.030883075669407845, -0.0036901775747537613, 0.040736157447099686, 0.057113830000162125, 0.00579175865277648, 0.019706163555383682, -0.04179522022604942, -0.0015968705993145704, -0.05170503631234169, -0.011347118765115738, 0.037350933998823166, -0.04338381811976433, -0.05261280760169029, 0.023450711742043495, -0.001046062563546002, 0.05518481880426407, -0.012793876230716705, -0.0046948702074587345, -0.011413310654461384, -0.010533908382058144, 0.006307106930762529, -0.00025752640794962645, 0.017786609008908272, -0.04743095487356186, 0.019857456907629967, 0.018779480829834938, 0.013247760944068432, 0.0010832952102646232, 0.04122786596417427, -0.01005165558308363, 0.03048592619597912, 0.004191341809928417, -0.00033657209132798016, 0.02021678350865841, 0.015460449270904064, 0.03771025687456131, -0.015838686376810074, 0.0493977889418602, 0.04523717984557152, 0.04720401391386986, -0.04379987716674805, -0.052083276212215424, 0.03235819935798645, 0.019725074991583824, -0.032622966915369034, 0.029332302510738373, 0.011602428741753101, 0.007309435401111841, -0.011148544028401375, -0.027630234137177467, -0.04743095487356186, 0.02940795011818409, -0.027800440788269043, -0.014675606973469257, 0.04417811706662178, -0.0054986244067549706, -0.0603666715323925, 0.007687672972679138, 0.020821962505578995, 0.023204857483506203, -0.024188274517655373, -0.010827042162418365, 0.09070130437612534, -0.05817289650440216, 0.03837217390537262, 0.0024112628307193518, 0.042135633528232574, 0.07882465422153473, -0.07069254666566849, 0.063127800822258, -0.02853800356388092, 0.013767837546765804, 0.01421226654201746, -0.003581434255465865, 0.005961965303868055, -0.039412327110767365, -0.02273206040263176, 0.009039871394634247, -0.0750044509768486, 0.053520575165748596, 0.03173410892486572, 0.005720838904380798, 0.04584236070513725, -0.04292993247509003, -0.003498694859445095, -0.034495241940021515, -0.018694378435611725, 0.013503070920705795, -0.0011689895763993263, -0.00873728096485138, 0.045426297932863235, -0.030240071937441826, 0.0002851554600056261, 0.035459745675325394, -0.0347600057721138, 0.047393132001161575, 0.005214946810156107, -0.05261280760169029, 0.031771931797266006, 0.022599678486585617, 0.061387911438941956, -0.0246988944709301, 0.006945382338017225, -0.034703269600868225, 0.030334630981087685, 0.041492629796266556, -0.029275566339492798, 0.0005552405491471291, -0.0272141732275486, -0.005909957457333803, -0.011422766372561455, -0.01891186460852623, 0.06566199660301208, 0.01388130895793438, -0.05405011028051376, -0.03279317170381546, 0.013446335680782795, -0.035800158977508545, -0.00615108385682106, -0.06048014387488365, 0.03823978826403618, -0.032944466918706894, 0.004978548269718885, 0.059534549713134766, -0.026608994230628014, 0.011091808788478374, 0.04610712453722954, 0.02174864336848259, -0.01911989413201809, -0.0031417335849255323, 0.0326986126601696, 0.03059939667582512, -0.052083276212215424, -0.0072148763574659824, 0.033076852560043335, -0.016538426280021667, -0.018240492790937424, -0.014287913218140602, -0.018561994656920433, 0.031128928065299988, -0.021464966237545013, 0.003276480594649911, 0.06089620292186737, 0.016292572021484375, -0.001905370387248695, 0.03451415151357651, -0.013172113336622715, 0.0555630587041378, 0.019649427384138107, -0.026098372414708138, 0.01786225661635399, -0.03610274940729141, -0.03182866796851158, 0.00042906292947009206, 0.0033426720183342695, -0.07712258398532867, -0.008401595987379551, 0.02798955887556076, 0.026741376146674156, -0.014023147523403168, 0.09440802782773972, -0.10643597692251205, 0.026703553274273872, -0.00429299334064126, -0.028046295046806335, -0.08684328198432922, 0.06762883067131042, 0.04720401391386986, -0.02702505514025688, -0.046636659651994705, 0.011157999746501446, -0.0034490511752665043, 0.08169925212860107, -0.0012966446811333299, -0.04338381811976433, -0.049473438411951065, -0.009162798523902893, 0.04179522022604942, -0.02897297590970993, 0.032206904143095016, -0.02065175585448742, 0.08147231489419937, 0.029767274856567383, -0.05117550492286682, 0.04440505802631378, 0.02513386867940426, -0.0011270289542153478, -0.048943907022476196, -0.040395744144916534, 0.0010584733681753278, -0.039752740412950516, 0.07265938073396683, -0.047166191041469574, -0.012964082881808281, 0.007054125424474478, 0.03258514404296875, 0.008883848786354065, 0.007385083008557558, 0.035459745675325394, 0.011422766372561455, -0.013134289532899857, 0.03562995418906212, 0.026760287582874298, -0.03880714625120163, -0.01465669460594654, -0.01928064599633217, -0.03059939667582512, 0.014391928911209106, -0.035138245671987534, -0.099249467253685, 0.04088745266199112, 0.050683796405792236, -0.0037989208940416574, -0.0252662505954504, -0.019838545471429825, 0.001453849603421986, -0.03288773074746132, -0.019743986427783966, -0.015006564557552338, 0.05336927995085716, -0.008051726035773754, 0.05752989277243614, 0.014060971327126026, 0.03322814777493477, 0.03793720155954361, 0.023356152698397636, -0.035459745675325394, -0.06914177536964417, -0.008841296657919884, 0.02239164710044861, -0.04474547132849693, -0.04448070377111435, 0.015838686376810074, 0.006888646632432938, 0.06963348388671875, 0.00901150330901146, -0.009134430438280106, -0.06717494130134583, 0.011347118765115738, 0.01920499838888645, 0.006245643366128206, 0.013361232355237007, 0.12277582287788391, -0.027932824566960335, 0.012661493383347988, 0.02229708805680275, 0.009919272735714912, -0.010694659315049648, 0.034287210553884506, -0.05004079267382622, -0.04867913946509361, -0.03982838615775108, 0.010779762640595436, -0.012377815321087837, 0.019148262217640877, 0.05261280760169029, -0.0400175042450428, -0.011526781134307384, 0.01230216771364212, 0.09176036715507507, 0.049889497458934784, 0.019148262217640877, -0.04735530912876129, -0.024642160162329674, -0.06119879335165024, -0.0066191526129841805, 0.027062878012657166, -0.02250511944293976, 0.0020625751931220293, 0.1010650023818016, 0.006609696429222822, -0.016472233459353447, 0.031015457585453987, 0.07560963183641434, 0.012670949101448059, 0.040395744144916534, -0.012103592976927757, 0.00146212347317487, 0.015318610705435276, -0.0542014054954052, -0.06324127316474915, 0.004285901319235563, 0.001108708092942834, -0.030864162370562553, 0.01371110137552023, -0.031979963183403015, -0.017966270446777344, -0.05681123957037926, -0.0033497640397399664, -0.017597489058971405, 0.0404713898897171, -0.012765508145093918, -0.00032888914574868977, -0.030315719544887543, 0.05249933525919914, 0.048490021377801895, -0.007758592255413532, -0.029143182560801506, -0.027951736003160477, -0.007555289659649134, -0.0076734889298677444, -0.017190884798765182, 0.013928588479757309, -0.008836568333208561, 0.007125045172870159, 0.08018630743026733, -0.013465247116982937, 0.06108532100915909, -0.015545552596449852, -0.04610712453722954, -0.008595442399382591, 0.003938395995646715, 0.03016442432999611, -0.016339851543307304, 0.024661071598529816, -0.0016997038619592786, 0.03398462012410164, 0.008543434552848339, 0.05049467831850052, 0.01202794536948204, -0.04383770376443863, 0.03585689514875412, -0.04179522022604942, -0.02918100729584694, -0.035686686635017395, 0.06933089345693588, -0.015696847811341286, -0.005385153461247683, -0.007087221369147301, 0.034287210553884506, 0.009266813285648823, -0.010893234051764011, 0.02492583729326725, 0.029805097728967667, -0.011091808788478374, -0.013124833814799786, 0.02895406447350979, 0.03585689514875412, -0.029010800644755363, 0.03922320529818535, 0.026514433324337006, 0.011422766372561455, -0.03381441533565521, 0.032944466918706894, -0.04807395860552788, 0.022902267053723335, 0.03419265151023865, 0.011328206397593021, -0.024888014420866966, 0.003101545851677656, 0.03462762385606766, 0.004855621140450239, -0.0441402904689312, 0.01683156006038189, -0.00476106209680438, -0.06834747642278671, 0.018561994656920433, 0.004479747731238604, -0.005640463437885046, 0.02895406447350979, -0.01130929496139288, 0.019933104515075684, 0.023526359349489212, -0.02042481303215027, 0.008169925771653652, 0.022826621308922768, 0.06384645402431488, -0.003720909357070923, 0.03922320529818535, 0.0381830558180809, 0.03290664404630661, -0.038636937737464905, 0.0013616542564705014, 0.06668323278427124, 0.04799831286072731, 0.05726512521505356, 0.10575514286756516, -0.006609696429222822, -0.04799831286072731, 0.0006181815988384187, 0.019015880301594734, 0.07598786801099777, -0.04330816864967346, 0.025096043944358826, -0.03160172700881958, 0.010505540296435356, -0.06399775296449661, 0.019337382167577744, 0.04493458941578865, -0.00751273799687624, -0.028916241601109505, 0.05783248320221901, -0.00762148154899478, 0.049813851714134216, 0.02513386867940426, 0.03572451323270798, -0.06460292637348175, -0.005314233712852001, -0.014477032236754894, -0.031979963183403015, 0.04493458941578865, -0.02108672820031643, -0.06501898914575577, -0.04319470003247261, -0.07564745843410492, 0.029464684426784515, 0.03182866796851158, 0.03434394672513008, 0.024793453514575958, 0.04448070377111435, -0.04005533084273338, 0.04765789955854416, 0.0409252755343914, 0.02152170240879059, 0.04769572243094444, 0.0647163987159729, -0.028821680694818497, -0.01564011164009571, -0.014826902188360691, -0.03037245385348797, 0.0024077168200165033, 0.010874321684241295, 0.03598927706480026, -0.0381830558180809, 0.0395636223256588, -0.024679983034729958, 0.025512104853987694, -0.025096043944358826, -0.014571591280400753, 0.09561838954687119, -0.04296775534749031, -0.007120316848158836, -0.01703958958387375, -0.019876370206475258, 0.03226364031434059, -0.015167315490543842, -0.0027043966110795736, -0.019838545471429825, 0.0542014054954052, 0.06354386359453201, 0.0665319412946701, -0.03542192280292511, -0.034816741943359375, -0.008023358881473541, -0.0017647133208811283, 0.02329941652715206, 0.02611728571355343, -0.008798744529485703, -0.03937450051307678, -0.034381769597530365, -0.048036135733127594, 0.007158140651881695, 0.031015457585453987, -0.04746878147125244, -0.03466544672846794, -0.018372876569628716, 0.014032603241503239, -0.0013261944986879826, -0.014477032236754894, 0.019517043605446815, -0.02154061384499073, 0.03006986528635025, 0.04886825755238533, -0.008269213140010834, 0.00028973567532375455, -0.016935573890805244, -0.06785576790571213, -0.03215016797184944, 0.06891483068466187, -0.0029337028972804546, 0.061614856123924255, -0.01602780446410179, 0.009484300389885902, 0.005512808449566364, 0.06577546149492264 ]
39,349
pyspark.sql.dataframe
_jseq
Return a JVM Seq of Columns from a list of Column or names
def _jseq( self, cols: Sequence, converter: Optional[Callable[..., Union["PrimitiveType", JavaObject]]] = None, ) -> JavaObject: """Return a JVM Seq of Columns from a list of Column or names""" return _to_seq(self.sparkSession._sc, cols, converter)
(self, cols: Sequence, converter: Optional[Callable[..., Union[ForwardRef('PrimitiveType'), py4j.java_gateway.JavaObject]]] = None) -> py4j.java_gateway.JavaObject
[ 0.021725933998823166, -0.01005830243229866, -0.014833809807896614, -0.027201149612665176, -0.03620988875627518, 0.04639064148068428, 0.043346911668777466, 0.07773756235837936, 0.05429734289646149, 0.02207578718662262, -0.009026233106851578, 0.04894457384943962, 0.021201152354478836, 0.018734682351350784, 0.010985415428876877, 0.018524769693613052, 0.04974924027919769, 0.021813396364450455, 0.014405238442122936, 0.05331775173544884, 0.009647224098443985, -0.03253642097115517, 0.05426235496997833, 0.05265302583575249, -0.04264720156788826, 0.021341094747185707, 0.05685127526521683, -0.020623894408345222, -0.03325362130999565, -0.0064985379576683044, -0.0363498292863369, 0.003091834718361497, -0.030874615535140038, -0.009874628856778145, -0.034040793776512146, 0.05478713661432266, -0.014247803948819637, -0.019346926361322403, 0.07227984070777893, -0.07116030156612396, 0.023912521079182625, -0.004051746800541878, -0.009516028687357903, -0.06857138127088547, -0.03155682981014252, -0.010714278556406498, 0.02034400962293148, -0.021953338757157326, 0.00707579730078578, -0.025241967290639877, 0.03641980141401291, -0.035545166581869125, 0.048979561775922775, -0.03582505136728287, -0.045900844037532806, 0.03440814092755318, 0.012096202000975609, 0.07192998379468918, -0.014011653140187263, 0.027533510699868202, 0.002427112078294158, 0.0017438034992665052, -0.027953334152698517, 0.040583062916994095, 0.061294421553611755, 0.03166178613901138, 0.005020405165851116, -0.03586003556847572, -0.008982501924037933, -0.002930027199909091, -0.018524769693613052, -0.029177824035286903, -0.010451888665556908, 0.06521278619766235, 0.01344314031302929, 0.0047623878344893456, -0.059860020875930786, -0.014588912017643452, -0.006826526485383511, -0.037959158420562744, 0.035020384937524796, 0.013110779225826263, -0.022705525159835815, -0.047650113701820374, 0.03236149623990059, -0.004622445907443762, -0.004040813539177179, 0.06206410005688667, -0.03313117474317551, 0.021638469770550728, -0.04205245152115822, -0.03484546020627022, -0.03460055962204933, 0.040583062916994095, -0.0342332124710083, 0.01418657973408699, -0.013303198851644993, 0.0006341103580780327, -0.03453059121966362, 0.026169080287218094, 0.030209893360733986, -0.015585996210575104, 0.018192408606410027, 0.029247794300317764, -0.023230306804180145, 0.006271133199334145, -0.047265276312828064, -0.02891543321311474, 0.03010493703186512, -0.04037315025925636, -0.017387744039297104, 0.10572587698698044, 0.03680464252829552, -0.06206410005688667, -0.02139357291162014, 0.003968656528741121, 0.020169083029031754, -0.003813408548012376, -0.03432067856192589, 0.02071135677397251, 0.023177828639745712, 0.009052472189068794, 0.028635550290346146, -0.033673446625471115, -0.0399533286690712, 0.0010861873161047697, 0.016390660777688026, 0.0041435835883021355, 0.03942854702472687, 0.02583671733736992, 0.08333522081375122, -0.06332357227802277, 0.016040805727243423, 0.0319591648876667, 0.015752175822854042, -0.03545770421624184, 0.01415159460157156, -0.00795043259859085, 0.011571421287953854, -0.014982497319579124, 0.011702616699039936, -0.007622444070875645, 0.04492125287652016, -0.009647224098443985, -0.0037609306164085865, -0.009743434377014637, 0.059580136090517044, 0.03542271628975868, -0.06766176223754883, 0.010014571249485016, -0.05069384351372719, -0.014816316775977612, -0.024297360330820084, -0.02065887860953808, -0.025171995162963867, 0.015620981343090534, -0.0021220832131803036, -0.021603485569357872, 0.016696782782673836, -0.007771132048219442, 0.00294751999899745, -0.002149415435269475, -0.0697958767414093, 0.07049558311700821, -0.00033318126224912703, 0.04607577249407768, -0.039148662239313126, -0.0039905221201479435, -0.03813408687710762, 0.0032711350359022617, 0.05037897825241089, 0.03918365016579628, 0.03468802571296692, -0.05163845047354698, 0.03003496676683426, 0.01434401422739029, 0.013215734623372555, 0.07290957123041153, 0.03054225444793701, 0.003028423758223653, -0.0032864410895854235, -0.0011731041595339775, -0.006677838508039713, -0.01370553020387888, 0.05517197772860527, 0.043801721185445786, -0.03318365290760994, -0.0049285683780908585, 0.01227112952619791, -0.04401163384318352, -0.02791834995150566, 0.05013407766819, 0.01787753961980343, 0.04068801924586296, -0.04541105031967163, -0.004902329295873642, -0.03468802571296692, 0.033743418753147125, -0.052513085305690765, 0.007298829033970833, 0.026151586323976517, 0.013653052970767021, 0.012865881435573101, 0.015306112356483936, -0.02590668946504593, -0.020011648535728455, -0.012096202000975609, -0.008602035231888294, 0.03596499189734459, -0.0812361016869545, 0.03451309725642204, -0.0017569230403751135, -0.02823321893811226, -0.08067633211612701, 0.010460634715855122, 0.012446056120097637, -0.053107839077711105, -0.03890376538038254, 0.03883379325270653, 0.0034307558089494705, 0.05398247390985489, -0.004841104615479708, -0.06293873488903046, 0.011536436155438423, 0.0342332124710083, -0.009174921549856663, -0.01876966655254364, -0.04030318185687065, -0.013758008368313313, 0.003699706168845296, -0.0471603199839592, -0.02289794385433197, -0.010539351962506771, -0.027585988864302635, -0.0038768197409808636, 0.038553912192583084, -0.02581922523677349, 0.007088916841894388, 0.0005277875461615622, -0.0030087444465607405, -0.0343906469643116, 0.08550431579351425, 0.011099118739366531, 0.03260639309883118, 0.08151598274707794, 0.060244858264923096, 0.026099108159542084, 0.032326508313417435, -0.05016906559467316, 0.06223902851343155, 0.018944595009088516, -0.027498524636030197, 0.06381337344646454, -0.017466461285948753, -0.004884836729615927, -0.008173463866114616, -0.0064416867680847645, 0.023072872310876846, 0.000989977503195405, 0.020221561193466187, 0.0013939494965597987, -0.04264720156788826, 0.009139935486018658, 0.03785420209169388, -0.01988920010626316, 0.010145765729248524, -0.019661795347929, -0.005116614978760481, -0.017221562564373016, 0.03229152411222458, 0.03865886852145195, 0.01990669220685959, -0.051848363131284714, -0.03278132155537605, 0.06832648813724518, -0.010241976007819176, -0.005352766253054142, -0.06605243682861328, -0.04408160597085953, 0.008427108637988567, 0.03760930523276329, -0.0030502895824611187, 0.01990669220685959, 0.034810472279787064, 0.013023314997553825, 0.023825056850910187, -0.05524194613099098, -0.017912525683641434, -0.050798799842596054, -0.029475199058651924, 0.017816314473748207, 0.033306099474430084, 0.013198242522776127, -0.003362971590831876, 0.05835564807057381, 0.029895024374127388, 0.012970836833119392, 0.010276961140334606, 0.03183671459555626, -0.004801745992153883, -0.0074956221505999565, -0.0008347298135049641, 0.015227395109832287, 0.048244867473840714, -0.05646643787622452, -0.03988335654139519, -0.09572005271911621, -0.02267053909599781, -0.023860042914748192, 0.037434376776218414, 0.00080739741679281, -0.02394750714302063, -0.03174925222992897, 0.012069962918758392, -0.06307867914438248, -0.006970840971916914, -0.03680464252829552, 0.024594737216830254, 0.03785420209169388, 0.0004605499852914363, 0.007425651419907808, -0.06241395324468613, 0.012201158329844475, -0.005580171477049589, -0.04775507003068924, 0.04198247939348221, -0.018139930441975594, -0.02559182047843933, -0.00671719666570425, -0.04394166171550751, 0.05825069174170494, -0.0049329414032399654, 0.05072883144021034, 0.007364426739513874, 0.02830318920314312, -0.03349852189421654, 0.0011938768438994884, -0.029300272464752197, 0.022880451753735542, -0.012673460878431797, 0.01607579179108143, -0.06374339759349823, -0.006126818247139454, 0.034810472279787064, 0.007788624614477158, 0.011160342954099178, -0.014169087633490562, 0.006026235409080982, 0.02223322167992592, 0.005002912133932114, 0.04925944283604622, -0.029545171186327934, -0.008204076439142227, 0.03475799411535263, -0.0319591648876667, 0.03537023812532425, 0.004340376239269972, -0.04243728891015053, 0.012218651361763477, -0.03055974654853344, 0.08200577646493912, -0.022705525159835815, 0.034268200397491455, -0.040653035044670105, 0.03512534126639366, 0.03159181773662567, -0.028583072125911713, -0.058075763285160065, 0.05681629106402397, 0.020903777331113815, 0.05027402192354202, 0.07325942814350128, 0.010355678386986256, 0.03669968619942665, -0.08088624477386475, -0.020378995686769485, -0.05636148154735565, 0.055731743574142456, -0.02417491190135479, -0.05261804163455963, -0.05713116005063057, -0.11979001015424728, 0.014352760277688503, 0.009358594194054604, 0.015795908868312836, 0.0025123890955001116, 0.028408145532011986, -0.055521830916404724, -0.05968509241938591, 0.009454804472625256, -0.03342854976654053, 0.037574321031570435, -0.02065887860953808, -0.028583072125911713, -0.003968656528741121, -0.018892116844654083, 0.0049285683780908585, 0.07234980911016464, 0.07759761810302734, -0.018577247858047485, -0.05247810110449791, -0.0376792773604393, -0.014711360447108746, 0.02025654725730419, -0.09683959186077118, -0.006349849980324507, 0.04415157437324524, -0.0007341467426158488, -0.013583081774413586, 0.024437302723526955, 0.02109619602560997, 0.0024139925371855497, 0.006787167862057686, -0.015551010146737099, 0.010224482975900173, 0.028093276545405388, -0.028425637632608414, -0.0309445858001709, 0.009489789605140686, 0.011702616699039936, -0.00412827730178833, 0.0014967191964387894, -0.0117900799959898, 0.06528275460004807, -0.004117344506084919, -0.028950419276952744, -0.01779007539153099, 0.03551018238067627, -0.014798824675381184, -0.04303204268217087, -0.02071135677397251, -0.025102024897933006, 0.003024050500243902, -0.07091540843248367, 0.013215734623372555, 0.06944601982831955, -0.004985419567674398, -0.029370242729783058, 0.022320685908198357, 0.012988329865038395, 0.027306105941534042, 0.04278714582324028, -0.01535859052091837, -0.023772578686475754, 0.026833802461624146, -0.020886283367872238, -0.0319591648876667, 0.03620988875627518, -0.06307867914438248, -0.015638474375009537, 0.04625070095062256, 0.05335273593664169, 0.061294421553611755, -0.03788919001817703, 0.06699704378843307, 0.013792994432151318, 0.009227399714291096, 0.001916543929837644, -0.021673455834388733, -0.032029133290052414, 0.06325360387563705, -0.05422737076878548, 0.047405216842889786, -0.032763827592134476, -0.0379941463470459, 0.02784837782382965, -0.06937605142593384, -0.03729443624615669, -0.024664707481861115, 0.008326524868607521, 0.039323590695858, 0.00795043259859085, 0.0658075362443924, -0.09844891726970673, 0.004526236094534397, -0.020693864673376083, -0.016390660777688026, -0.018034974113106728, -0.02079882100224495, 0.02942272089421749, -0.04663553833961487, -0.06951598823070526, 0.012227397412061691, -0.025259459391236305, -0.01193876750767231, 0.04558597505092621, -0.00041271839290857315, -0.08088624477386475, 0.008313405327498913, -0.030139923095703125, -0.041562654078006744, 0.060699671506881714, 0.05037897825241089, -0.013889203779399395, 0.06538771092891693, -0.01201748475432396, 0.024892112240195274, 0.0006406701286323369, -0.04033816605806351, 0.05443728342652321, 0.01325072068721056, 0.040268197655677795, -0.049504343420267105, -0.00791982002556324, 0.013451886363327503, -0.09774921089410782, 0.055206961929798126, -0.06489791721105576, -0.11055386811494827, -0.04271717369556427, -0.020309025421738625, 0.021061211824417114, -0.04257723316550255, -0.027078699320554733, -0.026781324297189713, -0.008120985701680183, 0.005676381289958954, -0.008816320449113846, -0.0037740501575171947, 0.028215724974870682, -0.031276948750019073, -0.023912521079182625, -0.029562663286924362, 0.03690959885716438, -0.03991834074258804, 0.04051309451460838, -0.015061214566230774, 0.00046874969848431647, 0.042682189494371414, 0.024682199582457542, -0.027673451229929924, 0.0135918278247118, 0.002324342494830489, 0.006262386683374643, -0.02072884887456894, 0.02560931257903576, 0.06685709953308105, 0.062204040586948395, 0.022495612502098083, 0.03918365016579628, 0.02034400962293148, 0.08606408536434174, -0.008947515860199928, 0.03970842808485031, -0.01430028211325407, -0.004784253425896168, -0.013495618477463722, -0.031276948750019073, 0.058145735412836075, 0.052373144775629044, -0.05790083855390549, 0.01988920010626316, -0.01025072205811739, 0.04075799137353897, 0.02025654725730419, -0.033743418753147125, -0.006415447685867548, -0.008081627078354359, -0.003113700542598963, -0.034880444407463074, 0.024944590404629707, 0.01167637761682272, 0.020029142498970032, -0.017099114134907722, -0.051848363131284714, 0.08634396642446518, 0.047650113701820374, 0.0030196774750947952, 0.027271119877696037, -0.03475799411535263, 0.02461222931742668, -0.01630319654941559, -0.01847229152917862, -0.0376792773604393, 0.03753933310508728, -0.05121862515807152, -0.02711368538439274, 0.006406701635569334, -0.0435568243265152, 0.024594737216830254, 0.0008494892390444875, 0.04813991114497185, -0.025661790743470192, -0.008794454857707024, 0.009673463180661201, 0.0012430750066414475, -0.0252244733273983, -0.0017766023520380259, 0.018559755757451057, 0.0025189488660544157, 0.03669968619942665, -0.0034132632426917553, -0.03935857489705086, 0.03414575010538101, 0.04705536365509033, -0.017833808436989784, -0.03925361856818199, 0.056116580963134766, -0.03190668672323227, -0.03159181773662567, -0.024227390065789223, 0.023930013179779053, 0.014816316775977612, 0.0270262211561203, 0.025626806542277336, -0.0006565229268744588, -0.044256530702114105, 0.003491980256512761, 0.02064138650894165, 0.07724776118993759, -0.04876964911818504, 0.025329429656267166, -0.003728131763637066, 0.015892118215560913, -0.04698539152741432, -0.01922447793185711, -0.03669968619942665, -0.015437307767570019, -0.009551014751195908, -0.01883963868021965, -0.03781921789050102, -0.021830890327692032, 0.060314830392599106, -0.016425644978880882, -0.021148674190044403, -0.0010522952070459723, -0.051778391003608704, 0.005571424961090088, 0.04030318185687065, -0.0031552459113299847, 0.03355100005865097, -0.002387753687798977, 0.09620985388755798, -0.004331629723310471, 0.010932937264442444, -0.015874626114964485, -0.07311948388814926, -0.055976640433073044, 0.03325362130999565, 0.0076049515046179295, 0.008282793685793877, 0.014169087633490562, -0.007521861232817173, -0.003214283613488078, -0.00016631731705274433, -0.024892112240195274, 0.0030590358655899763, -0.0002812498132698238, -0.01061806920915842, -0.008833813481032848, -0.012638475745916367, 0.044711340218782425, -0.021463543176651, 0.00811223965138197, 0.00151639839168638, 0.02791834995150566, -0.08550431579351425, -0.01069678645581007, 0.009690956212580204, 0.012507280334830284, 0.023825056850910187, -0.027061207219958305, 0.00020458259677980095, -0.09285125136375427, -0.047999970614910126, 0.005190958734601736, 0.011265299282968044, 0.017965003848075867, 0.04866469278931618, 0.06871132552623749, -0.04016324132680893, -0.05653640627861023, 0.029335258528590202, -0.04705536365509033, 0.02944021485745907, 0.006634106393903494, 0.031504351645708084, -0.017693866044282913, 0.03872883692383766, -0.03251893073320389, -0.0271836556494236, -0.002149415435269475, -0.02844312973320484, 0.04299705848097801, -0.08487457782030106, -0.06430316716432571, 0.04040813818573952, 0.032693855464458466, 0.005440229550004005, -0.06325360387563705, 0.03159181773662567, 0.0618891716003418, 0.0069970800541341305, 0.009393580257892609, 0.009454804472625256, 0.05324777960777283, 0.002348395064473152, -0.03078715316951275, -0.03988335654139519, 0.06748683750629425, 0.024944590404629707, -0.005965010728687048, -0.025994151830673218, 0.05370258912444115, 0.05083378776907921, 0.012104948982596397, 0.05380754545331001, 0.03146936744451523, -0.009822151623666286, 0.002187680918723345, -0.005208451300859451, 0.042087435722351074, -0.0023833804298192263, -0.025941673666238785, -0.012927105650305748, -0.01651310920715332, 0.013276959769427776, 0.05156848207116127, 0.027288611978292465, 0.02064138650894165, 0.0019821415189653635, -0.012454802170395851, 0.044396474957466125, -0.033655956387519836, -0.034880444407463074, -0.012437310069799423, -0.06489791721105576, 0.03820405900478363, 0.011274045333266258, -0.0008975942037068307, -0.011413986794650555, -0.02424488216638565, 0.019102029502391815, 0.008536437526345253, -0.04925944283604622, -0.06643727421760559, -0.024717185646295547, 0.017755091190338135, -0.045376066118478775, 0.01711660623550415, -0.11237310618162155, 0.011956260539591312, 0.04247227683663368, 0.055976640433073044, -0.0432419553399086, -0.04862970486283302, -0.014291536062955856, -0.005518946796655655, 0.0012321420945227146, -0.027428554370999336, 0.007819237187504768, 0.02597665973007679, -0.02867053635418415, 0.021341094747185707, 0.0022806108463555574, -0.02282797358930111, -0.019714273512363434, 0.0484897643327713, -0.03904370591044426, -0.07151015847921371, -0.06458304822444916, 0.07521861046552658, -0.012673460878431797, 0.017755091190338135, -0.006979587487876415, -0.011413986794650555, 0.04768510162830353, 0.024577243253588676 ]
39,350
pyspark.sql.dataframe
_repr_html_
Returns a :class:`DataFrame` with html code when you enabled eager evaluation by 'spark.sql.repl.eagerEval.enabled', this only called by REPL you are using support eager evaluation with HTML.
def _repr_html_(self) -> Optional[str]: """Returns a :class:`DataFrame` with html code when you enabled eager evaluation by 'spark.sql.repl.eagerEval.enabled', this only called by REPL you are using support eager evaluation with HTML. """ if not self._support_repr_html: self._support_repr_html = True if self.sparkSession._jconf.isReplEagerEvalEnabled(): return self._jdf.htmlString( self.sparkSession._jconf.replEagerEvalMaxNumRows(), self.sparkSession._jconf.replEagerEvalTruncate(), ) else: return None
(self) -> Optional[str]
[ 0.03511008992791176, -0.07877352088689804, 0.01772749237716198, 0.012398897670209408, 0.054389599710702896, 0.019382977858185768, 0.02553931437432766, -0.022124875336885452, 0.0028194990009069443, -0.001824698643758893, 0.030436793342232704, -0.0357653871178627, -0.00046318030217662454, 0.027177555486559868, -0.008553341962397099, -0.03133351355791092, -0.0028238100931048393, -0.054113686084747314, 0.042180392891168594, 0.001947566750459373, -0.030729951336979866, 0.004091291222721338, -0.0022137807682156563, -0.005608819890767336, -0.030229857191443443, 0.023228531703352928, -0.009950158186256886, -0.006298605352640152, -0.030609238892793655, 0.042594265192747116, 0.015364975668489933, -0.04456015303730965, -0.05097516253590584, 0.005854555871337652, -0.024211477488279343, 0.018813904374837875, -0.02390107326209545, -0.015114928595721722, -0.008268806152045727, -0.06704716384410858, -0.0476296991109848, -0.03704148903489113, 0.012847257778048515, -0.0840848758816719, -0.09394881129264832, -0.04925069585442543, 0.03409265726804733, -0.046595022082328796, 0.01581333577632904, -0.03928329423069954, 0.058079954236745834, 0.06777144223451614, -0.03519631549715996, 0.042007945477962494, -0.03759332001209259, 0.006544341333210468, -0.0322129912674427, 0.03890391066670418, 0.038627997040748596, -0.07097894698381424, -0.04276671260595322, 0.005807132925838232, 0.0030501459259539843, 0.07339319586753845, 0.04331853985786438, 0.030488526448607445, -0.01758953370153904, 0.027074087411165237, -0.0428701788187027, -0.04307711496949196, -0.04783663526177406, 0.016166850924491882, -0.02747071348130703, 0.0593215674161911, -0.07028915733098984, -0.05307900905609131, -0.038352083414793015, -0.06808184832334518, -0.014278563670814037, -0.003979200962930918, 0.05673487111926079, -0.007760088890790939, 0.054493069648742676, -0.007022880483418703, 0.050112929195165634, -0.08291223645210266, 0.03136800229549408, 0.06697818636894226, -0.01752917841076851, -0.010683055967092514, 0.026936130598187447, 0.020383166149258614, -0.018813904374837875, -0.011122793890535831, -0.01757228933274746, 0.031247291713953018, 0.0041387141682207584, 0.001349393161945045, 0.0007070302963256836, -0.03412714600563049, 0.01379571296274662, 0.0816706195473671, 0.022900884971022606, 0.0022094696760177612, 0.0010476119350641966, 0.036317214369773865, 0.0012082026805728674, 0.02764316089451313, 0.009691488929092884, -0.060183800756931305, -0.03371327370405197, 0.05763159319758415, -0.0005561396828852594, -0.03928329423069954, 0.05552774667739868, 0.02133162133395672, -0.05283758044242859, -0.02738449163734913, 0.036317214369773865, -0.014002649113535881, -0.032333701848983765, -0.016218585893511772, -0.04290466755628586, -0.05269962549209595, -0.03407541289925575, 0.05683833733201027, 0.013235262595117092, -0.03354082629084587, 0.02340097911655903, -0.020745303481817245, 0.10512333363294601, -0.001619918504729867, -0.012588588520884514, 0.03707598149776459, 0.04397383704781532, 0.00990704633295536, 0.007471241056919098, 0.009958780370652676, 0.030178122222423553, 0.03955920785665512, -0.028833040967583656, -0.04704338312149048, -0.020193476229906082, 0.0735311508178711, -0.01945195533335209, -0.006402073428034782, -0.024056274443864822, 0.028798552230000496, 0.0016587190330028534, -0.009838067926466465, 0.06425353139638901, -0.030178122222423553, 0.014554477296769619, -0.026556748896837234, 0.046353597193956375, 0.04180101305246353, 0.008488674648106098, 0.008941346779465675, 0.032126765698194504, -0.04569830000400543, 0.014330297708511353, -0.03952471911907196, -0.028039786964654922, 0.010605454444885254, -0.008148092776536942, 0.01564089022576809, 0.017399843782186508, -0.05356185883283615, -0.003489884315058589, 0.0952593982219696, 0.06708165258169174, 0.026849906891584396, 0.013269752264022827, 0.01600302755832672, -0.04121469333767891, 0.12788626551628113, 0.004789699334651232, 0.06759899854660034, -0.0239872969686985, -0.008424007333815098, -0.006755588576197624, -0.018382787704467773, -0.03907635807991028, 0.01749468967318535, 0.01749468967318535, -0.02159029059112072, -0.009208638221025467, -0.05687282979488373, 0.06180479750037193, 0.054493069648742676, -0.04942314326763153, -0.04121469333767891, -0.009588020853698254, -0.0034661730751395226, 0.0003578263276722282, -0.06139092519879341, -0.017192907631397247, -0.009079303592443466, -0.02395280823111534, -0.00889823492616415, -0.01774473674595356, 0.028005298227071762, 0.027091331779956818, -0.014028515666723251, 0.01366637833416462, 0.0036687974352389574, -0.06628840416669846, 0.015433954074978828, 0.018520744517445564, -0.02781560644507408, -0.0295745600014925, -0.024418411776423454, -0.0005033279885537922, 0.03793821111321449, 0.06697818636894226, 0.06325334310531616, -0.0508372038602829, 0.014088871888816357, -0.05273411422967911, -0.029177933931350708, 0.050492312759160995, -0.07815271615982056, 0.010364029556512833, 0.028919264674186707, 0.008402451872825623, -0.06135643646121025, 0.02959180437028408, -0.012683434411883354, 0.015477065928280354, -0.002169591374695301, 0.0008449874585494399, -0.006302916444838047, 0.02534962259232998, -0.018400032073259354, 0.021366111934185028, 0.016770413145422935, -0.016641078516840935, 0.05138903111219406, 0.01807238534092903, -0.006393450777977705, -0.06170132756233215, 0.0320405438542366, 0.020469389855861664, 0.012838635593652725, -0.013355975039303303, 0.01755504496395588, 0.011441819369792938, 0.05342390015721321, 0.0025737627875059843, 0.01748606748878956, 0.007768711075186729, -0.06342579424381256, -0.024056274443864822, -0.026625726372003555, 0.0023732937406748533, -0.01176084578037262, 0.026832662522792816, 0.06587453186511993, -0.002053190255537629, 0.04359445348381996, 0.03804168105125427, -0.07046160846948624, -0.04014552757143974, 0.030229857191443443, 0.00495352316647768, -0.03617925941944122, -0.07104792445898056, -0.01745157688856125, 0.012735167518258095, 0.001488428097218275, 0.04180101305246353, 0.03471346199512482, -0.00632447237148881, -0.022297320887446404, -0.0038800444453954697, -0.05314798653125763, -0.03690353408455849, 0.009329351596534252, -0.048284996300935745, -0.0584593340754509, -0.024383923038840294, -0.07004773616790771, -0.015494310297071934, 0.038490042090415955, -0.01746882125735283, -0.031161068007349968, -0.02921242266893387, -0.03579987585544586, 0.059873394668102264, -0.01478728000074625, 0.017313620075583458, 0.02971251681447029, 0.008298983797430992, 0.019176041707396507, 0.0026017853524535894, -0.010286428965628147, 0.07801476120948792, -0.030936887487769127, -0.03167840838432312, 0.05373430252075195, -0.015364975668489933, -0.050319865345954895, 0.11471135914325714, 0.05466551333665848, 0.004772454500198364, -0.02367689274251461, -0.020521122962236404, -0.011597021482884884, 0.009648377075791359, -0.018158607184886932, -0.02555655874311924, -0.010113982483744621, 0.007320350501686335, 0.06359823793172836, -0.005117347463965416, -0.02738449163734913, -0.0028453657869249582, 0.0028108765836805105, -0.0037463984917849302, -0.01572711393237114, -0.042421817779541016, -0.028005298227071762, 0.0354204922914505, 0.03348909318447113, -0.0078118229284882545, -0.026987863704562187, 0.044249750673770905, -0.031161068007349968, 0.062149688601493835, 0.044422198086977005, -0.005276860203593969, -0.03157493844628334, 0.04393934831023216, 0.005966646131128073, 0.02783285081386566, -0.004065424203872681, -0.0139854047447443, -0.00021501912851817906, -0.021297132596373558, -0.04459464177489281, 0.031109333038330078, -0.0009209716226905584, 0.026780929416418076, 0.015028704889118671, 0.009958780370652676, 0.00594509020447731, 0.03493764251470566, -0.0020036117639392614, 0.022159364074468613, -0.012260939925909042, -0.030574750155210495, 0.018331054598093033, -0.028970997780561447, 0.013588777743279934, -0.0471123605966568, 0.028522636741399765, -0.0024185609072446823, 0.11988475173711777, -0.020934995263814926, 0.025039220228791237, 0.06139092519879341, -0.028005298227071762, -0.025073708966374397, 0.0391453355550766, -0.038317594677209854, 0.02560829371213913, -0.04700889438390732, 0.042421817779541016, -0.012028137221932411, 0.019176041707396507, -0.02752244845032692, -0.00393608957529068, 0.03340287134051323, -0.04369792342185974, -0.04342200607061386, 0.04118020460009575, -0.05335492268204689, 0.009217261336743832, -0.004940589889883995, -0.018675947561860085, -0.0023646715562790632, -0.028470903635025024, 0.04335302859544754, -0.0318680964410305, -0.020314188674092293, 0.008221383206546307, -0.044456686824560165, -0.012605832889676094, -0.0469399131834507, -0.04704338312149048, -0.04518096148967743, 0.000022498868929687887, 0.01199364848434925, 0.04911274090409279, -0.02935037948191166, -0.01278690155595541, 0.013994026929140091, 0.007212571334093809, -0.0213488657027483, 0.028057031333446503, 0.04162856563925743, 0.036455173045396805, 0.022590480744838715, -0.0348169319331646, -0.015244263224303722, 0.031161068007349968, 0.05163045600056648, -0.020866015926003456, -0.013071438297629356, 0.012493742629885674, -0.000606795831117779, -0.038524530827999115, -0.10374376177787781, 0.026453280821442604, -0.014123361557722092, 0.01996929571032524, 0.030954131856560707, 0.007747155148535967, 0.034627240151166916, 0.02750520408153534, -0.0030501459259539843, -0.00296823401004076, 0.030005676671862602, 0.05756261572241783, -0.0294883381575346, 0.0055053518153727055, -0.011519420892000198, -0.009062059223651886, 0.019003594294190407, 0.04756072163581848, -0.03907635807991028, -0.020883260294795036, -0.01995205134153366, -0.010570965707302094, 0.06104603037238121, -0.042145904153585434, 0.0028065654914826155, -0.013588777743279934, -0.005311349872499704, 0.010157094337046146, 0.06649533659219742, -0.014442387036979198, 0.013355975039303303, 0.004244337324053049, 0.02165926992893219, -0.014045760966837406, 0.003830465953797102, 0.014037138782441616, -0.08008411526679993, -0.004462051205337048, 0.07615233957767487, 0.028746817260980606, -0.0013192150508984923, 0.028833040967583656, -0.020831527188420296, -0.001697519444860518, 0.04883682355284691, 0.025935940444469452, -0.02165926992893219, 0.05749363452196121, -0.015158040449023247, 0.020917750895023346, 0.0064063845202326775, 0.03528253734111786, 0.031040355563163757, -0.024866772815585136, -0.01078652311116457, -0.014261318370699883, -0.10877919942140579, -0.03519631549715996, 0.02169375866651535, -0.04735378548502922, -0.03166116401553154, -0.05783852934837341, 0.017322242259979248, 0.04590523615479469, -0.044077303260564804, -0.01597716100513935, 0.02547033503651619, -0.013959537260234356, -0.094914510846138, -0.03281655162572861, -0.001541239907965064, -0.04318058118224144, -0.00545361777767539, -0.040490418672561646, 0.017132552340626717, -0.00437151687219739, 0.04207692667841911, -0.0174084659665823, -0.02562553808093071, 0.04552585259079933, 0.0040481798350811005, -0.03371327370405197, -0.007191015407443047, 0.01788269355893135, 0.05283758044242859, 0.03400643169879913, 0.016494499519467354, -0.007139281835407019, 0.046250127255916595, 0.01765851303935051, 0.015011460520327091, 0.06059766933321953, 0.028367435559630394, -0.050009459257125854, 0.07911841571331024, 0.07435889542102814, -0.015045950189232826, -0.003858488518744707, 0.02386658452451229, -0.02157304622232914, 0.018865637481212616, 0.013502554036676884, -0.019296754151582718, -0.016761790961027145, 0.040317971259355545, 0.012950725853443146, 0.018486255779862404, 0.0297470074146986, -0.004806943703442812, -0.03493764251470566, -0.058631781488657, 0.006621942389756441, -0.036248236894607544, 0.012243695557117462, 0.06563310325145721, 0.042525287717580795, -0.0317818745970726, 0.03174738585948944, -0.03497213497757912, 0.017167041078209877, 0.05159596726298332, 0.004080513492226601, -0.0400075688958168, 0.03323042392730713, -0.030781686305999756, 0.025159932672977448, 0.018434522673487663, -0.01189018040895462, -0.01940022222697735, 0.01565813459455967, 0.016166850924491882, -0.010338163003325462, -0.03735189512372017, -0.03583436459302902, 0.013933670707046986, 0.05463102459907532, 0.055872637778520584, 0.004026623908430338, -0.018537990748882294, 0.03907635807991028, 0.07504867762327194, 0.018969105556607246, -0.004940589889883995, 0.05466551333665848, 0.04152509570121765, 0.05756261572241783, 0.021003972738981247, -0.022814661264419556, -0.014209584333002567, -0.06383966654539108, 0.07615233957767487, -0.03179911896586418, 0.06908203661441803, 0.03893839940428734, 0.0015164506621658802, 0.03742087259888649, -0.05087169259786606, -0.08774073421955109, 0.003502817824482918, -0.009725977666676044, 0.04535340890288353, -0.03986961022019386, -0.012579966336488724, -0.030609238892793655, -0.00979495607316494, 0.04607768356800079, 0.016572101041674614, 0.044215261936187744, -0.05314798653125763, 0.005794199649244547, 0.042145904153585434, 0.0029941010288894176, -0.05090618133544922, 0.010372651740908623, -0.015158040449023247, -0.008566276170313358, 0.022780172526836395, -0.02766040526330471, -0.008635254576802254, -0.048284996300935745, -0.00022687482123728842, -0.04366343468427658, 0.08008411526679993, 0.040697354823350906, -0.04342200607061386, 0.028919264674186707, 0.0068116337060928345, -0.012114360928535461, -0.01986582763493061, 0.05459653586149216, 0.04718133807182312, -0.05666589364409447, 0.017080817371606827, -0.03714495897293091, 0.018313810229301453, 0.038731466978788376, -0.0317818745970726, 0.01953817903995514, -0.05149250105023384, 0.03383398801088333, 0.018469011411070824, -0.031023111194372177, -0.0554242767393589, -0.04714684933423996, -0.030988620594143867, 0.009588020853698254, -0.04756072163581848, -0.046560533344745636, -0.014830391854047775, 0.04900927096605301, -0.014925237745046616, -0.0063115390948951244, 0.013726734556257725, 0.002940211445093155, 0.02543584629893303, -0.04335302859544754, -0.006893545389175415, 0.02581522800028324, 0.0098725575953722, -0.016322053968906403, 0.03343736007809639, -0.02365964837372303, 0.0014054382918402553, -0.02352169156074524, 0.026677461341023445, 0.03552396222949028, -0.02179722674190998, 0.011131416074931622, -0.010415763594210148, -0.007018569391220808, -0.06715063750743866, -0.046319108456373215, 0.022124875336885452, 0.02388382889330387, -0.022383544594049454, -0.02578073926270008, 0.046595022082328796, -0.008255871944129467, -0.04414628446102142, -0.009725977666676044, 0.042145904153585434, -0.015175284817814827, -0.038283105939626694, 0.07553152740001678, -0.028229478746652603, -0.04173203185200691, 0.020417654886841774, -0.0018171541159972548, 0.012519610114395618, -0.058114442974328995, -0.05301002785563469, -0.018348298966884613, 0.02935037948191166, 0.02762591652572155, -0.01610649563372135, 0.007949779741466045, 0.03755883127450943, -0.029833229258656502, -0.003367016324773431, 0.044077303260564804, 0.0009737833752296865, -0.04073184356093407, -0.01986582763493061, 0.016175473108887672, -0.04059388488531113, -0.029022732749581337, 0.0030027232132852077, -0.01742571033537388, 0.020452145487070084, 0.024970240890979767, -0.048457443714141846, -0.04349098727107048, -0.0549069382250309, 0.016149606555700302, -0.01265756692737341, 0.034334082156419754, 0.028022542595863342, -0.1016744077205658, -0.04490504786372185, 0.0018203874351456761, -0.024228721857070923, 0.025056464597582817, -0.006268427241593599, -0.06708165258169174, 0.025039220228791237, -0.0547344945371151, 0.026194611564278603, 0.03780025616288185, -0.009260372258722782, 0.0549069382250309, 0.017123928293585777, -0.04680195823311806, 0.01772749237716198, 0.05269962549209595, -0.002455205889418721, 0.02955731563270092, -0.03133351355791092, -0.04769868031144142, -0.024952996522188187, 0.08049798756837845, -0.0005760788335464895, -0.008829256519675255, -0.03790372237563133, 0.022228343412280083, 0.011519420892000198, -0.005483795888721943, -0.008596453815698624, -0.009519042447209358, 0.0027483648154884577, 0.0126661891117692, 0.006070113740861416, 0.01945195533335209, -0.030816175043582916, 0.08380895853042603, -0.0803600326180458, -0.030574750155210495, 0.04114571586251259, 0.02198691852390766, 0.00976908951997757, 0.030729951336979866, 0.05190637335181236, -0.016666946932673454, -0.00445342855527997, -0.06756450980901718, -0.021141931414604187, -0.013994026929140091, -0.042628753930330276, -0.050078440457582474, 0.014433764852583408, -0.034351326525211334, -0.015235641039907932, 0.013157662004232407, 0.058045465499162674, -0.006152025889605284, 0.03305797651410103, 0.026211855933070183, 0.014502743259072304, 0.038524530827999115, 0.02747071348130703, 0.020193476229906082, 0.019038084894418716, 0.038765955716371536, 0.048422954976558685, 0.03528253734111786, -0.042180392891168594, 0.054286133497953415, -0.028419168666005135, -0.01995205134153366, -0.03354082629084587, 0.07284136861562729, -0.03379949927330017, 0.029005486518144608, -0.026780929416418076, -0.026780929416418076, -0.003571796463802457, 0.005557085853070021 ]
39,351
pyspark.sql.dataframe
_show_string
null
def _show_string( self, n: int = 20, truncate: Union[bool, int] = True, vertical: bool = False ) -> str: if not isinstance(n, int) or isinstance(n, bool): raise PySparkTypeError( error_class="NOT_INT", message_parameters={"arg_name": "n", "arg_type": type(n).__name__}, ) if not isinstance(vertical, bool): raise PySparkTypeError( error_class="NOT_BOOL", message_parameters={"arg_name": "vertical", "arg_type": type(vertical).__name__}, ) if isinstance(truncate, bool) and truncate: return self._jdf.showString(n, 20, vertical) else: try: int_truncate = int(truncate) except ValueError: raise PySparkTypeError( error_class="NOT_BOOL", message_parameters={ "arg_name": "truncate", "arg_type": type(truncate).__name__, }, ) return self._jdf.showString(n, int_truncate, vertical)
(self, n: int = 20, truncate: Union[bool, int] = True, vertical: bool = False) -> str
[ 0.009156239219009876, -0.0016759955324232578, 0.03999197855591774, 0.02581956423819065, 0.0544564314186573, -0.00016051334387157112, 0.018175048753619194, -0.023551978170871735, -0.0319179967045784, -0.0858934298157692, -0.011140377260744572, 0.060400258749723434, 0.004505110438913107, -0.004616771824657917, 0.012729406356811523, -0.009087524376809597, 0.0072322264313697815, -0.09063474088907242, 0.06380163878202438, 0.032450538128614426, 0.02755461074411869, 0.022504078224301338, -0.004977524280548096, -0.008782602846622467, -0.021232854574918747, -0.003918887581676245, 0.02769204042851925, 0.003820110112428665, -0.022589972242712975, 0.014533167704939842, -0.015684138983488083, -0.029238123446702957, 0.01156984455883503, 0.0387207567691803, -0.01915423385798931, 0.009697368368506432, 0.004359091632068157, -0.024204768240451813, -0.02698771469295025, 0.007854954339563847, -0.02006470412015915, -0.017427776008844376, 0.03710595890879631, -0.049818187952041626, -0.06496978551149368, -0.04081655666232109, 0.031436994671821594, 0.011715863831341267, -0.0300455205142498, -0.00802674051374197, 0.05081455036997795, 0.005445643328130245, -0.036178313195705414, -0.03586909547448158, -0.0668938010931015, -0.03231310844421387, 0.026764390990138054, 0.025012165307998657, 0.04102269932627678, -0.032776933163404465, -0.05088326707482338, 0.008731067180633545, 0.028482260182499886, 0.02480602264404297, -0.02844790369272232, 0.018741946667432785, -0.008267242461442947, 0.025871099904179573, 0.019841382279992104, -0.032776933163404465, 0.017779938876628876, 0.012669280171394348, -0.00013588608999270946, 0.047516245394945145, -0.05146734043955803, 0.010083888657391071, -0.07235662639141083, -0.016371287405490875, -0.023981444537639618, -0.03992326557636261, 0.07160075753927231, -0.034185584634542465, 0.03365304321050644, -0.057514239102602005, 0.00823717936873436, -0.020923638716340065, 0.0007300941506400704, 0.0049088094383478165, 0.005458527244627476, 0.052704207599163055, -0.03954533487558365, -0.01941191405057907, -0.004320439416915178, -0.0010006583761423826, -0.04157241806387901, 0.017539437860250473, 0.008804076351225376, -0.06847424060106277, -0.0006243378738872707, -0.040026336908340454, 0.009508402086794376, 0.02339736931025982, -0.0006184326484799385, -0.02870558388531208, -0.07785379886627197, -0.03600652515888214, -0.06661894172430038, 0.04504251480102539, 0.012875424697995186, -0.0015063559403643012, -0.02447962760925293, -0.005746270064264536, 0.02872276119887829, -0.0600910410284996, 0.033034611493349075, 0.05036790668964386, -0.022710222750902176, -0.01156984455883503, -0.005291034933179617, -0.038033608347177505, 0.0217138584703207, -0.05486872047185898, -0.02365504950284958, -0.08953531086444855, -0.04645116627216339, 0.048924896866083145, -0.03272539749741554, 0.03394508361816406, 0.0751052126288414, 0.01522031519562006, 0.052910350263118744, -0.0305093452334404, 0.03834282606840134, 0.1060955598950386, 0.014713544398546219, 0.01591605134308338, -0.009551349096000195, 0.0854124203324318, -0.019497808068990707, 0.08630571514368057, -0.017728403210639954, -0.06452314555644989, -0.04923411086201668, 0.04480201005935669, -0.02204025350511074, -0.022641507908701897, 0.009894922375679016, -0.005686144810169935, 0.014181004837155342, 0.018810659646987915, -0.013511036522686481, -0.010719499550759792, -0.0037041539326310158, -0.004039138555526733, 0.05747988075017929, 0.009577116928994656, 0.025853920727968216, -0.0650041475892067, 0.040335554629564285, -0.04517994448542595, -0.014327024109661579, -0.04164113476872444, -0.03772439435124397, 0.020150598138570786, -0.05954132229089737, -0.002909639850258827, 0.005488589871674776, 0.018312478438019753, 0.045660946518182755, 0.06493543088436127, 0.052394989877939224, 0.036178313195705414, -0.004664013162255287, 0.02408451773226261, -0.023105332627892494, 0.05696452036499977, 0.007391129620373249, 0.0010344790061935782, -0.010066709481179714, -0.046038877218961716, -0.06582872569561005, -0.0556245818734169, -0.01470495481044054, -0.02556188404560089, 0.00732241477817297, -0.028533795848488808, 0.002855956554412842, -0.03306896984577179, 0.008293010294437408, -0.04627937823534012, -0.03542244806885719, -0.013218998908996582, 0.020975174382328987, 0.008907148614525795, -0.010083888657391071, -0.037655677646398544, 0.027056429535150528, -0.012823889032006264, -0.011621381156146526, -0.07489906996488571, 0.005583072546869516, 0.10341568291187286, 0.038789473474025726, -0.03834282606840134, 0.016328340396285057, -0.022967902943491936, -0.04387436434626579, 0.05620865896344185, -0.03672802820801735, -0.005016176030039787, 0.005170784424990416, 0.00008133034134516492, 0.007854954339563847, 0.016328340396285057, 0.015074296854436398, -0.003094310639426112, 0.009843386709690094, 0.02703925035893917, -0.048615679144859314, -0.028499439358711243, 0.09379561990499496, -0.043187215924263, 0.05095198005437851, 0.040850915014743805, 0.004917398560792208, -0.0022310817148536444, 0.011363700032234192, 0.011269217357039452, 0.03525066375732422, 0.010521944612264633, -0.005699028726667166, -0.02126721292734146, 0.013382195495069027, 0.04830646514892578, -0.017024077475070953, -0.02076902985572815, -0.028980443254113197, -0.008696709759533405, 0.0476536750793457, -0.043668217957019806, -0.07613593339920044, 0.01814069226384163, -0.006137085147202015, 0.025785207748413086, 0.04164113476872444, -0.043152857571840286, -0.008177054114639759, 0.04902796819806099, -0.016182322055101395, 0.027211038395762444, 0.04634809494018555, -0.041297558695077896, -0.02678157016634941, 0.0007472728029824793, 0.03762131929397583, 0.04672602564096451, -0.06813066452741623, 0.03902997449040413, -0.01781429722905159, 0.01961805857717991, -0.0030170066747814417, -0.04823774844408035, -0.06411085277795792, 0.022315112873911858, 0.045214299112558365, -0.05991925299167633, -0.05428464710712433, -0.042328279465436935, 0.010710909962654114, -0.019841382279992104, -0.03889254480600357, 0.07902195304632187, -0.03531937673687935, 0.004646834451705217, 0.020683137699961662, 0.009551349096000195, 0.03689981624484062, -0.022864829748868942, 0.01929166354238987, -0.05191398784518242, -0.03102470561861992, -0.012789531610906124, 0.0018370456527918577, 0.014945456758141518, 0.07324991375207901, -0.03648752719163895, 0.022727400064468384, -0.04057605564594269, 0.015624014660716057, 0.009989405982196331, 0.023277118802070618, -0.022847652435302734, 0.010496176779270172, 0.0035538405645638704, -0.0028645459096878767, -0.038480255752801895, 0.04957768693566322, -0.017144327983260155, -0.06249605864286423, -0.08568727970123291, -0.004698370583355427, -0.07166947424411774, 0.024754485115408897, 0.005097774788737297, 0.0032596555538475513, -0.02678157016634941, -0.01175880990922451, -0.013940502889454365, 0.06321756541728973, 0.010650784708559513, -0.05466257780790329, -0.04961204528808594, 0.030612416565418243, 0.035216305404901505, 0.00816846452653408, 0.01406075432896614, -0.04823774844408035, 0.045076869428157806, -0.02813868597149849, 0.004419216886162758, 0.025802385061979294, -0.005943825002759695, -0.02928965911269188, 0.02647235430777073, -0.004900219850242138, -0.021748214960098267, -0.019051162526011467, 0.008829844184219837, 0.03342972323298454, 0.023122509941458702, -0.010298621840775013, 0.03056088089942932, 0.01929166354238987, 0.018346836790442467, -0.046004518866539, -0.014876741915941238, 0.01753084920346737, 0.020597243681550026, -0.020202133804559708, 0.026455175131559372, 0.09496377408504486, 0.03298307582736015, 0.01917141303420067, -0.025664955377578735, 0.045145586133003235, 0.03686545789241791, 0.03044063039124012, -0.014507399871945381, 0.04799724742770195, 0.06067511811852455, 0.02025366947054863, -0.008941506035625935, -0.025235489010810852, -0.06239298731088638, -0.00183382467366755, 0.028241759166121483, 0.05308213829994202, 0.06043461710214615, -0.015082885511219501, 0.017728403210639954, -0.01518595777451992, -0.027125144377350807, -0.01188765000551939, 0.012609154917299747, 0.014601882547140121, 0.01675780676305294, -0.020270848646759987, -0.014936867170035839, 0.051364269107580185, 0.06988289207220078, -0.013760127127170563, -0.05964439734816551, 0.01412946917116642, -0.051810916513204575, -0.01614796370267868, 0.07407449185848236, -0.0340309776365757, 0.017659688368439674, -0.021507713943719864, -0.04940589889883995, 0.005308213643729687, -0.04339335858821869, 0.011080252006649971, 0.017479311674833298, -0.05589944124221802, 0.01865605264902115, -0.08005267381668091, 0.023672228679060936, -0.01483379490673542, 0.028035614639520645, -0.027331288903951645, 0.020614422857761383, 0.035525523126125336, 0.02082056738436222, 0.04119448736310005, -0.007584389764815569, 0.009766082279384136, -0.015812980011105537, 0.024015802890062332, 0.035285018384456635, -0.015898874029517174, 0.007507085334509611, -0.030681131407618523, 0.03190081939101219, -0.044595867395401, 0.03954533487558365, 0.06163712218403816, -0.02459987811744213, -0.032330285757780075, -0.01528044044971466, 0.06658458709716797, -0.01057348120957613, -0.05734245106577873, 0.018535802140831947, 0.028791476041078568, 0.0005446180002763867, -0.028791476041078568, 0.03255360946059227, -0.040919627994298935, -0.017608152702450752, -0.02434219792485237, 0.00013454399595502764, 0.025012165307998657, 0.06002232804894447, -0.018604516983032227, -0.01870758831501007, -0.025424454361200333, 0.03813668340444565, 0.032210033386945724, 0.04401179030537605, -0.0014548199251294136, -0.010685142129659653, -0.03464940935373306, -0.0049345772713422775, 0.027829470112919807, 0.004140063188970089, 0.01612219586968422, -0.06823373585939407, -0.024943450465798378, 0.03882382810115814, 0.09489505738019943, -0.025201130658388138, 0.01570131815969944, -0.004436395596712828, 0.013184641487896442, 0.01650012657046318, -0.026352103799581528, 0.010436051525175571, -0.04301542788743973, -0.028946084901690483, 0.03353279456496239, 0.03786182403564453, -0.061877623200416565, -0.014524578116834164, 0.014181004837155342, -0.0711197555065155, -0.04923411086201668, 0.00029499022639356554, -0.03741517663002014, 0.04212213680148125, -0.003446473740041256, 0.04167548939585686, -0.08506885170936584, 0.04868439584970474, 0.01383743155747652, 0.03231310844421387, 0.010324389673769474, -0.016835112124681473, -0.08286997675895691, -0.02839636616408825, 0.012256992049515247, -0.03272539749741554, -0.0321584977209568, 0.004483636934310198, 0.05517793819308281, 0.04445843771100044, 0.014593292959034443, -0.02781229093670845, 0.03368740156292915, 0.0014548199251294136, -0.03720903396606445, -0.02973630465567112, -0.03267385810613632, 0.012815299443900585, -0.011578434146940708, 0.052326276898384094, 0.022349469363689423, 0.05390671640634537, 0.01418959442526102, -0.015100064687430859, 0.026575425639748573, 0.09475763142108917, -0.0024672886356711388, -0.0363844558596611, 0.022074609994888306, -0.004492226056754589, -0.027829470112919807, -0.01954934373497963, -0.0047584958374500275, 0.012076616287231445, -0.022916367277503014, 0.033481258898973465, 0.04748188704252243, -0.004655423574149609, 0.012506082653999329, -0.000916912336833775, 0.046554237604141235, 0.07586107403039932, -0.039579689502716064, -0.06283963471651077, 0.0528072789311409, -0.00852921698242426, 0.03858332708477974, 0.03834282606840134, -0.040713485330343246, -0.023483263328671455, 0.019016804173588753, -0.0030277431942522526, 0.04401179030537605, -0.018862197175621986, -0.022332290187478065, -0.016440002247691154, -0.07819737493991852, -0.05253241956233978, -0.024754485115408897, -0.00714633334428072, 0.05108940973877907, 0.013167462311685085, -0.05356314033269882, 0.04923411086201668, -0.05191398784518242, 0.04823774844408035, 0.015048528090119362, 0.006493543274700642, -0.015237494371831417, 0.0035946399439126253, -0.05005868896842003, 0.04043862596154213, 0.056036870926618576, 0.012377242557704449, 0.0032274455297738314, -0.011234859935939312, -0.015400691889226437, -0.04109141603112221, -0.003102899994701147, 0.00712915463373065, 0.09111575037240982, 0.05799524113535881, 0.10836314409971237, 0.0143184345215559, -0.023053795099258423, 0.02537291869521141, 0.04775674641132355, -0.02896326407790184, 0.004034843761473894, 0.03516476973891258, -0.012686459347605705, -0.012222634628415108, 0.015400691889226437, 0.004831505473703146, -0.01127780694514513, -0.0027249690610915422, 0.08692415058612823, -0.04198470711708069, 0.025166774168610573, 0.03492426872253418, -0.006270220037549734, -0.034632228314876556, 0.0058407532051205635, -0.06826809793710709, 0.03992326557636261, -0.004904514644294977, -0.02717668004333973, -0.016105016693472862, -0.09516991674900055, -0.007915079593658447, 0.02454834058880806, 0.021232854574918747, 0.005097774788737297, 0.067580945789814, -0.03600652515888214, 0.009534170851111412, -0.0014548199251294136, 0.01547799538820982, -0.008164170198142529, 0.07022646814584732, 0.010547712445259094, 0.014979813247919083, -0.014369970187544823, -0.015873106196522713, 0.011578434146940708, -0.007309530861675739, 0.0019283074652776122, -0.020906459540128708, 0.050539691001176834, 0.033670224249362946, 0.015812980011105537, -0.0068628848530352116, 0.01936037838459015, -0.003543103812262416, -0.038033608347177505, 0.05064276605844498, -0.01505711767822504, 0.02640363946557045, -0.0009378488757647574, 0.052841637283563614, 0.040404267609119415, 0.04280928522348404, -0.06259912997484207, -0.0027807997539639473, -0.03710595890879631, 0.005806395784020424, -0.04878746718168259, -0.020975174382328987, -0.05452514812350273, -0.009671599604189396, 0.01160420197993517, -0.04978382959961891, -0.03889254480600357, -0.03628138452768326, -0.004030548967421055, 0.09015373885631561, -0.025991350412368774, -0.011879061348736286, -0.019686773419380188, 0.03875511512160301, -0.0235863346606493, -0.005308213643729687, 0.0029697653371840715, -0.10870672017335892, -0.012737995013594627, 0.01767686754465103, 0.006850000936537981, 0.03858332708477974, -0.06651587039232254, -0.02908351458609104, 0.0012572649866342545, 0.021181318908929825, -0.035285018384456635, 0.05407850071787834, 0.028568154200911522, 0.00751138012856245, -0.011973544023931026, 0.007365361321717501, 0.07146333158016205, 0.025098059326410294, 0.04009505361318588, 0.018415551632642746, 0.006192916072905064, -0.019686773419380188, -0.04493943974375725, 0.023174047470092773, 0.0002598276187200099, -0.03358433023095131, 0.03672802820801735, 0.029375551268458366, 0.03475248068571091, -0.05074583739042282, -0.01146677229553461, 0.008434734307229519, 0.022143324837088585, -0.051158126443624496, -0.05813267081975937, -0.01987573876976967, 0.019446272403001785, -0.01769404672086239, -0.009276489727199078, -0.0054757059551775455, 0.06589743494987488, -0.0683024525642395, 0.03597216680645943, -0.024823199957609177, 0.05071147903800011, -0.033034611493349075, -0.0018714030738919973, -0.00715921726077795, 0.013536804355680943, 0.042259566485881805, -0.0077733551152050495, -0.05569329857826233, 0.06507285684347153, -0.027400003746151924, 0.001980917062610388, -0.08046495914459229, -0.020597243681550026, -0.0030019753612577915, -0.04517994448542595, -0.02999398484826088, -0.006884358357638121, 0.026609783992171288, -0.030938811600208282, -0.03858332708477974, -0.03468376770615578, 0.008821254596114159, 0.07929681241512299, -0.07366220653057098, -0.001890729065053165, 0.01173304207623005, 0.04583273455500603, -0.016955362632870674, 0.020236492156982422, -0.014309844933450222, -0.032639503479003906, 0.016628967598080635, -0.01793454773724079, -0.010771036148071289, 0.008052508346736431, -0.01767686754465103, -0.00724081601947546, -0.006867179647088051, 0.005681850016117096, 0.07352477312088013, 0.022899188101291656, -0.03275975212454796, -0.02858533337712288, 0.06754659116268158, 0.002201019087806344, -0.013562572188675404, -0.0018220143392682076, 0.024771664291620255, 0.016491537913680077, -0.042843639850616455, -0.01896526850759983, 0.03178056702017784, -0.035285018384456635, 0.053219567984342575, -0.06057204306125641, 0.002490909304469824, -0.0072064585983753204, -0.036556243896484375, 0.024891914799809456, 0.011844703927636147, 0.021301569417119026, -0.0443553663790226, 0.020648779347538948, 0.022143324837088585, 0.000014645500414189883, -0.008615111000835896, -0.006794170010834932, -0.027142323553562164, 0.002808714983984828, 0.04280928522348404, 0.005836458411067724, -0.02820740081369877, 0.009491223841905594, 0.026678498834371567, 0.04731009900569916, 0.03927047550678253, -0.022538434714078903, -0.009920691139996052, 0.050264835357666016, 0.01162996981292963, -0.04363385960459709, 0.04902796819806099, 0.07057003676891327, -0.004745611920952797, -0.03841153904795647, 0.06933317333459854, 0.006532195024192333, -0.04102269932627678, -0.030389094725251198, 0.012248402461409569, 0.0004729506908915937, 0.03916740417480469, -0.04146934673190117, 0.03851461410522461, 0.014232540503144264, 0.02640363946557045 ]
39,352
pyspark.sql.dataframe
_sort_cols
Return a JVM Seq of Columns that describes the sort order
def _sort_cols( self, cols: Sequence[Union[str, Column, List[Union[str, Column]]]], kwargs: Dict[str, Any] ) -> JavaObject: """Return a JVM Seq of Columns that describes the sort order""" if not cols: raise PySparkValueError( error_class="CANNOT_BE_EMPTY", message_parameters={"item": "column"}, ) if len(cols) == 1 and isinstance(cols[0], list): cols = cols[0] jcols = [_to_java_column(cast("ColumnOrName", c)) for c in cols] ascending = kwargs.get("ascending", True) if isinstance(ascending, (bool, int)): if not ascending: jcols = [jc.desc() for jc in jcols] elif isinstance(ascending, list): jcols = [jc if asc else jc.desc() for asc, jc in zip(ascending, jcols)] else: raise PySparkTypeError( error_class="NOT_BOOL_OR_LIST", message_parameters={"arg_name": "ascending", "arg_type": type(ascending).__name__}, ) return self._jseq(jcols)
(self, cols: Sequence[Union[str, pyspark.sql.column.Column, List[Union[str, pyspark.sql.column.Column]]]], kwargs: Dict[str, Any]) -> py4j.java_gateway.JavaObject
[ -0.007750018499791622, 0.004712189082056284, -0.012231261469423771, 0.0016155124176293612, 0.0012524385238066316, -0.012719801627099514, 0.05624426156282425, 0.053153134882450104, -0.007390275597572327, -0.0195060633122921, -0.014123243279755116, 0.05539153516292572, 0.010925527662038803, 0.04842762276530266, 0.02138916216790676, 0.039651669561862946, 0.027926715090870857, 0.022188592702150345, 0.003932745661586523, 0.00013178084918763489, 0.0088203651830554, 0.0017753982683643699, -0.017489727586507797, 0.008287412114441395, 0.022828135639429092, 0.03918977826833725, 0.04700641706585884, -0.021708935499191284, -0.02780235931277275, -0.0015899752033874393, 0.0004582836991176009, 0.002293916651979089, -0.028228720650076866, 0.002691410481929779, -0.036276303231716156, -0.007110475562512875, 0.08335378021001816, 0.014896024018526077, 0.02718058042228222, -0.04960012063384056, 0.0030022994615137577, -0.018511218950152397, -0.012080257758498192, -0.08520135283470154, -0.04249408468604088, -0.0017742878990247846, 0.0221352968364954, -0.02291695959866047, 0.019665949046611786, -0.02899261936545372, 0.003510825103148818, -0.0312487855553627, 0.07305002957582474, 0.0051829637959599495, -0.01886652037501335, -0.009379965253174305, 0.024888884276151657, 0.06374112516641617, -0.001583313220180571, 0.036311835050582886, -0.018902050331234932, 0.009282257407903671, -0.03217257186770439, -0.006386548280715942, 0.007425805553793907, -0.00748798344284296, -0.02725164219737053, -0.00004698032353189774, -0.0787348598241806, -0.012630975805222988, -0.04121499881148338, 0.027873419225215912, 0.009060193784534931, 0.09586039930582047, 0.009300022386014462, -0.010614638216793537, -0.05631532147526741, -0.020998330786824226, 0.01112094335258007, -0.05951303616166115, 0.05194510892033577, -0.007354745641350746, 0.009566498920321465, -0.04974224045872688, 0.05482305586338043, -0.03933189809322357, 0.03565452620387077, 0.042991507798433304, 0.005800300277769566, 0.029294626787304878, -0.04196113348007202, -0.013528112322092056, -0.02472899854183197, 0.0321192741394043, -0.014842729084193707, 0.0035618997644633055, -0.010774524882435799, 0.013821236789226532, -0.0066663483157753944, 0.028708377853035927, 0.03222586587071419, -0.026043616235256195, 0.032350219786167145, -0.020483143627643585, 0.0009793003555387259, -0.005325084552168846, -0.01589086838066578, -0.04970670863986015, -0.05262018367648125, -0.044732484966516495, -0.017312075942754745, 0.01470060832798481, 0.05429010093212128, -0.05436116084456444, 0.03355824574828148, -0.017205486074090004, 0.038798946887254715, -0.05127003788948059, -0.028193190693855286, 0.016246171668171883, -0.03922531008720398, 0.012266791425645351, 0.051767461001873016, -0.01569545269012451, -0.07397381961345673, -0.0022672689519822598, 0.016015224158763885, 0.0009704178082756698, -0.07010103017091751, 0.040397804230451584, 0.04963564872741699, -0.06153825670480728, -0.010925527662038803, 0.03766198083758354, 0.003037829650565982, -0.022330712527036667, 0.08356696367263794, 0.031906094402074814, 0.035423580557107925, 0.00861162506043911, 0.028761673718690872, -0.027944479137659073, 0.012959630228579044, -0.0410018190741539, 0.021513517946004868, 0.015002614818513393, 0.0462602823972702, -0.004192559979856014, -0.017454195767641068, 0.036276303231716156, -0.033540479838848114, -0.05471646413207054, -0.05549812689423561, -0.03103560395538807, -0.002192877698689699, -0.02050090953707695, -0.03608088940382004, -0.07397381961345673, -0.04160583019256592, 0.005720357410609722, 0.023165671154856682, -0.018120387569069862, -0.01688571460545063, 0.03055594675242901, -0.011440714821219444, 0.05446775257587433, 0.027678003534674644, -0.03517486900091171, -0.04014909267425537, 0.0057381228543818, 0.05720357596874237, 0.050879206508398056, 0.029418982565402985, -0.05873137339949608, -0.02988087385892868, 0.026452211663126945, -0.02421381138265133, 0.020181138068437576, 0.018155917525291443, -0.005187404807657003, 0.004405741114169359, -0.023751920089125633, -0.0019197395304217935, 0.009983978234231472, 0.026185736060142517, 0.008953602984547615, -0.018919816240668297, -0.05091473460197449, -0.00444349180907011, -0.06317264586687088, -0.0754660815000534, 0.03673819825053215, 0.05009754002094269, 0.06843110918998718, -0.027855653315782547, 0.01338599156588316, -0.03943848982453346, 0.018511218950152397, 0.03100007399916649, 0.007354745641350746, 0.0025559517089277506, 0.029792048037052155, 0.05823395028710365, 0.007621221709996462, 0.004372431896626949, -0.003604091703891754, 0.0034708536695688963, -0.029863109812140465, -0.001495598116889596, -0.06203567981719971, 0.042280904948711395, -0.023680858314037323, -0.01961265504360199, -0.10850914567708969, -0.018600044772028923, 0.01466507837176323, 0.004163691774010658, 0.014363071881234646, 0.051483217626810074, 0.015064792707562447, 0.07269473373889923, 0.03577888384461403, -0.02817542664706707, -0.01957712508738041, 0.08740422129631042, -0.009539850987493992, 0.021939881145954132, -0.02869061380624771, -0.03261669725179672, -0.021549049764871597, -0.03199492022395134, -0.0763898715376854, 0.03028947114944458, 0.0006234434549696743, -0.032012686133384705, 0.014416366815567017, -0.0325278714299202, 0.009708619676530361, -0.05226488038897514, -0.03219033405184746, -0.05635085329413414, 0.0990581139922142, 0.007297008763998747, 0.01787167601287365, 0.022845899686217308, -0.010747876949608326, 0.03407343477010727, 0.022597188130021095, -0.030786894261837006, 0.04412847384810448, 0.012222378514707088, -0.00924672745168209, 0.015206913463771343, -0.04252961650490761, -0.03339836001396179, 0.015802044421434402, 0.0008560550631955266, 0.015704335644841194, 0.0013157266657799482, 0.0276247076690197, 0.013474817387759686, -0.0385502353310585, -0.009832974523305893, 0.04679323732852936, 0.04199666157364845, -0.0438087023794651, 0.03815940394997597, 0.004128161817789078, -0.011867077089846134, 0.05105685442686081, -0.004181457217782736, -0.030680302530527115, -0.049173757433891296, -0.008012053556740284, 0.06718755513429642, 0.03281211480498314, 0.001658814842812717, -0.08107984811067581, -0.03515710309147835, -0.01657482422888279, 0.09848963469266891, -0.020962800830602646, -0.014540722593665123, 0.054219041019678116, -0.0003400348359718919, 0.03203044831752777, -0.05134109780192375, -0.023147907108068466, -0.07944546639919281, 0.0006428740452975035, 0.049102697521448135, 0.048285502940416336, 0.014585135504603386, 0.013981122523546219, 0.016175109893083572, -0.0030156231950968504, 0.044057413935661316, -0.016281701624393463, 0.024746764451265335, 0.026221266016364098, -0.04924481734633446, -0.0377330407500267, 0.08356696367263794, 0.028530728071928024, 0.020856210961937904, -0.008234117180109024, -0.07845062017440796, -0.04832103103399277, -0.014771668240427971, -0.03455309197306633, 0.017543021589517593, -0.009726384654641151, -0.0714867040514946, -0.005444998852908611, -0.09152571856975555, 0.016192875802516937, -0.05119897797703743, 0.002627012087032199, -0.000973748741671443, 0.01634387858211994, 0.0008066458976827562, -0.051483217626810074, -0.03069806843996048, -0.03140867128968239, -0.0027247199323028326, 0.043915290385484695, 0.017241016030311584, -0.025155361741781235, 0.02684304490685463, -0.002411610446870327, 0.039758261293172836, 0.027820123359560966, 0.08278530091047287, 0.029525572434067726, -0.014487427659332752, -0.03343389183282852, 0.0019663728307932615, -0.0019530490972101688, 0.020749619230628014, 0.02476452849805355, -0.011982549913227558, -0.06114742532372475, 0.028637317940592766, 0.005649297032505274, 0.04832103103399277, 0.0016377188730984926, 0.024782294407486916, 0.03348718583583832, 0.01620175875723362, 0.061929088085889816, 0.08171939104795456, -0.02909921109676361, -0.019381707534193993, 0.003828375833109021, -0.0036085329484194517, 0.035050515085458755, 0.004880957305431366, -0.023965099826455116, 0.014229833148419857, -0.01568656973540783, 0.12584786117076874, -0.037839632481336594, 0.003941628150641918, 0.007807754911482334, 0.058447130024433136, 0.009939565323293209, -0.014656195417046547, -0.025492897257208824, 0.03826599568128586, -0.019399473443627357, 0.02060749940574169, 0.01338599156588316, 0.08683574199676514, 0.020518673583865166, -0.07589244842529297, 0.012355617247521877, -0.030094055458903313, 0.024604642763733864, 0.028530728071928024, -0.016965657472610474, -0.024160515516996384, -0.07681623101234436, 0.03565452620387077, 0.008505035191774368, -0.04881845414638519, 0.014149890281260014, 0.007541278842836618, -0.045656271278858185, -0.026221266016364098, 0.000027809992388938554, -0.0723038986325264, 0.04601157084107399, -0.026079146191477776, -0.01359029021114111, 0.006430961191654205, 0.01784502901136875, 0.010721229016780853, 0.044625893235206604, 0.0390121266245842, -0.05567577853798866, -0.022668249905109406, -0.02165563963353634, -0.025368541479110718, 0.040682047605514526, -0.018404629081487656, -0.015615509822964668, 0.04874739423394203, 0.01060575619339943, -0.015935281291604042, 0.06462938338518143, 0.018884286284446716, 0.005769211333245039, -0.03147973120212555, -0.026647629216313362, 0.018582278862595558, 0.008789275772869587, 0.017471961677074432, -0.007923227734863758, 0.036311835050582886, -0.02332555688917637, 0.016414938494563103, 0.025635018944740295, -0.018475688993930817, 0.06750732660293579, 0.03139090538024902, -0.03467744588851929, -0.00022886427177581936, 0.0009371082414872944, -0.019257353618741035, -0.003464191686362028, 0.015775395557284355, 0.048107851296663284, -0.04274279624223709, 0.010765641927719116, 0.07468441873788834, 0.03243904560804367, 0.01169830933213234, -0.03380695730447769, 0.003102228045463562, 0.030076289549469948, 0.015047027729451656, 0.039616141468286514, -0.030680302530527115, 0.018333569169044495, 0.01627281866967678, 0.04416400194168091, 0.020731855183839798, -0.005444998852908611, -0.05691933259367943, -0.03558346629142761, 0.08214575797319412, 0.04796573147177696, 0.05940644443035126, -0.0547875240445137, 0.02913474105298519, -0.05429010093212128, -0.06338582187891006, 0.04164136201143265, -0.042351964861154556, -0.016024107113480568, 0.07010103017091751, -0.044661425054073334, 0.01062352117151022, -0.03183503448963165, -0.04807232320308685, 0.03577888384461403, -0.09138359874486923, -0.04320468753576279, -0.00006092869080021046, 0.030378296971321106, 0.037022437900304794, -0.021975411102175713, 0.03517486900091171, -0.020447613671422005, -0.037910692393779755, 0.005898008588701487, -0.0011802678927779198, -0.0261679720133543, -0.006653024349361658, 0.04348893091082573, -0.005360614508390427, -0.028406372293829918, -0.008087554946541786, -0.030875718221068382, 0.016965657472610474, 0.03062700666487217, -0.02957886829972267, -0.02940121665596962, 0.048107851296663284, -0.058518193662166595, -0.01494043692946434, 0.06235545128583908, 0.05215829238295555, -0.002769132610410452, 0.02476452849805355, 0.012844156473875046, -0.015411212109029293, 0.006617494393140078, -0.039722733199596405, 0.04014909267425537, 0.006577522959560156, 0.0313020795583725, -0.008971367962658405, 0.008518358692526817, -0.016725828871130943, -0.0901755765080452, 0.09188102185726166, -0.02265048399567604, -0.04238749295473099, -0.03862129524350166, 0.0051385508850216866, -0.04533649981021881, 0.020589733496308327, -0.00743468850851059, 0.012346734292805195, 0.01957712508738041, 0.02380521409213543, 0.04270726442337036, 0.03281211480498314, 0.014043300412595272, 0.02428487129509449, -0.027233876287937164, -0.006213338579982519, -0.00858053658157587, -0.017720673233270645, 0.045514147728681564, 0.05368608981370926, 0.005969068966805935, 0.043027035892009735, 0.005822506733238697, -0.015775395557284355, 0.010055038146674633, 0.02350320853292942, -0.021815525367856026, 0.016041873022913933, 0.06317264586687088, -0.031088899821043015, 0.09998190402984619, -0.021104922518134117, 0.012533267959952354, 0.008913631550967693, 0.044945668429136276, 0.008762628771364689, -0.02869061380624771, -0.036347366869449615, -0.010063921101391315, -0.006191132124513388, -0.03311412036418915, 0.018120387569069862, -0.0022872546687722206, -0.03815940394997597, 0.019754774868488312, -0.012018080800771713, 0.01568656973540783, -0.04341787099838257, -0.032314691692590714, -0.054076921194791794, -0.02677198313176632, 0.0180759746581316, -0.003988261800259352, 0.01909746788442135, 0.037200089544057846, 0.086906798183918, -0.006586405448615551, -0.05784311890602112, 0.03659607470035553, 0.013163928873836994, -0.02650550752878189, -0.005724798887968063, -0.03481956943869591, 0.043062567710876465, -0.00214846502058208, -0.01081005483865738, -0.03100007399916649, 0.028601787984371185, -0.05539153516292572, 0.0261679720133543, 0.06438066810369492, -0.06054341048002243, 0.010747876949608326, -0.03309635445475578, 0.010667934082448483, -0.04171242192387581, -0.03011181950569153, -0.05262018367648125, -0.025706078857183456, 0.014824964106082916, 0.048214443027973175, 0.027269406244158745, -0.0306625384837389, -0.022632719948887825, -0.03918977826833725, -0.006906176917254925, -0.02268601395189762, -0.0035574582871049643, 0.01555333286523819, -0.035245928913354874, 0.02551066316664219, -0.047361716628074646, -0.042955975979566574, -0.037164557725191116, 0.044768016785383224, 0.04359551891684532, -0.014789434149861336, 0.016788005828857422, -0.03359377756714821, -0.03677372634410858, 0.03039606101810932, 0.004054880701005459, 0.05119897797703743, -0.010019508190453053, 0.06079212203621864, -0.028459666296839714, 0.04409294202923775, -0.011005470529198647, -0.027873419225215912, -0.003193274140357971, -0.05269124358892441, 0.027980009093880653, -0.02698516473174095, -0.08285635709762573, -0.028353076428174973, 0.07582138478755951, 0.021531283855438232, -0.012408912181854248, -0.025599488988518715, -0.04487460479140282, 0.022259652614593506, 0.054254572838544846, -0.027926715090870857, 0.008780393749475479, -0.02401839569211006, 0.10730111598968506, -0.009566498920321465, 0.001995241269469261, -0.053401846438646317, -0.05379267781972885, -0.06782709807157516, -0.0004899277701042593, -0.06480703502893448, 0.043915290385484695, 0.021495753899216652, 0.053437378257513046, -0.01705448143184185, 0.01336822658777237, 0.01113870833069086, -0.026789749041199684, 0.015597744844853878, 0.018138151615858078, -0.025457367300987244, -0.010952175594866276, 0.016050754114985466, 0.02643444761633873, 0.003799507627263665, -0.0176407303661108, 0.01828027330338955, -0.05091473460197449, 0.021993175148963928, 0.04881845414638519, -0.031017839908599854, 0.037910692393779755, -0.03577888384461403, 0.048249971121549606, -0.07987182587385178, -0.03251010552048683, 0.03926083818078041, 0.04629581421613693, 0.021886585280299187, 0.007901022210717201, 0.04274279624223709, -0.008771510794758797, 0.017143307253718376, 0.09173890203237534, -0.0438087023794651, 0.01824474334716797, -0.013039573095738888, -0.013732410967350006, -0.021975411102175713, 0.0006351018091663718, -0.05961962789297104, -0.014123243279755116, -0.013448169454932213, -0.06128954514861107, 0.006053452845662832, -0.050594963133335114, -0.02527971751987934, -0.005529382731765509, 0.03425108641386032, -0.03918977826833725, -0.05983280763030052, 0.011387419886887074, 0.027056224644184113, -0.0038483617827296257, 0.00407708715647459, -0.027535881847143173, -0.015375681221485138, 0.014771668240427971, -0.01558886282145977, 0.0221352968364954, 0.0345175601541996, 0.030929014086723328, 0.0075501613318920135, -0.001825362560339272, 0.028814969584345818, 0.009300022386014462, 0.03462415188550949, 0.0377330407500267, 0.05794971063733101, 0.03565452620387077, -0.0067329672165215015, -0.03904765844345093, 0.01835133321583271, -0.04355999082326889, -0.04679323732852936, 0.007194859441369772, 0.016965657472610474, 0.04867633432149887, 0.03448203206062317, 0.02039431780576706, 0.0147183733060956, -0.025794904679059982, 0.019115231931209564, 0.007638986688107252, -0.05816289037466049, 0.026896338909864426, -0.05951303616166115, -0.0401846244931221, -0.00835403148084879, 0.001974145183339715, -0.06526892632246017, -0.0030289471615105867, -0.004154809284955263, 0.04807232320308685, 0.028370842337608337, -0.018902050331234932, -0.04793019965291023, -0.009877387434244156, 0.0008288522949442267, -0.037804100662469864, 0.01699230447411537, -0.06917724013328552, 0.03904765844345093, 0.039616141468286514, 0.0007794431294314563, 0.011947019957005978, -0.01968371495604515, -0.009966213256120682, -0.014620665460824966, 0.026452211663126945, -0.03350495174527168, -0.02265048399567604, -0.022010941058397293, -0.01263985875993967, 0.015029262751340866, -0.0003686255367938429, 0.00035335865686647594, -0.02568831294775009, 0.05013307183980942, -0.004396858625113964, -0.09273374825716019, -0.08179045468568802, -0.018475688993930817, -0.05041731148958206, -0.009957330301404, 0.04629581421613693, 0.004427947569638491, 0.03343389183282852, 0.012373382225632668 ]
39,353
pyspark.sql.dataframe
agg
Aggregate on the entire :class:`DataFrame` without groups (shorthand for ``df.groupBy().agg()``). .. versionadded:: 1.3.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Parameters ---------- exprs : :class:`Column` or dict of key and value strings Columns or expressions to aggregate DataFrame by. Returns ------- :class:`DataFrame` Aggregated DataFrame. Examples -------- >>> from pyspark.sql import functions as sf >>> df = spark.createDataFrame([(2, "Alice"), (5, "Bob")], schema=["age", "name"]) >>> df.agg({"age": "max"}).show() +--------+ |max(age)| +--------+ | 5| +--------+ >>> df.agg(sf.min(df.age)).show() +--------+ |min(age)| +--------+ | 2| +--------+
def agg(self, *exprs: Union[Column, Dict[str, str]]) -> "DataFrame": """Aggregate on the entire :class:`DataFrame` without groups (shorthand for ``df.groupBy().agg()``). .. versionadded:: 1.3.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Parameters ---------- exprs : :class:`Column` or dict of key and value strings Columns or expressions to aggregate DataFrame by. Returns ------- :class:`DataFrame` Aggregated DataFrame. Examples -------- >>> from pyspark.sql import functions as sf >>> df = spark.createDataFrame([(2, "Alice"), (5, "Bob")], schema=["age", "name"]) >>> df.agg({"age": "max"}).show() +--------+ |max(age)| +--------+ | 5| +--------+ >>> df.agg(sf.min(df.age)).show() +--------+ |min(age)| +--------+ | 2| +--------+ """ return self.groupBy().agg(*exprs) # type: ignore[arg-type]
(self, *exprs: Union[pyspark.sql.column.Column, Dict[str, str]]) -> pyspark.sql.dataframe.DataFrame
[ 0.018252715468406677, -0.03187980502843857, 0.045627161860466, 0.003307321574538946, -0.01520905364304781, -0.04781045764684677, 0.0018248088890686631, -0.014246923848986626, -0.04625624790787697, 0.012368920259177685, 0.02277657575905323, 0.0614653006196022, 0.0014697922160848975, 0.024682333692908287, -0.015699369832873344, -0.03286043927073479, 0.0010743013117462397, -0.0411495566368103, 0.06361158937215805, -0.007808054331690073, -0.024127257987856865, -0.04059448093175888, -0.0022468972019851208, 0.026588091626763344, -0.04311082139611244, -0.005092812702059746, 0.056062571704387665, -0.057283736765384674, -0.017984429374337196, 0.022351019084453583, -0.014672481454908848, -0.028142301365733147, 0.030529122799634933, -0.07038350403308868, -0.04414696246385574, -0.0366719514131546, -0.03195381537079811, -0.013793612830340862, 0.05106689780950546, -0.046404268592596054, 0.0024145760107785463, -0.004977172240614891, -0.00407980103045702, -0.0757492333650589, 0.010342896915972233, 0.04159361869096756, 0.057061705738306046, 0.019705161452293396, -0.02545943856239319, 0.007586024701595306, -0.009565792046487331, 0.03756007179617882, 0.006022563204169273, 0.013543829321861267, -0.04703335091471672, 0.033341504633426666, 0.007539768237620592, -0.047366395592689514, 0.004954044241458178, 0.01274822186678648, -0.018613513559103012, 0.0030968557111918926, -0.025662966072559357, -0.01779940351843834, -0.007151215802878141, 0.03743055462837219, -0.04085351899266243, -0.014015642926096916, -0.07475009560585022, -0.016735510900616646, -0.05898596718907356, 0.01399714034050703, -0.029585495591163635, 0.012535442598164082, -0.032083332538604736, -0.04603421688079834, -0.0341741144657135, 0.04488706216216087, 0.009427023120224476, -0.045627161860466, 0.031787291169166565, -0.024053247645497322, 0.002263086847960949, 0.007747921161353588, 0.053102172911167145, 0.013738105073571205, 0.009667555801570415, 0.04066849127411842, 0.0039826626889407635, -0.03966935724020004, 0.04799548164010048, 0.012082131579518318, 0.0074611324816942215, 0.008390882983803749, 0.003566356608644128, -0.03763408213853836, -0.047144368290901184, 0.05909698083996773, 0.006901431828737259, 0.017022298648953438, 0.04281478375196457, 0.00674878666177392, -0.03918829187750816, -0.0158843956887722, -0.008996839635074139, -0.02475634403526783, 0.045183103531599045, -0.03015907295048237, 0.0012951749376952648, 0.06057718023657799, 0.03818915784358978, 0.016642997041344643, 0.040927525609731674, -0.0013090517604723573, -0.03941032290458679, 0.01734609343111515, -0.04151960834860802, 0.016032414510846138, -0.021666426211595535, 0.015532847493886948, -0.05591455101966858, 0.0693843737244606, 0.029344962909817696, -0.05983708053827286, 0.026403065770864487, 0.020352749153971672, 0.005939302034676075, -0.07112360745668411, 0.04163062199950218, 0.02719867415726185, 0.03915128856897354, -0.02571847289800644, 0.025366926565766335, 0.00210118992254138, 0.004068236798048019, -0.01609717309474945, 0.08052287250757217, 0.013664095662534237, 0.021203864365816116, 0.06187235563993454, -0.005930050741881132, -0.016291450709104538, 0.010481665842235088, 0.05998510122299194, -0.0007875126320868731, 0.015736375004053116, 0.0776364877820015, 0.0078126797452569, -0.026329055428504944, 0.010342896915972233, -0.03620938956737518, -0.005425857845693827, -0.022480536252260208, 0.021444397047162056, 0.05054882541298866, 0.018715277314186096, 0.01388612575829029, 0.014913014136254787, -0.028919406235218048, -0.02151840552687645, 0.015292314812541008, 0.06845924258232117, 0.005684892646968365, -0.012572447769343853, -0.0504378117620945, -0.01737384684383869, -0.023313147947192192, 0.042925797402858734, -0.04281478375196457, -0.032564397901296616, -0.03237937390804291, -0.030862167477607727, 0.0018201833590865135, -0.03385957330465317, -0.002053777454420924, 0.09384467452764511, 0.008261365815997124, 0.06816320866346359, -0.040187425911426544, 0.012109885923564434, 0.00976006779819727, -0.0633525550365448, -0.03361903876066208, 0.00009215111640514806, 0.03830017149448395, 0.0005073731881566346, -0.01804918795824051, -0.05402729660272598, 0.01902056857943535, -0.031565263867378235, -0.06435169279575348, -0.03456266596913338, -0.02945597842335701, 0.015634611248970032, 0.012433678843080997, -0.007789552211761475, -0.010870218276977539, 0.03245338425040245, -0.026551086455583572, 0.038004133850336075, -0.02699514664709568, 0.028290320187807083, 0.06794117391109467, -0.03243488073348999, 0.007641531992703676, -0.008580533787608147, -0.06642396748065948, -0.027605727314949036, -0.009158737026154995, -0.013405060395598412, 0.02081531099975109, -0.042185697704553604, -0.006952313706278801, 0.0048522804863750935, -0.006660899613052607, 0.068348228931427, 0.044405996799468994, -0.02897491306066513, -0.00011499013635329902, -0.0029326460789889097, 0.027883265167474747, -0.012433678843080997, 0.019464628770947456, -0.02177744172513485, 0.038707226514816284, -0.04233371838927269, 0.05225105583667755, 0.009658304043114185, 0.02675461396574974, -0.03162077069282532, 0.020223231986165047, -0.06975442171096802, 0.002800815738737583, -0.053620241582393646, -0.0049031623639166355, 0.047181371599435806, 0.04425797611474991, 0.01708705723285675, 0.04954969137907028, -0.022184496745467186, -0.025089388713240623, 0.062242407351732254, 0.006827421952039003, 0.040927525609731674, -0.02545943856239319, -0.027272682636976242, 0.012609452940523624, 0.049364667385816574, -0.027069155126810074, 0.030011052265763283, 0.034969720989465714, 0.03754156827926636, 0.0332304872572422, 0.01976066827774048, -0.00642961822450161, 0.02497837319970131, -0.021111350506544113, 0.013358804397284985, 0.008390882983803749, -0.014302431605756283, 0.060022104531526566, -0.020685793831944466, -0.044961072504520416, 0.036468423902988434, 0.038004133850336075, 0.00420006737112999, 0.04769944027066231, -0.03441464900970459, 0.00015625938249286264, 0.01559760607779026, -0.07630430161952972, 0.0425187423825264, 0.04781045764684677, -0.02747621014714241, 0.014848255552351475, 0.011360534466803074, 0.02351667545735836, -0.02793877385556698, 0.022110486403107643, -0.00877481047064066, 0.03559880703687668, 0.006688653491437435, -0.04847654700279236, -0.014940767548978329, 0.01462622545659542, 0.027531718835234642, -0.04388792812824249, -0.010167122818529606, -0.05395328626036644, -0.01658749021589756, 0.024145761504769325, 0.03263840824365616, -0.02179594337940216, -0.02503388002514839, 0.010583429597318172, 0.014080401510000229, 0.01383986882865429, -0.002056090161204338, -0.04373990744352341, -0.007326989434659481, 0.026865627616643906, 0.03728253394365311, 0.060059111565351486, 0.04858756065368652, 0.003753694472834468, -0.0623164176940918, -0.04581218585371971, -0.03213883936405182, 0.05273212119936943, 0.014330185018479824, 0.007849684916436672, 0.02279507927596569, 0.02941897325217724, -0.035561803728342056, -0.04473904147744179, -0.014829752966761589, 0.054064299911260605, -0.01273897010833025, 0.03837418183684349, -0.02377571165561676, 0.032083332538604736, -0.024608323350548744, -0.03955834358930588, -0.01630995236337185, -0.004583993926644325, 0.06864427030086517, -0.014663230627775192, -0.014376441948115826, 0.004070549737662077, -0.018243463709950447, 0.026292050257325172, 0.01828972063958645, 0.05613658204674721, 0.016023164615035057, -0.0445910207927227, -0.08481545746326447, 0.02381271682679653, -0.0033443267457187176, -0.06135428696870804, 0.00649437727406621, -0.07463908195495605, -0.01730908825993538, 0.012766724452376366, 0.012294910848140717, 0.031065694987773895, -0.009824827313423157, -0.002578785875812173, -0.043480873107910156, -0.0013691849308088422, -0.05269511789083481, 0.029011918231844902, -0.017669886350631714, 0.005518370307981968, -0.040113415569067, 0.06609092652797699, 0.050955880433321, -0.008992214687168598, 0.06061418727040291, -0.012313412502408028, -0.04899461567401886, 0.1103489026427269, -0.032286860048770905, 0.007026324048638344, -0.04573817551136017, 0.023146625608205795, 0.011360534466803074, 0.021592415869235992, -0.022850586101412773, -0.00031743349973112345, -0.016189686954021454, 0.03336000442504883, -0.014089653268456459, 0.022961601614952087, 0.030399605631828308, -0.039077278226614, 0.019372116774320602, 0.01297950278967619, -0.030251584947109222, 0.012664960697293282, -0.01388612575829029, 0.023960735648870468, -0.02797577902674675, 0.04522010684013367, -0.036042869091033936, 0.002689800690859556, 0.05972606688737869, -0.01730908825993538, -0.030492117628455162, -0.019612649455666542, -0.050955880433321, 0.009778570383787155, 0.008603662252426147, -0.02205497771501541, -0.003984975628554821, -0.06342656910419464, -0.02053777314722538, 0.012156141921877861, 0.012026623822748661, -0.029622500762343407, -0.03733804076910019, -0.043665897101163864, 0.007165092509239912, 0.007183595094829798, -0.043702900409698486, 0.015532847493886948, -0.025940503925085068, 0.03730103746056557, -0.09488081187009811, -0.00092107750242576, -0.0425187423825264, 0.09673106670379639, -0.01586589217185974, -0.06372260302305222, 0.058578912168741226, 0.05713571608066559, 0.027809254825115204, 0.02201797440648079, -0.020611783489584923, 0.032823432236909866, 0.027661236003041267, -0.02527441270649433, 0.009006091393530369, -0.050400808453559875, 0.043924931436777115, -0.002330158371478319, -0.042222701013088226, -0.03711601346731186, -0.06142829731106758, -0.0030436611268669367, 0.0070448266342282295, -0.018918804824352264, -0.03474769368767738, -0.06383362412452698, 0.048402536660432816, -0.03815215080976486, -0.005740400403738022, 0.0069939447566866875, 0.016226692125201225, 0.00630935188382864, 0.03317498043179512, -0.0066562737338244915, -0.03691248595714569, 0.011675076559185982, 0.005893046036362648, 0.026625094935297966, -0.02103734202682972, 0.00830762181431055, 0.02051927149295807, -0.08740580081939697, 0.04266676306724548, 0.08326124399900436, 0.011203262954950333, -0.006836673244833946, 0.02033424563705921, -0.007345492020249367, 0.013451316393911839, 0.04636726155877113, 0.007965325377881527, 0.0020942515693604946, 0.03484020382165909, 0.00023691871319897473, -0.027420703321695328, 0.035247258841991425, -0.05025278776884079, -0.04684832692146301, 0.04921664670109749, -0.010916474275290966, -0.06690503656864166, -0.009279003366827965, -0.02553344890475273, -0.014043396338820457, -0.006142829544842243, -0.06831122189760208, -0.05077085644006729, 0.014700234867632389, 0.023701701313257217, -0.013562331907451153, -0.031306229531764984, 0.012692714110016823, 0.02397923916578293, -0.053361207246780396, 0.017688388004899025, 0.009834078140556812, 0.003631115425378084, 0.004977172240614891, 0.018696775659918785, -0.0032333116978406906, -0.05206603184342384, 0.03091767616569996, 0.011184760369360447, 0.019113080576062202, -0.02179594337940216, 0.013553080148994923, 0.024608323350548744, -0.04336985573172569, 0.03833717852830887, -0.010287389159202576, -0.018243463709950447, -0.04584919288754463, -0.019205594435334206, -0.017975177615880966, 0.01857650838792324, -0.042481739073991776, 0.014876008965075016, 0.022443531081080437, -0.08311322331428528, 0.08459342271089554, 0.05424932762980461, -0.021666426211595535, -0.05535947531461716, -0.06257545202970505, -0.007229851558804512, -0.0411495566368103, 0.023960735648870468, 0.01683727465569973, -0.019409121945500374, 0.0631675273180008, -0.03337850794196129, 0.031084198504686356, -0.0029950919561088085, 0.037726595997810364, 0.008969086222350597, -0.02224000357091427, 0.08511149138212204, 0.011286524124443531, 0.013950884342193604, -0.005032679531723261, 0.04925365000963211, 0.02351667545735836, 0.011934111826121807, 0.030085062608122826, 0.05117791146039963, 0.007752547040581703, -0.002722180215641856, -0.005860666278749704, 0.042185697704553604, -0.017401600256562233, -0.014839003793895245, -0.0638706237077713, 0.018400734290480614, 0.0007568678702227771, 0.0376155786216259, 0.0321018360555172, -0.0026921136304736137, -0.04877258837223053, -0.008367755450308323, 0.03859621286392212, -0.06305651366710663, 0.158381387591362, -0.010416907258331776, 0.021240869536995888, 0.02301710844039917, 0.03371155261993408, 0.01630070060491562, 0.017207324504852295, -0.00904309656471014, -0.02027873881161213, 0.021407391875982285, -0.08881199359893799, -0.0356358140707016, 0.003136173589155078, -0.01262795552611351, 0.028068291023373604, 0.022628556936979294, -0.03513624519109726, 0.04980872571468353, 0.01828046888113022, 0.01952013559639454, 0.03149125352501869, -0.02151840552687645, -0.05269511789083481, -0.009329885244369507, 0.03617238625884056, -0.07186370342969894, 0.02179594337940216, 0.04137158766388893, -0.026329055428504944, 0.06139129027724266, -0.08118896186351776, -0.0395953468978405, -0.045442137867212296, -0.03315647691488266, -0.034044597297906876, -0.01879853941500187, -0.05521145462989807, -0.0013263978762552142, -0.01632845588028431, 0.008367755450308323, -0.011332780122756958, -0.017475610598921776, 0.04089052230119705, -0.053620241582393646, 0.012886990793049335, 0.02553344890475273, 0.0047875214368104935, 0.03966935724020004, -0.0614653006196022, 0.002002895576879382, -0.05761678144335747, -0.0317687913775444, -0.03472919017076492, 0.015495842322707176, -0.010296640917658806, -0.01498702447861433, 0.002477022120729089, -0.011675076559185982, -0.029622500762343407, 0.07689638435840607, 0.028382834047079086, 0.011462298221886158, -0.011388287879526615, 0.08244713395833969, -0.03326749429106712, 0.0676451325416565, 0.0623164176940918, -0.000054567917686654255, -0.027143165469169617, -0.006526756566017866, -0.0029580870177596807, -0.024386294186115265, 0.009834078140556812, 0.05117791146039963, -0.055063437670469284, 0.01981617696583271, 0.0055461241863667965, 0.015320069156587124, 0.028345828875899315, 0.03963235393166542, -0.02423827350139618, 0.036523934453725815, 0.008451016619801521, -0.04625624790787697, -0.0019323547603562474, -0.011073745787143707, 0.04799548164010048, -0.05817185714840889, -0.016272947192192078, 0.002444642595946789, -0.024589821696281433, -0.03904027119278908, -0.004054360091686249, -0.037208523601293564, 0.007206723093986511, -0.03644992411136627, -0.0008083279244601727, -0.045146096497774124, -0.07645232230424881, 0.04429498314857483, 0.01470948662608862, -0.08992214500904083, 0.06139129027724266, -0.06945838034152985, 0.021425893530249596, -0.01388612575829029, 0.04573817551136017, 0.12418877333402634, -0.004181564785540104, -0.011934111826121807, -0.011786092072725296, 0.0599110908806324, 0.042481739073991776, -0.03215734288096428, 0.02875288389623165, 0.04555315151810646, 0.059282004833221436, 0.008131848648190498, -0.0356358140707016, 0.022369520738720894, 0.058763936161994934, 0.034026093780994415, -0.012294910848140717, -0.005601631477475166, 0.012489186599850655, 0.01200812216848135, -0.012933246791362762, 0.0027268058620393276, -0.004500732757151127, -0.05073385313153267, -0.008571282960474491, -0.04233371838927269, -0.021740436553955078, 0.020667290315032005, -0.0006811232306063175, -0.006471248809248209, -0.03195381537079811, -0.03263840824365616, 0.009325259365141392, -0.0315837636590004, -0.003404459683224559, -0.11212514340877533, 0.03019607812166214, -0.07600826770067215, 0.00040965687367133796, -0.00008008112490642816, -0.024367790669202805, 0.02527441270649433, 0.006961564999073744, 0.0096398014575243, 0.00016160776431206614, 0.06882929801940918, -0.02101883850991726, 0.07697039842605591, 0.0066701509058475494, 0.062464434653520584, 0.04744040593504906, 0.06705305725336075, 0.02053777314722538, 0.015320069156587124, 0.005763528402894735, -0.034266628324985504, -0.03239787369966507, 0.015477340668439865, -0.018724529072642326, 0.08133698254823685, 0.0807449072599411, -0.007470383774489164, 0.053324200212955475, 0.055840540677309036, -0.004015042446553707, -0.013738105073571205, 0.009538037702441216, 0.0021983280312269926, 0.0013946258695796132, -0.027827758342027664, 0.047144368290901184, -0.003709750948473811, 0.01447820570319891, -0.017494112253189087, 0.005851415451616049, -0.00903384480625391, 0.04921664670109749, 0.018437739461660385, 0.07323288917541504, -0.0019554828759282827, 0.04077950865030289, -0.022665560245513916, 0.0014836691552773118, -0.02999255061149597, -0.02429378032684326, -0.016291450709104538, -0.02947448007762432, -0.0459602065384388, 0.012526191771030426, -0.06412965804338455, -0.0068829297088086605, -0.06331554800271988, -0.019150085747241974, 0.01090722344815731, 0.0009251249139197171, 0.0886639729142189, 0.01587514393031597, 0.011323529295623302, 0.011786092072725296, 0.030806660652160645, -0.020648788660764694, 0.0037906994111835957, -0.03937331587076187, -0.002946523018181324, 0.042481739073991776, -0.05128892511129379, 0.02026023529469967, 0.062242407351732254, 0.028308823704719543, -0.02841983735561371, -0.027550220489501953, -0.008034709841012955, 0.017891915515065193, -0.014006391167640686 ]
39,354
pyspark.sql.dataframe
alias
Returns a new :class:`DataFrame` with an alias set. .. versionadded:: 1.3.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Parameters ---------- alias : str an alias name to be set for the :class:`DataFrame`. Returns ------- :class:`DataFrame` Aliased DataFrame. Examples -------- >>> from pyspark.sql.functions import col, desc >>> df = spark.createDataFrame( ... [(14, "Tom"), (23, "Alice"), (16, "Bob")], ["age", "name"]) >>> df_as1 = df.alias("df_as1") >>> df_as2 = df.alias("df_as2") >>> joined_df = df_as1.join(df_as2, col("df_as1.name") == col("df_as2.name"), 'inner') >>> joined_df.select( ... "df_as1.name", "df_as2.name", "df_as2.age").sort(desc("df_as1.name")).show() +-----+-----+---+ | name| name|age| +-----+-----+---+ | Tom| Tom| 14| | Bob| Bob| 16| |Alice|Alice| 23| +-----+-----+---+
def alias(self, alias: str) -> "DataFrame": """Returns a new :class:`DataFrame` with an alias set. .. versionadded:: 1.3.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Parameters ---------- alias : str an alias name to be set for the :class:`DataFrame`. Returns ------- :class:`DataFrame` Aliased DataFrame. Examples -------- >>> from pyspark.sql.functions import col, desc >>> df = spark.createDataFrame( ... [(14, "Tom"), (23, "Alice"), (16, "Bob")], ["age", "name"]) >>> df_as1 = df.alias("df_as1") >>> df_as2 = df.alias("df_as2") >>> joined_df = df_as1.join(df_as2, col("df_as1.name") == col("df_as2.name"), 'inner') >>> joined_df.select( ... "df_as1.name", "df_as2.name", "df_as2.age").sort(desc("df_as1.name")).show() +-----+-----+---+ | name| name|age| +-----+-----+---+ | Tom| Tom| 14| | Bob| Bob| 16| |Alice|Alice| 23| +-----+-----+---+ """ assert isinstance(alias, str), "alias should be a string" return DataFrame(getattr(self._jdf, "as")(alias), self.sparkSession)
(self, alias: str) -> pyspark.sql.dataframe.DataFrame
[ 0.041681285947561264, -0.019580941647291183, 0.06028040498495102, 0.020007017999887466, 0.0014125325251370668, 0.021266719326376915, -0.04534924030303955, 0.033030103892087936, 0.0025564522948116064, -0.02297102101147175, -0.005789067596197128, -0.014134587720036507, 0.008294575847685337, 0.06294800341129303, -0.009243982844054699, 0.01142993476241827, 0.03690183162689209, 0.04690534248948097, 0.05909480154514313, 0.0702468603849411, -0.014847801066935062, -0.03169630467891693, 0.03012167662382126, -0.005427829921245575, -0.050758544355630875, 0.033011578023433685, -0.010661146603524685, -0.021507544443011284, 0.035197529941797256, 0.0012620167108252645, -0.009494070895016193, -0.06276275217533112, -0.0037420534063130617, 0.03590148314833641, -0.046794191002845764, 0.002366570755839348, 0.0037420534063130617, -0.011818960309028625, 0.04838734120130539, -0.036327555775642395, 0.025731248781085014, -0.010827871970832348, 0.03349322825670242, -0.07350726425647736, -0.010688934475183487, 0.011717072688043118, -0.008632658049464226, -0.07395186275243759, 0.04638664051890373, -0.016200127080082893, 0.03651280701160431, 0.0028713776264339685, -0.042459338903427124, -0.01371777430176735, -0.0690612643957138, -0.0031168339774012566, -0.008401094935834408, 0.03230762854218483, -0.015403551049530506, 0.016088977456092834, 0.023341521620750427, -0.019377166405320168, -0.025694197043776512, -0.0008347835391759872, -0.04008813574910164, 0.04649779200553894, 0.02030341885983944, -0.02428629621863365, -0.03845793381333351, -0.027676373720169067, -0.029714126139879227, 0.010957547463476658, 0.006233667954802513, 0.030566276982426643, -0.016385376453399658, -0.006094730459153652, -0.05694590136408806, -0.018839942291378975, -0.042459338903427124, -0.03993993625044823, 0.015672164037823677, -0.04320034012198448, -0.03269665315747261, -0.01315276138484478, 0.025379272177815437, 0.01635758951306343, -0.0089475829154253, 0.03819858282804489, -0.04027338698506355, -0.035049330443143845, 0.05501930043101311, 0.00907725840806961, -0.02121114358305931, 0.013680724427103996, -0.025527473539114, -0.06120665371417999, -0.009230089373886585, -0.009494070895016193, -0.010318433865904808, 0.05401894822716713, 0.031992703676223755, 0.0023712022230029106, -0.01034622173756361, 0.03495670482516289, -0.009521858766674995, -0.03982878476381302, -0.006752368528395891, -0.04416364058852196, -0.001047242316417396, -0.02528664842247963, -0.03751315921545029, 0.023341521620750427, -0.008340888656675816, -0.004760929383337498, 0.00786386989057064, 0.019080767408013344, 0.03764283284544945, -0.011652234941720963, -0.029788225889205933, 0.022767245769500732, 0.005752017721533775, 0.06076205521821976, 0.022933971136808395, -0.07321086525917053, 0.00489060441032052, -0.005631605163216591, 0.016366852447390556, -0.04331148788332939, 0.020340468734502792, 0.022192969918251038, 0.050388045608997345, -0.008364045061171055, -0.02260052040219307, 0.05450059846043587, 0.04520104080438614, 0.052055295556783676, 0.033011578023433685, 0.06372606009244919, 0.00540004251524806, 0.0561678484082222, -0.034030456095933914, -0.004087081644684076, -0.006567118223756552, 0.011698547750711441, -0.028824925422668457, -0.00951259583234787, -0.0007143709226511419, -0.02786162495613098, -0.06739401072263718, -0.008702126331627369, 0.011568873189389706, -0.029936427250504494, 0.0382726825773716, 0.0230080708861351, -0.002293628640472889, -0.03751315921545029, -0.024619746953248978, -0.015218300744891167, -0.006085467990487814, 0.004665988497436047, 0.0325484536588192, -0.01952536776661873, -0.04542334005236626, 0.05813150107860565, -0.05531569942831993, -0.03265960514545441, 0.023452671244740486, -0.013541786931455135, -0.04446003958582878, -0.026898324489593506, 0.02310069464147091, 0.0077712442725896835, 0.0575016513466835, -0.005061960779130459, -0.05890955403447151, 0.062281105667352676, 0.03038102760910988, 0.029047226533293724, 0.006446705665439367, -0.051054947078228, 0.014884850941598415, 0.008836433291435242, -0.03993993625044823, 0.03560508042573929, -0.023582346737384796, -0.009067995473742485, -0.03588295727968216, 0.011911585927009583, 0.06939471513032913, 0.022767245769500732, 0.0008672023541294038, -0.0026328680105507374, 0.023656446486711502, 0.040421586483716965, -0.01774696633219719, -0.08988337963819504, 0.008702126331627369, 0.0002859799424186349, -0.04790569096803665, 0.08721578121185303, -0.0034989125560969114, 0.05405599623918533, 0.027750475332140923, 0.01072598434984684, 0.05609374865889549, -0.02287839539349079, -0.014708862639963627, -0.041570138186216354, -0.008303838782012463, -0.05483404919505119, 0.01295824907720089, -0.02799130044877529, -0.012198722921311855, -0.01393081247806549, 0.002635183511301875, 0.028639676049351692, -0.027898674830794334, 0.013134236447513103, 0.04920244216918945, -0.015764789655804634, 0.004605782218277454, -0.024490071460604668, -0.03282633051276207, 0.029473301023244858, 0.008535400964319706, -0.06209585443139076, 0.07224756479263306, -0.016061188653111458, 0.04394133761525154, -0.059576451778411865, 0.017385728657245636, -0.09284738451242447, 0.030973827466368675, -0.0548710972070694, 0.016607677564024925, 0.052166447043418884, -0.01808967813849449, 0.008294575847685337, 0.00032679285504855216, -0.05987285450100899, -0.027176199480891228, 0.04805389419198036, 0.05401894822716713, 0.028269175440073013, -0.017459828406572342, -0.024749422445893288, -0.018793629482388496, 0.02248937077820301, -0.010892709717154503, -0.03549393266439438, 0.010707459412515163, -0.01007760874927044, 0.04301508888602257, 0.05009164288640022, 0.012383973225951195, 0.0010593993356451392, -0.02363792061805725, 0.00794260110706091, -0.059317104518413544, -0.0012515963753685355, -0.0664307102560997, -0.04394133761525154, -0.026101747527718544, -0.026157323271036148, 0.0019103923114016652, -0.008702126331627369, -0.06168830394744873, -0.007817557081580162, -0.009549645707011223, -0.005251842085272074, 0.06528215855360031, 0.033845204859972, 0.016542838886380196, 0.003232615301385522, 0.03362290561199188, 0.016802189871668816, -0.0015711529413238168, -0.009466283023357391, -0.029843801632523537, -0.03945828601717949, -0.026731599122285843, -0.028398850932717323, -0.05016574636101723, 0.018302716314792633, -0.00021260351059027016, -0.041940636932849884, 0.020785069093108177, 0.02006259374320507, 0.016246439889073372, -0.013856712728738785, 0.006974668707698584, -0.007715669460594654, 0.03549393266439438, -0.013699249364435673, -0.03758725896477699, 0.04842439293861389, -0.008090800605714321, 0.0010675040539354086, -0.025897972285747528, 0.04201473668217659, -0.010059083811938763, -0.02274871990084648, 0.08439997583627701, 0.12915641069412231, 0.00510827312245965, -0.03499375656247139, -0.03553098067641258, -0.05513044819235802, 0.05290744826197624, 0.002405936596915126, -0.008225107565522194, 0.03397487848997116, -0.004471475724130869, 0.0007572100730612874, -0.022433795034885406, 0.007655463181436062, -0.0210629440844059, -0.0035869062412530184, 0.035957057029008865, 0.025897972285747528, -0.017283840104937553, 0.00699319364503026, -0.056908849626779556, -0.011800435371696949, 0.07117311656475067, 0.08388127386569977, -0.01078155916184187, -0.008303838782012463, 0.06654185801744461, -0.009197670966386795, 0.011466985568404198, -0.016505789011716843, 0.038235634565353394, -0.0363646075129509, -0.09381068497896194, -0.03868023306131363, 0.0016788296634331346, 0.015107151120901108, 0.008618763647973537, 0.039643533527851105, 0.028398850932717323, -0.06683825701475143, -0.0019694408401846886, -0.03525310754776001, 0.015209038741886616, 0.019099291414022446, -0.04153308644890785, 0.002079433063045144, -0.047201741486787796, -0.006029892712831497, -0.002778752474114299, 0.0039643533527851105, 0.010753772221505642, -0.001967125106602907, 0.0396064855158329, 0.02169279381632805, -0.03434538096189499, 0.057649850845336914, -0.028139499947428703, -0.011893060989677906, 0.019840292632579803, -0.07891657203435898, 0.019099291414022446, -0.037457581609487534, 0.06457820534706116, 0.02515697292983532, -0.008160269819200039, -0.0038207846228033304, -0.04512694105505943, -0.01965504325926304, -0.017200477421283722, -0.04045863449573517, 0.027806049212813377, 0.01112427283078432, 0.0013268543407320976, -0.016264963895082474, -0.043237388134002686, -0.015737000852823257, 0.013393586501479149, 0.00236425525508821, 0.019877342507243156, -0.05939120426774025, 0.057538699358701706, 0.05120314657688141, -0.0005531454226002097, -0.0032094591297209263, -0.05939120426774025, -0.030325451865792274, 0.027491124346852303, 0.028398850932717323, -0.036457233130931854, -0.0014715810539200902, 0.006803312338888645, 0.029343625530600548, -0.026731599122285843, 0.0052935234270989895, -0.08373307436704636, -0.015422075986862183, -0.01583888940513134, -0.03447505459189415, -0.030362501740455627, -0.017237527295947075, 0.0060530491173267365, -0.02261904440820217, 0.012282085604965687, 0.04312623664736748, 0.05335204675793648, -0.04690534248948097, -0.002389727160334587, -0.019340116530656815, -0.01129099726676941, -0.07428531348705292, -0.06820911169052124, 0.036605432629585266, 0.0485355444252491, 0.09084668010473251, 0.04019928723573685, -0.023730546236038208, 0.05609374865889549, 0.03819858282804489, -0.0006917935679666698, -0.02323037013411522, -0.015403551049530506, 0.028287699446082115, -0.0016684093279764056, -0.019099291414022446, -0.008882745169103146, 0.023082170635461807, -0.018098941072821617, 0.009438496083021164, -0.0012365448055788875, -0.03054775297641754, 0.023712020367383957, 0.0021801628172397614, 0.04686829075217247, 0.009957196190953255, 0.03868023306131363, -0.05735345184803009, -0.01104091014713049, -0.000759525690227747, 0.10196168720722198, -0.016385376453399658, -0.001656831125728786, 0.009540383704006672, -0.05183299630880356, -0.08084317296743393, -0.010587046854197979, -0.005835380405187607, -0.06539330631494522, -0.0549081489443779, 0.0753597691655159, 0.029658552259206772, 0.026249948889017105, -0.005122167058289051, -0.08380717784166336, -0.017256053164601326, -0.012847098521888256, -0.07117311656475067, -0.030992353335022926, 0.09047617763280869, 0.010179496370255947, -0.031344328075647354, -0.02964002639055252, 0.029843801632523537, -0.008345520123839378, 0.04390428960323334, -0.013245387002825737, -0.048461444675922394, -0.003985194023698568, -0.002043540822342038, 0.06420771032571793, -0.04442298784852028, -0.023045120760798454, -0.044904641807079315, 0.03167777881026268, 0.02224854566156864, -0.07698997110128403, 0.004082450643181801, 0.008160269819200039, 0.0677274614572525, -0.0996645912528038, -0.032011229544878006, 0.02526812255382538, 0.04127373546361923, 0.05542685091495514, 0.005696442443877459, 0.01646873913705349, -0.008345520123839378, 0.0060530491173267365, -0.00523794861510396, -0.020896218717098236, 0.047831591218709946, -0.00025269281468354166, 0.003475756151601672, -0.026379624381661415, 0.07191411405801773, 0.007396112661808729, 0.016264963895082474, -0.061354853212833405, -0.022896921262145042, 0.0204330924898386, -0.08625247329473495, -0.03588295727968216, 0.015940776094794273, 0.02515697292983532, -0.04864669218659401, 0.024082520976662636, 0.012059785425662994, -0.014847801066935062, -0.008526138961315155, -0.057020001113414764, 0.04538629204034805, 0.009216195903718472, 0.022155920043587685, 0.01705227792263031, 0.02565714716911316, -0.03666100651025772, 0.04134783521294594, 0.08528917282819748, -0.003373868530616164, -0.02310069464147091, 0.02287839539349079, -0.019617991521954536, -0.03627198189496994, -0.020729493349790573, -0.03690183162689209, 0.06087320297956467, 0.033511754125356674, 0.005552873481065035, 0.04697944223880768, -0.05312974750995636, 0.006154936738312244, -0.011309522204101086, -0.017459828406572342, 0.010429584421217442, 0.042199987918138504, -0.06543035805225372, 0.014940425753593445, -0.0020215425174683332, -0.018932566046714783, -0.027917200699448586, 0.017580240964889526, -0.015699950978159904, -0.06528215855360031, -0.01834902912378311, -0.0038184691220521927, -0.01818230375647545, 0.00587243027985096, 0.10203579068183899, -0.032363202422857285, 0.02654634788632393, -0.02069244347512722, 0.0447193905711174, 0.013782612048089504, -0.002753280568867922, 0.001268963678739965, -0.026342572644352913, -0.02121114358305931, 0.013254649005830288, -0.017219003289937973, 0.010466634295880795, 0.010114658623933792, 0.09684878587722778, -0.03716118261218071, 0.018599117174744606, 0.009716371074318886, 0.06294800341129303, 0.016867026686668396, 0.009808995760977268, -0.06042860448360443, 0.006442074663937092, -0.04534924030303955, 0.07080261409282684, -0.008873483166098595, 0.013782612048089504, 0.01380113698542118, 0.08432587236166, 0.08432587236166, -0.023600870743393898, 0.008975370787084103, -0.01870100386440754, 0.06683825701475143, -0.07506337016820908, 0.06205880641937256, -0.06287390738725662, 0.006141042802482843, 0.004038453567773104, 0.003021893324330449, 0.033808156847953796, -0.07502631843090057, -0.04368199035525322, -0.03842088580131531, 0.007020981051027775, -0.01583888940513134, 0.033252403140068054, 0.005353729706257582, -0.0664307102560997, -0.0028667463921010494, 0.05201824754476547, -0.01711711473762989, -0.010976072400808334, -0.006798680871725082, -0.01575552672147751, -0.04049568623304367, 0.006692162249237299, 0.02645372413098812, -0.017950741574168205, -0.0065578557550907135, -0.04201473668217659, 0.007590625435113907, -0.020766543224453926, 0.051388394087553024, -0.011818960309028625, -0.0008162585436366498, 0.037216756492853165, -0.037457581609487534, -0.048720791935920715, -0.03916188329458237, -0.030214302241802216, 0.003945828415453434, -0.05261104553937912, 0.03949533402919769, 0.05094379559159279, 0.021007368341088295, -0.026972424238920212, 0.001035085297189653, 0.04205178841948509, -0.004126447252929211, -0.01965504325926304, 0.011791173368692398, 0.03923598304390907, -0.032233528792858124, 0.03934713453054428, -0.019080767408013344, 0.051166094839572906, -0.06457820534706116, -0.0077851382084190845, -0.04583089053630829, 0.024082520976662636, 0.027509650215506554, -0.008901270106434822, 0.016626201570034027, -0.015912989154458046, 0.012597011402249336, -0.0005728282267227769, -0.053203847259283066, 0.007141394075006247, -0.02028489299118519, -0.04516398906707764, -0.02400842122733593, -0.010272121988236904, 0.03438242897391319, 0.03169630467891693, 0.02721324935555458, 0.07313676178455353, 0.06939471513032913, -0.05261104553937912, 0.00301726208999753, 0.037346433848142624, 0.014560663141310215, 0.043496739119291306, -0.04583089053630829, -0.011383622884750366, 0.029584450647234917, 0.024990247562527657, 0.024601221084594727, -0.008285313844680786, 0.03369700536131859, 0.02888050116598606, 0.0497952438890934, 0.025231072679162025, 0.007294225040823221, -0.025823872536420822, -0.05520454794168472, 0.030992353335022926, -0.03230762854218483, 0.02169279381632805, -0.05453765019774437, 0.0345306321978569, -0.05883545055985451, -0.028954600915312767, 0.015857413411140442, 0.015366501174867153, -0.0002715072769206017, -0.04379313811659813, 0.04531218856573105, 0.03986583650112152, -0.03127022832632065, -0.0017645078478381038, -0.054093047976493835, 0.011263210326433182, -0.035197529941797256, -0.02606469765305519, 0.07847196608781815, -0.013004561886191368, -0.04620138928294182, 0.0000036045992146682693, -0.053314998745918274, -0.007738825865089893, 0.0008643078035674989, 0.011596660129725933, 0.02030341885983944, 0.03434538096189499, 0.025064347311854362, 0.041199635714292526, 0.051647745072841644, 0.01683923974633217, 0.002568030497059226, 0.025620097294449806, -0.034919656813144684, -0.03975468501448631, -0.007970388047397137, 0.07698997110128403, 0.08269567042589188, 0.07773096859455109, -0.045793842524290085, -0.008359413594007492, -0.018367553129792213, -0.0035660655703395605, 0.06087320297956467, 0.024323346093297005, -0.012569223530590534, 0.03553098067641258, 0.04457119107246399, -0.0021280613727867603, 0.0011722862254828215, -0.07550796866416931, 0.026157323271036148, -0.005599186290055513, 0.0066226935014128685, -0.02669454924762249, 0.05023984611034393, 0.032011229544878006, 0.03217795491218567, -0.005404673516750336, -0.024953197687864304, 0.03343765437602997, 0.014384674839675426, -0.014097537845373154, 0.03312272951006889, -0.026601923629641533, -0.015477651730179787, -0.003200196661055088, -0.023915795609354973, 0.01168928574770689, -0.04690534248948097, 0.006488387007266283, 0.025453371927142143, 0.021174093708395958, 0.06146600469946861, 0.053944848477840424, -0.021544594317674637, -0.03649428114295006, 0.007020981051027775, 0.054463546723127365, -0.008618763647973537, 0.007312750443816185, 0.024193670600652695, 0.02093326859176159, -0.08506687730550766, -0.023841695860028267, 0.06050270423293114, 0.028324749320745468, -0.011142797768115997, -0.02912132628262043, -0.04486759006977081, -0.008896639570593834, 0.026101747527718544 ]
39,355
pyspark.sql.dataframe
approxQuantile
Calculates the approximate quantiles of numerical columns of a :class:`DataFrame`. The result of this algorithm has the following deterministic bound: If the :class:`DataFrame` has N elements and if we request the quantile at probability `p` up to error `err`, then the algorithm will return a sample `x` from the :class:`DataFrame` so that the *exact* rank of `x` is close to (p * N). More precisely, floor((p - err) * N) <= rank(x) <= ceil((p + err) * N). This method implements a variation of the Greenwald-Khanna algorithm (with some speed optimizations). The algorithm was first present in [[https://doi.org/10.1145/375663.375670 Space-efficient Online Computation of Quantile Summaries]] by Greenwald and Khanna. .. versionadded:: 2.0.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Parameters ---------- col: str, tuple or list Can be a single column name, or a list of names for multiple columns. .. versionchanged:: 2.2.0 Added support for multiple columns. probabilities : list or tuple a list of quantile probabilities Each number must belong to [0, 1]. For example 0 is the minimum, 0.5 is the median, 1 is the maximum. relativeError : float The relative target precision to achieve (>= 0). If set to zero, the exact quantiles are computed, which could be very expensive. Note that values greater than 1 are accepted but gives the same result as 1. Returns ------- list the approximate quantiles at the given probabilities. * If the input `col` is a string, the output is a list of floats. * If the input `col` is a list or tuple of strings, the output is also a list, but each element in it is a list of floats, i.e., the output is a list of list of floats. Notes ----- Null values will be ignored in numerical columns before calculation. For columns only containing null values, an empty list is returned.
def approxQuantile( self, col: Union[str, List[str], Tuple[str]], probabilities: Union[List[float], Tuple[float]], relativeError: float, ) -> Union[List[float], List[List[float]]]: """ Calculates the approximate quantiles of numerical columns of a :class:`DataFrame`. The result of this algorithm has the following deterministic bound: If the :class:`DataFrame` has N elements and if we request the quantile at probability `p` up to error `err`, then the algorithm will return a sample `x` from the :class:`DataFrame` so that the *exact* rank of `x` is close to (p * N). More precisely, floor((p - err) * N) <= rank(x) <= ceil((p + err) * N). This method implements a variation of the Greenwald-Khanna algorithm (with some speed optimizations). The algorithm was first present in [[https://doi.org/10.1145/375663.375670 Space-efficient Online Computation of Quantile Summaries]] by Greenwald and Khanna. .. versionadded:: 2.0.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Parameters ---------- col: str, tuple or list Can be a single column name, or a list of names for multiple columns. .. versionchanged:: 2.2.0 Added support for multiple columns. probabilities : list or tuple a list of quantile probabilities Each number must belong to [0, 1]. For example 0 is the minimum, 0.5 is the median, 1 is the maximum. relativeError : float The relative target precision to achieve (>= 0). If set to zero, the exact quantiles are computed, which could be very expensive. Note that values greater than 1 are accepted but gives the same result as 1. Returns ------- list the approximate quantiles at the given probabilities. * If the input `col` is a string, the output is a list of floats. * If the input `col` is a list or tuple of strings, the output is also a list, but each element in it is a list of floats, i.e., the output is a list of list of floats. Notes ----- Null values will be ignored in numerical columns before calculation. For columns only containing null values, an empty list is returned. """ if not isinstance(col, (str, list, tuple)): raise PySparkTypeError( error_class="NOT_LIST_OR_STR_OR_TUPLE", message_parameters={"arg_name": "col", "arg_type": type(col).__name__}, ) isStr = isinstance(col, str) if isinstance(col, tuple): col = list(col) elif isStr: col = [cast(str, col)] for c in col: if not isinstance(c, str): raise PySparkTypeError( error_class="DISALLOWED_TYPE_FOR_CONTAINER", message_parameters={ "arg_name": "col", "arg_type": type(col).__name__, "allowed_types": "str", "return_type": type(c).__name__, }, ) col = _to_list(self._sc, cast(List["ColumnOrName"], col)) if not isinstance(probabilities, (list, tuple)): raise PySparkTypeError( error_class="NOT_LIST_OR_TUPLE", message_parameters={ "arg_name": "probabilities", "arg_type": type(probabilities).__name__, }, ) if isinstance(probabilities, tuple): probabilities = list(probabilities) for p in probabilities: if not isinstance(p, (float, int)) or p < 0 or p > 1: raise PySparkTypeError( error_class="NOT_LIST_OF_FLOAT_OR_INT", message_parameters={ "arg_name": "probabilities", "arg_type": type(p).__name__, }, ) probabilities = _to_list(self._sc, cast(List["ColumnOrName"], probabilities)) if not isinstance(relativeError, (float, int)): raise PySparkTypeError( error_class="NOT_FLOAT_OR_INT", message_parameters={ "arg_name": "relativeError", "arg_type": type(relativeError).__name__, }, ) if relativeError < 0: raise PySparkValueError( error_class="NEGATIVE_VALUE", message_parameters={ "arg_name": "relativeError", "arg_value": str(relativeError), }, ) relativeError = float(relativeError) jaq = self._jdf.stat().approxQuantile(col, probabilities, relativeError) jaq_list = [list(j) for j in jaq] return jaq_list[0] if isStr else jaq_list
(self, col: Union[str, List[str], Tuple[str]], probabilities: Union[List[float], Tuple[float]], relativeError: float) -> Union[List[float], List[List[float]]]
[ 0.033886685967445374, -0.024843432009220123, -0.039888303726911545, 0.032335247844457626, 0.05205485224723816, -0.008058294653892517, 0.05315718799829483, -0.0029319128952920437, -0.024639295414090157, 0.049196936190128326, -0.003911769017577171, 0.0496460385620594, 0.0017096445662900805, -0.0017632305389270186, -0.020250357687473297, 0.06324154138565063, 0.04584909602999687, -0.011533722281455994, 0.023271581158041954, 0.04105188325047493, -0.003156463149935007, 0.01818857714533806, -0.00021498142450582236, 0.036703772842884064, -0.020209530368447304, 0.01465701311826706, 0.03613219037652016, 0.025966184213757515, -0.04011285677552223, -0.02114855870604515, 0.016014521941542625, -0.016606518998742104, -0.0397045835852623, 0.0033912204671651125, -0.015565421432256699, 0.010788623243570328, 0.04131726175546646, -0.05879136174917221, 0.01906636543571949, -0.09194315969944, -0.05911798030138016, 0.020209530368447304, -0.019688982516527176, -0.06965143233537674, -0.014452876523137093, 0.07185611128807068, 0.007838848046958447, 0.010513038374483585, -0.022455032914876938, 0.003853079630061984, 0.005246312357485294, 0.02259792946279049, 0.03948003053665161, 0.01831105910241604, -0.021781383082270622, 0.06271078437566757, 0.023883990943431854, -0.0386226586997509, 0.0056137582287192345, -0.027803413569927216, 0.025027155876159668, 0.024843432009220123, 0.021944692358374596, -0.018903056159615517, 0.022291723638772964, 0.03521357476711273, 0.0005297984462231398, -0.013391365297138691, -0.056137584149837494, 0.005187623202800751, -0.017065824940800667, -0.008073605597019196, 0.006517063360661268, 0.037214115262031555, -0.028191274031996727, 0.0150959063321352, 0.03225359320640564, -0.06503794342279434, -0.021944692358374596, -0.017310788854956627, 0.03656087815761566, -0.011686824262142181, 0.0471963994204998, -0.08165466785430908, 0.007532643154263496, -0.049564383924007416, 0.026946039870381355, 0.023169511929154396, 0.04523668438196182, 0.07050880789756775, -0.05327967181801796, 0.0014238532166928053, 0.017565960064530373, 0.027313485741615295, 0.0093137351796031, -0.017882373183965683, -0.034397028386592865, -0.024271849542856216, 0.015912452712655067, -0.03676501289010048, 0.027640104293823242, 0.03529522940516472, 0.0772453173995018, 0.0038913553580641747, 0.02931402623653412, -0.02494550123810768, -0.02009725570678711, -0.00827263854444027, 0.007731676567345858, -0.015116319991648197, -0.06507877260446548, 0.029783539474010468, 0.014636599458754063, -0.06022031605243683, 0.023802336305379868, 0.027048109099268913, -0.034886956214904785, -0.014320187270641327, 0.014381428249180317, 0.05250395089387894, 0.031192082911729813, 0.004639005754143, 0.01161537691950798, -0.01828043907880783, -0.05074837803840637, -0.002885982161387801, 0.04250125586986542, -0.012248200364410877, -0.06144513934850693, 0.057974815368652344, 0.07426492124795914, -0.038193970918655396, -0.009579113684594631, 0.058954671025276184, 0.0022914342116564512, 0.005450448952615261, 0.008686015382409096, 0.019760429859161377, 0.060914382338523865, 0.03200862929224968, 0.04817625507712364, -0.040276166051626205, 0.01681065559387207, -0.0011967512546107173, 0.09888380020856857, 0.015616455115377903, 0.04433848336338997, 0.01276874914765358, -0.023189926519989967, -0.038541004061698914, -0.09586258232593536, -0.014126257970929146, -0.027088936418294907, -0.075081467628479, 0.03496861085295677, -0.02663983590900898, 0.02176096849143505, 0.002903844229876995, -0.012727921828627586, -0.01485094241797924, 0.007114163134247065, -0.03502985090017319, -0.01545314583927393, 0.008573739789426327, -0.044297657907009125, 0.003033981192857027, -0.013830259442329407, 0.03458075225353241, -0.02772175893187523, -0.03749990463256836, 0.08316528052091599, 0.030355121940374374, 0.036969151347875595, -0.0259049441665411, -0.06467049568891525, 0.022904135286808014, -0.007971537299454212, 0.03188614919781685, 0.0029701886232942343, -0.03151870146393776, 0.016351347789168358, -0.06952895224094391, 0.0019826774951070547, -0.03637715429067612, -0.0060781692154705524, 0.035254403948783875, 0.009926145896315575, -0.007767400238662958, -0.041235607117414474, 0.02036263234913349, -0.05315718799829483, -0.018760159611701965, 0.05270808935165405, 0.036744602024555206, 0.018045682460069656, 0.01204406376928091, 0.00857884343713522, 0.03247814252972603, -0.03104918822646141, 0.00833387952297926, 0.03068174235522747, 0.012972885742783546, 0.04633902385830879, -0.03213111311197281, 0.0007718917913734913, -0.04572661593556404, -0.060424454510211945, -0.012646266259253025, 0.06209837645292282, -0.02225089631974697, -0.046869780868291855, -0.0018104370683431625, 0.0007163921254687011, -0.019719602540135384, -0.010023110546171665, 0.06781420111656189, -0.02686438523232937, -0.046257369220256805, 0.034029584378004074, -0.027272658422589302, 0.08353272825479507, -0.05960790812969208, 0.01040586642920971, 0.04744136333465576, 0.07455071061849594, 0.020617803558707237, 0.007257058750838041, -0.005833205301314592, 0.01605534926056862, -0.00100473512429744, -0.03382544592022896, -0.05866887792944908, 0.0011061655823141336, -0.057852331548929214, -0.0772453173995018, 0.034764476120471954, -0.006491546053439379, 0.03474406152963638, 0.010339522734284401, -0.016606518998742104, -0.05372877046465874, 0.035989295691251755, -0.01265647355467081, 0.053320497274398804, 0.0315595306456089, -0.053034707903862, -0.03615260496735573, 0.046747297048568726, -0.016586104407906532, 0.009972075931727886, 0.039030931890010834, 0.025108810514211655, 0.018535610288381577, -0.06712013483047485, 0.04031699150800705, -0.029640644788742065, -0.01761699467897415, 0.023904403671622276, 0.017504720017313957, 0.03749990463256836, 0.007379540707916021, -0.09725070744752884, 0.04384855553507805, -0.009196356870234013, -0.05340215191245079, -0.016208451241254807, -0.018178369849920273, 0.028395410627126694, 0.04384855553507805, 0.0539737343788147, -0.07067211717367172, 0.06691600382328033, 0.010931518860161304, -0.0689573660492897, 0.04968686401844025, 0.017167894169688225, 0.02531294710934162, -0.018852021545171738, -0.05013596639037132, -0.022557102143764496, 0.029987676069140434, -0.04609405994415283, 0.013891500420868397, 0.0647113248705864, -0.028415825217962265, 0.08639063686132431, -0.033192623406648636, 0.003546874737367034, 0.016647346317768097, 0.04019451141357422, -0.009242287836968899, 0.030947118997573853, -0.05221816152334213, 0.00039009240572340786, 0.027578864246606827, 0.03104918822646141, 0.0564233772456646, -0.013677156530320644, 0.042092982679605484, 0.0070223016664385796, 0.015994107350707054, -0.00223657232709229, 0.0277421735227108, 0.03823480010032654, -0.02259792946279049, 0.019270502030849457, -0.017137274146080017, -0.05511689931154251, -0.042092982679605484, 0.014677426777780056, 0.01869891956448555, 0.036254674196243286, -0.029273198917508125, 0.010069041512906551, 0.01948484592139721, -0.06430304795503616, -0.015749143436551094, 0.007711262907832861, -0.0038428728003054857, -0.009135115891695023, 0.00763471145182848, -0.005266726016998291, 0.024537228047847748, 0.031722839921712875, -0.017024997621774673, -0.0013881293125450611, 0.0013804741902276874, 0.009420907124876976, 0.00015581368643324822, -0.05875053256750107, 0.04033740609884262, -0.004317490383982658, 0.03498902544379234, -0.01380984578281641, 0.013595501892268658, 0.010676347650587559, -0.0168616883456707, -0.00781843438744545, 0.02845665253698826, 0.0009530630777589977, -0.03752031922340393, -0.05630089342594147, 0.039418790489435196, 0.020250357687473297, 0.004031699150800705, -0.020505528897047043, 0.0484212189912796, 0.01668817363679409, -0.011247930116951466, 0.046012405306100845, 0.032702695578336716, -0.01290143746882677, 0.0041490779258310795, 0.05830143392086029, 0.035968881100416183, 0.03764280304312706, 0.00494521064683795, 0.031824905425310135, 0.016708586364984512, 0.01769864931702614, 0.1146431565284729, -0.021924277767539024, 0.015228595584630966, -0.02933443896472454, 0.04335862770676613, 0.03609136492013931, -0.01533066388219595, -0.0035621849820017815, -0.0010500280186533928, 0.051401615142822266, 0.05911798030138016, -0.020250357687473297, 0.001317957416176796, 0.020474908873438835, -0.014759081415832043, 0.014646805822849274, -0.02884451113641262, 0.03786735236644745, -0.0006800302653573453, -0.00605265237390995, 0.011329584755003452, -0.06373146921396255, 0.01545314583927393, 0.009824077598750591, 0.010114971548318863, 0.032090283930301666, 0.044175174087285995, -0.08516582101583481, -0.01926029473543167, -0.03315179422497749, -0.046747297048568726, -0.0018015061505138874, 0.002264641225337982, 0.03686708211898804, -0.02747679501771927, -0.022802066057920456, 0.0254354290664196, 0.003008464118465781, -0.04327697306871414, 0.016606518998742104, -0.042460426688194275, -0.03321303799748421, -0.08516582101583481, -0.005062589421868324, -0.03202904388308525, 0.0033605999778956175, -0.007782710716128349, 0.018596850335597992, -0.02200593240559101, 0.03288641571998596, -0.028783271089196205, 0.01167661789804697, -0.00662933848798275, 0.01980125717818737, -0.05131996050477028, 0.03345800191164017, -0.0469106063246727, -0.06899819523096085, -0.00387859670445323, -0.010737588629126549, 0.006302719470113516, -0.08100143074989319, -0.013003505766391754, 0.05095251277089119, -0.048339564353227615, -0.04997265711426735, 0.006659958977252245, 0.00476148771122098, -0.020546356216073036, -0.010788623243570328, -0.03253938630223274, 0.004664523061364889, -0.0481354258954525, -0.03764280304312706, 0.04952355474233627, 0.02308785729110241, -0.05148326978087425, -0.009283115155994892, -0.055280208587646484, -0.022067174315452576, 0.031069600954651833, 0.03605053573846817, -0.010829450562596321, 0.018688712269067764, 0.0174740981310606, 0.0412151925265789, -0.032212767750024796, -0.014075223356485367, -0.08055233210325241, -0.03080422431230545, 0.015973694622516632, -0.031334977596998215, 0.08941186219453812, 0.009788352996110916, 0.03260062634944916, 0.030355121940374374, -0.051524095237255096, -0.010482418350875378, 0.023536957800388336, 0.03780611231923103, 0.06075107306241989, 0.04891114681959152, 0.015075492672622204, -0.05462697148323059, -0.014432462863624096, 0.056137584149837494, -0.011707237921655178, -0.031212497502565384, -0.003929630853235722, -0.017412858083844185, 0.05928128957748413, 0.024149367585778236, -0.0017147479811683297, -0.018300851806998253, 0.004161836579442024, 0.016188038513064384, -0.0035443229135125875, 0.050054311752319336, 0.04887031763792038, 0.0062618921510875225, 0.015922660008072853, -0.07340754568576813, 0.027680931612849236, -0.01818857714533806, 0.01867850497364998, -0.02235296554863453, -0.047237224876880646, -0.013840465806424618, 0.03017139993607998, -0.039520859718322754, -0.0876971110701561, 0.057362403720617294, 0.07148866355419159, 0.05340215191245079, -0.05062589421868324, -0.02529253251850605, 0.06120017543435097, -0.03700997680425644, 0.003095222171396017, -0.038316454738378525, 0.04593075066804886, 0.037214115262031555, -0.039786238223314285, 0.0132586769759655, 0.01724954880774021, -0.05597427487373352, 0.07283596694469452, 0.01815795712172985, -0.0698963925242424, -0.07259099930524826, -0.02060759626328945, -0.007731676567345858, -0.006476236041635275, -0.008879945613443851, -0.02480260469019413, 0.031355392187833786, 0.06495628505945206, -0.019831877201795578, 0.01857643760740757, -0.023394063115119934, 0.006348650436848402, 0.001116372412070632, 0.013401572592556477, 0.03449909761548042, -0.012921851128339767, 0.025986598804593086, 0.0373978391289711, -0.004764039535075426, -0.006460925564169884, 0.02058718353509903, -0.04158264026045799, 0.0701821893453598, 0.01642279513180256, -0.042705390602350235, 0.045155029743909836, 0.09292301535606384, -0.001773437368683517, 0.032090283930301666, 0.0040265959687530994, 0.0025772254448384047, -0.026088666170835495, 0.05376959964632988, 0.030947118997573853, 0.0076551251113414764, -0.04090898856520653, -0.026415284723043442, -0.013095367699861526, 0.02735431306064129, 0.06712013483047485, -0.00732850655913353, 0.041500985622406006, 0.01938277669250965, 0.029252784326672554, 0.008344086818397045, 0.0314166322350502, 0.0017989544430747628, -0.0011801650980487466, -0.0064354087226092815, 0.005404518451541662, -0.013707777485251427, -0.02955899015069008, 0.007216231431812048, 0.0938212126493454, 0.00018994278798345476, -0.004508868791162968, 0.005256519187241793, -0.04146015644073486, 0.02284289337694645, 0.011258137412369251, -0.08614567667245865, 0.026660248637199402, 0.05507607385516167, -0.037826523184776306, -0.07071293890476227, -0.01442225556820631, -0.0907183364033699, 0.008231811225414276, -0.04805377125740051, -0.07536725699901581, -0.010962138883769512, -0.0395616851747036, 0.004733419045805931, -0.02065863087773323, -0.0019278157269582152, -0.06642607599496841, 0.002679293742403388, -0.021801795810461044, 0.003947492688894272, -0.009870007634162903, 0.010140488855540752, 0.01284019649028778, -0.042337946593761444, -0.025700807571411133, -0.009211666882038116, 0.011278551071882248, 0.016341140493750572, -0.021536419168114662, 0.009701595641672611, -0.02798713743686676, -0.031212497502565384, 0.008073605597019196, 0.03349882736802101, 0.025966184213757515, -0.01289123110473156, 0.025517083704471588, -0.011707237921655178, -0.017708856612443924, 0.021311867982149124, 0.02800755202770233, 0.024108540266752243, -0.02433309145271778, 0.0925963968038559, -0.0301918126642704, 0.07973578572273254, -0.02531294710934162, -0.005460655782371759, -0.04678812623023987, 0.006659958977252245, 0.01308516040444374, 0.004764039535075426, -0.09406618028879166, 0.0062312716618180275, 0.08316528052091599, 0.0032866003457456827, 0.0036106673069298267, -0.04707391560077667, -0.013789432123303413, -0.06022031605243683, 0.02058718353509903, -0.0004742987803183496, 0.023557372391223907, 0.020301392301917076, 0.05017679184675217, -0.01764761470258236, -0.026599008589982986, -0.020985249429941177, -0.005843412131071091, -0.049319420009851456, -0.01514694094657898, -0.021066904067993164, 0.03351924195885658, 0.01953587867319584, -0.0036310809664428234, -0.0052310023456811905, 0.06695682555437088, -0.0013230608310550451, -0.0527489148080349, 0.0053534843027591705, 0.04250125586986542, -0.02921195700764656, -0.011125448159873486, -0.01216654572635889, 0.019984979182481766, 0.0060781692154705524, -0.014554944820702076, 0.0005951859639026225, -0.06903902441263199, 0.04629819840192795, -0.03943920508027077, 0.03345800191164017, -0.0011259412858635187, -0.06969226151704788, -0.013524054549634457, 0.01953587867319584, -0.028150446712970734, 0.026782730594277382, 0.018270231783390045, 0.006098582874983549, -0.06222085654735565, 0.028436237946152687, 0.02565998025238514, 0.027170591056346893, 0.05630089342594147, -0.05740323290228844, 0.03068174235522747, 0.051401615142822266, -0.031355392187833786, -0.03531564399600029, -0.059567078948020935, 0.004223077557981014, 0.017361823469400406, -0.0023220547009259462, -0.05875053256750107, 0.050544239580631256, 0.002801775699481368, 0.0037229424342513084, 0.035621847957372665, -0.017902785912156105, -0.0640580877661705, -0.042337946593761444, 0.012462543323636055, -0.009813870303332806, -0.03545853868126869, -0.01612679660320282, -0.0603836253285408, -0.011227516457438469, -0.03700997680425644, 0.019964566454291344, 0.05070754885673523, 0.02186303772032261, 0.022699996829032898, 0.05270808935165405, 0.0014161980943754315, 0.06369064003229141, 0.0447467565536499, 0.04899280145764351, 0.016606518998742104, 0.055525172501802444, -0.0038632864598184824, -0.030518433079123497, -0.018321266397833824, -0.001654782914556563, -0.06879405677318573, -0.046869780868291855, -0.04519585892558098, 0.0760204941034317, 0.022169241681694984, 0.0006851336802355945, -0.036744602024555206, 0.002763500204309821, -0.0011150966165587306, -0.027660518884658813, 0.04225629195570946, -0.03484613075852394, -0.046012405306100845, -0.001335819368250668, 0.00791539903730154, 0.005955687258392572, -0.003955148160457611, -0.01410584431141615, -0.010375246405601501, 0.06373146921396255, 0.020617803558707237, 0.022883720695972443, 0.02212841436266899, -0.07671456038951874, -0.00470024673268199, 0.024394331499934196, 0.014646805822849274, -0.0049273488111793995, -0.04617571458220482, 0.01040586642920971, 0.01715768687427044, -0.05160574987530708, -0.02370026707649231, -0.02394523099064827, -0.05462697148323059, -0.0167902410030365, 0.01818857714533806, -0.003143704729154706, 0.016841275617480278, -0.05034010112285614, -0.03484613075852394, 0.04617571458220482, 0.01241150964051485, -0.010594693012535572, -0.02321033924818039, 0.019944151863455772, -0.0420113280415535, -0.04629819840192795, -0.04682895168662071, 0.0028885339852422476, 0.020138083025813103, -0.032804761081933975, -0.027293073013424873, 0.010441591031849384, -0.015820592641830444, 0.0030799119267612696 ]
39,356
pyspark.sql.dataframe
cache
Persists the :class:`DataFrame` with the default storage level (`MEMORY_AND_DISK_DESER`). .. versionadded:: 1.3.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Notes ----- The default storage level has changed to `MEMORY_AND_DISK_DESER` to match Scala in 3.0. Returns ------- :class:`DataFrame` Cached DataFrame. Examples -------- >>> df = spark.range(1) >>> df.cache() DataFrame[id: bigint] >>> df.explain() == Physical Plan == AdaptiveSparkPlan isFinalPlan=false +- InMemoryTableScan ...
def cache(self) -> "DataFrame": """Persists the :class:`DataFrame` with the default storage level (`MEMORY_AND_DISK_DESER`). .. versionadded:: 1.3.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Notes ----- The default storage level has changed to `MEMORY_AND_DISK_DESER` to match Scala in 3.0. Returns ------- :class:`DataFrame` Cached DataFrame. Examples -------- >>> df = spark.range(1) >>> df.cache() DataFrame[id: bigint] >>> df.explain() == Physical Plan == AdaptiveSparkPlan isFinalPlan=false +- InMemoryTableScan ... """ self.is_cached = True self._jdf.cache() return self
(self) -> pyspark.sql.dataframe.DataFrame
[ 0.05105859041213989, -0.033887963742017746, 0.02344416081905365, -0.003603655844926834, 0.05221901461482048, 0.011459172703325748, -0.02694356068968773, 0.030932513996958733, -0.03231051564216614, -0.06966161727905273, 0.028938036412000656, 0.01777803525328636, -0.01611899398267269, 0.047105900943279266, 0.007288903929293156, -0.014097320847213268, 0.01174927782267332, -0.027360588312149048, 0.0244232676923275, 0.04638063907623291, 0.02195736952126026, -0.04050599783658981, 0.010806434787809849, -0.012229765765368938, -0.032673146575689316, 0.02643587626516819, 0.018204128369688988, -0.0028557274490594864, 0.047432269901037216, 0.05207396298646927, -0.018657417967915535, -0.005339756608009338, -0.04681579768657684, -0.00862157717347145, -0.012664924375712872, 0.014831651002168655, -0.029246274381875992, -0.00597889581695199, 0.03328962251543999, -0.03854778781533241, -0.04333452880382538, -0.019908498972654343, 0.005752250552177429, -0.04017962887883186, -0.03858404979109764, -0.019926629960536957, 0.03515717759728432, -0.03283633291721344, 0.09355906397104263, -0.08579874038696289, 0.06668803095817566, 0.04714216664433479, -0.04025215655565262, -0.002020540414378047, -0.04746853560209274, -0.030062196776270866, 0.025094136595726013, 0.0344863086938858, -0.021540343761444092, 0.01882060244679451, 0.0069308048114180565, -0.04090489447116852, 0.014006663113832474, 0.017143430188298225, -0.02732432447373867, 0.03992578759789467, -0.013353925198316574, 0.007973372004926205, 0.03261875361204147, 0.014432755298912525, -0.018267588689923286, -0.04395100474357605, -0.014858848415315151, 0.09290632605552673, -0.07985157519578934, 0.0043833148665726185, -0.021467816084623337, -0.050986066460609436, -0.0662166103720665, -0.0050677829422056675, 0.03174843639135361, -0.04605427011847496, -0.039345577359199524, -0.04268179088830948, 0.00044054127647541463, 0.014677532017230988, 0.005135776475071907, 0.03909173607826233, -0.03415993973612785, -0.0020352723076939583, 0.010833632200956345, 0.048230063170194626, 0.0003317516529932618, 0.017451666295528412, 0.02367987297475338, -0.064512237906456, -0.02438700571656227, -0.006123948842287064, 0.03660770505666733, -0.0035696590784937143, -0.017968418076634407, 0.0905129611492157, -0.0027265397366136312, 0.02966330200433731, -0.022682635113596916, 0.01570196822285652, 0.02779574692249298, -0.011477303691208363, 0.00931964349001646, -0.03466762229800224, -0.014559676870703697, 0.10915224254131317, 0.033688515424728394, -0.010180894285440445, 0.012438278645277023, 0.008775695227086544, -0.08703169226646423, -0.024912821128964424, -0.037387363612651825, 0.03405115008354187, -0.0416664220392704, 0.0498981699347496, 0.017116231843829155, -0.035574205219745636, -0.019255761057138443, 0.04721469059586525, -0.030461091548204422, -0.04783116653561592, 0.0026789442636072636, 0.042065318673849106, 0.07354177534580231, -0.017261285334825516, 0.02844848297536373, 0.09878096729516983, 0.02886551059782505, 0.005956231150776148, 0.06955282390117645, 0.026236427947878838, -0.015012966468930244, 0.06690561026334763, -0.025094136595726013, -0.061212290078401566, 0.0514574870467186, 0.018748076632618904, 0.028375957161188126, -0.011876199394464493, 0.038003839552402496, -0.01784149743616581, -0.045836690813302994, -0.03073306567966938, 0.04326200112700462, 0.002864793175831437, 0.009917986579239368, -0.0403609462082386, -0.013508043251931667, -0.007941641844809055, -0.025184795260429382, 0.028738589957356453, 0.027070481330156326, -0.016916785389184952, -0.006921739317476749, 0.0514574870467186, -0.030334170907735825, 0.00964601244777441, -0.013435517437756062, 0.028140246868133545, 0.0005688790115527809, 0.019817840307950974, -0.0551200695335865, 0.005788513924926519, 0.03127701207995415, 0.04315321147441864, 0.06610782444477081, 0.03443191200494766, -0.06777592748403549, 0.05029706284403801, 0.026127638295292854, 0.040614787489175797, 0.03624507412314415, -0.03386983275413513, 0.012483607977628708, -0.03280006721615791, -0.07491978257894516, 0.02409689873456955, 0.009364972822368145, -0.03142206743359566, 0.012275095097720623, -0.03437751904129982, 0.06520123779773712, 0.061865027993917465, 0.014949506148695946, -0.0011082942364737391, 0.005353355314582586, -0.036970335990190506, -0.033325884491205215, -0.05363328009843826, -0.015919547528028488, -0.042609263211488724, -0.05559149384498596, 0.07390441000461578, 0.021286500617861748, 0.022392528131604195, 0.05337943509221077, -0.03401488438248634, 0.0577310211956501, -0.006740422919392586, -0.06331555545330048, -0.03405115008354187, -0.0023843056987971067, 0.05461238697171211, -0.013680294156074524, 0.007012397050857544, -0.010026776231825352, -0.016372837126255035, 0.04250047728419304, 0.029300669208168983, -0.020488711073994637, 0.0359187051653862, 0.0058610402047634125, -0.030370432883501053, 0.022410660982131958, -0.02886551059782505, -0.0737956240773201, 0.08035925775766373, -0.03506651893258095, -0.06668803095817566, 0.05421349033713341, -0.02750563994050026, -0.024314478039741516, -0.07506483048200607, -0.01118719857186079, 0.011368514969944954, -0.0013349391520023346, -0.08035925775766373, -0.0019525468815118074, 0.022247476503252983, 0.006445784587413073, 0.048882801085710526, -0.000255683931754902, -0.03724231198430061, -0.009383103810250759, 0.047105900943279266, 0.08195484429597855, 0.029645169153809547, -0.00023216950648929924, 0.008122957311570644, 0.0314764603972435, 0.06005186587572098, 0.03419620171189308, 0.005285362247377634, 0.00957348570227623, -0.03194788470864296, -0.0304973553866148, -0.019727183505892754, 0.024731505662202835, -0.06893634796142578, -0.0017587654292583466, 0.06103097274899483, -0.009600683115422726, 0.008394931443035603, -0.005892770830541849, -0.05493875592947006, -0.010135565884411335, -0.020905736833810806, -0.000933777482714504, -0.003644451964646578, -0.0173066146671772, -0.02012607827782631, -0.024550190195441246, 0.03443191200494766, 0.047903694212436676, 0.01174927782267332, 0.05584533512592316, -0.03988952562212944, -0.0010272685904055834, -0.020524973049759865, -0.04543779417872429, 0.028647931292653084, -0.05802112817764282, 0.009500959888100624, -0.004886467009782791, -0.0152486776933074, -0.0201804731041193, -0.025148531422019005, -0.06331555545330048, 0.00674948887899518, -0.04844764247536659, -0.003413274185732007, 0.05519259721040726, -0.03466762229800224, -0.04464000463485718, 0.05834749713540077, -0.03435938432812691, -0.019654655829072, 0.004047879949212074, 0.016554152593016624, 0.004786742851138115, -0.03941810131072998, 0.0061602117493748665, 0.08826463669538498, -0.02474963665008545, -0.03067867085337639, 0.05939912796020508, 0.08833716809749603, 0.02251945063471794, -0.016998376697301865, -0.03588243946433067, -0.03419620171189308, 0.020615631714463234, 0.039816997945308685, 0.02008981443941593, 0.00531255966052413, 0.007424890995025635, -0.003637652611359954, -0.010770171880722046, -0.04910038039088249, -0.015049229376018047, 0.0015423194272443652, -0.005525605753064156, 0.022265607491135597, -0.026871034875512123, 0.023389765992760658, -0.02844848297536373, 0.000817621941678226, -0.0028557274490594864, 0.016436297446489334, 0.04957180097699165, 0.019545868039131165, 0.03174843639135361, -0.009519090875983238, 0.01641816645860672, -0.025583690032362938, 0.05482996627688408, 0.019872235134243965, -0.039309311658144, 0.010715777054429054, 0.003367945086210966, -0.03622693940997124, 0.004526101052761078, 0.05414096266031265, 0.03142206743359566, -0.02320845052599907, -0.005444013513624668, -0.045002635568380356, -0.032854463905096054, -0.019310155883431435, 0.04609053209424019, 0.006128481589257717, 0.021776054054498672, 0.0201804731041193, -0.019310155883431435, -0.0020840009674429893, -0.005235500168055296, 0.04409605637192726, 0.030787460505962372, -0.05269043520092964, 0.0044694398529827595, 0.004451308399438858, -0.04246421158313751, -0.03760494291782379, 0.05754970386624336, -0.0013077418552711606, -0.04471253231167793, -0.010180894285440445, -0.013417385518550873, 0.0065455082803964615, -0.01221163384616375, 0.012356686405837536, 0.0016023803036659956, -0.07259893417358398, 0.016708271577954292, -0.02803145721554756, 0.02527545392513275, 0.01923763006925583, 0.0006799350958317518, -0.017089035362005234, -0.08819211274385452, 0.02862980030477047, -0.024912821128964424, 0.013870676048099995, 0.02032552659511566, -0.05399591103196144, 0.03236490860581398, -0.03610001876950264, 0.01828572154045105, 0.023244714364409447, 0.009818262420594692, -0.032383039593696594, 0.03272754326462746, 0.008304273709654808, -0.048846535384655, -0.026236427947878838, 0.0018426240421831608, 0.042609263211488724, -0.022863950580358505, 0.038692839443683624, -0.0025338914711028337, 0.032147329300642014, -0.0061375475488603115, -0.011341317556798458, 0.015167085453867912, -0.04170268401503563, 0.05450359731912613, -0.028593536466360092, -0.04235542193055153, 0.0022483186330646276, 0.08326032012701035, -0.05983428657054901, 0.022029897198081017, -0.0314764603972435, 0.024695241823792458, -0.06175623834133148, -0.02522105909883976, 0.0688275620341301, 0.021703528240323067, 0.03256435692310333, 0.06860998272895813, -0.03464949131011963, 0.023045266047120094, 0.08514600247144699, -0.008308806456625462, 0.009500959888100624, 0.0006068420480005443, 0.010616052895784378, -0.02989901229739189, -0.008766629733145237, -0.045147690922021866, -0.004235995467752218, -0.014759124256670475, 0.042609263211488724, 0.005521073006093502, -0.014351163059473038, -0.002298180479556322, 0.0152486776933074, 0.008984209038317204, -0.005548270419239998, 0.032673146575689316, -0.04627184942364693, -0.0403609462082386, 0.03417807072401047, 0.057513441890478134, -0.0616474486887455, 0.01679893024265766, -0.006690561305731535, -0.02097826451063156, -0.02554742805659771, -0.02077881619334221, 0.041920263320207596, -0.021377159282565117, 0.011776475235819817, 0.10458308458328247, 0.029772089794278145, 0.022773291915655136, 0.01627311296761036, -0.10117433965206146, 0.013979465700685978, -0.026889165863394737, -0.054394807666540146, 0.011160001158714294, 0.03443191200494766, 0.030515486374497414, 0.011286922730505466, 0.004347051493823528, 0.00039209588430821896, -0.0365714430809021, -0.012701187282800674, 0.011776475235819817, -0.0505509078502655, 0.01118719857186079, -0.035193439573049545, 0.01447808463126421, -0.022773291915655136, -0.06280787289142609, -0.11401151120662689, -0.014278636313974857, -0.021177710965275764, -0.07307035475969315, -0.024278216063976288, 0.01284623984247446, -0.008952478878200054, -0.07491978257894516, 0.03249182924628258, 0.01564757339656353, 0.006341527681797743, 0.03218359500169754, -0.05493875592947006, -0.003857498290017247, 0.04043347388505936, -0.003896028036251664, -0.0016363770700991154, -0.07549998909235, 0.003524330211803317, -0.04438616335391998, -0.003120901994407177, -0.016735468059778214, 0.06494739651679993, 0.042427949607372284, 0.02592819184064865, -0.036408256739377975, -0.004342518746852875, 0.023426029831171036, -0.04801248386502266, -0.04104994609951973, 0.08217242360115051, -0.025891928002238274, -0.03843899816274643, 0.03789504989981651, -0.030986908823251724, -0.03328962251543999, -0.031784698367118835, -0.040143366903066635, 0.033235225826501846, 0.0017134364461526275, 0.027668824419379234, -0.041920263320207596, 0.02008981443941593, -0.047287218272686005, -0.02774135209619999, -0.03392422944307327, -0.04181147366762161, -0.0029259873554110527, 0.03843899816274643, 0.07103961706161499, -0.012302292510867119, -0.03606375679373741, 0.007982437498867512, 0.06353313475847244, 0.0050768484361469746, 0.0531618557870388, 0.01756952330470085, -0.02264637127518654, -0.011014948599040508, 0.0021961904130876064, 0.03359786048531532, 0.004120406694710255, -0.01790495775640011, -0.0038031034637242556, -0.011341317556798458, 0.009052202105522156, -0.05330691114068031, 0.004827538970857859, -0.011105606332421303, 0.030152853578329086, -0.08224494755268097, -0.040614787489175797, -0.033235225826501846, -0.0018040944123640656, 0.017941219732165337, 0.09602496773004532, -0.021377159282565117, -0.0023865720722824335, -0.0015026564942672849, 0.06458476930856705, -0.07100335508584976, 0.06520123779773712, 0.024731505662202835, 0.03274567425251007, 0.019509604200720787, 0.050841011106967926, -0.021504079923033714, -0.019654655829072, -0.029155615717172623, 0.05776728317141533, -0.021776054054498672, -0.003648984944447875, 0.03082372434437275, 0.06201007962226868, 0.030569881200790405, -0.005711454898118973, -0.03133140876889229, 0.0640045553445816, -0.0020862675737589598, 0.08260758221149445, -0.03880162909626961, 0.009292446076869965, -0.010389408096671104, -0.0160011388361454, 0.0351390466094017, -0.03988952562212944, -0.002579220337793231, -0.012619595043361187, -0.008481057360768318, -0.008354135788977146, 0.029536379501223564, -0.050841011106967926, 0.01074297446757555, -0.0449301116168499, 0.04964432492852211, 0.02045244723558426, 0.00018613222346175462, 0.02587379701435566, 0.005339756608009338, 0.03292698785662651, -0.042101580649614334, 0.04054226353764534, 0.05403217300772667, -0.06860998272895813, -0.01709810085594654, 0.03399675339460373, -0.024532057344913483, 0.006917206104844809, 0.05464864894747734, -0.04852016642689705, -0.07303409278392792, -0.0050904471427202225, 0.021594738587737083, -0.01594674400985241, 0.0521102249622345, 0.0065228440798819065, -0.02881111577153206, -0.021413421258330345, 0.02868419513106346, 0.01555691473186016, 0.04590921476483345, 0.0030053129885345697, -0.03639012575149536, -0.0041090743616223335, -0.02367987297475338, -0.05791233852505684, -0.028285298496484756, -0.05243659391999245, 0.050659697502851486, 0.035936836153268814, -0.0359187051653862, -0.01882060244679451, -0.025094136595726013, 0.016608547419309616, -0.024731505662202835, -0.009251650422811508, 0.022664502263069153, 0.02681664004921913, -0.05203769728541374, 0.0017780301859602332, 0.006935338024049997, 0.011150935664772987, -0.04746853560209274, -0.01562037505209446, 0.0034359386190772057, 0.011613290756940842, 0.02815837785601616, -0.025855664163827896, 0.008585313335061073, 0.010842697694897652, -0.01769644394516945, -0.07343298941850662, -0.05356075242161751, 0.007846450433135033, -0.009292446076869965, 0.025293584913015366, -0.03140393644571304, -0.035755518823862076, -0.0455828495323658, 0.03443191200494766, -0.035284098237752914, 0.05385085940361023, 0.04656195268034935, -0.017805233597755432, 0.009609749540686607, 0.009591617621481419, -0.035574205219745636, -0.0038438995834439993, -0.0029939808882772923, -0.026889165863394737, 0.0027265397366136312, 0.04946301132440567, 0.025656217709183693, -0.033416543155908585, 0.03651704639196396, 0.01648162677884102, 0.04993443191051483, -0.04007083922624588, 0.020071683451533318, -0.05011574923992157, -0.003367945086210966, 0.01564757339656353, -0.012356686405837536, -0.04264552891254425, -0.020234867930412292, -0.02232000231742859, -0.005647994112223387, 0.0003422339796088636, 0.044494953006505966, 0.014369294978678226, 0.016463493928313255, -0.05860133841633797, 0.03945436701178551, 0.019926629960536957, -0.05874639004468918, -0.03653517737984657, -0.0774582028388977, -0.010362210683524609, -0.03789504989981651, 0.030859986320137978, 0.008630642667412758, 0.01657228358089924, 0.014686597511172295, 0.008753030560910702, 0.02041618339717388, -0.013408320024609566, -0.015012966468930244, -0.0416664220392704, 0.09073054045438766, 0.029355064034461975, 0.05947165563702583, 0.05399591103196144, 0.016545087099075317, -0.018539562821388245, 0.023951847106218338, -0.009591617621481419, -0.04681579768657684, 0.008349603042006493, 0.03497586026787758, -0.00018967356299981475, 0.05965296924114227, -0.0077648586593568325, 0.004197465721517801, 0.008163753896951675, -0.023969978094100952, 0.005919968243688345, 0.048919063061475754, 0.014260505326092243, -0.007488351780921221, 0.01029875036329031, -0.0009887389605864882, -0.007053193170577288, -0.0086533073335886, -0.005616263952106237, -0.01001770980656147, 0.015429993160068989, -0.05258164554834366, -0.03381543979048729, 0.04815753549337387, 0.06860998272895813, -0.040469735860824585, 0.042609263211488724, -0.052327804267406464, 0.023154055699706078, -0.004356117453426123, -0.0009190455893985927, 0.03363412246108055, 0.00113719142973423, 0.008331471122801304, -0.019491473212838173, 0.016100862994790077, 0.0033656787127256393, -0.014169846661388874, -0.04152137041091919, 0.03347093611955643, 0.016699206084012985, 0.006128481589257717, -0.005330691114068031, -0.027052350342273712, 0.005815711338073015, 0.05421349033713341, 0.054576121270656586, 0.017478864639997482, -0.035247836261987686, 0.013227003626525402, 0.06966161727905273, -0.016010204330086708, -0.026599060744047165, -0.004650755785405636, -0.022410660982131958, -0.0030461091082543135, -0.07125719636678696, -0.02815837785601616, 0.0731428861618042, -0.001801827922463417 ]
39,357
pyspark.sql.dataframe
checkpoint
Returns a checkpointed version of this :class:`DataFrame`. Checkpointing can be used to truncate the logical plan of this :class:`DataFrame`, which is especially useful in iterative algorithms where the plan may grow exponentially. It will be saved to files inside the checkpoint directory set with :meth:`SparkContext.setCheckpointDir`. .. versionadded:: 2.1.0 Parameters ---------- eager : bool, optional, default True Whether to checkpoint this :class:`DataFrame` immediately. Returns ------- :class:`DataFrame` Checkpointed DataFrame. Notes ----- This API is experimental. Examples -------- >>> import tempfile >>> df = spark.createDataFrame([ ... (14, "Tom"), (23, "Alice"), (16, "Bob")], ["age", "name"]) >>> with tempfile.TemporaryDirectory() as d: ... spark.sparkContext.setCheckpointDir("/tmp/bb") ... df.checkpoint(False) DataFrame[age: bigint, name: string]
def checkpoint(self, eager: bool = True) -> "DataFrame": """Returns a checkpointed version of this :class:`DataFrame`. Checkpointing can be used to truncate the logical plan of this :class:`DataFrame`, which is especially useful in iterative algorithms where the plan may grow exponentially. It will be saved to files inside the checkpoint directory set with :meth:`SparkContext.setCheckpointDir`. .. versionadded:: 2.1.0 Parameters ---------- eager : bool, optional, default True Whether to checkpoint this :class:`DataFrame` immediately. Returns ------- :class:`DataFrame` Checkpointed DataFrame. Notes ----- This API is experimental. Examples -------- >>> import tempfile >>> df = spark.createDataFrame([ ... (14, "Tom"), (23, "Alice"), (16, "Bob")], ["age", "name"]) >>> with tempfile.TemporaryDirectory() as d: ... spark.sparkContext.setCheckpointDir("/tmp/bb") ... df.checkpoint(False) DataFrame[age: bigint, name: string] """ jdf = self._jdf.checkpoint(eager) return DataFrame(jdf, self.sparkSession)
(self, eager: bool = True) -> pyspark.sql.dataframe.DataFrame
[ 0.05019785836338997, -0.03840761259198189, 0.023473303765058517, 0.01154014840722084, 0.014559165574610233, -0.013237228617072105, -0.005837064236402512, 0.05012640357017517, -0.010950636118650436, -0.04137304052710533, -0.033727243542671204, -0.05277027562260628, 0.01396965328603983, 0.016881486400961876, -0.010441511869430542, -0.003543772269040346, 0.02843949757516384, -0.01438052486628294, 0.027599889785051346, 0.07745832949876785, 0.016291974112391472, -0.05580715462565422, 0.005104640033096075, 0.0032557151280343533, -0.04680369794368744, -0.0023692138493061066, -0.03431675583124161, 0.029243377968668938, 0.019132351502776146, 0.02315175160765648, -0.006989292334765196, -0.026456592604517937, -0.023955632001161575, 0.015273725613951683, -0.030243761837482452, 0.022651560604572296, -0.004262798465788364, 0.0015262560918927193, 0.010521899908781052, -0.06152363866567612, -0.004792019724845886, -0.005832598078995943, -0.025706304237246513, -0.0027555229607969522, -0.038764894008636475, -0.005296677816659212, 0.0013721790164709091, -0.03628179803490639, 0.050019219517707825, -0.018435655161738396, 0.023866312578320503, 0.0379788763821125, -0.02393776923418045, 0.011406168341636658, -0.015407705679535866, -0.02336611971259117, 0.013201500289142132, -0.011790243908762932, -0.008288898505270481, -0.012379756197333336, 0.017033329233527184, -0.0367283970117569, 0.04483865574002266, 0.05884403735399246, 0.0020811567083001137, 0.010191415436565876, -0.04019401594996452, -0.026724552735686302, -0.053377650678157806, -0.03158356249332428, -0.007382300682365894, -0.04358817636966705, -0.0018679051427170634, 0.09732310473918915, -0.09360739588737488, -0.052019987255334854, -0.040408384054899216, -0.036388982087373734, -0.06005879119038582, 0.013040724210441113, -0.01645275019109249, -0.05412793904542923, -0.03546005114912987, -0.03542432561516762, 0.009097245521843433, 0.013862469233572483, 0.022883791476488113, 0.052305810153484344, -0.005904054269194603, 0.04390972852706909, 0.021776223555207253, 0.0734567940235138, -0.02283019945025444, 0.0046357098035514355, 0.05237726494669914, -0.04651787132024765, -0.006390848197042942, 0.00865511130541563, -0.020757975056767464, 0.000037891233660047874, -0.03662121295928955, 0.04337380826473236, -0.022597968578338623, -0.00429629348218441, -0.013496256433427334, -0.023919904604554176, -0.015434501692652702, -0.0015921295853331685, 0.027189018204808235, -0.09325011074542999, -0.04140876606106758, 0.011691992171108723, -0.034263163805007935, -0.003947945311665535, 0.03474549204111099, 0.020382830873131752, 0.000970797089394182, -0.013424800708889961, -0.047732625156641006, 0.027635617181658745, 0.04351671785116196, 0.0036286262329667807, -0.0035504712723195553, -0.05684326961636543, -0.03490626811981201, 0.008780159056186676, 0.06738302856683731, -0.0021682437509298325, 0.05559278652071953, 0.008726567029953003, 0.08310335874557495, -0.0039993044920265675, -0.020954478532075882, 0.03546005114912987, 0.01223684474825859, 0.008226375095546246, 0.058772582560777664, 0.05662890151143074, -0.06566808372735977, -0.0001574265625094995, 0.022740880027413368, -0.03113696351647377, 0.01808730699121952, 0.03869343921542168, 0.019221670925617218, -0.01000384334474802, -0.0450172945857048, -0.03890780732035637, -0.00461337948217988, 0.03772878274321556, 0.07234922796487808, -0.042730703949928284, -0.003199890023097396, -0.06148790940642357, -0.013398004695773125, -0.02422359213232994, -0.00914637092500925, -0.00009239040809916332, 0.03244103491306305, -0.03288763388991356, -0.02209777571260929, 0.03490626811981201, -0.013531984761357307, 0.04483865574002266, -0.04576758295297623, 0.04480292648077011, -0.015202268958091736, 0.00797627866268158, -0.07106301933526993, -0.008856081403791904, 0.09460777789354324, 0.04841145873069763, 0.02311602421104908, 0.03994391858577728, -0.05151979252696037, 0.06970535218715668, 0.033280644565820694, 0.01352305244654417, -0.0007575455238111317, -0.008668509311974049, 0.02590280957520008, 0.011227527633309364, -0.03399520367383957, 0.0007022787467576563, 0.028385905548930168, 0.0010841218754649162, -0.037335772067308426, 0.002054360695183277, 0.09775184094905853, 0.04373108595609665, -0.03437034785747528, -0.0024808638263493776, 0.07270650565624237, 0.03922935947775841, 0.0014760135672986507, -0.08095967769622803, 0.036585483700037, 0.008771226741373539, -0.04959048330783844, 0.04844718426465988, 0.029564930126070976, 0.0078065707348287106, 0.08303190022706985, -0.047482527792453766, 0.028957555070519447, 0.020775839686393738, -0.06338149309158325, -0.0190608948469162, -0.01975759118795395, -0.005051048006862402, -0.018792934715747833, -0.017408473417162895, -0.04333807900547981, 0.042945072054862976, 0.04140876606106758, -0.0260635856539011, 0.03644257411360741, 0.008847149088978767, 0.0031128032132983208, 0.012853152118623257, 0.03897926211357117, -0.03294122591614723, -0.026903193444013596, 0.07084865123033524, -0.007797638885676861, -0.05602152273058891, 0.020650791004300117, -0.05044795572757721, 0.019900502637028694, -0.08288899064064026, 0.00002723214311117772, -0.032173074781894684, -0.01788187026977539, -0.07127738744020462, 0.049197472631931305, 0.06881215423345566, -0.042123325169086456, -0.00040277751395478845, 0.015488093718886375, -0.029118331149220467, 0.005622696131467819, 0.008409480564296246, 0.039014991372823715, -0.0016345565672963858, 0.053091827780008316, -0.004209206439554691, 0.0563073493540287, 0.022062048316001892, 0.017131581902503967, 0.009825203567743301, -0.019007302820682526, -0.030225899070501328, 0.008717634715139866, -0.0008223025361075997, 0.039014991372823715, -0.020757975056767464, -0.017194105312228203, 0.05559278652071953, 0.002802415983751416, 0.08145987242460251, -0.0013442664640024304, -0.023133888840675354, 0.0006877642590552568, 0.0013442664640024304, -0.04769689589738846, 0.0007787590147927403, -0.05602152273058891, -0.05334192141890526, -0.015532753430306911, 0.017408473417162895, -0.020686520263552666, 0.036103155463933945, 0.01474673766642809, -0.01771216280758381, -0.015854306519031525, -0.06741876155138016, -0.07063428312540054, -0.008699771016836166, -0.013505188748240471, -0.05162697657942772, -0.022615831345319748, -0.0423019677400589, -0.01669391430914402, 0.02901114709675312, -0.06363159418106079, -0.03420957177877426, -0.046053409576416016, -0.016676049679517746, 0.05184134468436241, -0.04140876606106758, -0.024705920368433, -0.01157587580382824, 0.0590941347181797, -0.013147908262908459, -0.00022106707911007106, 0.024527281522750854, 0.007435892708599567, -0.05252017825841904, -0.04051556810736656, 0.017899734899401665, 0.049519024789333344, -0.031851522624492645, -0.010771995410323143, 0.07467154413461685, 0.04140876606106758, 0.003496879246085882, -0.03490626811981201, -0.016291974112391472, 0.02413427270948887, -0.0030502791050821543, -0.010057435370981693, -0.020436422899365425, 0.015702461823821068, 0.02786784991621971, -0.03211948275566101, -0.08274608105421066, -0.012835288420319557, -0.03669266775250435, 0.026277953758835793, 0.0066364784725010395, -0.01873934268951416, 0.033495012670755386, 0.00001633754072827287, 0.035942379385232925, -0.04151595011353493, 0.016783233731985092, 0.046124864369630814, 0.01178131252527237, -0.005332405678927898, 0.015827510505914688, 0.015613141469657421, -0.016506342217326164, 0.0536634735763073, 0.01530052162706852, -0.06406033039093018, 0.0034388212952762842, 0.0012058204738423228, 0.0012515969574451447, 0.028403770178556442, 0.011924223974347115, 0.12061776965856552, -0.04344526305794716, 0.02590280957520008, -0.03244103491306305, -0.022973112761974335, 0.01645275019109249, 0.003695616265758872, -0.009851999580860138, 0.04512447863817215, 0.10068154335021973, -0.04984057694673538, 0.01848924718797207, -0.05577142909169197, 0.05159125104546547, 0.00004926558176521212, -0.0274569783359766, 0.007404630538076162, 0.01848924718797207, -0.014175089076161385, -0.06066616624593735, 0.012165388092398643, -0.023187480866909027, -0.012210048735141754, -0.0016557701164856553, 0.028832506388425827, 0.01898943819105625, -0.02090088650584221, -0.01450557354837656, -0.02822512947022915, -0.017953326925635338, -0.0204542875289917, -0.04280215874314308, 0.0026193098165094852, -0.01595255732536316, 0.036799851804971695, 0.017238765954971313, -0.058808308094739914, 0.03919363021850586, 0.055414147675037384, 0.08874838054180145, 0.025152521207928658, -0.06584672629833221, 0.010602287948131561, -0.005234153941273689, 0.012522668577730656, 0.00904365349560976, -0.05355628952383995, -0.02717115357518196, 0.01940031163394451, -0.013576644472777843, -0.018310606479644775, 0.015648869797587395, -0.02074011228978634, -0.00531900767236948, 0.03278044983744621, 0.014782465063035488, 0.026974650099873543, 0.019239535555243492, 0.005207357928156853, -0.016658185049891472, 0.026027856394648552, -0.004760757554322481, 0.0072170584462583065, -0.04566039890050888, -0.024527281522750854, 0.007833367213606834, 0.005149299744516611, -0.05076950788497925, -0.015398773364722729, -0.013138976879417896, 0.07402843981981277, -0.02343757636845112, -0.015121880918741226, 0.09396467357873917, -0.006091626361012459, 0.06827623397111893, -0.010736268013715744, -0.017935462296009064, 0.05477104336023331, 0.03515636548399925, 0.0275284331291914, 0.004544156603515148, 0.01163840014487505, 0.006051432341337204, -0.04991203546524048, 0.003921149298548698, -0.02786784991621971, -0.010888111777603626, -0.0007982977549545467, 0.02695678547024727, 0.0017495561623945832, -0.06934807449579239, -0.014809261076152325, 0.030065122991800308, -0.010539763607084751, 0.029439883306622505, 0.06666847318410873, -0.02340184897184372, -0.04219478368759155, 0.051198240369558334, 0.06227392703294754, -0.04019401594996452, 0.03433461859822273, 0.0023692138493061066, -0.01764070615172386, -0.020436422899365425, -0.009271419607102871, -0.008320161141455173, -0.07574338465929031, 0.01452343724668026, 0.10882752388715744, -0.008101326413452625, 0.020364968106150627, 0.013898196630179882, -0.11504419893026352, 0.0332091860473156, -0.03462044522166252, -0.034423939883708954, -0.006980360485613346, 0.06295275688171387, 0.012379756197333336, -0.015863237902522087, -0.02213350310921669, 0.00022106707911007106, -0.007953949272632599, -0.052591633051633835, -0.022437192499637604, 0.012799560092389584, -0.033084139227867126, -0.054485220462083817, 0.043838270008563995, -0.07202767580747604, -0.042159054428339005, -0.07281368970870972, 0.01812303438782692, 0.04994776099920273, -0.07567193359136581, -0.0004477166512515396, 0.08574722707271576, 0.0076056006364524364, -0.07702959328889847, -0.008226375095546246, 0.00623900443315506, -0.0039300816133618355, 0.030493859201669693, -0.050019219517707825, -0.04783980920910835, -0.017167309299111366, 0.006743662524968386, -0.0018757206853479147, -0.02442009747028351, 0.04987630620598793, 0.015086153522133827, -0.01505935750901699, -0.001771886134520173, 0.04337380826473236, 0.006730264518409967, 0.057879380881786346, 0.009548311121761799, -0.02483096905052662, 0.05527123436331749, 0.003691150341182947, -0.02032923884689808, 0.02901114709675312, -0.06813331693410873, -0.05827238783240318, 0.026117177680134773, -0.01225470844656229, -0.05191280320286751, -0.020632928237318993, 0.004019401501864195, 0.04462428763508797, -0.022472919896245003, 0.0788159966468811, -0.04169458895921707, -0.0018578566377982497, 0.006676672492176294, 0.032994817942380905, 0.05266309157013893, -0.03363792225718498, -0.008239773102104664, 0.015890033915638924, 0.0646677017211914, 0.014309069141745567, -0.0732424259185791, 0.021383214741945267, 0.027546297758817673, 0.0014157225377857685, 0.024455824866890907, 0.04115867242217064, -0.03367365151643753, 0.03687131032347679, 0.04616059362888336, 0.021704766899347305, 0.0013844604836776853, -0.014836057089269161, -0.009458991698920727, 0.012379756197333336, -0.002931930124759674, -0.050054945051670074, 0.019936231896281242, 0.012326164171099663, 0.012862084433436394, 0.012754900380969048, -0.03303054720163345, 0.0010673743672668934, 0.003918916452676058, 0.03662121295928955, 0.01624731346964836, -0.02736765705049038, -0.0038273632526397705, -0.03546005114912987, 0.05094814673066139, -0.012102864682674408, 0.03694276511669159, -0.02156185545027256, 0.0650249794125557, 0.026974650099873543, 0.010530831292271614, -0.037049949169158936, -0.05216289684176445, -0.03947945311665535, 0.10646947473287582, -0.06080907583236694, 0.0464821457862854, 0.0046357098035514355, 0.03808606043457985, 0.03444180265069008, 0.015282656997442245, -0.04566039890050888, 0.07445717602968216, 0.00906151719391346, 0.04826854541897774, -0.051984257996082306, 0.005059979856014252, 0.01566673442721367, -0.004157847259193659, 0.05587861314415932, -0.030297353863716125, 0.003429889213293791, 0.002182758180424571, -0.014737805351614952, -0.024330776184797287, 0.028278721496462822, -0.07295659929513931, 0.0493403859436512, -0.03640684485435486, 0.02197272703051567, 0.0041690124198794365, 0.016863621771335602, -0.013630236499011517, 0.01890011876821518, 0.04716097563505173, -0.0332091860473156, 0.06588245183229446, -0.017417406663298607, -0.03152997046709061, -0.0014849455328658223, 0.06602536886930466, -0.025992128998041153, -0.027063969522714615, 0.02597426436841488, -0.0006336139631457627, -0.055414147675037384, -0.05523550882935524, 0.015505957417190075, -0.05023358762264252, 0.06663274019956589, -0.002183874836191535, -0.006140752229839563, -0.03542432561516762, 0.0394437275826931, 0.0082844328135252, -0.03408452495932579, -0.038443341851234436, 0.035656556487083435, -0.06416751444339752, -0.025884944945573807, -0.07502882927656174, 0.029386291280388832, -0.016068674623966217, -0.000747497018892318, 0.033941611647605896, 0.0043945456854999065, -0.024598736315965652, -0.029243377968668938, 0.021579720079898834, -0.056200165301561356, -0.018507109954953194, -0.007377834524959326, 0.020632928237318993, 0.018667886033654213, 0.032262396067380905, -0.011763447895646095, 0.037335772067308426, -0.0465536005795002, -0.019507495686411858, -0.03601383790373802, 0.04265924543142319, 0.004917067941278219, -0.04769689589738846, 0.039014991372823715, 0.045517489314079285, -0.029832890257239342, -0.013362276367843151, -0.059344228357076645, -0.0019259632099419832, -0.017828278243541718, 0.05487822741270065, -0.011066751554608345, -0.014487708918750286, -0.0068999724462628365, 0.0006782739656046033, 0.0058058020658791065, 0.03097618743777275, 0.098823681473732, -0.022615831345319748, -0.04305225610733032, 0.008436276577413082, -0.01587216928601265, -0.0109417038038373, -0.018560701981186867, -0.0677403137087822, 0.01788187026977539, 0.042444877326488495, 0.0843895673751831, -0.061059173196554184, 0.027028242126107216, 0.031119098886847496, -0.02958279475569725, -0.010870248079299927, 0.05527123436331749, -0.04462428763508797, -0.015613141469657421, 0.03469190001487732, -0.06648983061313629, -0.04683942347764969, -0.028939690440893173, -0.016336632892489433, -0.013630236499011517, 0.028368042781949043, 0.026152905076742172, 0.04037265479564667, 0.006422110367566347, -0.007203660439699888, -0.001083563663996756, 0.03335209935903549, -0.012201116420328617, 0.004943863954395056, -0.06784749776124954, -0.02568844147026539, 0.018560701981186867, 0.011968884617090225, 0.051198240369558334, 0.0035594033543020487, -0.03994391858577728, -0.014469845220446587, 0.015488093718886375, -0.043873999267816544, -0.02057933621108532, -0.014389457181096077, 0.055378418415784836, 0.0009624233352951705, 0.007163466420024633, 0.030529586598277092, 0.032101619988679886, -0.0017450901214033365, 0.02540261670947075, -0.03133346885442734, -0.03456685319542885, -0.01505935750901699, 0.04758971184492111, -0.000759220274630934, -0.030994050204753876, 0.0034745491575449705, 0.018239149823784828, -0.02425932139158249, -0.07581484317779541, -0.00680172024294734, 0.038193244487047195, 0.010495103895664215, -0.028743186965584755, 0.0036107623018324375, 0.028868233785033226, -0.029815027490258217, 0.013183636590838432, 0.017194105312228203, -0.011066751554608345, -0.014773533679544926, -0.013022860512137413, 0.028403770178556442, 0.017435269430279732, 0.009735883213579655, -0.003688917262479663, 0.05584288388490677, -0.006355120334774256, 0.010298599489033222, 0.016149062663316727, 0.016291974112391472, 0.014719941653311253, 0.0026036789640784264, 0.010673743672668934, -0.04766117036342621, -0.0020733412820845842, 0.012120728380978107, -0.020025551319122314, 0.010450443252921104, 0.015988286584615707, 0.026867466047406197, 0.0112543236464262, -0.006551624275743961, 0.040408384054899216, 0.032834041863679886, 0.003983673639595509, 0.0465536005795002, 0.04055129364132881, -0.026813874021172523, 0.01595255732536316, 0.006377450190484524, -0.0564502589404583, -0.015389841049909592, 0.002440669806674123, -0.022937383502721786, 0.03145851567387581, -0.03263754025101662, 0.0006135169533081353, 0.05612870678305626, 0.05816520377993584 ]
39,358
pyspark.sql.dataframe
coalesce
Returns a new :class:`DataFrame` that has exactly `numPartitions` partitions. Similar to coalesce defined on an :class:`RDD`, this operation results in a narrow dependency, e.g. if you go from 1000 partitions to 100 partitions, there will not be a shuffle, instead each of the 100 new partitions will claim 10 of the current partitions. If a larger number of partitions is requested, it will stay at the current number of partitions. However, if you're doing a drastic coalesce, e.g. to numPartitions = 1, this may result in your computation taking place on fewer nodes than you like (e.g. one node in the case of numPartitions = 1). To avoid this, you can call repartition(). This will add a shuffle step, but means the current upstream partitions will be executed in parallel (per whatever the current partitioning is). .. versionadded:: 1.4.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Parameters ---------- numPartitions : int specify the target number of partitions Returns ------- :class:`DataFrame` Examples -------- >>> df = spark.range(10) >>> df.coalesce(1).rdd.getNumPartitions() 1
def coalesce(self, numPartitions: int) -> "DataFrame": """ Returns a new :class:`DataFrame` that has exactly `numPartitions` partitions. Similar to coalesce defined on an :class:`RDD`, this operation results in a narrow dependency, e.g. if you go from 1000 partitions to 100 partitions, there will not be a shuffle, instead each of the 100 new partitions will claim 10 of the current partitions. If a larger number of partitions is requested, it will stay at the current number of partitions. However, if you're doing a drastic coalesce, e.g. to numPartitions = 1, this may result in your computation taking place on fewer nodes than you like (e.g. one node in the case of numPartitions = 1). To avoid this, you can call repartition(). This will add a shuffle step, but means the current upstream partitions will be executed in parallel (per whatever the current partitioning is). .. versionadded:: 1.4.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Parameters ---------- numPartitions : int specify the target number of partitions Returns ------- :class:`DataFrame` Examples -------- >>> df = spark.range(10) >>> df.coalesce(1).rdd.getNumPartitions() 1 """ return DataFrame(self._jdf.coalesce(numPartitions), self.sparkSession)
(self, numPartitions: int) -> pyspark.sql.dataframe.DataFrame
[ 0.0008782917866483331, -0.027418585494160652, -0.03256922587752342, 0.023401085287332535, 0.014936862513422966, 0.009279740042984486, 0.0061163874343037605, -0.02185589261353016, -0.004721422214061022, -0.022576982155442238, 0.015752380713820457, -0.011546023190021515, -0.006635744124650955, 0.02159835956990719, 0.02163269743323326, 0.005854563321918249, 0.0510600320994854, -0.008348332718014717, 0.10486707836389542, 0.04731723293662071, 0.01916038990020752, -0.04223526641726494, -0.002777054673060775, 0.004768636077642441, -0.0545281320810318, 0.02630261331796646, -0.01503987517207861, 0.013880981132388115, -0.04508528858423233, 0.029307154938578606, 0.02642279490828514, 0.0019282717257738113, -0.02946167252957821, 0.0022147761192172766, -0.009614531882107258, 0.047729283571243286, 0.008618741296231747, -0.01024977769702673, 0.011520269326865673, -0.03746233880519867, 0.02163269743323326, -0.02113480120897293, -0.025478510186076164, -0.09154408425092697, -0.03196831792593002, 0.008850520476698875, 0.01594982109963894, 0.0173233263194561, 0.022920357063412666, 0.03622618317604065, 0.07293309271335602, 0.005039045121520758, -0.04017500951886177, 0.010730504989624023, -0.09786219894886017, 0.0646233931183815, -0.004412383306771517, 0.006004790309816599, -0.03504153713583946, -0.013374500907957554, 0.0018209666013717651, -0.032964110374450684, -0.013486098498106003, 0.06548183411359787, 0.0041054910980165005, 0.022182099521160126, -0.0011438718065619469, -0.036775585263967514, -0.06410832703113556, -0.022285111248493195, 0.007519937586039305, -0.01327148824930191, -0.049446165561676025, 0.050029903650283813, -0.03516171872615814, -0.0015720189549028873, -0.021323658525943756, -0.045016612857580185, -0.0005848124856129289, -0.005051921587437391, 0.008584403432905674, -0.055695611983537674, 0.0007645484292879701, -0.05576428771018982, 0.07444395124912262, 0.005249362904578447, 0.04755759611725807, 0.04481058567762375, -0.014773759059607983, 0.01117689348757267, -0.01405266858637333, 0.07464997470378876, 0.009356999769806862, 0.021701373159885406, 0.06695834547281265, -0.01879984326660633, 0.012936696410179138, -0.014541979879140854, -0.0068288929760456085, -0.04731723293662071, -0.0020366497337818146, 0.040861763060092926, -0.053017277270555496, -0.05638236179947853, 0.012893774546682835, -0.047488920390605927, 0.004260010551661253, 0.05555826053023338, -0.015743795782327652, -0.027126716449856758, -0.02506645955145359, -0.0014818826457485557, 0.010121012106537819, 0.044879261404275894, 0.005910362116992474, 0.0185251422226429, -0.03979729488492012, 0.029993906617164612, -0.0026869182474911213, 0.027796298265457153, -0.009914985857903957, 0.042303942143917084, -0.025014951825141907, -0.08467655628919601, -0.01692844368517399, 0.023658616468310356, 0.05809924378991127, -0.0025645906571298838, 0.038629814982414246, 0.04178887605667114, 0.09607664495706558, -0.04130814969539642, -0.027452923357486725, -0.0011610406218096614, 0.005309453699737787, -0.018216105177998543, 0.011468763463199139, 0.041342489421367645, 0.00485018827021122, -0.021443840116262436, -0.005678582936525345, -0.07657288014888763, 0.035196054726839066, 0.03756535053253174, 0.04752326011657715, 0.02175287902355194, 0.05954142287373543, -0.03045746497809887, -0.006034835707396269, 0.06393663585186005, 0.025392666459083557, 0.04175454005599022, -0.002330665709450841, -0.07856446504592896, -0.014507642015814781, -0.012455970048904419, 0.035196054726839066, -0.01688552275300026, -0.0011921590194106102, -0.060605891048908234, 0.007863313890993595, 0.010395713150501251, 0.007893359288573265, 0.03670690953731537, -0.023881811648607254, -0.010833517648279667, 0.0025860515888780355, 0.003523897612467408, -0.019984491169452667, -0.03444062918424606, 0.0584426186978817, 0.015838224440813065, 0.02173570916056633, -0.04302503168582916, -0.029083959758281708, 0.09126938134431839, -0.0065842377953231335, -0.0459437295794487, -0.017349079251289368, 0.021838722750544548, 0.005395297892391682, -0.00902220793068409, -0.014713668264448643, 0.003182667773216963, 0.012455970048904419, 0.04532565176486969, -0.002568882890045643, -0.031281568109989166, 0.07767168432474136, 0.03845812752842903, -0.01940075308084488, -0.011880815029144287, 0.008588695898652077, 0.06585954129695892, 0.017048625275492668, -0.04123947396874428, 0.045634690672159195, 0.026714663952589035, -0.07355117052793503, 0.03512737900018692, 0.05957576259970665, 0.01350326742976904, 0.08083074539899826, -0.01542617380619049, 0.04316238313913345, -0.0016396210994571447, -0.09662605077028275, 0.012078256346285343, 0.00746413879096508, 0.0014722251798957586, -0.010850686579942703, -0.025890560820698738, -0.0030968235805630684, -0.001123483874835074, 0.02298903279006481, -0.0009410652564838529, 0.002246967749670148, -0.010292699560523033, 0.04786663502454758, 0.0011664058547466993, 0.05243353918194771, -0.06177336722612381, 0.024791758507490158, 0.061120953410863876, 0.03907620534300804, -0.03119572252035141, 0.005738673731684685, -0.08529463410377502, -0.001989435637369752, -0.027847805991768837, -0.039728619158267975, -0.06448604166507721, -0.029375828802585602, -0.06194505840539932, 0.036432210355997086, 0.04103345051407814, -0.009150974452495575, -0.012516060844063759, -0.01479951199144125, -0.013829474337399006, -0.043780457228422165, 0.02798515558242798, 0.03636353462934494, 0.004953200928866863, 0.01991581730544567, -0.0013724315213039517, 0.003618326038122177, 0.027916479855775833, -0.0011814285535365343, 0.02922130934894085, -0.020070334896445274, -0.03746233880519867, -0.0012812222121283412, -0.020070334896445274, 0.029547518119215965, -0.026920689269900322, -0.03394273295998573, -0.012816514819860458, -0.02357277274131775, 0.035848468542099, -0.005021876189857721, -0.06922463327646255, -0.059747450053691864, 0.01566653698682785, -0.045256976038217545, -0.019572440534830093, -0.04862206056714058, -0.015443341806530952, -0.010292699560523033, 0.022456800565123558, 0.0014325223164632916, 0.06496676802635193, 0.0643143504858017, -0.02973637357354164, 0.018610987812280655, -0.04814133420586586, -0.0739632248878479, -0.016679495573043823, 0.014584901742637157, -0.024911940097808838, -0.014001162722706795, -0.024482719600200653, -0.08975852280855179, 0.02211342379450798, -0.02468874491751194, -0.017907066270709038, -0.026319781318306923, -0.09181877970695496, -0.028671909123659134, -0.004511103965342045, -0.05215883627533913, 0.04580637812614441, 0.009872063994407654, 0.02642279490828514, -0.005863147787749767, 0.03351351246237755, 0.03759968653321266, 0.008219566196203232, -0.00908229872584343, 0.018387792631983757, 0.025993574410676956, -0.01092794630676508, 0.01914322003722191, 0.07197163999080658, 0.046493131667375565, -0.03766836225986481, -0.024379706010222435, -0.021941736340522766, 0.0019475865410640836, 0.04824434965848923, -0.04199490323662758, -0.019726959988474846, 0.0525708869099617, 0.030388789251446724, -0.0034959984477609396, -0.042681656777858734, 0.010661829262971878, 0.023744460195302963, 0.022010410204529762, 0.0033565019257366657, 0.017958572134375572, -0.020928775891661644, -0.047111205756664276, 0.053841378539800644, -0.0370502844452858, 0.04470757395029068, -0.0022491137497127056, -0.0034080082550644875, -0.016653742641210556, 0.013589111156761646, -0.02764178067445755, 0.00982914213091135, -0.0065842377953231335, 0.0096402857452631, -0.030045412480831146, -0.013082630932331085, 0.01752076856791973, -0.016636574640870094, 0.040484048426151276, 0.07416924834251404, 0.035196054726839066, -0.05147208273410797, -0.012387294322252274, -0.017434922978281975, 0.009399921633303165, 0.009794804267585278, 0.0366038978099823, -0.015228732489049435, -0.006777386646717787, -0.016756756231188774, -0.030629152432084084, -0.014644992537796497, -0.0346466526389122, 0.04130814969539642, 0.020430881530046463, 0.02371012233197689, -0.009442844428122044, 0.06015950068831444, 0.02542700432240963, -0.017512183636426926, 0.03852680325508118, -0.03845812752842903, -0.01198382768779993, 0.026731833815574646, 0.03523039445281029, 0.02776196226477623, -0.07073548436164856, 0.0031933982390910387, -0.06170469522476196, -0.03361652418971062, -0.02934149093925953, -0.03965994343161583, 0.03749667480587959, -0.0373593233525753, 0.030560476705431938, 0.0019733398221433163, -0.07149091362953186, 0.01656789891421795, 0.03742799907922745, 0.010867854580283165, -0.02872341498732567, -0.05651971325278282, 0.02812250703573227, -0.02261132001876831, -0.07300177216529846, 0.03632919490337372, -0.05033894255757332, -0.04975520446896553, -0.01652497798204422, -0.025718873366713524, 0.0022834513802081347, 0.03425177186727524, -0.015572108328342438, -0.0068589383736252785, -0.02163269743323326, 0.007335372734814882, 0.018336286768317223, -0.011897983029484749, 0.05837394669651985, -0.03387405723333359, 0.022903189063072205, -0.05621067434549332, 0.01339166983962059, 0.0007355760899372399, -0.004777220543473959, 0.0014926132280379534, 0.0732077956199646, -0.011897983029484749, -0.009983661584556103, -0.002281305380165577, 0.021804384887218475, -0.046493131667375565, -0.003953117877244949, 0.04285334423184395, -0.010378544218838215, 0.029135465621948242, -0.0032942648977041245, 0.030131256207823753, 0.06877823919057846, 0.02946167252957821, -0.02125498279929161, -0.032225850969552994, 0.009786220267415047, 0.024602901190519333, -0.03499002754688263, -0.027796298265457153, 0.016739586368203163, -0.004893110133707523, -0.008335456252098083, -0.008726046420633793, 0.0037428000941872597, -0.05085400864481926, -0.01582963950932026, 0.010163933970034122, 0.031367409974336624, 0.027040870860219002, 0.07135356217622757, 0.009356999769806862, -0.0301999319344759, 0.02482609450817108, 0.08838502317667007, -0.005566985812038183, 0.03189964219927788, -0.016739586368203163, -0.008082215674221516, 0.005335207097232342, -0.039247892796993256, -0.04460456222295761, -0.12718652188777924, 0.018765507265925407, 0.054219093173742294, 0.027950817719101906, 0.008618741296231747, 0.035917144268751144, -0.05823659524321556, 0.014112759381532669, 0.00868312455713749, -0.020207686349749565, -0.029427336528897285, 0.025117965415120125, 0.04161718860268593, -0.0029637652914971113, 0.009305493906140327, 0.009425675496459007, 0.005245070438832045, 0.03450930118560791, -0.05775586888194084, -0.05500885844230652, -0.05586729943752289, -0.06980837136507034, 0.013177059590816498, 0.0018027247861027718, -0.02371012233197689, -0.09181877970695496, 0.03694727271795273, 0.01989864744246006, -0.030165594071149826, -0.015494848601520061, 0.10143331438302994, 0.03842379152774811, -0.08714886754751205, -0.013529020361602306, 0.007305327337235212, -0.0015559231396764517, 0.025753211230039597, -0.036672573536634445, -0.0491027906537056, -0.012910943478345871, 0.019486596807837486, -0.0010049117263406515, 0.00844276137650013, 0.03880150616168976, -0.02396765537559986, 0.023795966058969498, -0.018971532583236694, 0.03656955808401108, 0.020070334896445274, -0.015357498079538345, 0.017958572134375572, -0.018216105177998543, 0.027590272948145866, -0.0013906733365729451, 0.0035367743112146854, 0.029135465621948242, -0.02934149093925953, -0.07197163999080658, 0.028689077123999596, 0.048690736293792725, -0.04724855720996857, -0.021426672115921974, -0.047351568937301636, 0.04408949613571167, -0.02285168319940567, 0.016954196617007256, -0.019229063764214516, 0.03308429196476936, 0.02187306061387062, 0.013717876747250557, 0.06616858392953873, -0.02542700432240963, -0.012378710322082043, 0.017177391797304153, 0.06568785756826401, 0.08680549263954163, -0.04961785301566124, 0.009563026018440723, 0.02838003821671009, -0.017889896407723427, -0.020345035940408707, 0.05744682997465134, -0.09346698969602585, -0.010833517648279667, 0.006258030422031879, 0.028191180899739265, 0.04542866349220276, -0.005077674984931946, -0.06548183411359787, 0.007206606678664684, -0.0030474632512778044, -0.020791426301002502, 0.02063690684735775, 0.026731833815574646, 0.027967987582087517, -0.0058202254585921764, -0.040243685245513916, -0.008520021103322506, -0.004324393346905708, 0.05686308816075325, 0.05696610361337662, -0.024843264371156693, -0.0033221642952412367, 0.0026912104804068804, 0.062219757586717606, -0.005627076607197523, 0.03845812752842903, -0.03873283043503761, -0.0021890229545533657, -0.01916038990020752, 0.020310699939727783, -0.012893774546682835, 0.004442428704351187, -0.00988923292607069, 0.062460120767354965, -0.0579962320625782, 0.03708462417125702, 0.014430382288992405, -0.008090800605714321, 0.011580360122025013, 0.027470091357827187, -0.06654629856348038, 0.04683650657534599, -0.02346975915133953, 0.0028285610023885965, -0.04680217057466507, -0.013460344634950161, -0.020087504759430885, -0.0096402857452631, 0.04275032877922058, -0.08756091445684433, -0.009683207608759403, -0.04927447810769081, -0.0003750311443582177, 0.023006202653050423, -0.007150808349251747, -0.041582852602005005, 0.0037342156283557415, -0.06376495212316513, -0.0076701645739376545, 0.07286442071199417, -0.05020159110426903, -0.015357498079538345, -0.0006030543590895832, 0.03550509363412857, 0.01620735414326191, 0.03917921707034111, 0.03239753842353821, -0.05033894255757332, -0.012018165551126003, 0.03282675892114639, -0.06094926595687866, -0.014190019108355045, 0.027092378586530685, 0.01646488532423973, 0.007408340461552143, 0.025152303278446198, -0.0031054080463945866, -0.07073548436164856, 0.07300177216529846, 0.03085234761238098, 0.007064964156597853, 0.02357277274131775, 0.06094926595687866, 0.022302281111478806, -0.03626052290201187, 0.0011943051358684897, 0.0009979369351640344, -0.060605891048908234, -0.06998005509376526, -0.07015174627304077, -0.010344206355512142, -0.023641448467969894, 0.026560144498944283, 0.020413711667060852, 0.005717212799936533, -0.046733494848012924, 0.06283783167600632, 0.008296825923025608, -0.06421133875846863, -0.022422462701797485, 0.026628820225596428, 0.07107885926961899, -0.04240695387125015, 0.05318896472454071, 0.002281305380165577, 0.009846311062574387, -0.05686308816075325, 0.0047729285433888435, -0.0202591922134161, 0.022302281111478806, -0.013880981132388115, -0.013975408859550953, 0.02185589261353016, 0.039625607430934906, -0.05737815424799919, -0.0005271360278129578, -0.11509968340396881, -0.032363202422857285, 0.005893193185329437, 0.004260010551661253, 0.01620735414326191, -0.0185251422226429, -0.062322769314050674, 0.057549841701984406, 0.010292699560523033, 0.0283972080796957, 0.0786331370472908, 0.012198437936604023, -0.026937859132885933, 0.02911829762160778, 0.016121510416269302, 0.01234437245875597, -0.03318730369210243, -0.0373593233525753, 0.03574545681476593, 0.07307044416666031, 0.03244904428720474, -0.0075714439153671265, -0.01893719471991062, -0.005828809924423695, -0.013966824859380722, 0.015469095669686794, 0.044398535043001175, 0.01381230540573597, -0.040346696972846985, -0.0036118878051638603, -0.028208350762724876, -0.06142999231815338, -0.020928775891661644, -0.010902192443609238, -0.023538434877991676, 0.0685378760099411, -0.0032942648977041245, 0.0018671078141778708, -0.006919029168784618, -0.028053831309080124, -0.0245513953268528, -0.004554026294499636, -0.06393663585186005, 0.012919527478516102, -0.05621067434549332, 0.040724411606788635, 0.004184896592050791, -0.0010607104049995542, 0.014035499654710293, -0.05703477934002876, -0.027693286538124084, -0.023984823375940323, 0.0026654573157429695, -0.005236486438661814, 0.008468514308333397, -0.0026654573157429695, 0.04041537269949913, -0.025718873366713524, 0.028826426714658737, -0.022456800565123558, 0.07904519140720367, -0.008927780203521252, 0.0005284773651510477, -0.06307819485664368, -0.037290651351213455, -0.034595146775245667, 0.031624943017959595, 0.01686835289001465, -0.027847805991768837, -0.046355780214071274, 0.054493796080350876, 0.005446804221719503, -0.017537936568260193, 0.016937028616666794, 0.024602901190519333, 0.012026749551296234, -0.00958019495010376, 0.049446165561676025, 0.029650529846549034, -0.00902220793068409, 0.039385244250297546, 0.032019827514886856, -0.06256313621997833, 0.004742883145809174, 0.005936115048825741, 0.032363202422857285, 0.05160943418741226, 0.031882476061582565, -0.005738673731684685, 0.07664155960083008, -0.008455637842416763, 0.050029903650283813, 0.011906567960977554, -0.02875775285065174, -0.021667035296559334, -0.004974661860615015, -0.03490418568253517, 0.015194394625723362, -0.005635661073029041, 0.02700653485953808, -0.017907066270709038, 0.017752546817064285, 0.02237095683813095, 0.0022212143521755934, 0.0857066884636879, 0.00869170855730772, -0.0012511768145486712, -0.009434259496629238, -0.005476849619299173, 0.007236652076244354, -0.027950817719101906, -0.010962283238768578, 0.04014066979289055, -0.006622867658734322, -0.05892334505915642, -0.03869849070906639, 0.04457022249698639, -0.025753211230039597, 0.04875941202044487, 0.008404131047427654, 0.020842932164669037, 0.07732830941677094, 0.022061917930841446 ]
39,359
pyspark.sql.dataframe
colRegex
Selects column based on the column name specified as a regex and returns it as :class:`Column`. .. versionadded:: 2.3.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Parameters ---------- colName : str string, column name specified as a regex. Returns ------- :class:`Column` Examples -------- >>> df = spark.createDataFrame([("a", 1), ("b", 2), ("c", 3)], ["Col1", "Col2"]) >>> df.select(df.colRegex("`(Col1)?+.+`")).show() +----+ |Col2| +----+ | 1| | 2| | 3| +----+
def colRegex(self, colName: str) -> Column: """ Selects column based on the column name specified as a regex and returns it as :class:`Column`. .. versionadded:: 2.3.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Parameters ---------- colName : str string, column name specified as a regex. Returns ------- :class:`Column` Examples -------- >>> df = spark.createDataFrame([("a", 1), ("b", 2), ("c", 3)], ["Col1", "Col2"]) >>> df.select(df.colRegex("`(Col1)?+.+`")).show() +----+ |Col2| +----+ | 1| | 2| | 3| +----+ """ if not isinstance(colName, str): raise PySparkTypeError( error_class="NOT_STR", message_parameters={"arg_name": "colName", "arg_type": type(colName).__name__}, ) jc = self._jdf.colRegex(colName) return Column(jc)
(self, colName: str) -> pyspark.sql.column.Column
[ 0.06250575929880142, -0.021934689953923225, 0.06917447596788406, 0.06985937058925629, 0.031451135873794556, -0.018528234213590622, 0.034803520888090134, 0.04087746515870094, 0.01615813374519348, -0.0094533646479249, 0.03404653072357178, 0.017437808215618134, -0.023358551785349846, 0.005632366985082626, 0.029810991138219833, -0.026584772393107414, 0.08737828582525253, -0.001201947103254497, 0.03889487311244011, 0.050357867032289505, -0.008498115465044975, 0.01253539603203535, 0.05435910075902939, 0.029396450147032738, -0.032640691846609116, 0.021790500730276108, -0.009318187832832336, 0.03932743892073631, 0.02020442672073841, -0.018600327894091606, -0.02379111759364605, -0.06355112046003342, -0.08557593077421188, 0.010264425538480282, -0.0554405152797699, 0.006691251881420612, -0.00621813302859664, -0.019681742414832115, 0.033956412225961685, -0.09055043756961823, 0.02105153538286686, 0.025989994406700134, 0.006236156914383173, -0.05446724221110344, -0.04127398505806923, -0.022024808451533318, -0.010967344976961613, -0.030874382704496384, -0.0501415841281414, 0.002766618737950921, 0.011598169803619385, 0.004017004277557135, 0.005213318858295679, 0.0007598063093610108, -0.017536938190460205, -0.029774945229291916, 0.007511324714869261, 0.09826453030109406, 0.042391445487737656, 0.04386937990784645, -0.03220812603831291, -0.04743804782629013, -0.05576493963599205, -0.005046600941568613, -0.016978206112980843, 0.029648778960108757, 0.04599616304039955, 0.0005595756811089814, -0.01046268455684185, -0.02094339393079281, -0.05954989045858383, 0.011913582682609558, 0.007506818510591984, 0.03462328761816025, 0.0053935544565320015, -0.04112979769706726, -0.03619133681058884, -0.027684209868311882, 0.03449711948633194, 0.023592859506607056, 0.0320819616317749, -0.028621435165405273, -0.011886547319591045, -0.029792968183755875, 0.032658714801073074, -0.03720065578818321, 0.008398985490202904, -0.01331942155957222, -0.024710319936275482, 0.03792160004377365, -0.02153817191720009, -0.010021107271313667, -0.007592430803924799, 0.087955042719841, -0.015419167466461658, -0.05471957102417946, 0.03997628763318062, 0.05104276165366173, 0.05122299864888191, 0.023160293698310852, -0.011255722492933273, 0.04686129465699196, -0.012868831865489483, -0.0032104491256177425, 0.017996538430452347, 0.0002336024190299213, -0.04657291620969772, -0.004789764992892742, -0.04826713353395462, -0.016581688076257706, -0.017753221094608307, -0.0022033818531781435, -0.048807840794324875, -0.012850808911025524, 0.01830293983221054, 0.03532620519399643, -0.04264377802610397, -0.052376504987478256, -0.02772025763988495, 0.029919132590293884, 0.07468969374895096, 0.015085731633007526, 0.010516755282878876, 0.0022157731000334024, 0.011102521792054176, 0.038101837038993835, -0.015554344281554222, -0.04556359723210335, 0.00974174216389656, 0.10273437201976776, 0.03628145530819893, 0.04372519254684448, -0.007042711600661278, -0.01700524240732193, -0.043941475450992584, 0.08189912140369415, 0.0641639232635498, -0.008989257737994194, -0.015022649429738522, 0.008732421323657036, -0.011210663244128227, -0.007128323428332806, 0.010778097435832024, -0.017870374023914337, -0.020240474492311478, -0.017401760444045067, 0.005902720615267754, 0.039904192090034485, 0.012210971675813198, 0.02388123609125614, -0.04505893588066101, -0.015193873085081577, 0.05208813026547432, -0.033938389271497726, 0.03770531713962555, 0.0064569455571472645, -0.009885930456221104, 0.04278796538710594, 0.02519695647060871, 0.03179358318448067, 0.02950459159910679, -0.0023340529296547174, -0.06708374619483948, 0.0031631372403353453, 0.02863945998251438, -0.009408305399119854, 0.037885554134845734, 0.03532620519399643, -0.013310409151017666, 0.019573600962758064, 0.07577110826969147, 0.048699699342250824, -0.013959257863461971, 0.05626959726214409, -0.040264666080474854, 0.08485499024391174, -0.027756303548812866, 0.056666117161512375, 0.04855550825595856, -0.015536321327090263, 0.0749780684709549, 0.010669955983757973, -0.029774945229291916, 0.0378134585916996, 0.06686746329069138, 0.007398677058517933, -0.012283066287636757, 0.013121161609888077, -0.0064749689772725105, 0.030604029074311256, -0.0050195655785501, -0.05021367967128754, 0.017897408455610275, 0.006015367805957794, -0.043689142912626266, -0.023214364424347878, 0.0067948875948786736, 0.03723670542240143, -0.01928522437810898, -0.014103447087109089, 0.013986293226480484, 0.037633221596479416, 0.02033059112727642, -0.005902720615267754, 0.010093201883137226, -0.09163185209035873, 0.031685441732406616, -0.003884080331772566, -0.054647475481033325, -0.0756269171833992, 0.020168378949165344, -0.003933644853532314, 0.0258097592741251, 0.022024808451533318, -0.014049376361072063, 0.019321272149682045, -0.054034676402807236, -0.00986790657043457, 0.04639267921447754, -0.009669647552073002, 0.046897340565919876, 0.02876562438905239, 0.006668722257018089, 0.05158346891403198, 0.07454550266265869, -0.04509498178958893, 0.012850808911025524, -0.02662081830203533, 0.01171532366424799, -0.04448218271136284, -0.04044489935040474, -0.0837014764547348, 0.05457538366317749, 0.0005556329851970077, -0.059405699372291565, 0.004979012534022331, 0.02211492508649826, 0.019573600962758064, 0.07526644319295883, -0.07234662771224976, -0.04614035040140152, 0.018618352711200714, -0.010264425538480282, -0.007245476823300123, 0.04603220894932747, 0.003985462710261345, -0.05706263706088066, 0.03219010308384895, -0.016086040064692497, 0.045239172875881195, -0.0015015890821814537, 0.020186403766274452, 0.03166741877794266, 0.00027556356508284807, -0.000593088218010962, -0.01844712905585766, -0.06513720005750656, 0.075194351375103, -0.0016457776073366404, 0.03893091902136803, 0.010678967460989952, -0.02117769978940487, 0.03397443890571594, -0.04686129465699196, -0.022385278716683388, -0.051907893270254135, 0.0183209627866745, 0.015500273555517197, 0.02878364734351635, 0.022096902132034302, 0.01510375551879406, 0.012931915000081062, 0.0186904463917017, -0.001201947103254497, 0.031090665608644485, -0.02546731010079384, -0.0837014764547348, -0.018375033512711525, 0.029648778960108757, -0.02496265061199665, 0.03332559019327164, -0.001486944849602878, -0.00392238050699234, 0.03961581736803055, 0.011030427180230618, 0.042283304035663605, 0.04516707733273506, -0.050610195845365524, -0.06975123286247253, -0.0035055852495133877, -0.0579998604953289, -0.04055304080247879, 0.009363247081637383, 0.021664336323738098, -0.03896696865558624, 0.012697608210146427, 0.03635355085134506, -0.00862878654152155, -0.0058801909908652306, -0.028026657178997993, 0.01273365505039692, -0.0036903268191963434, -0.018528234213590622, 0.03379420191049576, -0.04866364970803261, 0.03103659488260746, -0.130851149559021, -0.0016671805642545223, -0.005452131386846304, 0.007565395440906286, 0.020835252478718758, -0.03148718550801277, -0.05684635415673256, 0.010417626239359379, -0.07706880569458008, 0.046320587396621704, -0.013355468399822712, 0.02258353866636753, -0.020168378949165344, -0.014905495569109917, 0.045707784593105316, -0.04848341643810272, -0.029937157407402992, -0.015545332804322243, -0.005497190169990063, 0.022925985977053642, -0.007186900358647108, -0.011580146849155426, -0.028224917128682137, 0.002644959604367614, 0.029450520873069763, 0.030171463266015053, 0.023845188319683075, -0.022871915251016617, 0.036101218312978745, -0.07418502867221832, -0.036569833755493164, -0.031469158828258514, 0.007299547549337149, 0.05980221927165985, 0.0238992590457201, -0.04462637007236481, 0.023340528830885887, -0.05580098554491997, 0.015995921567082405, 0.005348495673388243, 0.05367420241236687, -0.013815069571137428, 0.010886238887906075, -0.03577679395675659, 0.055476561188697815, -0.08961321413516998, -0.04603220894932747, -0.0475822351872921, 0.0027733775787055492, 0.024187637493014336, -0.05277302488684654, 0.025305097922682762, 0.004213010426610708, -0.053566060960292816, 0.060955729335546494, -0.05234045907855034, 0.0021324141416698694, -0.08745038509368896, -0.00561434356495738, 0.02698129042983055, -0.026566747575998306, 0.001653662882745266, -0.02772025763988495, -0.009561506099998951, 0.03602912649512291, 0.011021415702998638, 0.027684209868311882, -0.05158346891403198, -0.03766927123069763, -0.06614651530981064, -0.020871298387646675, 0.010859203524887562, 0.019086964428424835, -0.02617022953927517, 0.01522991992533207, -0.03137904405593872, -0.022637609392404556, 0.0049474709667265415, -0.015274979174137115, 0.03411862626671791, -0.021916666999459267, -0.018600327894091606, -0.05562074854969978, 0.005091659724712372, -0.03219010308384895, 0.031000547111034393, -0.008552186191082, -0.018023574724793434, -0.015121778473258018, -0.014274670742452145, 0.005343989934772253, 0.039796050637960434, -0.01568952202796936, 0.06484881788492203, -0.039904192090034485, 0.002076090546324849, -0.03127090260386467, -0.023484718054533005, 0.033001165837049484, 0.06766049563884735, 0.05731496587395668, 0.022205043584108353, -0.028621435165405273, 0.04267982393503189, -0.019050918519496918, -0.027630139142274857, -0.020312568172812462, -0.024926602840423584, -0.03709251433610916, 0.0006246294942684472, 0.04556359723210335, -0.03766927123069763, -0.019898025318980217, 0.0200782623142004, -0.03130694851279259, -0.03671402111649513, -0.012886855751276016, 0.08081770688295364, 0.0017696897266432643, 0.02699931338429451, 0.0165186058729887, -0.008718904107809067, -0.01183247659355402, 0.0028229423332959414, -0.12025328725576401, 0.010129248723387718, -0.068417489528656, -0.01421158853918314, 0.025971971452236176, -0.007484289351850748, 0.018474163487553596, -0.05562074854969978, -0.03577679395675659, 0.012174924835562706, 0.046789199113845825, 0.028369106352329254, 0.008313373662531376, 0.004129651468247175, -0.043581001460552216, -0.013472621329128742, 0.0025593475438654423, 0.021484101191163063, -0.05767543613910675, -0.003552897134795785, -0.0038885860703885555, 0.07342804223299026, 0.010787108913064003, 0.025755688548088074, -0.0007598063093610108, 0.0057360026985406876, -0.05100671574473381, -0.011273745447397232, 0.05389048531651497, -0.010498732328414917, 0.01213887706398964, 0.03581284359097481, 0.029937157407402992, -0.03188370168209076, -0.048122942447662354, 0.004740200005471706, -0.0073671359568834305, -0.021790500730276108, -0.027269667014479637, 0.002660730155184865, -0.004354946315288544, -0.030748218297958374, -0.01331942155957222, -0.07959210127592087, 0.06672327220439911, 0.0005347932456061244, -0.05936965346336365, -0.0014385065296664834, 0.027503974735736847, 0.018870681524276733, -0.04790665954351425, 0.014527000486850739, -0.0230521522462368, -0.02901795506477356, 0.05482771247625351, 0.0014756801538169384, 0.016077028587460518, -0.03601109981536865, -0.04830317944288254, -0.03280290588736534, -0.053818393498659134, 0.08024094998836517, 0.027161525562405586, 0.004413522779941559, -0.0025503358338028193, -0.02579173445701599, 0.02213294990360737, -0.013580762781202793, -0.03867859020829201, 0.037164609879255295, -0.0159328393638134, 0.027918515726923943, -0.0873061940073967, 0.0013540210202336311, -0.030531935393810272, -0.05540446564555168, 0.03127090260386467, -0.0017392749432474375, -0.0238992590457201, -0.06484881788492203, -0.018492186442017555, 0.04412170872092247, -0.07721298933029175, 0.004264828283339739, 0.022277137264609337, 0.04819503799080849, 0.06823725253343582, 0.011589158326387405, 0.035037826746702194, 0.005091659724712372, -0.05753124877810478, 0.009912965819239616, -0.028495270758867264, -0.02355681173503399, 0.009498423896729946, 0.0832689106464386, 0.005925250239670277, -0.015067707747220993, 0.015743592754006386, -0.003604714758694172, -0.028711553663015366, 0.021015487611293793, -0.005907226353883743, 0.016626747325062752, 0.027179550379514694, 0.011625205166637897, -0.022547490894794464, 0.026801055297255516, -0.06708374619483948, 0.002991913352161646, -0.03365001454949379, 0.001012699562124908, 0.04502288997173309, 0.03593900799751282, -0.08759456872940063, 0.028116775676608086, 0.005105177406221628, 0.02213294990360737, 0.006885005161166191, 0.013562739826738834, -0.045743830502033234, 0.027179550379514694, 0.034407004714012146, 0.034767474979162216, 0.03665994852781296, 0.008187208324670792, -0.05017763003706932, 0.019537555053830147, -0.04960087686777115, 0.0015635450836271048, -0.008664833381772041, -0.0012717884965240955, 0.10222971439361572, 0.028333058580756187, -0.050826478749513626, 0.0339924618601799, -0.009056845679879189, 0.00250978278927505, 0.05223231762647629, -0.02676500752568245, 0.02472834475338459, 0.03128892555832863, 0.07396874576807022, -0.032640691846609116, -0.012102830223739147, -0.06232551857829094, 0.02415158972144127, 0.055728890001773834, -0.04873574525117874, 0.0010335393017157912, -0.019717790186405182, 0.04412170872092247, -0.032658714801073074, 0.036912281066179276, -0.08218749612569809, -0.029792968183755875, -0.010778097435832024, 0.00188008404802531, -0.024331824854016304, -0.02186259627342224, 0.06758840382099152, 0.0014148505870252848, 0.03271278738975525, 0.031072642654180527, -0.0067948875948786736, 0.04531126469373703, -0.03698437288403511, 0.04459032416343689, 0.04700548201799393, -0.0028049186803400517, -0.07461759448051453, 0.022277137264609337, 0.024890556931495667, -0.012093818746507168, 0.012003700248897076, 0.036209359765052795, -0.0008713271818123758, 0.025287074968218803, -0.016599711030721664, -0.014752295799553394, -0.017744209617376328, 0.03343373164534569, -0.0100391311571002, 0.05688240006566048, 0.01112054567784071, 0.023628905415534973, -0.04383333399891853, -0.013355468399822712, 0.0015804421855136752, -0.010534779168665409, -0.015293003059923649, 0.04718571901321411, 0.0715896338224411, -0.0042738402262330055, 0.03792160004377365, 0.014707236550748348, 0.013121161609888077, -0.006164062302559614, -0.02689117193222046, -0.006353309843689203, 0.012256030924618244, -0.04516707733273506, 0.0209253691136837, -0.025971971452236176, 0.02982901595532894, -0.002025399124249816, -0.04527521878480911, -0.052628837525844574, -0.034298863261938095, 0.002347570611163974, -0.031451135873794556, 0.022205043584108353, 0.03896696865558624, -0.04516707733273506, -0.004361704923212528, 0.025989994406700134, -0.02152014710009098, -0.03896696865558624, 0.03774136304855347, -0.05753124877810478, -0.016194181516766548, -0.004152181092649698, 0.030117392539978027, 0.03777741268277168, 0.007186900358647108, -0.026458606123924255, -0.08658525347709656, 0.013950246386229992, -0.014085423201322556, 0.004300875589251518, 0.010210354812443256, -0.04931249842047691, 0.03889487311244011, -0.004717670381069183, -0.0330372117459774, -0.048339225351810455, 0.0435449555516243, -0.05147532746195793, -0.017176466062664986, 0.06445229798555374, 0.002190990839153528, -0.008367444388568401, -0.01141793467104435, -0.07843859493732452, 0.02710745483636856, -0.018600327894091606, 0.01491450797766447, -0.06228947266936302, 0.02269168011844158, 0.033469777554273605, 0.0036723031662404537, 0.015311026014387608, -0.018996847793459892, 0.07894325256347656, -0.008106102235615253, 0.0075383600778877735, -0.005141224712133408, -0.028206894174218178, 0.027684209868311882, -0.04040885344147682, 0.008286338299512863, 0.00418822793290019, -0.008646809495985508, -0.00070291938027367, -0.043581001460552216, 0.0018913488602265716, 0.04379728436470032, 0.021015487611293793, 0.020042214542627335, 0.050826478749513626, -0.034425027668476105, 0.05612540990114212, -0.015653474256396294, 0.05446724221110344, 0.02544928714632988, 0.02103351056575775, 0.055368419736623764, 0.01781630329787731, 0.018582304939627647, -0.055116090923547745, -0.028134798631072044, 0.005573790520429611, 0.00975976511836052, 0.01723053678870201, 0.011336828581988811, 0.029937157407402992, -0.011363863945007324, -0.021916666999459267, 0.035993076860904694, 0.0001232080248882994, 0.042751919478178024, -0.024061471223831177, 0.004442811012268066, 0.02272772789001465, -0.021610265597701073, 0.009471388533711433, -0.06081153824925423, -0.04019257053732872, 0.0356866754591465, 0.02377309463918209, -0.02224109135568142, 0.04231935366988182, 0.05053810402750969, 0.034551192075014114, -0.00867835059762001, -0.06264994293451309, -0.021087581291794777, -0.015410155989229679, -0.024926602840423584, -0.026080111041665077, -0.07148149609565735, 0.04743804782629013, 0.029054000973701477, -0.01948348432779312, -0.010895250365138054, 0.03456921502947807, -0.01856428198516369, 0.06063130497932434, -0.014752295799553394, 0.022439349442720413, -0.021826548501849174, -0.015680508688092232, -0.032027892768383026, 0.020186403766274452, -0.06419996917247772, -0.014121470041573048, -0.0018293927423655987, 0.01784333772957325, -0.017987526953220367, -0.021141652017831802, 0.009435340762138367, 0.04815899208188057, -0.030712170526385307, -0.023682976141572, 0.03127090260386467, -0.022637609392404556, 0.028963884338736534, 0.047041527926921844 ]
39,360
pyspark.sql.dataframe
collect
Returns all the records as a list of :class:`Row`. .. versionadded:: 1.3.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Returns ------- list List of rows. Examples -------- >>> df = spark.createDataFrame( ... [(14, "Tom"), (23, "Alice"), (16, "Bob")], ["age", "name"]) >>> df.collect() [Row(age=14, name='Tom'), Row(age=23, name='Alice'), Row(age=16, name='Bob')]
def collect(self) -> List[Row]: """Returns all the records as a list of :class:`Row`. .. versionadded:: 1.3.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Returns ------- list List of rows. Examples -------- >>> df = spark.createDataFrame( ... [(14, "Tom"), (23, "Alice"), (16, "Bob")], ["age", "name"]) >>> df.collect() [Row(age=14, name='Tom'), Row(age=23, name='Alice'), Row(age=16, name='Bob')] """ with SCCallSiteSync(self._sc): sock_info = self._jdf.collectToPython() return list(_load_from_socket(sock_info, BatchedSerializer(CPickleSerializer())))
(self) -> List[pyspark.sql.types.Row]
[ 0.04310555383563042, -0.053641676902770996, -0.017557237297296524, 0.017210185527801514, 0.01034034974873066, 0.025735190138220787, 0.0028186796698719263, 0.017423756420612335, 0.06186412274837494, 0.0033926491159945726, -0.02742595225572586, -0.0165872722864151, 0.0051479279063642025, 0.023546097800135612, 0.019577253609895706, 0.011221325956285, -0.03573738783597946, -0.02235366404056549, 0.030789680778980255, 0.04595315456390381, -0.011399300768971443, -0.018180150538682938, 0.035950955003499985, 0.038798555731773376, -0.04061390087008476, 0.04410221427679062, 0.022175688296556473, -0.024471567943692207, 0.025005491450428963, 0.04032914340496063, -0.010189070366322994, 0.010625109076499939, -0.05873176082968712, -0.039368078112602234, -0.03741035237908363, 0.025503821671009064, -0.006024454720318317, -0.07688521593809128, 0.0702645406126976, -0.0014315866865217686, -0.025788582861423492, 0.010278058238327503, 0.034989893436431885, -0.04495649412274361, -0.0175483375787735, 0.005076737608760595, 0.0074304575100541115, -0.015377042815089226, 0.03563060238957405, -0.08898751437664032, 0.001330363331362605, 0.07261381298303604, -0.05406881496310234, 0.02888534776866436, -0.0019810847006738186, -0.04616672545671463, -0.04645148292183876, 0.01815345324575901, -0.004667395260185003, 0.011666263453662395, 0.007136798929423094, -0.02760392799973488, 0.006380404811352491, 0.04125461354851723, 0.0829363688826561, -0.017290273681282997, -0.015350346453487873, -0.025041086599230766, -0.02283419668674469, -0.021534979343414307, -0.02155277691781521, 0.008671833202242851, -0.00597996124997735, 0.06755932420492172, -0.05972842127084732, -0.018758568912744522, 0.028742967173457146, 0.005868726875633001, -0.014611749909818172, -0.07090525329113007, 0.051755141466856, 0.02851160056889057, -0.02965063974261284, 0.007937686517834663, 0.01762842759490013, 0.005828682333230972, 0.04068509116768837, 0.03296097740530968, -0.09112321585416794, 0.04420899972319603, 0.009397082030773163, 0.04438697174191475, -0.0468430295586586, 0.03155497461557388, 0.0031568321865051985, -0.04274960234761238, -0.07154596596956253, 0.0036996561102569103, -0.04314114898443222, 0.045027684420347214, -0.0054015424102544785, 0.0410054475069046, -0.02733696438372135, 0.00276973657310009, -0.019684039056301117, -0.036840833723545074, 0.007639578077942133, -0.04331912472844124, 0.023172348737716675, 0.07272060215473175, 0.00912122055888176, 0.09325891733169556, 0.01704110950231552, -0.005214668344706297, -0.020947661250829697, -0.004618451930582523, 0.00678084883838892, -0.018420416861772537, -0.07987519353628159, -0.010082285851240158, 0.026233520358800888, 0.05132799968123436, 0.03965283930301666, -0.020947661250829697, -0.05228906497359276, 0.06944585591554642, 0.021161232143640518, -0.057236772030591965, 0.019755229353904724, 0.016204627230763435, 0.05730796232819557, -0.03189312666654587, 0.007986629381775856, 0.005721897352486849, 0.014433775097131729, -0.02986421063542366, 0.07175953686237335, -0.017770806327462196, 0.05253823101520538, 0.008707428351044655, -0.001215791911818087, -0.0104827294126153, 0.058696165680885315, 0.053712863475084305, 0.01307226624339819, -0.05122121423482895, 0.03054051660001278, 0.005672954022884369, -0.05438917130231857, -0.012769708409905434, -0.004912110976874828, -0.010767489671707153, 0.0025205714628100395, -0.038691774010658264, -0.04303436353802681, 0.03337031975388527, -0.011888732202351093, -0.033316925168037415, 0.020022191107273102, -0.09895411878824234, -0.06179293245077133, 0.015216865576803684, -0.011328110471367836, 0.027461547404527664, -0.05915890261530876, 0.05296536907553673, 0.006286968011409044, -0.007679622620344162, -0.07382404059171677, -0.006691861432045698, 0.025646202266216278, 0.004787528421729803, 0.06268280744552612, -0.005463833454996347, -0.031181225553154945, 0.09945245087146759, 0.022300271317362785, 0.05086526274681091, 0.07168834656476974, 0.007243583910167217, -0.005695200990885496, -0.0643557757139206, -0.013205747120082378, 0.0084226680919528, 0.04741254821419716, -0.0014783050864934921, -0.053819648921489716, -0.044742923229932785, 0.0761733129620552, -0.013446013443171978, -0.02128581330180168, -0.019078923389315605, -0.025236859917640686, 0.0019110068678855896, -0.03239145502448082, -0.04623791202902794, -0.04371066763997078, 0.055101070553064346, -0.124867282807827, 0.030469326302409172, 0.01058951485902071, -0.006500537972897291, 0.0316973552107811, -0.06086746230721474, -0.0053926436230540276, 0.0009304757113568485, -0.057628314942121506, -0.027479344978928566, 0.015875373035669327, -0.0205027237534523, 0.03232026472687721, 0.02233586646616459, -0.006313664373010397, 0.0006090083043090999, 0.04848039895296097, -0.04125461354851723, -0.018189048394560814, -0.030771883204579353, 0.03128800913691521, -0.05243144556879997, 0.03203550726175308, -0.03278300166130066, -0.0907672643661499, -0.014718535356223583, -0.019951000809669495, -0.031110035255551338, 0.002005556132644415, -0.060653891414403915, 0.02254943735897541, -0.06083186715841293, -0.010571717284619808, -0.054994285106658936, 0.018420416861772537, -0.04577517881989479, -0.0018631761195138097, 0.06983740627765656, -0.011870934627950191, 0.05969282612204552, 0.045027684420347214, -0.010269159451127052, -0.025930961593985558, 0.037801895290613174, 0.011114540509879589, -0.03363728150725365, -0.029917603358626366, 0.01567070186138153, -0.006415999960154295, 0.07289857417345047, 0.0030389237217605114, 0.009192410856485367, 0.005699650384485722, -0.024151211604475975, 0.04929908365011215, -0.0165694747120142, -0.0003512226103339344, -0.06236245110630989, 0.009655145928263664, 0.017833098769187927, -0.012894291430711746, 0.011532782576978207, 0.04741254821419716, -0.0022480471525341272, 0.012333669699728489, 0.05844699963927269, -0.023884249851107597, -0.0036974314134567976, -0.0849296823143959, 0.01693432405591011, 0.0017207961063832045, 0.07136798650026321, 0.037339162081480026, 0.01357059646397829, -0.024453770369291306, -0.033619482070207596, 0.014380382373929024, -0.05218227952718735, -0.038513798266649246, 0.01482531987130642, -0.033316925168037415, 0.015243561938405037, -0.05339251086115837, 0.010696299374103546, -0.006678513251245022, -0.013285836204886436, -0.03593315929174423, -0.049619439989328384, -0.016266917809844017, 0.010456033051013947, -0.06787967681884766, -0.012823101133108139, -0.001043378608301282, 0.002820904366672039, -0.0032502689864486456, -0.05122121423482895, 0.021018851548433304, 0.024738529697060585, 0.007706318981945515, -0.008671833202242851, -0.009913209825754166, 0.027265775948762894, 0.020858673378825188, -0.018420416861772537, 0.04378185793757439, 0.09026893973350525, -0.02361728623509407, -0.06029793992638588, -0.03408221900463104, -0.01785089634358883, -0.04274960234761238, 0.017726313322782516, -0.0165872722864151, 0.020912066102027893, 0.0316973552107811, -0.029917603358626366, -0.06585076451301575, -0.021428193897008896, -0.05093645304441452, 0.053997624665498734, -0.0027652871794998646, -0.02037814073264599, -0.008800865150988102, -0.008791966363787651, 0.034989893436431885, 0.002353719901293516, -0.011292516253888607, 0.048266828060150146, 0.02810225822031498, 0.008169054053723812, -0.005058940500020981, 0.0018231316935271025, 0.029437070712447166, -0.002467178972437978, 0.018989935517311096, 0.042393654584884644, -0.01483421865850687, 0.012476050294935703, 0.009254701435565948, 0.009681841358542442, -0.0124404551461339, -0.009699638932943344, -0.019541658461093903, -0.03580857813358307, 0.026286913082003593, 0.001436036080121994, -0.01034034974873066, 0.023474907502532005, 0.002952160779386759, 0.009054480120539665, 0.003399323206394911, -0.013784166425466537, 0.08379064500331879, -0.028547195717692375, -0.03990200161933899, 0.0711900144815445, 0.0013047794345766306, 0.027568332850933075, -0.025841975584626198, -0.002627356443554163, -0.017165692523121834, 0.01107004750519991, 0.04947705939412117, -0.018073365092277527, 0.00913011934608221, -0.04627350717782974, 0.031181225553154945, 0.0526806116104126, -0.021997714415192604, -0.0243825800716877, -0.00032619485864415765, 0.022869791835546494, -0.02302997000515461, 0.029704032465815544, 0.001420463202521205, -0.017806401476264, 0.0056106629781425, -0.011897630989551544, 0.012547239661216736, 0.008186851628124714, -0.028814157471060753, 0.046593863517045975, -0.01371297612786293, -0.03929688781499863, 0.037339162081480026, -0.053143344819545746, 0.038869746029376984, 0.024151211604475975, -0.034705132246017456, -0.06528124213218689, -0.041966512799263, -0.020271357148885727, -0.022656220942735672, 0.01356169767677784, -0.025735190138220787, -0.03335252031683922, -0.030326945707201958, -0.04203770309686661, 0.02703440748155117, 0.05161276087164879, 0.06951704621315002, -0.018972137942910194, -0.05043812468647957, -0.0024204603396356106, -0.046202316880226135, 0.022122297435998917, -0.06674063950777054, 0.01444267388433218, 0.008502757176756859, -0.08421778678894043, -0.007652926258742809, -0.04595315456390381, 0.10714097321033478, 0.0044849710538983345, -0.0023581692948937416, 0.02762172557413578, 0.03287198767066002, 0.05716558173298836, -0.00622022757306695, 0.04321233928203583, 0.03915450721979141, 0.06278958916664124, -0.012547239661216736, 0.0040378086268901825, -0.028333624824881554, 0.06823562830686569, -0.00016003848577383906, -0.0008609542273916304, 0.003864282974973321, 0.059870801866054535, 0.0004930464783683419, -0.02459614910185337, 0.007759711239486933, -0.015377042815089226, -0.04901432245969772, 0.0030478225089609623, -0.010820882394909859, 0.017939884215593338, 0.02714119292795658, -0.008355927653610706, -0.026998812332749367, 0.014718535356223583, 0.048658374696969986, 0.022798601537942886, 0.016987716779112816, -0.053428106009960175, 0.06556600332260132, -0.009343689307570457, -0.06880515068769455, 0.016640665009617805, -0.05631130188703537, -0.010473830625414848, 0.01982641965150833, -0.026073342189192772, 0.07165274769067764, -0.013784166425466537, -0.07062049210071564, 0.05648927390575409, 0.03103884495794773, -0.0682712197303772, -0.03434918075799942, -0.006847589276731014, 0.07539022713899612, -0.052253469824790955, 0.04136139899492264, -0.04691421985626221, 0.01147049106657505, -0.021250218152999878, -0.07645807415246964, 0.010420437902212143, -0.01584867760539055, -0.011532782576978207, 0.05591975525021553, 0.0131790516898036, -0.01654277928173542, -0.0966048464179039, 0.07987519353628159, 0.03915450721979141, -0.05086526274681091, 0.0003414895909372717, 0.00936148688197136, -0.0036373648326843977, -0.0946827158331871, -0.034117814153432846, 0.015946563333272934, -0.01518127042800188, 0.0035817476455122232, -0.0036084437742829323, 0.03189312666654587, -0.05047371983528137, 0.032444849610328674, -0.01728137582540512, -0.021712953224778175, 0.08208208531141281, -0.008720776997506618, 0.005699650384485722, 0.02509447932243347, 0.028155650943517685, 0.03748154267668724, 0.03737475723028183, 0.01331253256648779, 0.061828527599573135, 0.005628460552543402, -0.0009338127565570176, -0.05296536907553673, 0.03593315929174423, -0.00734147010371089, -0.02381305955350399, 0.08428897708654404, 0.02352830022573471, 0.0012013314990326762, -0.02283419668674469, -0.02157057449221611, 0.05232466012239456, -0.03356609120965004, 0.03593315929174423, -0.03345930576324463, -0.02740815468132496, -0.010900970548391342, 0.04449375718832016, -0.015608410350978374, 0.031110035255551338, 0.003846485400572419, 0.005744144320487976, -0.003857608884572983, 0.05004657804965973, -0.03737475723028183, 0.03246264532208443, -0.00754169188439846, 0.0004115672782063484, 0.01406002789735794, 0.06656266003847122, -0.02577078528702259, 0.022175688296556473, -0.011977720074355602, -0.03187532722949982, -0.01649828627705574, 0.017272476106882095, -0.0036907573230564594, 0.030914263799786568, -0.03288978710770607, -0.01882975921034813, -0.01083867996931076, 0.01591096818447113, -0.0056062135845422745, 0.02829802967607975, -0.05844699963927269, -0.04125461354851723, 0.0050055477768182755, -0.004974402021616697, 0.0370544008910656, -0.03922569751739502, 0.031056642532348633, 0.02545042894780636, 0.01884755678474903, -0.015537220053374767, 0.026589469984173775, -0.036164525896310806, 0.03698321059346199, -0.011764150112867355, -0.041219018399715424, -0.04609553515911102, 0.023012172430753708, -0.06140138581395149, -0.003911001142114401, -0.03787308558821678, -0.020627306774258614, 0.03491870313882828, 0.03926129266619682, 0.056631654500961304, -0.03602214530110359, -0.06503207981586456, 0.03676964342594147, 0.028244636952877045, 0.045810773968696594, -0.026482684537768364, 0.038300227373838425, -0.009343689307570457, 0.01317015290260315, 0.05520785599946976, -0.033316925168037415, -0.05310774967074394, 0.001860951422713697, 0.005637359339743853, 0.0028164549730718136, -0.008827561512589455, -0.041824132204055786, 0.015065586194396019, -0.03765951842069626, 0.0036507127806544304, 0.012031111866235733, 0.01517237164080143, 0.05495868995785713, 0.004912110976874828, -0.006678513251245022, 0.006954374257475138, 0.015991056337952614, -0.00771076837554574, -0.03025575540959835, 0.03822903707623482, -0.03436698019504547, 0.019381480291485786, -0.042998768389225006, 0.0243825800716877, 0.027942080050706863, -0.06396422535181046, -0.010527223348617554, -0.06492529064416885, -0.05940806493163109, 0.02731916680932045, 0.005254712887108326, 0.08008876442909241, -0.03961724415421486, 0.012262479402124882, -0.0010339237051084638, -0.037339162081480026, 0.018180150538682938, -0.010331450961530209, -0.04007997736334801, -0.018509402871131897, 0.037232376635074615, -0.02409781888127327, 0.02616233006119728, -0.007626230362802744, 0.044529352337121964, 0.011755251325666904, -0.03589756414294243, 0.00860954262316227, -0.07880734652280807, 0.02762172557413578, -0.0037686212453991175, 0.04919229820370674, -0.0004282524168957025, -0.07944805175065994, 0.05182632803916931, 0.02781749702990055, 0.02361728623509407, -0.026233520358800888, -0.04488530382514, -0.03812225162982941, 0.03310335800051689, -0.023065565153956413, 0.021641764789819717, 0.025717392563819885, -0.038015466183423996, -0.05339251086115837, 0.012235783971846104, -0.022869791835546494, -0.017806401476264, -0.02206890471279621, 0.0014404854737222195, -0.0025561663787811995, -0.01297437958419323, 0.009290296584367752, -0.004827572964131832, 0.04335471987724304, 0.004867617040872574, 0.09147916734218597, -0.03454495221376419, 0.0012313647894188762, 0.013659583404660225, 0.01518127042800188, -0.025308050215244293, 0.006398202385753393, 0.0032591677736490965, -0.035666197538375854, 0.023083362728357315, -0.0009160152403637767, -0.03287198767066002, 0.0868518128991127, -0.011274718679487705, 0.02851160056889057, -0.002382640726864338, 0.028760764747858047, 0.008800865150988102, 0.01932808943092823, 0.01819794625043869, 0.008845359086990356, -0.05520785599946976, -0.05296536907553673, 0.018491605296730995, -0.019470468163490295, -0.011132338084280491, 0.004340365994721651, -0.015884270891547203, 0.029454868286848068, -0.07453594356775284, -0.043959833681583405, 0.010082285851240158, 0.004224682226777077, 0.007043362129479647, -0.03783749043941498, 0.0438886433839798, 0.008040022104978561, 0.022905386984348297, 0.04986860603094101, -0.041824132204055786, 0.017779706045985222, 0.02712339535355568, -0.05239585041999817, 0.03301436826586723, 0.06859157979488373, 0.013526102527976036, 0.01961284875869751, 0.010028893128037453, 0.05481630936264992, 0.04677183926105499, 0.01584867760539055, -0.021819738671183586, 0.010580616071820259, 0.00407117884606123, 0.013882052153348923, 0.02205110713839531, 0.06364387273788452, -0.015466030687093735, 0.016640665009617805, 0.006060049869120121, 0.021143434569239616, 0.02059171162545681, -0.009539461694657803, -0.003908776678144932, 0.04634469747543335, -0.0032524936832487583, -0.014371483586728573, 0.04460054263472557, 0.040257953107357025, -0.005303656216710806, 0.07432237267494202, -0.013187949545681477, 0.033922042697668076, 0.04534803703427315, 0.019452670589089394, -0.0092636002227664, 0.013036671094596386, -0.0263581033796072, 0.048836350440979004, 0.03748154267668724, -0.020609509199857712, -0.00937038566917181, 0.01884755678474903, -0.011559478007256985, -0.035968754440546036, -0.03246264532208443, -0.0595504455268383, 0.019256899133324623, -0.0037686212453991175, -0.020075583830475807, -0.04755492880940437, 0.04993979260325432, -0.004300321917980909, -0.010803084820508957, 0.024809719994664192, 0.028618386015295982, 0.0015583939384669065, -0.035755183547735214, -0.007007766980677843, 0.00722133694216609, 0.011621769517660141, -0.04545482248067856, -0.010206867940723896, -0.02966843731701374, -0.037517137825489044, -0.008791966363787651, 0.07250703126192093, -0.07346809655427933, 0.05819783732295036, -0.03301436826586723, 0.0021256892941892147, 0.04759052395820618, 0.02069849707186222 ]
39,361
pyspark.sql.dataframe
corr
Calculates the correlation of two columns of a :class:`DataFrame` as a double value. Currently only supports the Pearson Correlation Coefficient. :func:`DataFrame.corr` and :func:`DataFrameStatFunctions.corr` are aliases of each other. .. versionadded:: 1.4.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Parameters ---------- col1 : str The name of the first column col2 : str The name of the second column method : str, optional The correlation method. Currently only supports "pearson" Returns ------- float Pearson Correlation Coefficient of two columns. Examples -------- >>> df = spark.createDataFrame([(1, 12), (10, 1), (19, 8)], ["c1", "c2"]) >>> df.corr("c1", "c2") -0.3592106040535498 >>> df = spark.createDataFrame([(11, 12), (10, 11), (9, 10)], ["small", "bigger"]) >>> df.corr("small", "bigger") 1.0
def corr(self, col1: str, col2: str, method: Optional[str] = None) -> float: """ Calculates the correlation of two columns of a :class:`DataFrame` as a double value. Currently only supports the Pearson Correlation Coefficient. :func:`DataFrame.corr` and :func:`DataFrameStatFunctions.corr` are aliases of each other. .. versionadded:: 1.4.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Parameters ---------- col1 : str The name of the first column col2 : str The name of the second column method : str, optional The correlation method. Currently only supports "pearson" Returns ------- float Pearson Correlation Coefficient of two columns. Examples -------- >>> df = spark.createDataFrame([(1, 12), (10, 1), (19, 8)], ["c1", "c2"]) >>> df.corr("c1", "c2") -0.3592106040535498 >>> df = spark.createDataFrame([(11, 12), (10, 11), (9, 10)], ["small", "bigger"]) >>> df.corr("small", "bigger") 1.0 """ if not isinstance(col1, str): raise PySparkTypeError( error_class="NOT_STR", message_parameters={"arg_name": "col1", "arg_type": type(col1).__name__}, ) if not isinstance(col2, str): raise PySparkTypeError( error_class="NOT_STR", message_parameters={"arg_name": "col2", "arg_type": type(col2).__name__}, ) if not method: method = "pearson" if not method == "pearson": raise PySparkValueError( error_class="VALUE_NOT_PEARSON", message_parameters={"arg_name": "method", "arg_value": method}, ) return self._jdf.stat().corr(col1, col2, method)
(self, col1: str, col2: str, method: Optional[str] = None) -> float
[ 0.00978715717792511, -0.03918491303920746, 0.11058852821588516, 0.03163818642497063, 0.02746571972966194, -0.06222418695688248, -0.03410538658499718, 0.04197864979505539, 0.05747120454907417, 0.04800151661038399, 0.0036350355949252844, 0.008054676465690136, 0.024073323234915733, 0.03820528835058212, -0.037552207708358765, 0.014413153752684593, -0.0048845079727470875, -0.015220435336232185, 0.005601083859801292, 0.023311395198106766, 0.0022687790915369987, -0.009283740073442459, -0.01915706880390644, 0.03274479880928993, -0.026631226763129234, 0.0167987160384655, -0.020263679325580597, -0.0037778972182422876, 0.021569842472672462, -0.014912036247551441, 0.012553684413433075, -0.028790025040507317, -0.048836011439561844, 0.037878748029470444, 0.016735222190618515, -0.02251318283379078, 0.04143441468477249, -0.013741930946707726, -0.002116846852004528, -0.021587984636425972, -0.037878748029470444, 0.02514365129172802, 0.014358730055391788, -0.05362527817487717, -0.034450069069862366, 0.029697082936763763, -0.045679450035095215, 0.00614531897008419, -0.05874108523130417, 0.01403218973428011, 0.01562861166894436, -0.03082183562219143, -0.01668987050652504, 0.031620047986507416, -0.011719191446900368, 0.03874952346086502, -0.00974180456250906, 0.034958019852638245, -0.04992448166012764, -0.002326604211702943, 0.07829725742340088, -0.03337974101305008, -0.05866852030158043, 0.020590219646692276, 0.051702313125133514, 0.016000505536794662, 0.021297724917531013, 0.03397839888930321, 0.018630973994731903, -0.026068851351737976, -0.023129982873797417, 0.02764713205397129, -0.026830779388546944, -0.005183837376534939, -0.0006434443639591336, -0.015374635346233845, 0.04477239027619362, -0.03860439360141754, 0.029588237404823303, -0.04085389897227287, -0.014358730055391788, -0.046368811279535294, 0.03849554806947708, -0.05888621509075165, -0.027229884639382362, -0.01534742396324873, -0.014404083602130413, 0.008018394000828266, -0.03345230594277382, 0.006458254065364599, -0.0388946533203125, -0.010875627398490906, 0.006090895272791386, 0.028790025040507317, 0.016717081889510155, -0.06211534142494202, 0.016045859083533287, -0.026431674137711525, 0.059539295732975006, -0.006721301004290581, 0.004204214550554752, 0.06440112739801407, 0.0615348257124424, 0.009183963760733604, 0.04673163592815399, -0.010041133500635624, -0.014939247630536556, -0.01692570559680462, 0.0047121671959757805, 0.032127998769283295, -0.0770636573433876, 0.04350250959396362, 0.048654597252607346, -0.02463569864630699, -0.008022929541766644, -0.0072247181087732315, -0.03698983043432236, 0.03544783219695091, -0.0056827194057404995, 0.05834197998046875, 0.046114835888147354, 0.06607011705636978, 0.045752011239528656, -0.06374804675579071, 0.005895877722650766, 0.01641775295138359, -0.012036661617457867, -0.00028671539621427655, -0.04451841488480568, 0.08751296997070312, 0.05783402919769287, -0.0077734882943332195, 0.020880479365587234, 0.042958274483680725, 0.006716765463352203, 0.03334345668554306, 0.03397839888930321, 0.03366999700665474, 0.029062142595648766, 0.029969200491905212, 0.051375772804021835, 0.027084756642580032, 0.029316119849681854, 0.006689553614705801, 0.003331171115860343, 0.09505969285964966, 0.005741678178310394, -0.0010357470018789172, -0.037298232316970825, 0.004653208423405886, -0.01507530640810728, -0.002746118465438485, 0.0770636573433876, -0.04266801476478577, 0.017578786239027977, -0.05547567456960678, 0.021025607362389565, -0.009324558079242706, 0.012780449353158474, -0.05747120454907417, 0.0025352274533361197, -0.020263679325580597, 0.04462726041674614, -0.0038051088340580463, 0.018884951248764992, 0.026613086462020874, 0.026703791692852974, -0.008798464201390743, -0.03827785328030586, -0.03637303039431572, -0.00319284456782043, -0.02467198111116886, 0.008703222498297691, -0.0396202988922596, -0.010503733530640602, 0.054278358817100525, 0.007982111535966396, -0.012209002859890461, 0.0013004946522414684, -0.026032568886876106, 0.02800995483994484, -0.05939416587352753, -0.009714593179523945, 0.002428648294880986, 0.012145509012043476, 0.06131713092327118, 0.03842298313975334, -0.060010965913534164, 0.06345778703689575, -0.0017154737142845988, 0.003206450492143631, 0.005941230803728104, -0.022694595158100128, 0.04386533051729202, 0.06073661521077156, -0.06523562222719193, 0.0498519167304039, -0.01241762563586235, -0.026540521532297134, 0.0019377029966562986, 0.054387208074331284, 0.03864067792892456, 0.051121797412633896, 0.012907437048852444, 0.0154744116589427, -0.04197864979505539, -0.0003540361358318478, 0.04785638675093651, 0.0038549972232431173, -0.03976542875170708, 0.031184658408164978, -0.0018152501434087753, 0.011592202819883823, -0.03350672870874405, -0.024381723254919052, 0.017188752070069313, 0.0394388884305954, -0.05504028871655464, 0.01699827052652836, 0.031801458448171616, 0.08061932772397995, -0.015819093212485313, -0.029388684779405594, 0.023166265338659286, 0.029606377705931664, -0.04241403937339783, 0.010104627348482609, -0.010685144923627377, 0.028590472415089607, -0.09041555225849152, -0.03343416377902031, -0.03571994975209236, -0.0019433720735833049, -0.04698561131954193, -0.09600303322076797, -0.01959245651960373, 0.01137450896203518, 0.0792405977845192, -0.014748765155673027, -0.0019762529991567135, -0.016989199444651604, 0.057362355291843414, 0.028445342555642128, 0.04074505344033241, -0.010703286156058311, -0.009524110704660416, 0.034522633999586105, 0.0302231777459383, 0.007279141806066036, 0.009229316376149654, 0.014512930065393448, -0.0388946533203125, -0.0005844855913892388, 0.01663544587790966, 0.020481372252106667, -0.05217398330569267, -0.02761084958910942, 0.027338732033967972, -0.004784731660038233, 0.023347675800323486, -0.015048095025122166, -0.017887186259031296, -0.009714593179523945, 0.016263552010059357, -0.051266927272081375, -0.03856811299920082, -0.03969286382198334, 0.017941610887646675, 0.02264017052948475, 0.025905581191182137, -0.025923721492290497, -0.005378854926675558, 0.004006929229944944, -0.03405096381902695, 0.03802387788891792, -0.005129413679242134, -0.034377504140138626, -0.02233177237212658, 0.016063999384641647, -0.03653630241751671, 0.01795068010687828, -0.021116314455866814, 0.002526156837120652, -0.020372526720166206, -0.029062142595648766, 0.05083153769373894, 0.006444647908210754, -0.04393789544701576, 0.03664514794945717, 0.043103404343128204, 0.01919335126876831, 0.0007358509465120733, -0.010403957217931747, 0.05326245352625847, 0.009224781766533852, 0.0553305484354496, 0.07517697662115097, -0.019955279305577278, -0.014694342389702797, -0.030023625120520592, -0.03392397612333298, 0.03080369532108307, -0.00483461981639266, 0.026721933856606483, 0.03644559532403946, -0.057326074689626694, 0.048908576369285583, -0.051448337733745575, -0.01395055465400219, 0.02811880223453045, -0.0063448715955019, 0.021479137241840363, -0.040454793721437454, -0.00417700270190835, -0.05914019048213959, 0.04393789544701576, -0.0073517062701284885, -0.018757961690425873, 0.02799181453883648, -0.00699795363470912, -0.009360839612782001, -0.020390667021274567, 0.034994304180145264, 0.04488123580813408, -0.03065856546163559, 0.006757583003491163, -0.023383958265185356, 0.026449816301465034, 0.03386954963207245, 0.027102896943688393, 0.026921486482024193, 0.04698561131954193, 0.0196287389844656, 0.008290511555969715, 0.04422815516591072, -0.007356241345405579, 0.020971184596419334, -0.03922119364142418, 0.040164534002542496, 0.03243640065193176, 0.017497152090072632, -0.07866008579730988, 0.048908576369285583, -0.0447361059486866, -0.04658650606870651, 0.010213474743068218, 0.00977808702737093, 0.012626249343156815, 0.011664767749607563, -0.05627388879656792, 0.009850651025772095, -0.018540268763899803, -0.034704044461250305, 0.03125722333788872, -0.012462979182600975, 0.06839218735694885, -0.08018393814563751, 0.026213981211185455, 0.057217229157686234, -0.05609247460961342, -0.03281736373901367, -0.03399654105305672, 0.021460995078086853, -0.0307674128562212, -0.01948360912501812, 0.07597518712282181, -0.0706779733300209, 0.018957514315843582, -0.07125848531723022, -0.026105133816599846, -0.01109332125633955, -0.03005990758538246, -0.00440603494644165, -0.026758214458823204, -0.02193266525864601, 0.04742100089788437, 0.005995654501020908, -0.004467261489480734, 0.023129982873797417, -0.020118549466133118, 0.046078555285930634, -0.0719478502869606, -0.03328903391957283, -0.014104753732681274, -0.017352022230625153, 0.005292684305459261, -0.0083540054038167, -0.04669535160064697, -0.05050499737262726, 0.006140783429145813, -0.03820528835058212, 0.0019921264611184597, -0.004390161484479904, -0.03584693744778633, -0.08119984716176987, 0.009351769462227821, -0.012027591466903687, 0.04531662538647652, -0.00390715291723609, 0.01272602565586567, -0.043538790196180344, -0.03102138824760914, 0.023166265338659286, -0.011564991436898708, 0.0025737774558365345, 0.037298232316970825, 0.00010147713328478858, -0.03129350766539574, -0.0007727001793682575, -0.010258827358484268, -0.08562628924846649, -0.009161286987364292, 0.013134201988577843, 0.040527358651161194, -0.01787811517715454, 0.0679205134510994, -0.016571952030062675, -0.007102265488356352, 0.0657435730099678, 0.07481415569782257, -0.011737332679331303, -0.032345693558454514, 0.00946061685681343, 0.06704974174499512, 0.015039023943245411, -0.011900602839887142, 0.03704425320029259, -0.020136691629886627, 0.0002461812400724739, 0.011265662498772144, -0.01941104419529438, 0.040164534002542496, -0.06389317661523819, -0.024037040770053864, 0.002562439301982522, 0.029189130291342735, -0.006870965473353863, 0.0007341501768678427, -0.004403767175972462, -0.013233978301286697, 0.025579039007425308, -0.005764354486018419, -0.035103149712085724, -0.07216554880142212, -0.0653807520866394, -0.04074505344033241, 0.0038323206827044487, -0.06458254158496857, -0.05061384290456772, -0.0356111042201519, 0.043357379734516144, 0.03136606886982918, 0.0083540054038167, 0.059756990522146225, -0.026667509227991104, 0.03136606886982918, -0.037624772638082504, -0.05645529925823212, 0.020445089787244797, -0.014748765155673027, -0.018757961690425873, 0.026631226763129234, -0.01950174942612648, -0.04386533051729202, -0.03849554806947708, 0.048473186790943146, -0.001547668012790382, -0.01256275549530983, -0.051448337733745575, 0.015982365235686302, 0.02811880223453045, -0.04752984642982483, -0.034849174320697784, -0.03045901283621788, 0.029896635562181473, 0.022730877622961998, -0.05504028871655464, -0.020445089787244797, -0.003932096995413303, -0.003419609274715185, -0.1000666543841362, -0.013034425675868988, -0.04165210947394371, -0.032164283096790314, 0.06948065757751465, -0.05932160094380379, -0.028844449669122696, -0.04647766053676605, 0.021660547703504562, -0.03347044438123703, 0.006140783429145813, 0.12720583379268646, 0.02746571972966194, 0.01659916341304779, -0.03078555315732956, 0.024145888164639473, 0.042631734162569046, -0.040345944464206696, -0.06770282238721848, 0.045679450035095215, 0.014630847610533237, 0.010122768580913544, -0.06603383272886276, 0.05250052362680435, 0.03067670576274395, -0.09716407209634781, -0.03069484792649746, -0.0036010209005326033, -0.05728979408740997, -0.015329282730817795, -0.06102687120437622, 0.017424587160348892, 0.05246424302458763, 0.021116314455866814, -0.005319896154105663, 0.0030341094825416803, 0.014594565145671368, 0.0037574884481728077, -0.0023118644021451473, 0.010022992268204689, -0.05826941505074501, -0.00761928828433156, -0.027229884639382362, 0.04197864979505539, -0.026304686442017555, 0.009288275614380836, 0.020989324897527695, -0.030168753117322922, 0.017188752070069313, -0.005147554911673069, -0.05547567456960678, 0.03259966894984245, -0.02521621622145176, 0.004344808403402567, 0.016662657260894775, 0.06955321878194809, -0.07691852748394012, -0.002678089076653123, -0.059249039739370346, -0.007065983023494482, -0.020735349506139755, 0.026304686442017555, -0.011637556366622448, 0.015637682750821114, -0.013170484453439713, -0.04774754121899605, -0.01117495633661747, -0.02548833377659321, 0.05326245352625847, 0.012671601958572865, 0.03539340943098068, 0.0014229475054889917, 0.05507656931877136, 0.034522633999586105, -0.02490781620144844, 0.00695713609457016, -0.0005414003389887512, -0.02216850034892559, 0.008635193109512329, -0.021696830168366432, -0.0021701366640627384, -0.0449175201356411, 0.05246424302458763, -0.03570180758833885, -0.00019785205950029194, 0.07953085750341415, 0.06672319769859314, 0.03279922157526016, -0.00696167116984725, -0.09868792444467545, -0.016127493232488632, 0.030168753117322922, 0.01800510473549366, -0.020680924877524376, -0.008676011115312576, 0.021660547703504562, 0.01791439764201641, -0.05620132386684418, -0.07677340507507324, -0.012753237970173359, -0.040382228791713715, 0.022839725017547607, -0.005741678178310394, 0.01827722229063511, -0.03642745688557625, 0.03366999700665474, -0.08054676651954651, 0.010848415084183216, 0.04074505344033241, -0.0253794863820076, -0.043139684945344925, -0.07220182567834854, -0.006979812402278185, -0.04702189564704895, -0.003959308844059706, 0.06371176242828369, -0.05765261501073837, 0.028626754879951477, 0.06454625725746155, 0.011991309002041817, -0.05010589212179184, 0.0040930998511612415, 0.014159177429974079, -0.06222418695688248, -0.03570180758833885, 0.0016236341325566173, -0.06886385381221771, 0.013034425675868988, 0.03831413760781288, 0.03628232702612877, -0.03372442349791527, 0.03042273037135601, 0.003040912328287959, -0.010004851035773754, 0.07807956635951996, -0.0029615447856485844, -0.04640509560704231, -0.03555667772889137, 0.001547668012790382, 0.0019343014573678374, -0.04520777612924576, 0.008444711565971375, 0.034994304180145264, 0.009714593179523945, -0.02240433543920517, 0.10696029663085938, -0.012825801968574524, -0.048473186790943146, -0.023166265338659286, -0.02207779511809349, 0.013106990605592728, -0.07035142928361893, 0.07764417678117752, -0.02458127588033676, 0.03029574267566204, -0.034994304180145264, 0.0023742245975881815, -0.021025607362389565, -0.021533560007810593, 0.03370628133416176, 0.02238619513809681, 0.03591950237751007, 0.011882461607456207, 0.020898619666695595, -0.016027716919779778, -0.03784246742725372, -0.051448337733745575, -0.023637935519218445, 0.04393789544701576, -0.04767497628927231, -0.025887439027428627, -0.006326730363070965, 0.015837235376238823, 0.02752014435827732, 0.05239167809486389, -0.05914019048213959, -0.02175125479698181, -0.0023742245975881815, 0.02449057064950466, 0.040418509393930435, -0.0012052535312250257, -0.0019830558449029922, 0.023111840710043907, 0.014785047620534897, -0.057326074689626694, -0.023547230288386345, 0.04226890951395035, -0.021225159987807274, 0.045534320175647736, -0.0028663037810474634, 0.05787030979990959, 0.060083530843257904, 0.020934902131557465, 0.017279457300901413, 0.06302239745855331, 0.0008639728766866028, -0.014712482690811157, -0.03831413760781288, -0.014531071297824383, 0.015828164294362068, 0.007560329511761665, 0.05852339044213295, -0.028372779488563538, 0.003040912328287959, -0.014921106398105621, -0.014658059924840927, 0.06654178351163864, 0.03082183562219143, -0.025742311030626297, -0.06073661521077156, -0.016535669565200806, -0.0035624708980321884, -0.014014048501849174, 0.006036472041159868, -0.006725836079567671, -0.0059366957284510136, -0.04651394113898277, -0.06128084659576416, -0.007442411966621876, 0.0502147376537323, 0.02274901792407036, 0.04756613075733185, 0.024037040770053864, 0.1004294753074646, 0.03976542875170708, 0.06980719417333603, 0.01942918635904789, 0.0026395393069833517, 0.014567353762686253, -0.0088120698928833, 0.0016077605541795492, 0.01800510473549366, 0.013061637058854103, -0.001630436978302896, -0.023002995178103447, 0.07945829629898071, -0.023801205679774284, 0.010367674753069878, -0.004748449195176363, -0.001418412197381258, -0.023710500448942184, -0.04150697961449623, 0.04814664646983147, 0.0005663444171659648, 0.06487280130386353, 0.010394886136054993, 0.06926295906305313, -0.0071204062551259995, -0.007270071189850569, 0.00765557074919343, -0.02732059173285961, -0.014023118652403355, 0.03405096381902695, 0.04952537640929222, 0.013370037078857422, -0.029570095241069794, 0.0024263805244117975, -0.02470826357603073, 0.013197695836424828, -0.031420495361089706, -0.025923721492290497, -0.001224528532475233, 0.00487090228125453, -0.023438382893800735, 0.015093447640538216, 0.007102265488356352, -0.05072269216179848, -0.024418005719780922, 0.034304939210414886, -0.043393660336732864, 0.002582848072052002, -0.0054060667753219604, -0.014331518672406673, 0.027248026803135872, -0.03058600053191185, -0.016481246799230576, -0.005614690016955137, 0.01993713714182377, -0.006054613273590803, -0.051339492201805115, -0.00409536762163043, 0.05837826058268547, 0.012853014282882214, 0.01984643191099167, 0.023039277642965317, 0.0029343331698328257, 0.026594944298267365, 0.05028730258345604 ]
39,362
pyspark.sql.dataframe
count
Returns the number of rows in this :class:`DataFrame`. .. versionadded:: 1.3.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Returns ------- int Number of rows. Examples -------- >>> df = spark.createDataFrame( ... [(14, "Tom"), (23, "Alice"), (16, "Bob")], ["age", "name"]) Return the number of rows in the :class:`DataFrame`. >>> df.count() 3
def count(self) -> int: """Returns the number of rows in this :class:`DataFrame`. .. versionadded:: 1.3.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Returns ------- int Number of rows. Examples -------- >>> df = spark.createDataFrame( ... [(14, "Tom"), (23, "Alice"), (16, "Bob")], ["age", "name"]) Return the number of rows in the :class:`DataFrame`. >>> df.count() 3 """ return int(self._jdf.count())
(self) -> int
[ 0.0047201309353113174, -0.08010126650333405, 0.027936341241002083, 0.030072147026658058, 0.04073408991098404, 0.05928996950387955, -0.019153907895088196, 0.057547152042388916, 0.020486649125814438, -0.004822649527341127, -0.01679597795009613, -0.01038855966180563, -0.008098975755274296, -0.008444976061582565, -0.0025245225988328457, -0.018043288961052895, 0.03359195590019226, -0.01249019242823124, 0.05553095415234566, 0.024587396532297134, -0.03875206038355827, 0.004587710835039616, 0.06390330940485, 0.005788033828139305, -0.030448049306869507, 0.02988419681787491, 0.003782512154430151, -0.009747818112373352, 0.08044299483299255, 0.044390588998794556, -0.07101127505302429, -0.004222488030791283, -0.04213517904281616, 0.0258347075432539, -0.016958298161625862, 0.03618909418582916, 0.005382230971008539, -0.04876472055912018, 0.037590183317661285, 0.00769317289814353, -0.03352360799908638, -0.006112676579505205, 0.0375218391418457, -0.03470257297158241, -0.0006220534560270607, -0.0065782819874584675, 0.015078789554536343, -0.07483863830566406, 0.026432733982801437, -0.05132768675684929, 0.01594165526330471, 0.026364387944340706, -0.0505417101085186, 0.015360715799033642, -0.07217315584421158, -0.006125491112470627, -0.0008511186460964382, 0.0009605786763131618, -0.03779521957039833, -0.0006236553308553994, -0.011396660469472408, -0.011003672145307064, -0.012071575038135052, 0.002853436628356576, -0.005617169663310051, 0.018743831664323807, 0.009081446565687656, 0.04148589447140694, -0.011934882961213589, -0.026894068345427513, 0.005484749563038349, 0.0222978126257658, 0.022144034504890442, 0.0925401970744133, -0.07531706243753433, -0.01241330336779356, -0.02144349180161953, 0.015796421095728874, -0.005770947318524122, -0.032532595098018646, 0.07463359832763672, -0.03410454839468002, 0.01647987775504589, -0.0014961319975554943, 0.05184027925133705, 0.05136185884475708, 0.039640557020902634, 0.04849133640527725, -0.06738894432783127, 0.049892425537109375, -0.009286483749747276, 0.06202380359172821, 0.03299392759799957, -0.010670485906302929, 0.024484878405928612, -0.04586002230644226, -0.01298569981008768, -0.01847044937312603, 0.011755475774407387, -0.008521865122020245, -0.018897609785199165, 0.041793450713157654, 0.04363878443837166, -0.021392231807112694, -0.03410454839468002, -0.030157579109072685, 0.002274633152410388, -0.06113530695438385, -0.014668715186417103, 0.024279842153191566, 0.017026644200086594, 0.07224150002002716, 0.024467792361974716, 0.004446747712790966, 0.032908495515584946, 0.005852108355611563, 0.02255411073565483, -0.015232567675411701, -0.014566196128726006, 0.005753861274570227, 0.016907040029764175, 0.06947349011898041, 0.03820529580116272, -0.0628097802400589, 0.03653082251548767, 0.04316036403179169, 0.005313884932547808, -0.050712574273347855, 0.029610812664031982, 0.02831224352121353, 0.10142514854669571, -0.0032613754738122225, 0.07511202245950699, 0.03362612798810005, 0.028124291449785233, 0.026706116273999214, 0.07948615401983261, 0.019017215818166733, -0.02932034246623516, 0.0449715293943882, 0.014301355928182602, -0.01178110484033823, 0.01059359684586525, 0.05139603465795517, -0.019341858103871346, 0.021101761609315872, 0.034207068383693695, 0.004583439324051142, -0.01831667125225067, -0.013575182296335697, 0.015693901106715202, -0.033096447587013245, 0.04295532777905464, -0.014139034785330296, -0.034138720482587814, 0.008902039378881454, 0.04370713233947754, -0.04076826199889183, 0.00920105166733265, -0.09896469861268997, 0.02021326683461666, 0.03994811326265335, -0.012481649406254292, 0.04247690737247467, -0.06298064440488815, 0.06670548766851425, -0.03261802718043327, -0.011934882961213589, -0.08078472316265106, -0.022246554493904114, 0.07695735991001129, 0.029371602460741997, 0.037556011229753494, 0.0037056230939924717, -0.03244716301560402, 0.12206558138132095, 0.01575370505452156, 0.04042653366923332, 0.052421219646930695, -0.022981271147727966, -0.004869637545198202, -0.04415138065814972, -0.024724088609218597, 0.010781547985970974, 0.03946969285607338, -0.008248481899499893, -0.018983041867613792, -0.04490318149328232, 0.04586002230644226, 0.04729528725147247, -0.016027087345719337, -0.050336673855781555, -0.013532466255128384, 0.0572395995259285, 0.010337300598621368, -0.051532723009586334, 0.016377359628677368, 0.007697444409132004, -0.0646892860531807, 0.05864068493247032, -0.010687572881579399, 0.027150364592671394, 0.007026801351457834, -0.04551829397678375, 0.04746615141630173, -0.008756804279983044, -0.02542463317513466, -0.0016467063687741756, -0.039264656603336334, -0.06882420927286148, 0.013028415851294994, -0.0564877949655056, -0.03410454839468002, 0.032430075109004974, 0.05088343843817711, -0.03875206038355827, 0.015403431840240955, -0.04873054847121239, 0.00906436052173376, -0.05064423009753227, 0.0576154999434948, 0.03133654221892357, -0.01730002835392952, -0.006300627253949642, 0.007107961922883987, -0.07258322834968567, 0.0325155071914196, -0.015728075057268143, 0.00834672898054123, -0.06841413676738739, -0.044834837317466736, 0.011234339326620102, 0.05597520247101784, -0.0009627144900150597, -0.007167764473706484, 0.013891281560063362, -0.007770061958581209, 0.022793320938944817, -0.008615841157734394, -0.045552466064691544, -0.05484749376773834, -0.0040516238659620285, 0.012823378667235374, -0.0012868230696767569, -0.05064423009753227, -0.00336816580966115, -0.018367931246757507, 0.08775599300861359, 0.006514207925647497, -0.007735888939350843, -0.023493865504860878, -0.0635615810751915, -0.012626884505152702, -0.006988356821238995, -0.011994685977697372, -0.07230984419584274, -0.007535123266279697, 0.07374510914087296, -0.03656499832868576, 0.024074804037809372, 0.022537022829055786, -0.04244273528456688, -0.038854580372571945, 0.04551829397678375, -0.026022659614682198, -0.003863672958686948, -0.019307686015963554, 0.018965955823659897, -0.026227695867419243, 0.028978614136576653, 0.0661587193608284, -0.015403431840240955, 0.005177193321287632, -0.09247185289859772, -0.013241996057331562, -0.09506899118423462, -0.010670485906302929, -0.0007235042285174131, -0.044800665229558945, -0.025322115048766136, -0.02668903023004532, -0.01565118506550789, -0.0028577083721756935, 0.008594483137130737, -0.031421978026628494, 0.012097204104065895, 0.022776233032345772, -0.02163144201040268, -0.049858253449201584, -0.016326099634170532, -0.011106190271675587, -0.00034066103398799896, -0.026330215856432915, 0.04432224482297897, -0.004826921503990889, 0.01730002835392952, -0.029832936823368073, -0.0360524021089077, -0.017248768359422684, 0.07196811586618423, -0.014369701966643333, -0.03745349124073982, 0.0014299220638349652, 0.05768384411931038, -0.018231239169836044, -0.03456588089466095, 0.014190293848514557, -0.005207094829529524, 0.012720859609544277, 0.037487663328647614, -0.020349958911538124, 0.05300216004252434, 0.0033233140129595995, 0.009739275090396404, -0.02865397185087204, -0.019444376230239868, -0.050815094262361526, -0.0013562367530539632, -0.042306043207645416, 0.00015658127085771412, 0.034958869218826294, 0.009465891867876053, 0.007466777227818966, -0.01853879541158676, -0.029969628900289536, 0.047363631427288055, 0.023733075708150864, 0.02831224352121353, 0.02340843342244625, -0.022314900532364845, -0.007133591454476118, 0.008304012939333916, 0.01787242293357849, -0.006937097292393446, -0.06749146431684494, -0.050302501767873764, 0.020947983488440514, 0.027560438960790634, -0.03608657792210579, 0.0728566125035286, 0.013216366991400719, -0.058777377009391785, 0.007842679508030415, -0.0184021033346653, -0.02315213531255722, -0.0077188024297356606, 0.002983720740303397, -0.03981142118573189, 0.0602126382291317, 0.015992915257811546, -0.001850675791501999, 0.01704373024404049, -0.007048159372061491, 0.013669157400727272, -0.02672320231795311, 0.02861979976296425, 0.0065782819874584675, 0.060520194470882416, 0.003846586449071765, 0.03823946788907051, -0.010063917376101017, -0.020315784960985184, 0.0003302489931229502, -0.03745349124073982, -0.012626884505152702, 0.060964442789554596, -0.025356287136673927, -0.0006733128102496266, -0.0676281601190567, -0.014668715186417103, -0.00027738779317587614, -0.04148589447140694, 0.005228452850133181, -0.013011329807341099, 0.05894824117422104, 0.055770162492990494, -0.008047716692090034, 0.01683015003800392, -0.0097563611343503, -0.020572083070874214, -0.0018570831744000316, -0.066534623503685, 0.00334894354455173, -0.030430961400270462, -0.02668903023004532, 0.017009558156132698, -0.10942160338163376, -0.04165675863623619, -0.04603089019656181, -0.023681815713644028, -0.047705359756946564, 0.016377359628677368, -0.013464120216667652, -0.06349323689937592, -0.032754719257354736, 0.019666500389575958, -0.026108091697096825, -0.01812872104346752, 0.08071637898683548, 0.01284046471118927, -0.024467792361974716, -0.017231682315468788, 0.06513353437185287, 0.0041541424579918385, 0.01348975021392107, 0.050336673855781555, 0.01228515524417162, -0.03137071803212166, -0.035403117537498474, -0.0821516364812851, 0.0382736399769783, -0.028346415609121323, -0.06920011341571808, 0.03560815751552582, -0.01565118506550789, 0.020674601197242737, 0.04442476108670235, -0.0021464850287884474, 0.05225035548210144, 0.036291614174842834, -0.03055056743323803, 0.015608469024300575, 0.01250727940350771, 0.10026326775550842, -0.03762435540556908, 0.017786990851163864, -0.015437604859471321, 0.012567081488668919, 0.010764461942017078, 0.027850909158587456, -0.0628097802400589, -0.022981271147727966, -0.024245668202638626, 0.034207068383693695, -0.039640557020902634, -0.004043080378323793, 0.009636756032705307, -0.06827744096517563, -0.034207068383693695, 0.030823949724435806, 0.04507404565811157, 0.006975541822612286, 0.021768134087324142, -0.0022468678653240204, 0.006501392927020788, -0.03639413043856621, 0.009166878648102283, -0.03058473952114582, -0.061852939426898956, 0.004540723282843828, 0.03355778381228447, -0.01824832521378994, 0.0050319586880505085, -0.021802306175231934, -0.08208329230546951, 0.025544239208102226, -0.037111762911081314, -0.05361727252602577, -0.008876409381628036, -0.006296355742961168, 0.03639413043856621, 0.054539937525987625, -0.00858594011515379, 0.014036516658961773, -0.027714217081665993, -0.03936717286705971, -0.03659917041659355, -0.05436907336115837, -0.006625270005315542, 0.01306258887052536, 0.04158841073513031, 0.007684629410505295, -0.060520194470882416, -0.055052533745765686, 0.04073408991098404, 0.010157892480492592, -0.04343374818563461, -0.011764018796384335, 0.007992185652256012, 0.020913811400532722, -0.057923056185245514, 0.0475686676800251, 0.02738957479596138, -0.00921813864260912, 0.02315213531255722, -0.009303570725023746, -0.035505637526512146, -0.03408746048808098, 0.04370713233947754, -0.05402734503149986, 0.024724088609218597, 0.02055499516427517, -0.0007496678736060858, -0.03229338675737381, 0.015497407875955105, -0.011268511414527893, 0.05864068493247032, 0.005476206075400114, -0.04251107946038246, 0.04032401368021965, -0.01821415312588215, 0.0011341129429638386, -0.05344640463590622, 0.04316036403179169, -0.029046960175037384, -0.03444627672433853, 0.07948615401983261, 0.01862422749400139, 0.009158335626125336, -0.03260093927383423, -0.013908367604017258, 0.04917479306459427, -0.012481649406254292, 0.032310470938682556, 0.02691115438938141, -0.0034899068996310234, 0.0031439063604921103, 0.019051387906074524, 0.025595497339963913, 0.031421978026628494, -0.018590053543448448, -0.04090495407581329, -0.005595811642706394, 0.03466840088367462, -0.046885211020708084, 0.03381408005952835, 0.039264656603336334, -0.006091318558901548, 0.04715859517455101, 0.10689280927181244, -0.06738894432783127, 0.009594039991497993, -0.009739275090396404, 0.001051884377375245, 0.0165396798402071, -0.009235224686563015, -0.02545880526304245, -0.00906436052173376, 0.00011112864740425721, 0.05064423009753227, -0.013942540623247623, -0.04760283976793289, -0.0070609743706882, 0.007172035984694958, -0.030704345554113388, -0.014873752370476723, -0.006608183495700359, -0.03477092087268829, 0.09445387870073318, -0.031199852004647255, -0.0026291769463568926, 0.005621441174298525, 0.027406660839915276, -0.007159221451729536, 0.052523739635944366, 0.04996076971292496, 0.019273512065410614, -0.029867108911275864, 0.026432733982801437, -0.052455391734838486, -0.023886853829026222, -0.061306171119213104, 0.04664599895477295, -0.02913239225745201, 0.005595811642706394, 0.019119733944535255, 0.06113530695438385, 0.004081524908542633, -0.009166878648102283, -0.02498038485646248, 0.03280597925186157, 0.025356287136673927, 0.04784205183386803, -0.02735540084540844, 0.005826478358358145, -0.04319453984498978, -0.04281863570213318, 0.05812809243798256, 0.006138306111097336, -0.01284046471118927, -0.036667514592409134, 0.03174661844968796, -0.005061859730631113, 0.04763701558113098, -0.04927731305360794, 0.05522339791059494, -0.0731983408331871, 0.006381787825375795, 0.0028149920981377363, 0.01454911008477211, -0.03460005670785904, -0.061374519020318985, -0.0293545164167881, -0.019751932471990585, 0.05553095415234566, 0.06069105863571167, -0.03359195590019226, -0.044356416910886765, 0.06404000520706177, -0.022605368867516518, 0.0009274737094528973, 0.042647771537303925, -0.05064423009753227, -0.018863437697291374, -0.003579610725864768, -0.015352172777056694, -0.05566764622926712, 0.11051513999700546, -0.022690800949931145, 0.016599483788013458, 0.019615240395069122, -0.013951083645224571, 0.007377073634415865, -0.039264656603336334, -0.0159758273512125, -0.008133148774504662, -0.03384825214743614, -0.02906404621899128, 0.0016787433996796608, 0.032720547169446945, -0.03912796452641487, 0.005604354664683342, 0.037966083735227585, 0.0052455393597483635, -0.031046073883771896, 0.033916596323251724, -0.017940768972039223, 0.013814392499625683, -0.052523739635944366, 0.010140806436538696, 0.02330591343343258, -0.07490698248147964, 0.024946212768554688, -0.04456145316362381, 0.04657765477895737, -0.061852939426898956, -0.05259208381175995, -0.03571067377924919, 0.01354955229908228, 0.04316036403179169, -0.01821415312588215, 0.06246805191040039, -0.020794205367565155, -0.0066893440671265125, 0.022537022829055786, -0.057581327855587006, -0.004519365262240171, -0.006608183495700359, 0.005288255400955677, -0.033950772136449814, -0.005420675501227379, -0.04295532777905464, 0.0252708550542593, 0.024108976125717163, 0.04234021529555321, 0.054950013756752014, -0.03244716301560402, 0.012960069812834263, -0.012874637730419636, -0.020452477037906647, -0.011610240675508976, -0.027030758559703827, -0.030072147026658058, -0.007705987431108952, 0.038410332053899765, -0.010858437046408653, 0.012703773565590382, -0.030465135350823402, 0.02679154835641384, -0.008487693034112453, 0.03769270330667496, 0.08078472316265106, 0.006257911212742329, 0.00606568856164813, -0.011422289535403252, 0.012755032628774643, -0.060110121965408325, -0.020315784960985184, 0.02467283047735691, -0.020264526829123497, -0.008560310117900372, 0.02530502900481224, -0.0419984869658947, -0.009602583013474941, -0.022366158664226532, -0.008022086694836617, -0.01241330336779356, -0.029644984751939774, 0.05108847841620445, -0.03051639534533024, -0.039264656603336334, -0.025732189416885376, 0.0006759825628250837, 0.07388179749250412, -0.018965955823659897, -0.03981142118573189, -0.0077230739407241344, 0.026227695867419243, 0.0032571039628237486, 0.009303570725023746, 0.006360429804772139, 0.058811549097299576, 0.028893182054162025, 0.0208112932741642, 0.0057581327855587006, 0.03663334250450134, -0.01795785501599312, -0.021511835977435112, 0.0049294400960206985, -0.01596728526055813, -0.036735862493515015, 0.0572395995259285, 0.01222535315901041, -0.012191180139780045, -0.042237699031829834, 0.11338566243648529, 0.0334552638232708, 0.007150677964091301, -0.009482977911829948, 0.0141219487413764, 0.025698017328977585, -0.0035689317155629396, 0.02270788885653019, 0.049038104712963104, -0.03384825214743614, 0.009491520933806896, -0.000630062713753432, 0.009081446565687656, 0.05737628787755966, 0.0036052402574568987, -0.033130619674921036, -0.03430958464741707, -0.03591571003198624, -0.06738894432783127, 0.03485635295510292, 0.016941212117671967, 0.022400332614779472, 0.007676086388528347, 0.04531325772404671, -0.017317114397883415, 0.03388242423534393, 0.009764904156327248, -0.012473106384277344, -0.04538160189986229, 0.0902847871184349, -0.0071933940052986145, 0.0008601958397775888, 0.016941212117671967, 0.018778005614876747, -0.001441668951883912, 0.018555881455540657, 0.005254082381725311, -0.013096761889755726, -0.060964442789554596, -0.0017695152200758457, 0.03434376046061516, -0.011934882961213589, 0.02084546536207199, 0.015420518815517426, -0.011729845777153969, 0.004677414894104004, 0.04705607518553734, -0.004967884626239538, 0.025253769010305405, -0.007765789981931448, 0.021323885768651962, 0.03806860372424126, 0.018299585208296776 ]
39,363
pyspark.sql.dataframe
cov
Calculate the sample covariance for the given columns, specified by their names, as a double value. :func:`DataFrame.cov` and :func:`DataFrameStatFunctions.cov` are aliases. .. versionadded:: 1.4.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Parameters ---------- col1 : str The name of the first column col2 : str The name of the second column Returns ------- float Covariance of two columns. Examples -------- >>> df = spark.createDataFrame([(1, 12), (10, 1), (19, 8)], ["c1", "c2"]) >>> df.cov("c1", "c2") -18.0 >>> df = spark.createDataFrame([(11, 12), (10, 11), (9, 10)], ["small", "bigger"]) >>> df.cov("small", "bigger") 1.0
def cov(self, col1: str, col2: str) -> float: """ Calculate the sample covariance for the given columns, specified by their names, as a double value. :func:`DataFrame.cov` and :func:`DataFrameStatFunctions.cov` are aliases. .. versionadded:: 1.4.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Parameters ---------- col1 : str The name of the first column col2 : str The name of the second column Returns ------- float Covariance of two columns. Examples -------- >>> df = spark.createDataFrame([(1, 12), (10, 1), (19, 8)], ["c1", "c2"]) >>> df.cov("c1", "c2") -18.0 >>> df = spark.createDataFrame([(11, 12), (10, 11), (9, 10)], ["small", "bigger"]) >>> df.cov("small", "bigger") 1.0 """ if not isinstance(col1, str): raise PySparkTypeError( error_class="NOT_STR", message_parameters={"arg_name": "col1", "arg_type": type(col1).__name__}, ) if not isinstance(col2, str): raise PySparkTypeError( error_class="NOT_STR", message_parameters={"arg_name": "col2", "arg_type": type(col2).__name__}, ) return self._jdf.stat().cov(col1, col2)
(self, col1: str, col2: str) -> float
[ -0.008554292842745781, -0.04314656928181648, 0.10473747551441193, 0.047904036939144135, 0.02367755025625229, -0.029075445607304573, 0.011097707785665989, 0.06140792742371559, 0.0381329320371151, 0.0427074208855629, -0.017090287059545517, 0.02569032460451126, 0.011198346503078938, 0.020255832001566887, -0.0331558883190155, 0.05090489983558655, 0.028910763561725616, -0.03522355854511261, 0.05181979760527611, 0.04303678125143051, -0.05676024779677391, -0.041536349803209305, -0.004890127573162317, -0.018252206966280937, -0.06773901730775833, 0.002628043293952942, -0.019816681742668152, -0.026220964267849922, 0.04036528244614601, -0.03630313649773598, -0.058882810175418854, -0.035315047949552536, -0.04534232243895531, 0.06005387753248215, 0.046110838651657104, 0.01607475057244301, 0.0278311837464571, -0.05646747723221779, -0.016285177320241928, -0.012268777005374432, -0.016660284250974655, 0.014803042635321617, 0.02786778099834919, -0.01549836527556181, -0.037840165197849274, 0.026678413152694702, -0.025397557765245438, -0.00858631357550621, -0.06514070928096771, 0.005233214236795902, 0.009208444505929947, -0.007950459606945515, 0.0029208105988800526, 0.012726224958896637, 0.0021534401457756758, 0.012808565981686115, 0.02085966430604458, 0.009652169421315193, -0.04947766289114952, 0.05482066422700882, 0.06891008466482162, -0.032954610884189606, -0.028380123898386955, -0.006074919831007719, 0.006514071021229029, 0.03401589393615723, 0.018252206966280937, 0.04581807181239128, 0.0030443216674029827, -0.021335411816835403, -0.012131541967391968, -0.0013849262613803148, -0.021902648732066154, 0.0655798614025116, 0.05123426392674446, -0.018572421744465828, -0.028087355196475983, -0.02892906218767166, 0.005260661244392395, -0.03765718638896942, 0.026440540328621864, -0.08600037544965744, -0.009752808138728142, -0.06499432772397995, 0.035315047949552536, 0.024372871965169907, -0.02931331843137741, -0.01590091921389103, 0.017264116555452347, 0.07633905112743378, -0.03110651858150959, 0.019011572003364563, 0.008503973484039307, 0.023439675569534302, 0.021243922412395477, -0.022982226684689522, 0.007680565118789673, -0.010585364885628223, 0.04289039969444275, 0.026257561519742012, 0.05873642489314079, 0.0453789196908474, 0.04658658429980278, 0.035205259919166565, -0.0044898600317537785, -0.016559645533561707, -0.001755459699779749, 0.0005663787596859038, 0.03319248557090759, 0.005466512870043516, -0.04365891218185425, 0.03244226798415184, 0.03370482847094536, -0.024427765980362892, -0.03302780166268349, -0.030429493635892868, -0.035058874636888504, 0.047025736421346664, -0.07253307849168777, 0.08124290406703949, 0.008659505285322666, 0.061773885041475296, 0.05760195106267929, -0.027172457426786423, -0.004062145482748747, -0.020274130627512932, -0.0119119668379426, -0.02089626155793667, -0.005384172312915325, 0.09602764993906021, 0.09675956517457962, -0.07216712087392807, 0.026788201183080673, 0.01822475902736187, 0.0408044308423996, 0.031929925084114075, 0.08504887670278549, 0.012653033249080181, 0.06733646243810654, 0.01671517826616764, 0.045049555599689484, 0.031692054122686386, -0.009080358780920506, -0.023622656241059303, -0.014546871185302734, 0.0880497470498085, 0.03450993821024895, -0.05584535002708435, -0.050685327500104904, -0.006335665937513113, -0.05690662935376167, 0.008256950415670872, 0.032844822853803635, -0.06375006586313248, -0.0017863375833258033, -0.05921217054128647, 0.007369500119239092, -0.01795029081404209, 0.009578977711498737, -0.03434525430202484, -0.021554987877607346, 0.015964962542057037, 0.00292538502253592, 0.04182911664247513, 0.022854141891002655, 0.02089626155793667, 0.021939244121313095, 0.013055588118731976, -0.05236873775720596, -0.04479338601231575, -0.013906443491578102, -0.01839859038591385, 0.015324534848332405, -0.006848008371889591, -0.014491978101432323, 0.017749013379216194, -0.02245158702135086, 0.020292429253458977, -0.01004557590931654, -0.050612132996320724, 0.05053894221782684, -0.0384988896548748, -0.04552530497312546, 0.027209054678678513, 0.0006421437137760222, 0.037840165197849274, 0.0063951341435313225, -0.028563102707266808, 0.05921217054128647, 0.0018114972626790404, 0.00035509461304172873, -0.0032227267511188984, -0.005818748846650124, 0.025672025978565216, 0.07611948251724243, -0.04647679626941681, 0.04215848073363304, 0.007387797813862562, -0.07802246510982513, 0.002564000431448221, 0.0442078523337841, 0.027465226128697395, 0.031234603375196457, -0.02199413813650608, 0.02748352289199829, 0.006724497303366661, -0.016559645533561707, 0.015809429809451103, -0.007108754012733698, -0.02684309519827366, -0.009460041299462318, -0.00007397804438369349, 0.04629381746053696, -0.010054724290966988, 0.028563102707266808, 0.014894532971084118, 0.007140775676816702, -0.022597970440983772, -0.0009177566389553249, 0.03549802675843239, 0.1380397528409958, -0.06510411202907562, -0.025306066498160362, 0.06638497114181519, 0.03268014267086983, -0.03401589393615723, 0.016770072281360626, -0.0384988896548748, 0.02966097928583622, -0.04600105062127113, -0.03430866077542305, -0.005475662183016539, 0.02389712445437908, -0.05921217054128647, -0.08219439536333084, 0.03901123255491257, 0.009551530703902245, 0.0430733785033226, -0.022323500365018845, -0.025287769734859467, -0.038023144006729126, 0.028563102707266808, 0.010841536335647106, 0.048965319991111755, -0.004480710718780756, -0.021207325160503387, 0.02451925538480282, 0.046184029430150986, -0.01236941572278738, 0.049770429730415344, 0.018627313897013664, -0.02009115181863308, -0.01921284943819046, 0.03423546627163887, -0.005173746030777693, -0.052515123039484024, 0.004899276420474052, 0.0204022154211998, 0.0027446928434073925, 0.008055672980844975, -0.028233738616108894, -0.03289971873164177, -0.0005252084229141474, 0.037419311702251434, -0.06971519440412521, 0.014629212208092213, -0.00916269887238741, -0.010960472747683525, 0.0004768903600051999, 0.030868643894791603, -0.08402419090270996, 0.03824272006750107, 0.030868643894791603, -0.059834301471710205, 0.02733713947236538, -0.011042813770473003, -0.0442078523337841, 0.0004162784025538713, 0.017895396798849106, 0.015818579122424126, 0.017437947914004326, -0.0005249225068837404, -0.040511664003133774, 0.015955813229084015, -0.016559645533561707, -0.006399708800017834, -0.019761787727475166, -0.09083103388547897, -0.001912135980091989, 0.035626113414764404, -0.010923877358436584, -0.011518560349941254, -0.00029305313364602625, 0.03099673055112362, -0.0016868424136191607, 0.04867255315184593, 0.05039256066083908, 0.02569032460451126, 0.015351981855928898, 0.023988613858819008, -0.025434153154492378, 0.06543347239494324, -0.027392033487558365, 0.028526507318019867, 0.012497501447796822, -0.03167375549674034, 0.02417159453034401, -0.08680548518896103, -0.012149839662015438, 0.01967029832303524, -0.0377303771674633, 0.00916269887238741, -0.04720871523022652, 0.040767837315797806, -0.05280788987874985, 0.04409806430339813, -0.027593310922384262, -0.019871575757861137, 0.034290362149477005, 0.005475662183016539, 0.015553259290754795, -0.07125222682952881, 0.029441405087709427, 0.0249767042696476, 0.01157345436513424, 0.03493078798055649, -0.02909374237060547, 0.037419311702251434, 0.04087762534618378, 0.028983956202864647, -0.006550666876137257, 0.009002592414617538, 0.01994476653635502, 0.0039180489256978035, 0.020749878138303757, -0.019395828247070312, 0.0006827423349022865, 0.021372007206082344, 0.024500956758856773, 0.04208528995513916, 0.016248581930994987, -0.08739101886749268, -0.0012991545954719186, -0.03655930608510971, -0.026715010404586792, -0.013787506148219109, 0.02009115181863308, -0.045964453369379044, 0.025342663750052452, 0.0408044308423996, -0.00763482041656971, -0.013659421354532242, 0.004171933047473431, 0.03174694627523422, 0.010804940015077591, 0.06810497492551804, -0.019505616277456284, -0.007154499180614948, 0.031966522336006165, -0.09858936071395874, 0.00025717198150232434, 0.019414126873016357, 0.010274299420416355, -0.047904036939144135, 0.021408602595329285, 0.051710013300180435, -0.004313742276281118, -0.0049770427867770195, -0.0652138963341713, -0.01656879484653473, -0.019798383116722107, -0.024226488545536995, -0.004533317405730486, -0.04043847322463989, -0.004544753581285477, -0.027209054678678513, 0.009450891986489296, 0.005082256160676479, 0.02188435010612011, 0.01906646601855755, -0.017776459455490112, -0.03511377051472664, -0.047940634191036224, -0.005946834105998278, -0.033412061631679535, 0.026220964267849922, -0.08695186674594879, -0.03941378742456436, -0.041463159024715424, 0.01886518858373165, -0.008728123269975185, 0.03000864014029503, -0.0028956509195268154, -0.023695847019553185, -0.03729122504591942, -0.023201802745461464, -0.005086830351501703, 0.018846889957785606, 0.02314690873026848, 0.021792860701680183, -0.07066669315099716, -0.015205597504973412, -0.016596242785453796, 0.007502160035073757, -0.0491848923265934, 0.018005184829235077, -0.03302780166268349, -0.017465393990278244, -0.00009999545000027865, 0.017959440127015114, -0.0031266624573618174, -0.01865476183593273, -0.02089626155793667, 0.0377303771674633, -0.02157328464090824, 0.03441844880580902, -0.03447334095835686, -0.02234179899096489, 0.05284448340535164, 0.07103265076875687, -0.016797520220279694, -0.0556623674929142, 0.03560781478881836, 0.00809226930141449, 0.03057587705552578, -0.03306439891457558, -0.02691628783941269, -0.01366856973618269, 0.03842569887638092, -0.02794097177684307, 0.002502244897186756, 0.057162802666425705, -0.03613845631480217, -0.03560781478881836, 0.01622113399207592, 0.05866323411464691, -0.012003456242382526, -0.003403418930247426, -0.010576216503977776, 0.02409840188920498, 0.026477135717868805, 0.03381461650133133, -0.011271538212895393, -0.011710689403116703, -0.09778425097465515, -0.02329329214990139, 0.00015681916556786746, -0.03930399939417839, -0.05727258697152138, -0.06016366556286812, 0.03690696880221367, 0.032735034823417664, -0.006212154403328896, -0.015681345015764236, -0.0010338342981413007, 0.037419311702251434, -0.03286312147974968, -0.029441405087709427, 0.034290362149477005, 0.004999915137887001, -0.038938041776418686, 0.027209054678678513, -0.02733713947236538, -0.06547006964683533, -0.032570354640483856, 0.0510878823697567, 0.017501991242170334, 0.0016731189098209143, 0.0058233230374753475, 0.0077766296453773975, 0.02223201096057892, 0.006559815723448992, -0.01956051029264927, -0.04387848824262619, 0.05913897976279259, 0.003952357452362776, -0.09039188176393509, -0.02653202973306179, 0.031216304749250412, 0.04490317404270172, -0.06093217805027962, -0.006212154403328896, -0.00869152694940567, 0.001400936977006495, 0.0800718367099762, -0.028215441852808, -0.023055419325828552, -0.028874168172478676, 0.011271538212895393, -0.014391339384019375, -0.00487182941287756, 0.07985226064920425, 0.030941836535930634, -0.0226894598454237, -0.04742829129099846, 0.013000695034861565, 0.04929468035697937, -0.024189891293644905, -0.061737287789583206, 0.02913033962249756, -0.0014935702783986926, 0.03535164147615433, -0.06927604228258133, 0.007822374813258648, -0.03912102058529854, -0.07531437277793884, 0.007689714431762695, -0.007095030974596739, -0.04087762534618378, -0.04021889716386795, -0.041646137833595276, 0.06382325291633606, 0.03820612281560898, 0.009277061559259892, 0.02051200345158577, -0.002026498084887862, -0.015470918267965317, 0.039816342294216156, 0.004313742276281118, 0.02909374237060547, -0.032387375831604004, -0.05020957812666893, 0.0071270521730184555, 0.054527897387742996, 0.0033896956592798233, 0.020255832001566887, -0.021060941740870476, -0.0017920556711032987, 0.02752012014389038, 0.020310726016759872, -0.08936719596385956, 0.002399318851530552, -0.03500398248434067, 0.03180183842778206, -0.0013300323626026511, 0.023274995386600494, -0.05094149708747864, 0.0196337029337883, -0.09639360755681992, 0.0074335429817438126, -0.005800450686365366, 0.019450722262263298, 0.014043677598237991, 0.05840706080198288, -0.0029116615187376738, -0.03666909411549568, -0.024153295904397964, -0.020146043971180916, 0.05646747723221779, 0.028581401333212852, 0.013851549476385117, -0.010448130778968334, 0.04380529746413231, 0.03092353790998459, 0.020292429253458977, 0.012442607432603836, -0.02406180649995804, -0.03575419634580612, 0.00028676321380771697, 0.016367517411708832, 0.004643105436116457, -0.02135371044278145, 0.09924808889627457, -0.005525981541723013, -0.019157955422997475, 0.06045643240213394, 0.026678413152694702, 0.033832911401987076, 0.01653219945728779, -0.11688731610774994, 0.014665808528661728, 0.004258848261088133, 0.01675177551805973, 0.024263083934783936, -0.053466614335775375, 0.036046963185071945, 0.02115243300795555, 0.0023158343974500895, -0.05785812437534332, 0.008019077591598034, -0.07685139775276184, 0.029715873301029205, -0.03297290951013565, 0.04629381746053696, -0.08182843774557114, 0.006422581151127815, -0.07721735537052155, -0.019432425498962402, 0.027392033487558365, 0.03758399188518524, -0.03141758218407631, -0.07011774927377701, -0.024958405643701553, -0.022707758471369743, 0.006907476577907801, 0.0038837401662021875, -0.02135371044278145, 0.01790454611182213, 0.01437304075807333, -0.05745556950569153, -0.059834301471710205, -0.030777154490351677, 0.05738237500190735, -0.03923080861568451, -0.025672025978565216, 0.03831591084599495, -0.06265218555927277, -0.0022529351990669966, 0.03343035653233528, 0.04175592586398125, -0.04958745092153549, 0.05496704578399658, -0.03099673055112362, 0.036083560436964035, 0.039779748767614365, 0.03377801924943924, -0.04669637233018875, -0.05727258697152138, -0.018453484401106834, 0.021372007206082344, -0.03820612281560898, -0.016010707244277, 0.03827931359410286, 0.0052515119314193726, -0.03396099805831909, 0.04329295456409454, 0.0031609712168574333, -0.06045643240213394, -0.027886077761650085, -0.02329329214990139, -0.0008634345722384751, -0.02775799296796322, 0.09192890673875809, -0.04684275761246681, 0.03557121753692627, -0.026092879474163055, -0.02878267876803875, -0.003446876537054777, -0.0007610804168507457, 0.0484163798391819, 0.040731240063905716, 0.0518563948571682, 0.03557121753692627, 0.0363946259021759, -0.018005184829235077, -0.07066669315099716, -0.061773885041475296, 0.02314690873026848, 0.05485725775361061, -0.05595513805747032, 0.013174525462090969, -0.012094945646822453, 0.02501329965889454, 0.03613845631480217, 0.03128949925303459, -0.021939244121313095, -0.015882622450590134, 0.004142198711633682, 0.005109703168272972, 0.020731579512357712, 0.03584568575024605, -0.0063265166245400906, -0.02237839438021183, 0.02111583575606346, 0.02973417192697525, 0.00333022722043097, 0.03999932110309601, -0.005782152526080608, -0.00044715619878843427, -0.025635430589318275, 0.05866323411464691, 0.06385985016822815, 0.01832539774477482, -0.02371414564549923, 0.012552394531667233, -0.024189891293644905, 0.013256865553557873, -0.03992613032460213, -0.03324737772345543, 0.004302306100726128, -0.0012385426089167595, 0.03719973564147949, 0.015855174511671066, 0.006020026281476021, 0.0010830099927261472, -0.02375074103474617, 0.018846889957785606, -0.03853548690676689, -0.017437947914004326, -0.041463159024715424, -0.013705166056752205, -0.02550734393298626, -0.016230283305048943, 0.01913965679705143, -0.017126882448792458, -0.022158820182085037, -0.007081307470798492, -0.018380291759967804, -0.03912102058529854, 0.05654067173600197, -0.018133269622921944, 0.05002659931778908, 0.001558756805025041, 0.10312725603580475, 0.0036710265558212996, 0.06532368808984756, 0.049990005791187286, -0.022158820182085037, 0.05397895723581314, -0.02526947110891342, -0.01699879765510559, -0.016056451946496964, 0.01998136378824711, 0.004945021588355303, 0.0015804856084287167, 0.0697517916560173, -0.022744353860616684, 0.02508649230003357, 0.01797773689031601, 0.023238398134708405, 0.008545143529772758, -0.030520983040332794, 0.008165461011230946, 0.01974348910152912, -0.02920353040099144, 0.001595352659933269, 0.04131677374243736, -0.001806922722607851, 0.02892906218767166, -0.009190145879983902, -0.02508649230003357, -0.01437304075807333, 0.03853548690676689, 0.02653202973306179, -0.0363946259021759, -0.0013334632385522127, -0.047025736421346664, -0.025287769734859467, 0.022890737280249596, -0.03610185906291008, -0.02111583575606346, 0.02043881267309189, 0.03359504044055939, -0.022506481036543846, -0.017053691670298576, -0.0009720787056721747, -0.03930399939417839, 0.009752808138728142, 0.05738237500190735, -0.022049032151699066, 0.014427934773266315, 0.0015564694767817855, -0.019761787727475166, -0.004476136527955532, -0.0032478864304721355, -0.021408602595329285, -0.04109719768166542, -0.018938379362225533, -0.017831353470683098, -0.04929468035697937, -0.005306405946612358, 0.06107856333255768, 0.01398878451436758, 0.015114108100533485, 0.021756265312433243, 0.02107924036681652, 0.041572947055101395, 0.043475933372974396 ]
39,364
pyspark.sql.dataframe
createGlobalTempView
Creates a global temporary view with this :class:`DataFrame`. The lifetime of this temporary view is tied to this Spark application. throws :class:`TempTableAlreadyExistsException`, if the view name already exists in the catalog. .. versionadded:: 2.1.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Parameters ---------- name : str Name of the view. Examples -------- Create a global temporary view. >>> df = spark.createDataFrame([(2, "Alice"), (5, "Bob")], schema=["age", "name"]) >>> df.createGlobalTempView("people") >>> df2 = spark.sql("SELECT * FROM global_temp.people") >>> sorted(df.collect()) == sorted(df2.collect()) True Throws an exception if the global temporary view already exists. >>> df.createGlobalTempView("people") # doctest: +IGNORE_EXCEPTION_DETAIL Traceback (most recent call last): ... AnalysisException: "Temporary table 'people' already exists;" >>> spark.catalog.dropGlobalTempView("people") True
def createGlobalTempView(self, name: str) -> None: """Creates a global temporary view with this :class:`DataFrame`. The lifetime of this temporary view is tied to this Spark application. throws :class:`TempTableAlreadyExistsException`, if the view name already exists in the catalog. .. versionadded:: 2.1.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Parameters ---------- name : str Name of the view. Examples -------- Create a global temporary view. >>> df = spark.createDataFrame([(2, "Alice"), (5, "Bob")], schema=["age", "name"]) >>> df.createGlobalTempView("people") >>> df2 = spark.sql("SELECT * FROM global_temp.people") >>> sorted(df.collect()) == sorted(df2.collect()) True Throws an exception if the global temporary view already exists. >>> df.createGlobalTempView("people") # doctest: +IGNORE_EXCEPTION_DETAIL Traceback (most recent call last): ... AnalysisException: "Temporary table 'people' already exists;" >>> spark.catalog.dropGlobalTempView("people") True """ self._jdf.createGlobalTempView(name)
(self, name: str) -> NoneType
[ 0.031006840988993645, -0.05905032530426979, 0.010940933600068092, -0.022929884493350983, 0.03546994924545288, 0.007580052595585585, -0.0414508692920208, 0.05124440789222717, -0.012169643305242062, -0.04286027327179909, 0.04210136458277702, 0.001655595493502915, 0.00985677819699049, -0.005402707029134035, -0.04748600348830223, 0.007006353698670864, 0.0402221605181694, 0.0073767732828855515, 0.012296128086745739, 0.0026200420688837767, -0.012025089003145695, -0.05753250792622566, 0.017183860763907433, -0.0007916592294350266, -0.01344352588057518, -0.027049673721194267, -0.05493053421378136, 0.005759574938565493, 0.041992947459220886, -0.0239417627453804, -0.07415622472763062, -0.03449420630931854, -0.042932551354169846, 0.05178648605942726, -0.006098373327404261, -0.019876180216670036, 0.023833347484469414, 0.0053801205940544605, 0.05337657779455185, -0.04770283401012421, 0.053015194833278656, -0.0421375036239624, -0.030591249465942383, -0.02213483676314354, -0.010191059671342373, -0.04849788174033165, -0.004018150735646486, -0.025134334340691566, 0.03312094509601593, 0.012747859582304955, 0.00695214606821537, -0.004657350480556488, -0.07115672528743744, 0.02889273874461651, -0.031476642936468124, -0.02265884540975094, 0.012955655343830585, 0.028441008180379868, -0.02491750195622444, -0.029073432087898254, 0.008492549881339073, 0.054533012211322784, -0.005696332547813654, 0.052184008061885834, -0.012007019482553005, 0.01864747144281864, -0.016072602942585945, -0.008691311813890934, -0.011356526985764503, -0.007882712408900261, -0.06649485975503922, 0.0047025238163769245, 0.0026471458841115236, 0.030627386644482613, -0.02643531933426857, 0.0007809306262061, -0.014870996586978436, -0.08210669457912445, -0.06035131216049194, -0.009486358612775803, 0.03794543445110321, -0.05135282129049301, 0.016912823542952538, -0.0041310833767056465, 0.011699842289090157, 0.05482212081551552, -0.033861782401800156, 0.016912823542952538, 0.03066352568566799, -0.010651825927197933, 0.07368642091751099, -0.005637607537209988, -0.011202937923371792, 0.05008797347545624, -0.0060260966420173645, -0.06309783458709717, -0.007823986932635307, 0.00004362031177151948, -0.02506205625832081, -0.035271186381578445, -0.003832940710708499, 0.016930891200900078, -0.03131401911377907, -0.017382623627781868, -0.007733641192317009, 0.004359207581728697, 0.018629401922225952, -0.022351669147610664, 0.010462098754942417, 0.013551941141486168, -0.015666043385863304, 0.07538492977619171, 0.01868361048400402, 0.003823906183242798, -0.023200923576951027, 0.038162264972925186, -0.013398352079093456, 0.0079459547996521, -0.04849788174033165, 0.01373263355344534, 0.0035935230553150177, -0.0172380693256855, 0.05847210809588432, -0.038632068783044815, -0.03133208677172661, 0.05532805994153023, 0.02923605404794216, -0.005962854251265526, -0.014780650846660137, 0.08297401666641235, 0.057966168969869614, -0.009102387353777885, 0.016018394380807877, 0.003385726595297456, 0.001846452010795474, 0.03554222360253334, 0.034259308129549026, 0.027645960450172424, -0.002563575515523553, 0.04463106021285057, -0.02587517350912094, 0.00010347471834393218, -0.03416896238923073, 0.06906069070100784, 0.046835508197546005, 0.024176662787795067, -0.028043484315276146, 0.01491617038846016, -0.01587384007871151, -0.013091174885630608, -0.01733745075762272, 0.027140021324157715, -0.020960336551070213, 0.017617523670196533, -0.03279569745063782, 0.010326579213142395, 0.040041469037532806, 0.018629401922225952, -0.024285078048706055, -0.00686631677672267, 0.03409668430685997, 0.01588287577033043, -0.02309250831604004, 0.006080304272472858, -0.04716075584292412, -0.013804910704493523, 0.04502858221530914, 0.03254272788763046, -0.058327555656433105, 0.005389155354350805, 0.013434491120278835, 0.03855979070067406, 0.01593708246946335, 0.01778918132185936, -0.02213483676314354, 0.030157586559653282, -0.011121626012027264, 0.012657512910664082, 0.016199087724089622, 0.008352513425052166, 0.010588583536446095, -0.027718236669898033, -0.0982244685292244, 0.024592256173491478, -0.013786841183900833, -0.004734145011752844, 0.01344352588057518, 0.0011767601827159524, 0.07101216912269592, 0.039607807993888855, 0.004221429582685232, -0.015250450931489468, 0.04564293846487999, -0.026579873636364937, 0.040077608078718185, -0.02260463871061802, -0.039210282266139984, -0.010444029234349728, -0.07972155511379242, 0.027627890929579735, 0.00982967484742403, 0.010968037880957127, -0.00842479057610035, -0.02108682133257389, 0.06866317242383957, -0.01965934969484806, 0.010615686886012554, -0.023851417005062103, 0.004964527674019337, -0.0036499896086752415, 0.05088302120566368, -0.002780406503006816, -0.001692863297648728, 0.08239579945802689, -0.011501080356538296, 0.06801267713308334, -0.03118753433227539, -0.0055969515815377235, 0.008117612451314926, 0.004144635517150164, -0.01535886712372303, -0.024158593267202377, 0.010245267301797867, 0.0576409250497818, -0.026616012677550316, -0.07646908611059189, -0.017129654064774513, -0.02780858427286148, 0.003966201562434435, -0.07560176402330399, 0.05471370369195938, -0.02645338885486126, 0.021791521459817886, -0.04983500391244888, -0.04622115567326546, 0.015006516128778458, 0.047377586364746094, -0.03303059935569763, 0.028639769181609154, -0.04455878213047981, -0.04654639959335327, 0.014735477045178413, 0.052545394748449326, 0.0345664843916893, 0.05442459508776665, -0.015033620409667492, -0.005032287444919348, 0.05615924298763275, 0.024700671434402466, -0.02347196266055107, -0.007720089051872492, -0.03080807998776436, -0.00410172063857317, -0.004987114574760199, 0.03924642130732536, -0.04622115567326546, -0.0433662123978138, 0.06544683873653412, -0.025080125778913498, 0.03026600182056427, -0.04275185614824295, 0.01225998904556036, -0.030103377997875214, 0.051641929894685745, -0.03693355619907379, -0.05077460780739784, -0.026110073551535606, -0.0065817260183393955, -0.0700002908706665, -0.023887554183602333, 0.036698658019304276, 0.056845877319574356, 0.026019727811217308, -0.038595929741859436, 0.007187046110630035, -0.06501317769289017, -0.027736306190490723, 0.04047513008117676, -0.08998488634824753, -0.006012544501572847, -0.010407891124486923, -0.0178524237126112, 0.032506588846445084, 0.050630051642656326, -0.07299979031085968, 0.0005163854220882058, -0.0063377912156283855, -0.052617669105529785, 0.014690304175019264, -0.04842560365796089, -0.05800230801105499, -0.01634364016354084, -0.019532864913344383, 0.027537545189261436, -0.0278627909719944, 0.023887554183602333, -0.052111729979515076, -0.002214613137766719, -0.06920524686574936, 0.08188986033201218, 0.047811247408390045, 0.0015460506547242403, -0.006089339032769203, 0.07545720785856247, 0.02302023023366928, -0.03129594773054123, -0.04173997789621353, -0.028441008180379868, 0.038668204098939896, 0.01781628467142582, -0.018990786746144295, -0.008957833051681519, 0.06920524686574936, -0.008027266710996628, -0.031079119071364403, 0.005935750436037779, 0.027700167149305344, -0.03899345174431801, -0.005578882526606321, 0.00868227705359459, -0.02833259105682373, 0.0030266002286225557, -0.06197754293680191, -0.03165733441710472, 0.009639947675168514, 0.030410556122660637, -0.019821973517537117, -0.04271571710705757, 0.004052030388265848, 0.048244912177324295, -0.03597588837146759, 0.017463935539126396, 0.03223555162549019, 0.012151573784649372, -0.025351164862513542, -0.04163156449794769, 0.002563575515523553, -0.030139517039060593, 0.0007696373504586518, -0.017987944185733795, 0.010922865010797977, 0.006762418430298567, -0.02545958012342453, -0.008451893925666809, -0.025351164862513542, 0.07220474630594254, -0.02311057783663273, 0.021701175719499588, 0.06389288604259491, -0.03563256934285164, -0.017599454149603844, 0.010769275948405266, -0.0700002908706665, 0.004099462181329727, 0.0030717733316123486, -0.0008836995111778378, 0.018448708578944206, 0.03142243251204491, -0.001247907872311771, -0.009820640087127686, -0.05529192090034485, -0.01201605424284935, 0.003083066549152136, -0.06851861625909805, 0.0016522074583917856, -0.038162264972925186, -0.004591849632561207, 0.04177611693739891, -0.0948997288942337, -0.04473947361111641, -0.02972392365336418, -0.053015194833278656, 0.05142509937286377, 0.016144879162311554, -0.008198924362659454, -0.009739328175783157, 0.0050684260204434395, -0.018448708578944206, -0.030482832342386246, -0.008366065099835396, 0.04907609522342682, -0.02500784955918789, 0.04134245589375496, -0.029416747391223907, 0.02833259105682373, -0.027700167149305344, -0.0714096948504448, 0.02587517350912094, -0.013606148771941662, 0.0032389138359576464, 0.008474480360746384, -0.019514795392751694, 0.03312094509601593, 0.03133208677172661, 0.026724427938461304, 0.017003169283270836, -0.043474625796079636, 0.030500901862978935, -0.042932551354169846, 0.0673983246088028, 0.01373263355344534, 0.024646462872624397, -0.06848247349262238, -0.06439882516860962, -0.011618531309068203, 0.018611332401633263, 0.05185876041650772, -0.06938593834638596, 0.011564322747290134, -0.05811072513461113, 0.004065582528710365, -0.01734648458659649, -0.022803399711847305, 0.0017685283673927188, -0.03780088201165199, 0.10566899925470352, -0.010949968360364437, 0.014599958434700966, 0.036770932376384735, 0.0440528430044651, -0.0211590975522995, 0.058363694697618484, 0.0282964538782835, 0.05001569911837578, -0.020960336551070213, -0.0006595277809537947, -0.026995467022061348, 0.03344619274139404, -0.01443733461201191, 0.02929026260972023, -0.03122367337346077, -0.050160251557826996, 0.032922182232141495, -0.01247682049870491, 0.03409668430685997, -0.002771371975541115, 0.039210282266139984, -0.05377410352230072, -0.08579282462596893, 0.08095026016235352, 0.06812109053134918, -0.027338782325387, 0.04282413423061371, 0.010669895447790623, -0.014039810746908188, -0.02119523659348488, -0.06519386917352676, 0.004982597194612026, -0.04950975999236107, -0.042498886585235596, 0.09468289464712143, 0.057460229843854904, -0.017482005059719086, -0.030591249465942383, -0.053087469190359116, 0.013371248729526997, -0.061182498931884766, -0.025351164862513542, -0.0063648950308561325, 0.08246807754039764, -0.03606623411178589, 0.039571668952703476, 0.007028940133750439, 0.008582896552979946, 0.014401196502149105, -0.035235047340393066, 0.014762581326067448, -0.03550608456134796, -0.01591901294887066, -0.03221748024225235, 0.03328356891870499, -0.016985099762678146, -0.03324742987751961, -0.040691960602998734, -0.038234543055295944, 0.007575535215437412, -0.08940667659044266, 0.04163156449794769, 0.0665309950709343, 0.027627890929579735, 0.006401033606380224, -0.006315204780548811, 0.025802895426750183, 0.03124174103140831, -0.012865309603512287, 0.0365721732378006, 0.042932551354169846, -0.02690512128174305, -0.02123137377202511, -0.04647412523627281, -0.07596314698457718, -0.02589324302971363, -0.06555525958538055, 0.015042655169963837, -0.05142509937286377, 0.02067122794687748, 0.006428137421607971, 0.06208596006035805, -0.0060532004572451115, 0.03808999061584473, 0.04907609522342682, -0.03125981241464615, -0.025134334340691566, 0.03808999061584473, 0.010959003120660782, -0.06880772113800049, 0.08051659911870956, -0.0013314782408997416, -0.06526614725589752, -0.024592256173491478, -0.05370182543992996, 0.001364228781312704, -0.002793958643451333, 0.023779138922691345, 0.032416243106126785, -0.00985677819699049, -0.05489439517259598, -0.10032050311565399, 0.024772947654128075, -0.02012914977967739, -0.04365532100200653, 0.010877691209316254, 0.016443021595478058, -0.017500072717666626, -0.011257145553827286, -0.016452057287096977, 0.01871974766254425, 0.03610237315297127, -0.005922198295593262, 0.09345418959856033, -0.04434195160865784, -0.010028436779975891, -0.019569003954529762, -0.016686957329511642, 0.014428299851715565, -0.021303651854395866, -0.08304629474878311, -0.03158505633473396, -0.005470466800034046, -0.035343464463949203, -0.023237062618136406, 0.0036612828262150288, 0.05225628614425659, -0.03939097747206688, -0.0037696983199566603, -0.02345389313995838, 0.05175034701824188, 0.005556296091526747, 0.04763055592775345, -0.027483336627483368, -0.027266506105661392, -0.01682247593998909, 0.028928877785801888, 0.008560309186577797, 0.0027962171006947756, -0.030645456165075302, -0.01927989535033703, 0.016108740121126175, 0.024104386568069458, -0.017102550715208054, 0.01974969543516636, 0.022333599627017975, 0.07115672528743744, -0.05326816439628601, -0.010516306385397911, 0.03315708413720131, -0.02025563456118107, 0.014690304175019264, 0.0005731341661885381, -0.018033117055892944, 0.024682601913809776, -0.09237003326416016, 0.06309783458709717, -0.03322935849428177, -0.005560813006013632, 0.018972717225551605, 0.06309783458709717, 0.10646405071020126, -0.01830415613949299, 0.010407891124486923, -0.023237062618136406, 0.007909816689789295, -0.019894249737262726, 0.024158593267202377, -0.02538730390369892, 0.049220651388168335, 0.04618501663208008, 0.01538597047328949, 0.022008351981639862, 0.03268728032708168, -0.015548594295978546, 0.019460586830973625, 0.0632062554359436, -0.029163777828216553, 0.010064574889838696, 0.046871647238731384, -0.04842560365796089, 0.03546994924545288, 0.0383068211376667, -0.014057880267500877, -0.011663704179227352, 0.03469296917319298, -0.021827660501003265, -0.07093989849090576, -0.02399597130715847, 0.003031117608770728, -0.051172129809856415, 0.005334947723895311, -0.018882371485233307, 0.030970703810453415, 0.0005657935398630798, -0.013859118334949017, 0.018367398530244827, 0.05507509037852287, 0.02406824752688408, 0.03315708413720131, -0.0489315427839756, -0.005764092318713665, -0.01179018896073103, 0.04817263409495354, -0.07509582489728928, 0.04076423868536949, 0.027519475668668747, -0.02878432348370552, -0.011293284595012665, 0.00958574004471302, 0.037222664803266525, -0.017653662711381912, -0.023779138922691345, 0.04716075584292412, -0.029597438871860504, -0.07856512069702148, -0.02408631704747677, -0.022893745452165604, 0.06584436446428299, 0.0028142863884568214, -0.044414229691028595, -0.0307358019053936, 0.009305666200816631, 0.07234929502010345, -0.020942267030477524, 0.04119789972901344, 0.022875675931572914, 0.02067122794687748, -0.02827838435769081, -0.014590923674404621, 0.04267958179116249, -0.003464779583737254, 0.046799369156360626, 0.02554992586374283, -0.03613850846886635, 0.008013714104890823, 0.05240083858370781, -0.03566870838403702, 0.01247682049870491, 0.09323735535144806, -0.10682543367147446, -0.04907609522342682, -0.0010909312404692173, 0.04376373440027237, -0.0365721732378006, 0.01154625415802002, -0.03135015815496445, 0.006003509741276503, 0.033807575702667236, 0.04408898204565048, -0.02690512128174305, 0.010191059671342373, -0.0278627909719944, 0.017057375982403755, 0.01634364016354084, -0.016433987766504288, 0.03563256934285164, -0.011139695532619953, 0.004580555949360132, 0.01642495207488537, -0.005109081976115704, 0.03176575154066086, -0.04173997789621353, -0.03550608456134796, -0.0067985570058226585, 0.04676323011517525, 0.023797208443284035, -0.01198895089328289, -0.03223555162549019, 0.02014721930027008, -0.03028407134115696, -0.03606623411178589, 0.04463106021285057, -0.04463106021285057, -0.004420191515237093, 0.04770283401012421, 0.014229537919163704, 0.08051659911870956, -0.042065225541591644, 0.025784825906157494, 0.04748600348830223, -0.00287752877920866, -0.02638111263513565, 0.017012203112244606, 0.0037900262977927923, 0.015657009556889534, 0.00817633792757988, 0.06103794276714325, -0.014509611763060093, 0.06385674327611923, 0.01441023126244545, 0.004248533397912979, 0.004304999951273203, -0.05442459508776665, 0.012991794385015965, -0.02265884540975094, 0.05760478600859642, 0.052617669105529785, -0.05052163824439049, 0.02397790178656578, -0.025224680081009865, -0.001342771458439529, 0.03019372560083866, 0.032976388931274414, 0.03299446031451225, 0.026652151718735695, -0.025080125778913498, 0.03754791244864464, -0.004438260570168495, 0.021357858553528786, -0.025839034467935562, -0.031133325770497322, 0.018466778099536896, 0.005818299949169159, -0.033373914659023285, 0.004621211905032396, -0.03693355619907379, 0.05146123841404915, 0.03122367337346077, 0.03510856255888939, 0.012639443390071392, 0.0471968948841095, -0.05334043875336647, 0.014310849830508232, -0.005913163535296917, -0.006324239075183868, -0.019406380131840706, -0.013055036775767803, 0.003794543445110321, 0.010398856364190578, 0.03519890829920769, 0.03765632584691048, -0.0060260966420173645, 0.08311857283115387, 0.0529429167509079, -0.00233093393035233, -0.009721259586513042, -0.0020011700689792633, 0.007656846661120653, 0.019496725872159004, 0.0021999317687004805, 0.02648952789604664, 0.016253294423222542, -0.008293787948787212, 0.0010056669125333428, 0.02453804761171341, -0.004144635517150164, -0.0019571261946111917, 0.012142539024353027, -0.0051632896065711975, 0.03321129083633423, 0.04170383885502815 ]
39,365
pyspark.sql.dataframe
createOrReplaceGlobalTempView
Creates or replaces a global temporary view using the given name. The lifetime of this temporary view is tied to this Spark application. .. versionadded:: 2.2.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Parameters ---------- name : str Name of the view. Examples -------- Create a global temporary view. >>> df = spark.createDataFrame([(2, "Alice"), (5, "Bob")], schema=["age", "name"]) >>> df.createOrReplaceGlobalTempView("people") Replace the global temporary view. >>> df2 = df.filter(df.age > 3) >>> df2.createOrReplaceGlobalTempView("people") >>> df3 = spark.sql("SELECT * FROM global_temp.people") >>> sorted(df3.collect()) == sorted(df2.collect()) True >>> spark.catalog.dropGlobalTempView("people") True
def createOrReplaceGlobalTempView(self, name: str) -> None: """Creates or replaces a global temporary view using the given name. The lifetime of this temporary view is tied to this Spark application. .. versionadded:: 2.2.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Parameters ---------- name : str Name of the view. Examples -------- Create a global temporary view. >>> df = spark.createDataFrame([(2, "Alice"), (5, "Bob")], schema=["age", "name"]) >>> df.createOrReplaceGlobalTempView("people") Replace the global temporary view. >>> df2 = df.filter(df.age > 3) >>> df2.createOrReplaceGlobalTempView("people") >>> df3 = spark.sql("SELECT * FROM global_temp.people") >>> sorted(df3.collect()) == sorted(df2.collect()) True >>> spark.catalog.dropGlobalTempView("people") True """ self._jdf.createOrReplaceGlobalTempView(name)
(self, name: str) -> NoneType
[ 0.047799769788980484, -0.08220984786748886, -0.010600174777209759, -0.025645583868026733, 0.017996901646256447, 0.01075314823538065, -0.05481856316328049, 0.058093998581171036, 0.002305852947756648, -0.02971288375556469, 0.03336625546216965, -0.0181138813495636, 0.003117963206022978, 0.01071715448051691, -0.03322228044271469, -0.012381868436932564, 0.03757752850651741, 0.016377180814743042, 0.014541496522724628, -0.01432553306221962, -0.004764679819345474, -0.05093123018741608, 0.013326705433428288, -0.001016824971884489, -0.003813093528151512, -0.03039676696062088, -0.03360021486878395, 0.01680910587310791, 0.03426609933376312, -0.03606579080224037, -0.043444517999887466, -0.04556815326213837, -0.03545389696955681, 0.047079894691705704, 0.01430753618478775, -0.02391788177192211, 0.01660214178264141, 0.024565769359469414, 0.060325611382722855, -0.03390616178512573, 0.053090859204530716, -0.05247896537184715, -0.039917126297950745, -0.04117691144347191, -0.011617000214755535, -0.011868956498801708, -0.003957068547606468, -0.01662013866007328, 0.05791402980685234, 0.02749926596879959, 0.01667412929236889, -0.025987526401877403, -0.07385928183794022, 0.027049342170357704, -0.03869333863258362, -0.012840788811445236, 0.021722258999943733, 0.04621604084968567, -0.0065643698908388615, -0.04722386971116066, 0.03370819613337517, 0.019796591252088547, -0.0332762710750103, 0.05089523643255234, -0.02546561509370804, 0.023503953590989113, -0.023126017302274704, 0.000897033023647964, 0.002485821954905987, -0.014478507451713085, -0.06536474823951721, 0.0008424799307249486, 0.009556354954838753, 0.02292805165052414, -0.03187251091003418, 0.0451362282037735, -0.02641945146024227, -0.06936005502939224, -0.06270120292901993, -0.01572929136455059, 0.051399149000644684, -0.051975052803754807, 0.01809588447213173, -0.014496504329144955, -0.007401225622743368, 0.04650399461388588, -0.015342358499765396, -0.0068388222716748714, 0.03194449841976166, -0.04607206583023071, 0.07954630255699158, -0.009727325290441513, -0.015963250771164894, 0.030000833794474602, 0.00588948605582118, -0.0521550215780735, 0.0031359600834548473, -0.029892852529883385, -0.018482817336916924, -0.03572385013103485, 0.008058112114667892, 0.011715983040630817, -0.04650399461388588, -0.034895990043878555, 0.006042459513992071, -0.0012789048487320542, 0.022766079753637314, -0.013749632984399796, 0.014514501206576824, -0.0014847443671897054, -0.022388145327568054, 0.06889213621616364, -0.0042315213941037655, 0.007603690959513187, -0.01108609139919281, 0.04229271784424782, -0.018464820459485054, -0.005052629858255386, -0.027013348415493965, 0.021902229636907578, -0.01931067556142807, -0.014127567410469055, 0.03872933238744736, -0.025573596358299255, -0.022082198411226273, 0.04553215950727463, 0.03496797755360603, 0.0011304303770884871, 0.003687115153297782, 0.04833967611193657, 0.041284892708063126, -0.020192522555589676, -0.004388994071632624, 0.008984953165054321, 0.006321411579847336, 0.0372895784676075, 0.0173760075122118, 0.022820070385932922, 0.003210197202861309, 0.041356880217790604, -0.03757752850651741, -0.01198593620210886, -0.027283301576972008, 0.07378729432821274, 0.042760636657476425, 0.013335703872144222, -0.012876782566308975, 0.022658098489046097, -0.017780939117074013, -0.007779160514473915, -0.01968860998749733, 0.029622899368405342, 0.003122462425380945, 0.019760597497224808, -0.017268026247620583, 0.018878748640418053, 0.033798180520534515, 0.01713304966688156, -0.03496797755360603, -0.01961662247776985, 0.06104549020528793, 0.022100195288658142, -0.024241825565695763, 0.007572196424007416, -0.03529192507266998, -0.02219017967581749, 0.06486083567142487, 0.030702713876962662, -0.04823169484734535, 0.023413969203829765, 0.015279369428753853, 0.042760636657476425, 0.020876405760645866, 0.009889297187328339, -0.019184697419404984, 0.05294688418507576, -0.017780939117074013, -0.012669818475842476, 0.039953120052814484, 0.02758925035595894, -0.005502552725374699, -0.006334909237921238, -0.08768090605735779, 0.028741050511598587, -0.025861546397209167, -0.006006465759128332, -0.002980736782774329, 0.005952475126832724, 0.0614774152636528, 0.04189678654074669, 0.03610178455710411, -0.0027557755820453167, 0.052442971616983414, -0.03318628668785095, 0.039593182504177094, -0.017807934433221817, -0.041320886462926865, -0.013281713239848614, -0.06864017993211746, 0.03746954724192619, 0.014532498084008694, 0.017286023125052452, 0.006429392844438553, -0.012219895608723164, 0.07022390514612198, -0.00886797346174717, 0.027319295331835747, -0.034554049372673035, 0.0012687814887613058, 0.009367386810481548, 0.053810734301805496, 0.03037877008318901, 0.004161783494055271, 0.06104549020528793, -0.012300882488489151, 0.07472313195466995, -0.020642446354031563, 0.006208931095898151, 0.015153391286730766, 0.0023171009961515665, -0.030702713876962662, -0.0012890280922874808, 0.010060267522931099, 0.05442262813448906, -0.03007282130420208, -0.06817226111888885, -0.007833151146769524, -0.03653370961546898, -0.00902094691991806, -0.07195161283016205, 0.048879582434892654, -0.02829112857580185, 0.025483611971139908, -0.06799229234457016, -0.03178252652287483, -0.004769179038703442, 0.0242778193205595, -0.04214874282479286, 0.0025443118065595627, -0.03815343230962753, -0.05366675928235054, 0.013497675769031048, 0.04877160117030144, 0.031278613954782486, 0.02821914106607437, -0.014811449684202671, -0.03257439285516739, 0.02868705987930298, 0.03441007435321808, -0.013452683575451374, -0.00000949055356613826, -0.05910182371735573, -0.01698007620871067, 0.0224781297147274, 0.036641690880060196, -0.014163561165332794, -0.035255931317806244, 0.06511279195547104, -0.031224623322486877, 0.018518811091780663, -0.04110492393374443, -0.007851148024201393, -0.0464320071041584, 0.024061856791377068, -0.02219017967581749, -0.038081444799900055, -0.013281713239848614, -0.0012969017261639237, -0.05082324892282486, -0.025591593235731125, 0.0349859744310379, 0.05550244450569153, 0.03869333863258362, -0.03320428356528282, 0.012021929956972599, -0.04898756369948387, -0.038441382348537445, 0.04042103886604309, -0.06939604878425598, -0.013344702310860157, 0.015045409090816975, -0.01646716520190239, 0.01413656584918499, 0.05229899659752846, -0.05902983620762825, -0.014604485593736172, -0.024763736873865128, -0.034931983798742294, 0.004335003439337015, -0.04117691144347191, -0.04751181975007057, 0.002137131989002228, -0.02152429334819317, 0.03930523246526718, -0.05258694663643837, 0.03930523246526718, -0.05543045699596405, 0.018752770498394966, -0.05874188616871834, 0.0860251858830452, 0.04261666163802147, -0.015351356938481331, 0.010168248787522316, 0.07450716942548752, 0.07058385014533997, -0.04769178852438927, -0.04225672408938408, -0.03212446719408035, 0.024601764976978302, 0.030918676406145096, -0.02148829959332943, -0.036677684634923935, 0.04438035935163498, -0.025645583868026733, -0.023719916120171547, -0.006073954049497843, 0.017744945362210274, -0.033798180520534515, 0.0004876035382039845, 0.003772600321099162, -0.01569329760968685, -0.024961702525615692, -0.07040388137102127, -0.020282506942749023, -0.004890657961368561, 0.011347046121954918, -0.020444480702280998, -0.02787720039486885, 0.010807138867676258, 0.038117438554763794, -0.04103293642401695, 0.016917087137699127, 0.03448206186294556, 0.01788892038166523, -0.02832712233066559, -0.04258066788315773, -0.0005351266008801758, -0.03674967214465141, 0.003358671674504876, -0.0067083449102938175, 0.0003824341401923448, 0.013281713239848614, -0.03676766902208328, -0.008795985952019691, -0.035579875111579895, 0.0771707147359848, -0.0033046810422092676, 0.01554032415151596, 0.06108148396015167, -0.039557188749313354, -0.015846271067857742, -0.014406519941985607, -0.06766834855079651, 0.004521721508353949, 0.0048996564000844955, 0.010600174777209759, 0.04689992591738701, 0.04103293642401695, -0.006087451707571745, -0.03970116376876831, -0.07303142547607422, -0.011787970550358295, -0.0016478413017466664, -0.07385928183794022, 0.02006654441356659, -0.04340852424502373, -0.005129117053002119, 0.04250868037343025, -0.09617543965578079, -0.05737411975860596, -0.022010210901498795, -0.04859163239598274, 0.06198132783174515, 0.014775455929338932, -0.014955424703657627, -0.012228894047439098, -0.012237892486155033, -0.024169838055968285, -0.035975806415081024, -0.017807934433221817, 0.045280203223228455, -0.024565769359469414, 0.03430209308862686, -0.030324779450893402, 0.025105677545070648, -0.01891474239528179, -0.0788264274597168, 0.03082869201898575, -0.005601535551249981, -0.011527014896273613, 0.00799512304365635, -0.019940566271543503, 0.03288033977150917, 0.03300631791353226, 0.018500814214348793, 0.032070476561784744, -0.06475285440683365, 0.011185074225068092, -0.04297659918665886, 0.05337880924344063, 0.03190850466489792, 0.02463775873184204, -0.04585610330104828, -0.06334909051656723, -0.009322394616901875, 0.025519605726003647, 0.062089309096336365, -0.026671407744288445, -0.0017839428037405014, -0.046719957143068314, -0.006609362084418535, -0.010690159164369106, -0.039557188749313354, -0.0022574863396584988, -0.009412379004061222, 0.11309252679347992, 0.02116435579955578, 0.027013348415493965, 0.03324027732014656, 0.031044654548168182, -0.02973088063299656, 0.055286481976509094, 0.022064201533794403, 0.06183735281229019, -0.023719916120171547, -0.006307913921773434, -0.009781315922737122, 0.018680782988667488, -0.02467375248670578, 0.039917126297950745, -0.03226844221353531, -0.05301887169480324, 0.03998911380767822, 0.0044722300954163074, 0.028561081737279892, -0.005084124393761158, 0.059893686324357986, -0.059245798736810684, -0.09099233150482178, 0.07173565030097961, 0.07954630255699158, -0.019976560026407242, 0.04020507633686066, -0.00661836052313447, -0.028021175414323807, -0.00902094691991806, -0.06846021115779877, 0.017385005950927734, -0.04589209705591202, -0.035165946930646896, 0.0987669974565506, 0.06338508427143097, -0.04106893017888069, -0.01823086105287075, -0.044200390577316284, -0.0022597359493374825, -0.04628802835941315, -0.030504748225212097, 0.008175092749297619, 0.08091406524181366, -0.03111664205789566, 0.0322144515812397, 0.012876782566308975, 0.018257856369018555, 0.008593520149588585, -0.03509395569562912, 0.007986124604940414, -0.05830996111035347, -0.01860879547894001, -0.038441382348537445, 0.030306782573461533, -0.05107520520687103, -0.029910849407315254, -0.03642572835087776, -0.033060308545827866, 0.01555832102894783, -0.06892812997102737, 0.02825513482093811, 0.07709872722625732, 0.02296404540538788, -0.019598625600337982, -0.010159250348806381, 0.015702296048402786, 0.0379374697804451, -0.003522893413901329, 0.01375863142311573, 0.04459632188081741, -0.030702713876962662, -0.022694092243909836, -0.03725358471274376, -0.06075754016637802, -0.017214035615324974, -0.0614774152636528, 0.001458873855881393, -0.047367844730615616, 0.025645583868026733, -0.008031116798520088, 0.05651026964187622, -0.0067803324200212955, 0.01963461935520172, 0.04265265539288521, -0.05550244450569153, -0.016494160518050194, 0.025627586990594864, 0.03496797755360603, -0.0752270445227623, 0.06892812997102737, 0.0019312924705445766, -0.054566603153944016, 0.008647510781884193, -0.05737411975860596, -0.000341378734447062, 0.01680910587310791, 0.008229083381593227, 0.031296610832214355, 0.0013193978229537606, -0.06237725913524628, -0.07252751290798187, 0.03613777831196785, -0.030936673283576965, -0.053162846714258194, -0.006231427192687988, 0.013821620494127274, -0.02186623588204384, 0.00705928448587656, -0.03118862956762314, 0.025699574500322342, 0.04175281152129173, -0.0020302755292505026, 0.08120201528072357, -0.04826768860220909, -0.00357238482683897, -0.03181852027773857, -0.010762146674096584, 0.023359978571534157, -0.02431381307542324, -0.06345707178115845, -0.04254467412829399, -0.006753337103873491, -0.03072071075439453, -0.04020507633686066, 0.021992214024066925, 0.0443083718419075, -0.03566985949873924, -0.012030928395688534, -0.005588037893176079, 0.03746954724192619, 0.010879126377403736, 0.06180135905742645, -0.02928095869719982, -0.044884271919727325, -0.01648516207933426, 0.02724730782210827, 0.01215690653771162, -0.022280164062976837, -0.03338425233960152, -0.034949980676174164, -0.0008526031742803752, -0.0003936822176910937, -0.014766457490622997, 0.02361193485558033, 0.040601007640361786, 0.08746494352817535, -0.046036072075366974, 0.020138531923294067, 0.036299750208854675, -0.01159000489860773, 0.014973421581089497, 0.0046881926245987415, -0.015117397531867027, 0.031242620199918747, -0.09523960202932358, 0.09034444391727448, -0.03797346353530884, -0.013164733536541462, 0.015441341325640678, 0.08105804026126862, 0.1121566891670227, -0.010366215370595455, 0.014838445000350475, -0.030882682651281357, 0.02141631208360195, -0.011365042999386787, 0.007450717035681009, -0.020606452599167824, 0.04146486148238182, 0.052406977862119675, 0.044524334371089935, 0.05294688418507576, 0.02613150142133236, -0.02111036516726017, 0.020192522555589676, 0.06777632981538773, -0.03153057023882866, 0.0016624637646600604, 0.04459632188081741, -0.0544586218893528, 0.032772358506917953, 0.033456239849328995, -0.004764679819345474, -0.003729857737198472, 0.010105259716510773, -0.0157832819968462, -0.06716443598270416, -0.037001628428697586, 0.015126395970582962, -0.05586238205432892, 0.0027220314368605614, -0.012894779443740845, 0.028759047389030457, 0.014766457490622997, -0.004355249926447868, 0.026365460827946663, 0.046719957143068314, 0.030234795063734055, 0.028489094227552414, -0.032700370997190475, -0.017367009073495865, -0.030558738857507706, 0.01752898097038269, -0.090272456407547, 0.05010337382555008, 0.029226968064904213, -0.04297659918665886, -0.015846271067857742, 0.00661836052313447, 0.03660569712519646, -0.016422173008322716, -0.03334825858473778, 0.04751181975007057, -0.028777044266462326, -0.09912693500518799, -0.027409281581640244, -0.011023102328181267, 0.04182479903101921, -0.007765662856400013, -0.043804459273815155, -0.03901728242635727, 0.005129117053002119, 0.054170671850442886, 0.004562214482575655, 0.038801319897174835, 0.026041517034173012, 0.005714016035199165, -0.027463272213935852, -0.03336625546216965, 0.053810734301805496, -0.00536757567897439, 0.031008660793304443, 0.03532791882753372, -0.05089523643255234, -0.0032011987641453743, 0.04747582599520683, -0.028363116085529327, 0.003329426748678088, 0.08508934825658798, -0.08364959806203842, -0.0394132137298584, 0.01804189383983612, 0.031296610832214355, -0.032718367874622345, 0.0013958846684545279, -0.024547772482037544, 0.027067339047789574, 0.03714560344815254, 0.04265265539288521, -0.015621310099959373, 0.004620704334229231, -0.015090401284396648, 0.011545011773705482, 0.008035616017878056, -0.04056501388549805, 0.049887411296367645, -0.007374230306595564, -0.0012260389048606157, -0.0027782716788351536, -0.005309085827320814, 0.050247348845005035, -0.03160255774855614, -0.02436780370771885, -0.009592348709702492, 0.03644372522830963, 0.02895701490342617, -0.019436653703451157, -0.02866906300187111, 0.03473401814699173, -0.03649771586060524, -0.010852131061255932, 0.05121918022632599, -0.026923364028334618, -0.0037388561759144068, 0.03289833664894104, -0.00401330878958106, 0.0593537800014019, -0.0332762710750103, 0.010195245034992695, 0.040708988904953, -0.004089795984327793, -0.01739400438964367, 0.013380696065723896, 0.016269199550151825, 0.02578955888748169, 0.0024970700033009052, 0.028183147311210632, -0.014109570533037186, 0.06266520917415619, 0.0015061156591400504, -0.015279369428753853, -0.006856819614768028, -0.065256766974926, 0.009736323729157448, -0.019814588129520416, 0.059605736285448074, 0.06068555265665054, -0.023809900507330894, 0.04582010954618454, -0.04474029690027237, -0.032700370997190475, 0.022460132837295532, 0.044920265674591064, 0.03797346353530884, 0.02749926596879959, -0.002499319612979889, 0.03298832103610039, 0.0014150063507258892, 0.017474990338087082, -0.03998911380767822, -0.032070476561784744, 0.014370525255799294, 0.00856652483344078, -0.030270788818597794, 0.027355289086699486, -0.041284892708063126, 0.007576695643365383, 0.028525087982416153, 0.04225672408938408, 0.006820825394243002, 0.0379374697804451, -0.05607834458351135, 0.00893546175211668, -0.01183296274393797, 0.004076298326253891, -0.03901728242635727, -0.005673523060977459, 0.01968860998749733, -0.00043080083560198545, 0.0428326241672039, 0.028147153556346893, -0.016836101189255714, 0.10128656029701233, 0.06187334656715393, 0.0032439413480460644, -0.010978110134601593, 0.011203071102499962, 0.032016485929489136, 0.008080609142780304, 0.009502364322543144, 0.04571212828159332, 0.012606829404830933, -0.005929979030042887, -0.00751820532605052, 0.03901728242635727, -0.0021033878438174725, 0.0012327877338975668, 0.011904950253665447, -0.004465481266379356, 0.035165946930646896, 0.021740255877375603 ]
39,366
pyspark.sql.dataframe
createOrReplaceTempView
Creates or replaces a local temporary view with this :class:`DataFrame`. The lifetime of this temporary table is tied to the :class:`SparkSession` that was used to create this :class:`DataFrame`. .. versionadded:: 2.0.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Parameters ---------- name : str Name of the view. Examples -------- Create a local temporary view named 'people'. >>> df = spark.createDataFrame([(2, "Alice"), (5, "Bob")], schema=["age", "name"]) >>> df.createOrReplaceTempView("people") Replace the local temporary view. >>> df2 = df.filter(df.age > 3) >>> df2.createOrReplaceTempView("people") >>> df3 = spark.sql("SELECT * FROM people") >>> sorted(df3.collect()) == sorted(df2.collect()) True >>> spark.catalog.dropTempView("people") True
def createOrReplaceTempView(self, name: str) -> None: """Creates or replaces a local temporary view with this :class:`DataFrame`. The lifetime of this temporary table is tied to the :class:`SparkSession` that was used to create this :class:`DataFrame`. .. versionadded:: 2.0.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Parameters ---------- name : str Name of the view. Examples -------- Create a local temporary view named 'people'. >>> df = spark.createDataFrame([(2, "Alice"), (5, "Bob")], schema=["age", "name"]) >>> df.createOrReplaceTempView("people") Replace the local temporary view. >>> df2 = df.filter(df.age > 3) >>> df2.createOrReplaceTempView("people") >>> df3 = spark.sql("SELECT * FROM people") >>> sorted(df3.collect()) == sorted(df2.collect()) True >>> spark.catalog.dropTempView("people") True """ self._jdf.createOrReplaceTempView(name)
(self, name: str) -> NoneType
[ 0.05392847955226898, -0.07443234324455261, 0.009239623323082924, -0.03366388753056526, 0.018865764141082764, 0.00704015139490366, -0.04969518631696701, 0.06048088148236275, -0.005995632149279118, -0.022049937397241592, 0.03186013549566269, -0.004530084319412708, 0.0209824126213789, 0.010445191524922848, -0.024332234635949135, -0.0011250438401475549, 0.03975614905357361, 0.011567934416234493, -0.0008127233595587313, 0.004037733655422926, -0.020651111379265785, -0.05359717831015587, 0.004267804324626923, -0.0027953542303293943, -0.007610725704580545, -0.00838376209139824, -0.023430360481142998, 0.019399527460336685, 0.01777062937617302, -0.018635693937540054, -0.024829186499118805, -0.020816762000322342, -0.03986658155918121, 0.0568733774125576, 0.013316469267010689, 0.004143566358834505, 0.022878190502524376, 0.006626024842262268, 0.07248134911060333, -0.037216171622276306, 0.049547940492630005, -0.047854624688625336, -0.040860485285520554, -0.03360867127776146, -0.04126540943980217, -0.022362833842635155, -0.02420339547097683, -0.02002531848847866, 0.074027419090271, 0.004274706356227398, 0.03406881168484688, -0.0032923060934990644, -0.07137700915336609, 0.018350407481193542, -0.03565169498324394, -0.014733701944351196, 0.006938920356333256, 0.05661569908261299, 0.004987924359738827, -0.040676429867744446, 0.021442553028464317, 0.016427019611001015, -0.026982644572854042, 0.05713105946779251, -0.043658141046762466, 0.019197065383195877, -0.01185322180390358, -0.01507420651614666, 0.0061796884983778, -0.03809964284300804, -0.04962156340479851, 0.010574031621217728, -0.001985506620258093, 0.04325321689248085, -0.03230186924338341, 0.04398944228887558, -0.029228132218122482, -0.05035778880119324, -0.06545040011405945, -0.024589914828538895, 0.04965837299823761, -0.07019905000925064, 0.005572302732616663, -0.01875533163547516, 0.01652825064957142, 0.025270922109484673, -0.012396187521517277, 0.004872889257967472, -0.0026412070728838444, -0.0309030432254076, 0.07583117485046387, 0.00007822390034561977, -0.027829304337501526, 0.010067876428365707, 0.005277812946587801, -0.030019573867321014, 0.027534814551472664, -0.03730820119380951, -0.02764524705708027, -0.00928103644400835, 0.00815369188785553, 0.05087314546108246, -0.04122859984636307, -0.013601756654679775, -0.02079835534095764, 0.004704937804490328, 0.0024341437965631485, -0.01753135770559311, 0.011034172028303146, -0.021387334913015366, -0.0055999113246798515, 0.05654207617044449, -0.0009461641311645508, 0.02420339547097683, -0.01658346690237522, 0.025344545021653175, -0.020687920972704887, -0.009837806224822998, -0.049106206744909286, 0.04119178652763367, 0.006147478707134724, -0.021074440330266953, 0.02692742832005024, -0.04406306520104408, -0.03738182410597801, 0.03336939588189125, 0.04049237444996834, -0.004079146310687065, 0.004129761829972267, 0.0469711534678936, 0.05171980336308479, -0.009847008623182774, 0.008609230630099773, 0.041154976934194565, -0.013656972907483578, 0.064419686794281, 0.01361095905303955, 0.017991498112678528, 0.009727372787892818, 0.01877373643219471, -0.035982996225357056, -0.0027194309514015913, -0.014512835070490837, 0.06581851094961166, 0.02252848446369171, -0.0036788240540772676, -0.015009786933660507, 0.011613949202001095, -0.010767290368676186, 0.004665825981646776, 0.0014287366066128016, 0.0013873239513486624, 0.011144605465233326, 0.01581043191254139, 0.00482227373868227, 0.0005130567587912083, 0.01803751103579998, 0.010656856931746006, -0.029725084081292152, -0.022546889260411263, 0.058934807777404785, 0.020448649302124977, -0.005291617009788752, 0.03117912821471691, -0.046345360577106476, -0.015874851495027542, 0.06633386760950089, 0.01534108817577362, -0.0593029223382473, 0.037087332457304, 0.03760268911719322, 0.06607618927955627, 0.030295656993985176, 0.013270455412566662, -0.024019340053200722, 0.05783047154545784, 0.005305421072989702, -0.03384794294834137, 0.03110550530254841, -0.0011515018995851278, -0.010546422563493252, 0.012515824288129807, -0.08959858119487762, 0.043105971068143845, -0.026393665000796318, -0.02495802566409111, -0.01676752418279648, 0.0007281724829226732, 0.06902109086513519, 0.027037862688302994, 0.017862658947706223, -0.008107677102088928, 0.05587947368621826, -0.026890616863965988, 0.010730478912591934, -0.04148627817630768, -0.030350875109434128, -0.011218228377401829, -0.06979412585496902, 0.027774086222052574, 0.03163926675915718, 0.009322448633611202, 0.03537560999393463, -0.011190619319677353, 0.07612565904855728, 0.010113890282809734, 0.018193960189819336, -0.051057200878858566, 0.012037278153002262, -0.01384102925658226, 0.053523555397987366, 0.01954677328467369, -0.009948239661753178, 0.05282414332032204, -0.01522145140916109, 0.049106206744909286, 0.010537220165133476, -0.004306916147470474, 0.018470043316483498, 0.011402283795177937, -0.029798705130815506, -0.00182100641541183, -0.004516280256211758, 0.07483726739883423, -0.006331534590572119, -0.07686188817024231, -0.01607731357216835, -0.025510195642709732, -0.01039917767047882, -0.07384336739778519, 0.03016681782901287, -0.039167169481515884, 0.022160371765494347, -0.06033363565802574, -0.039130356162786484, 0.02670656144618988, 0.004332223907113075, -0.04917982965707779, -0.013647770509123802, -0.048554036766290665, -0.04991605132818222, 0.01581043191254139, 0.06648111343383789, 0.0070585571229457855, 0.02129530720412731, -0.01605890691280365, -0.01978604681789875, 0.02943059243261814, 0.02149776928126812, -0.023117464035749435, -0.010389975272119045, -0.04641898348927498, 0.0029909140430390835, 0.028547123074531555, 0.029743488878011703, -0.011540326289832592, -0.02372485026717186, 0.03773152828216553, -0.02449788525700569, 0.008328544907271862, -0.045351456850767136, -0.03335099294781685, -0.02643047645688057, 0.014255155809223652, -0.010389975272119045, -0.05337630957365036, -0.0309030432254076, -0.018221568316221237, -0.049032583832740784, -0.02048546075820923, 0.06294723600149155, 0.04465204477310181, 0.03854137659072876, -0.023927312344312668, 0.02913610264658928, -0.05032097548246384, -0.0321730300784111, 0.01777062937617302, -0.05260327458381653, 0.012773503549396992, -0.010840912349522114, -0.024663535878062248, -0.016160137951374054, 0.04398944228887558, -0.040897298604249954, -0.014209141954779625, -0.008139886893332005, -0.0444311760365963, 0.012313362210988998, -0.0371425487101078, -0.0321178138256073, -0.011466704308986664, 0.0010600489331409335, 0.00692051462829113, -0.0469343401491642, 0.03563328832387924, -0.06493504345417023, -0.00364201283082366, -0.06552401930093765, 0.059155676513910294, 0.021829070523381233, -0.02939378283917904, 0.0209824126213789, 0.0863591879606247, 0.05543773993849754, -0.054701514542102814, -0.06961007416248322, -0.042848292738199234, 0.02175544761121273, 0.021865881979465485, -0.007624529767781496, -0.015322682447731495, 0.03333258628845215, -0.040639620274305344, 0.0013470615958794951, -0.013969868421554565, 0.01751295104622841, -0.014512835070490837, -0.0041412655264139175, 0.010656856931746006, -0.011751990765333176, -0.010408381000161171, -0.0865800604224205, -0.018994605168700218, -0.01608651503920555, 0.013482119888067245, -0.019473150372505188, -0.014181533828377724, 0.0185160581022501, 0.028528718277812004, -0.04814911261200905, -0.00015644780069123954, 0.03486025333404541, 0.0135741475969553, -0.056726135313510895, -0.03901992365717888, -0.0027953542303293943, -0.034694600850343704, 0.004863686393946409, 0.02076154388487339, 0.018000701442360878, 0.006607619114220142, -0.02617279812693596, -0.005434260703623295, -0.038688622415065765, 0.09254347532987595, 0.008052460849285126, 0.010666059330105782, 0.0715242549777031, -0.015884052962064743, -0.021571392193436623, -0.02792133204638958, -0.06736458837985992, -0.006800878327339888, -0.022583700716495514, -0.006768668536096811, 0.037915587425231934, 0.03559647873044014, -0.010003456845879555, -0.03263317048549652, -0.0741010457277298, -0.022602107375860214, -0.0135741475969553, -0.06622343510389328, 0.014144722372293472, -0.035449232906103134, -0.0012435299577191472, 0.0247187539935112, -0.0940895527601242, -0.04354770854115486, -0.0259335245937109, -0.040676429867744446, 0.044836100190877914, 0.0015483731403946877, -0.00987461768090725, -0.030332468450069427, -0.016951579600572586, -0.00007268783519975841, -0.030295656993985176, 0.012883936986327171, 0.031068693846464157, -0.03809964284300804, 0.036700814962387085, -0.03629589080810547, 0.0048958961851894855, -0.028510311618447304, -0.09865414351224899, 0.02567584626376629, -0.016509845852851868, -0.005084553733468056, -0.010721276514232159, -0.015460724011063576, 0.025270922109484673, 0.009235021658241749, 0.03613024204969406, 0.03854137659072876, -0.05264008417725563, 0.008646042086184025, -0.023411953821778297, 0.03134477883577347, 0.0519406720995903, 0.010343960486352444, -0.020062129944562912, -0.05356036499142647, -0.0080110477283597, 0.03013000637292862, 0.06456693261861801, -0.015433115884661674, 0.002427241764962673, -0.05654207617044449, 0.02573106251657009, -0.011659963056445122, -0.02523411065340042, -0.00767054408788681, -0.026375260204076767, 0.1310480386018753, 0.015037395060062408, 0.016141733154654503, 0.019399527460336685, 0.03736341744661331, -0.017715413123369217, 0.06478779762983322, 0.008558615110814571, 0.05805134028196335, -0.03920397907495499, 0.00017916725482791662, 0.013546539470553398, 0.008526405319571495, -0.0037639501970261335, 0.038173265755176544, -0.014908555895090103, -0.07008861750364304, 0.04380538687109947, 0.018957793712615967, 0.03629589080810547, 0.0022984023671597242, 0.05562179535627365, -0.04627173766493797, -0.09732893854379654, 0.0667019858956337, 0.07730362564325333, -0.01258024387061596, 0.041412655264139175, -0.02394571714103222, -0.020835166797041893, -0.01950996182858944, -0.04421031102538109, -0.00451397942379117, -0.06154840812087059, -0.02937537617981434, 0.11705976724624634, 0.06037044897675514, -0.0370689257979393, -0.018589681014418602, -0.07575754821300507, 0.02425861358642578, -0.03066376969218254, -0.017246069386601448, 0.001022087293677032, 0.08098474889993668, -0.010923737660050392, 0.025767873972654343, 0.000330726063111797, 0.015939271077513695, 0.016657089814543724, -0.028215821832418442, -0.011825613677501678, -0.04825954511761665, -0.0173288956284523, -0.009419078007340431, 0.03898311406373978, -0.07840795814990997, -0.010730478912591934, -0.044099874794483185, -0.015460724011063576, 0.026853805407881737, -0.07329119741916656, 0.028602339327335358, 0.10034746676683426, 0.044099874794483185, -0.044836100190877914, -0.0234855767339468, 0.024589914828538895, 0.030939854681491852, 0.017614182084798813, 0.025068460032343864, 0.011936047114431858, -0.0037087332457304, -0.0036627191584557295, -0.02519729919731617, -0.04144946485757828, -0.017255272716283798, -0.06655474007129669, 0.01002186257392168, -0.04836998134851456, 0.013252049684524536, -0.010150701738893986, 0.06228463351726532, -0.010610842145979404, 0.010693667456507683, 0.06055450439453125, -0.05249284207820892, 0.009847008623182774, -0.0010634999489411712, 0.020816762000322342, -0.079291433095932, 0.08172097057104111, 0.0004748076025862247, -0.06530315428972244, 0.004541588015854359, -0.04667666181921959, 0.01334407739341259, 0.02024618722498417, -0.00636834604665637, 0.02026459202170372, 0.020430242642760277, -0.060149580240249634, -0.04152308776974678, 0.03898311406373978, -0.03532039374113083, -0.03986658155918121, 0.007974236272275448, 0.020080536603927612, -0.007118375040590763, -0.012828719802200794, -0.02400093339383602, 0.00888531468808651, 0.031215939670801163, 0.018341204151511192, 0.08437138050794601, -0.05333949998021126, -0.010702870786190033, -0.022105155512690544, -0.02022778056561947, 0.0160220954567194, -0.03440011292695999, -0.07034629583358765, -0.04030831903219223, -0.01806512102484703, -0.020338214933872223, -0.02396412193775177, 0.03609342873096466, 0.02400093339383602, -0.061437975615262985, -0.014209141954779625, 0.001081905560567975, 0.016914768144488335, 0.01753135770559311, 0.05241921916604042, -0.04119178652763367, -0.041375841945409775, -0.020835166797041893, 0.036976899951696396, 0.02147936448454857, -0.012837923131883144, -0.0395352803170681, -0.010739682242274284, -0.01580122858285904, -0.0012504321057349443, -0.022620512172579765, 0.024534696713089943, 0.025823090225458145, 0.07840795814990997, -0.04965837299823761, 0.010997360572218895, 0.041118163615465164, 0.017595777288079262, 0.010334758087992668, 0.007817788980901241, -0.026025552302598953, 0.03824688866734505, -0.07200280576944351, 0.08716903626918793, -0.014043491333723068, -0.006009436212480068, 0.0025192699395120144, 0.08076387643814087, 0.11050736904144287, -0.003614404471591115, 0.004711839836090803, -0.022896597161889076, -0.009409875608980656, -0.025896713137626648, -0.023319926112890244, -0.0247187539935112, 0.03747384995222092, 0.027258729562163353, 0.03727138787508011, 0.04354770854115486, 0.019105037674307823, -0.016417816281318665, 0.013509728014469147, 0.0519406720995903, -0.0210376288741827, 0.01633499190211296, 0.046823907643556595, -0.059229299426078796, 0.03145521134138107, 0.03920397907495499, 0.02251007780432701, -0.01827678456902504, -0.0015380199765786529, -0.01726447604596615, -0.07218685746192932, -0.041375841945409775, 0.019344311207532883, -0.04873809218406677, 0.00789141096174717, -0.002611297881230712, 0.015249059535562992, 0.039498470723629, -0.0055630998685956, 0.039424847811460495, 0.03861499950289726, 0.04071323946118355, 0.026320042088627815, -0.03657197579741478, -0.035265177488327026, -0.036203861236572266, 0.04222250357270241, -0.06585532426834106, 0.04627173766493797, 0.04233293607831001, -0.018690912052989006, -0.013693784363567829, 0.01533188484609127, 0.043142784386873245, -0.017936279997229576, -0.04494653269648552, 0.03285403922200203, 0.005760960280895233, -0.0940895527601242, -0.027792492881417274, 0.006934319157153368, 0.015230653807520866, -0.025326138362288475, -0.024111367762088776, -0.05164618045091629, 0.013942260295152664, 0.04144946485757828, -0.0141907362267375, 0.019933290779590607, 0.0320810042321682, -0.011687571182847023, -0.02889683097600937, -0.044394366443157196, 0.03931441530585289, -0.025620628148317337, 0.024553103372454643, 0.053781233727931976, -0.03392156586050987, -0.007546306122094393, 0.04159671068191528, -0.030995070934295654, 0.039682526141405106, 0.09327970445156097, -0.08113199472427368, -0.034436922520399094, 0.03182332590222359, 0.03879905492067337, -0.028271038085222244, -0.005917408037930727, -0.012745894491672516, 0.013656972907483578, 0.06883703172206879, 0.07041991502046585, -0.048038680106401443, 0.031215939670801163, -0.018902575597167015, 0.004882091656327248, -0.0037570481654256582, -0.016463831067085266, 0.017430126667022705, 0.008954335935413837, -0.005825379863381386, -0.005678134970366955, -0.026890616863965988, 0.02666974999010563, -0.030258845537900925, -0.030056385323405266, 0.007509494666010141, 0.026577722281217575, 0.045866817235946655, -0.029559433460235596, -0.019841263070702553, 0.040124259889125824, -0.04347408562898636, -0.022362833842635155, 0.05786728113889694, -0.05481195077300072, -0.006064653396606445, 0.009184406138956547, -0.02447948046028614, 0.06221101060509682, -0.027516407892107964, 0.010031064972281456, 0.03738182410597801, -0.01320603583008051, -0.008549412712454796, -0.0051535749807953835, 0.01583804003894329, 0.031492024660110474, -0.0012078691506758332, 0.032743606716394424, -0.019951697438955307, 0.04380538687109947, -0.006184289697557688, -0.01950996182858944, 0.006064653396606445, -0.08076387643814087, -0.002740137279033661, -0.012138509191572666, 0.06640749424695969, 0.05113082379102707, -0.0005861041136085987, 0.04251699149608612, -0.04255380481481552, -0.04840679094195366, 0.047302454710006714, 0.04862765967845917, 0.043879009783267975, 0.009386868216097355, -0.008121482096612453, 0.052787330001592636, -0.008627636358141899, -0.0013792715035378933, -0.05676294490695, -0.03417924419045448, 0.01928909495472908, 0.001793398056179285, -0.029596243053674698, 0.03776834160089493, -0.035725317895412445, -0.010205918923020363, 0.040124259889125824, 0.02919132076203823, 0.0042378949001431465, 0.036203861236572266, -0.03686646372079849, 0.016997594386339188, -0.016187746077775955, 0.008438978344202042, -0.039645716547966, -0.01384102925658226, 0.04744970053434372, 0.0028298646211624146, 0.06026001274585724, 0.029964355751872063, -0.000969746324699372, 0.08326704800128937, 0.038688622415065765, 0.012028075754642487, -0.03502590209245682, 0.0135741475969553, 0.057940904051065445, -0.006023240741342306, 0.02718510664999485, 0.05738873779773712, 0.015690794214606285, -0.024424264207482338, -0.010086282156407833, 0.04104454070329666, 0.02052227035164833, -0.0007166690193116665, -0.016482235863804817, -0.011301053687930107, 0.04792824387550354, 0.029264941811561584 ]
39,367
pyspark.sql.dataframe
createTempView
Creates a local temporary view with this :class:`DataFrame`. The lifetime of this temporary table is tied to the :class:`SparkSession` that was used to create this :class:`DataFrame`. throws :class:`TempTableAlreadyExistsException`, if the view name already exists in the catalog. .. versionadded:: 2.0.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Parameters ---------- name : str Name of the view. Examples -------- Create a local temporary view. >>> df = spark.createDataFrame([(2, "Alice"), (5, "Bob")], schema=["age", "name"]) >>> df.createTempView("people") >>> df2 = spark.sql("SELECT * FROM people") >>> sorted(df.collect()) == sorted(df2.collect()) True Throw an exception if the table already exists. >>> df.createTempView("people") # doctest: +IGNORE_EXCEPTION_DETAIL Traceback (most recent call last): ... AnalysisException: "Temporary table 'people' already exists;" >>> spark.catalog.dropTempView("people") True
def createTempView(self, name: str) -> None: """Creates a local temporary view with this :class:`DataFrame`. The lifetime of this temporary table is tied to the :class:`SparkSession` that was used to create this :class:`DataFrame`. throws :class:`TempTableAlreadyExistsException`, if the view name already exists in the catalog. .. versionadded:: 2.0.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Parameters ---------- name : str Name of the view. Examples -------- Create a local temporary view. >>> df = spark.createDataFrame([(2, "Alice"), (5, "Bob")], schema=["age", "name"]) >>> df.createTempView("people") >>> df2 = spark.sql("SELECT * FROM people") >>> sorted(df.collect()) == sorted(df2.collect()) True Throw an exception if the table already exists. >>> df.createTempView("people") # doctest: +IGNORE_EXCEPTION_DETAIL Traceback (most recent call last): ... AnalysisException: "Temporary table 'people' already exists;" >>> spark.catalog.dropTempView("people") True """ self._jdf.createTempView(name)
(self, name: str) -> NoneType
[ 0.04258241131901741, -0.049630533903837204, 0.03445137292146683, -0.03033996745944023, 0.03307478502392769, 0.0034919411409646273, -0.03595644235610962, 0.061303988099098206, -0.015252579003572464, -0.03454314544796944, 0.034120991826057434, 0.027495021000504494, 0.02202538400888443, -0.010774084366858006, -0.033533647656440735, 0.013160167261958122, 0.045776091516017914, 0.004501437768340111, 0.0017149974592030048, 0.02727476879954338, -0.024962102994322777, -0.05825714394450188, 0.016638342291116714, 0.009691169485449791, -0.01106775552034378, 0.0003246449923608452, -0.036892518401145935, 0.010755729861557484, 0.03692922741174698, -0.014004473574459553, -0.05355839431285858, -0.009434206411242485, -0.042435575276613235, 0.0701141431927681, -0.0038406765088438988, 0.015482010319828987, 0.0254026111215353, -0.0022013913840055466, 0.0622217133641243, -0.0508052222430706, 0.05480650067329407, -0.029477305710315704, -0.03751657158136368, -0.022153865545988083, -0.039682403206825256, -0.05480650067329407, -0.02676084265112877, -0.033753901720047, 0.04482165724039078, -0.008213632740080357, 0.026210207492113113, 0.020300062373280525, -0.06372678279876709, 0.02241082862019539, -0.03307478502392769, -0.025072230026125908, 0.0024090264923870564, 0.040049489587545395, -0.012251620180904865, -0.018923476338386536, -0.0051071359775960445, 0.05175965279340744, -0.0023814947344362736, 0.05649511143565178, -0.03692922741174698, 0.01865733601152897, -0.006951761897653341, -0.019235502928495407, -0.010361107997596264, -0.033919092267751694, -0.03751657158136368, 0.007534516975283623, -0.00582754984498024, 0.04706090688705444, -0.01737252250313759, 0.0016736998222768307, -0.023640580475330353, -0.05568751320242882, -0.059211574494838715, -0.01985955610871315, 0.02863300032913685, -0.06908629089593887, -0.0008850304293446243, -0.012728837318718433, 0.03415770083665848, 0.043610259890556335, -0.021896902471780777, 0.015876632183790207, -0.007832777686417103, 0.013802574016153812, 0.061891332268714905, 0.003441466251388192, -0.02547602914273739, 0.028889963403344154, -0.007575814612209797, -0.041921649128198624, 0.017436763271689415, -0.019969681277871132, -0.032854530960321426, -0.0005050351610407233, 0.0010507943807169795, 0.049043189734220505, -0.029660850763320923, 0.002144033554941416, -0.03162478283047676, 0.0032074465416371822, -0.011040223762392998, -0.015775682404637337, 0.011141173541545868, -0.010489589534699917, 0.003168443450704217, 0.06409387290477753, 0.013095926493406296, 0.02085069753229618, -0.031257692724466324, 0.016812710091471672, -0.008176923729479313, -0.0027141699101775885, -0.0727204754948616, 0.020024744793772697, 0.028467809781432152, -0.028669709339737892, 0.030450094491243362, -0.05065838620066643, -0.05128243565559387, 0.04636343568563461, 0.0363602377474308, -0.006859989836812019, -0.008103505708277225, 0.07782302796840668, 0.056862201541662216, 0.0028472398407757282, 0.02619185298681259, 0.03228554129600525, -0.01270130556076765, 0.06108373403549194, 0.02006145380437374, 0.026210207492113113, 0.006034037563949823, 0.03872796893119812, -0.028981735929846764, 0.0023184011224657297, -0.02676084265112877, 0.06559893488883972, 0.024576658383011818, 0.00805303081870079, -0.020318416878581047, 0.0007123835384845734, -0.0017757966415956616, 0.00023387631517834961, 0.0015670143766328692, 0.0023287255316972733, -0.01668422855436802, 0.011297186836600304, -0.0029367180541157722, -0.011095287278294563, 0.022943109273910522, 0.011040223762392998, -0.013481371104717255, -0.012866495177149773, 0.03850771486759186, 0.012894026935100555, -0.0025237419176846743, 0.031863391399383545, -0.05965208262205124, -0.012536115013062954, 0.04544571042060852, 0.02903679944574833, -0.06941667199134827, 0.008869806304574013, 0.03814062476158142, 0.0642407089471817, 0.016619987785816193, 0.03061528503894806, -0.03041338548064232, 0.035112135112285614, 0.022869691252708435, -0.0037580812349915504, 0.014353209175169468, -0.01238927897065878, -0.004145819693803787, -0.005653182044625282, -0.10469399392604828, 0.04493178427219391, -0.01343548484146595, -0.024870330467820168, -0.004430314525961876, 0.0014695061836391687, 0.08494456857442856, 0.024044377729296684, -0.004434903152287006, -0.018427904695272446, 0.04673052579164505, -0.0204468984156847, 0.014197195880115032, -0.04654698073863983, -0.021474750712513924, -0.0204468984156847, -0.07576732337474823, 0.021713359281420708, 0.020777279511094093, 0.01249022874981165, 0.025732990354299545, -0.011746872216463089, 0.07789644598960876, -0.0035653591621667147, 0.0005371555453166366, -0.03083553910255432, 0.0055063460022211075, -0.022190574556589127, 0.04221532121300697, -0.014940552413463593, -0.016418088227510452, 0.08134708553552628, -0.008805565536022186, 0.035607706755399704, 0.0009699199581518769, -0.00884686317294836, 0.012903204187750816, 0.009470915421843529, -0.015197515487670898, -0.013499725610017776, -0.0044555519707500935, 0.08868888020515442, -0.0022495717275887728, -0.0770888477563858, -0.024851975962519646, -0.025604508817195892, -0.005134667735546827, -0.06963692605495453, 0.02815578319132328, -0.03894822299480438, 0.025512738153338432, -0.03595644235610962, -0.058734357357025146, 0.05352168530225754, 0.015738973394036293, -0.046693816781044006, 0.010563007555902004, -0.057045746594667435, -0.0444178581237793, 0.016831064596772194, 0.07470276206731796, 0.0044853780418634415, 0.047758374363183975, -0.006497488357126713, -0.0030376676004379988, 0.05392548441886902, 0.011526618152856827, -0.034341245889663696, -0.011214591562747955, -0.011370604857802391, 0.019510820508003235, 0.003168443450704217, 0.033937446773052216, -0.042141903191804886, -0.02718299627304077, 0.032157063484191895, -0.009516801685094833, 0.02182348445057869, -0.05454953759908676, -0.02360387146472931, -0.011242123320698738, 0.03228554129600525, -0.02509058453142643, -0.07378503680229187, -0.04584950953722, -0.01640891097486019, -0.067507803440094, -0.022153865545988083, 0.053484976291656494, 0.050548259168863297, 0.019400693476200104, -0.03204693645238876, 0.01759277656674385, -0.0712888315320015, -0.020869052037596703, 0.01927221193909645, -0.0759141594171524, 0.021015888080000877, -0.035515934228897095, -0.018831703811883926, -0.001480977633036673, 0.04852926358580589, -0.04808875545859337, -0.0068645779974758625, 0.01661081053316593, -0.06123057007789612, 0.021181078627705574, -0.03766340762376785, -0.040049489587545395, -0.031000729650259018, 0.003744315356016159, -0.008888160809874535, -0.028192492201924324, 0.0059560309164226055, -0.07015085220336914, -0.029073508456349373, -0.07158250361680984, 0.04247228428721428, 0.0302298404276371, -0.017556067556142807, 0.005377864930778742, 0.09015724062919617, 0.006056980695575476, -0.03843429684638977, -0.07224325835704803, -0.036084920167922974, 0.039755817502737045, 0.011306364089250565, -0.005786252208054066, 0.015160806477069855, 0.05106218531727791, -0.017455117776989937, -0.006511254236102104, 0.011113641783595085, 0.025824762880802155, -0.019932972267270088, -0.009544333443045616, 0.027917174622416496, -0.016766823828220367, 0.017427586019039154, -0.0864129289984703, -0.024851975962519646, -0.008929458446800709, 0.02567792683839798, -0.019988035783171654, -0.02854122780263424, 0.015197515487670898, 0.0353507436811924, -0.05275079607963562, 0.0019432813860476017, 0.03404757380485535, 0.011315541341900826, -0.07356478273868561, -0.043793804943561554, 0.0037397267296910286, -0.03272604942321777, -0.004535852465778589, 0.005689891055226326, 0.029183635488152504, -0.006869166623800993, -0.01759277656674385, -0.011480731889605522, -0.011581681668758392, 0.08604583889245987, -0.0006383919971995056, 0.014701943844556808, 0.07121541351079941, -0.003925566095858812, -0.019786138087511063, -0.006327709648758173, -0.06695716828107834, 0.0006194639718160033, -0.01630796119570732, -0.02026335336267948, 0.016427265480160713, 0.03329503908753395, -0.010599716566503048, -0.009755410254001617, -0.06647995114326477, -0.025035521015524864, -0.007011414039880037, -0.06475462764501572, 0.013160167261958122, -0.039278604090213776, 0.002592571312561631, 0.021805129945278168, -0.09456232190132141, -0.03612162917852402, -0.022355765104293823, -0.0543292835354805, 0.02698109671473503, 0.0039668637327849865, 0.000047140918468357995, -0.029605787247419357, 0.0014144426677376032, 0.008323759771883488, -0.0254026111215353, 0.029477305710315704, 0.024338049814105034, -0.034231118857860565, 0.03990265354514122, -0.020777279511094093, 0.007364737801253796, -0.029550723731517792, -0.09536991268396378, 0.0181801188737154, -0.019125375896692276, 0.014399095438420773, -0.0005414573824964464, -0.01679435558617115, 0.03872796893119812, 0.002757761627435684, 0.05858752503991127, 0.016555747017264366, -0.04287608340382576, 0.02378741465508938, -0.01677600108087063, 0.04988749697804451, 0.02509058453142643, 0.003714489284902811, -0.043903931975364685, -0.03949885815382004, -0.01145320013165474, 0.02598995342850685, 0.04724445194005966, -0.04713432490825653, 0.01659245602786541, -0.07088503241539001, 0.03507542610168457, -0.022153865545988083, -0.00948009267449379, -0.011480731889605522, -0.046877361834049225, 0.13310673832893372, -0.020979179069399834, -0.003404757473617792, 0.018391195684671402, 0.04463811218738556, -0.008654140867292881, 0.06537868082523346, 0.023842478170990944, 0.044491276144981384, -0.040049489587545395, -0.0003473013057373464, -0.00525856064632535, 0.025916535407304764, 0.004652862437069416, 0.028302619233727455, -0.011792758479714394, -0.06890274584293365, 0.038764677941799164, -0.003039961913600564, 0.0268709696829319, 0.007199547719210386, 0.02806401066482067, -0.0365254282951355, -0.09008382260799408, 0.06548880785703659, 0.06908629089593887, -0.01757442206144333, 0.04199506714940071, -0.012829786166548729, -0.004377545323222876, -0.032432377338409424, -0.036286819726228714, -0.017115559428930283, -0.06174449622631073, -0.03465327247977257, 0.11012692004442215, 0.05403561145067215, -0.010333576239645481, -0.028724772855639458, -0.07055465131998062, 0.039278604090213776, -0.045078620314598083, -0.026430461555719376, -0.014426627196371555, 0.08795469999313354, -0.014656058512628078, 0.03584631532430649, -0.0081448033452034, 0.013407953083515167, 0.024448176845908165, -0.03212035447359085, -0.0050474838353693485, -0.013105103746056557, -0.014032005332410336, -0.004565678536891937, 0.03865455090999603, -0.038691259920597076, -0.016124416142702103, -0.038067206740379333, -0.020979179069399834, 0.021107660606503487, -0.08927622437477112, 0.036580491811037064, 0.09544333070516586, 0.05058496817946434, -0.006318532396107912, -0.026357043534517288, 0.026595652103424072, 0.03276275843381882, 0.013481371104717255, 0.04882293567061424, 0.013371244072914124, -0.0038750912062823772, 0.003989806864410639, -0.027935529127717018, -0.06537868082523346, -0.02292475476861, -0.06112044304609299, 0.01967601105570793, -0.05403561145067215, 0.0029206578619778156, 0.008296228013932705, 0.06974705308675766, -0.009461738169193268, 0.018308600410819054, 0.06310272961854935, -0.03810391575098038, 0.0020706155337393284, 0.0030766709242016077, -0.00040179118514060974, -0.0639837458729744, 0.09008382260799408, 0.0009601691272109747, -0.06849894672632217, -0.040049489587545395, -0.040159616619348526, 0.012113961391150951, -0.001724174595437944, 0.00454044109210372, 0.01747347228229046, 0.012132315896451473, -0.0598723366856575, -0.06875590980052948, 0.028467809781432152, -0.018143409863114357, -0.02727476879954338, 0.022098802030086517, 0.023750705644488335, 0.0038177333772182465, -0.030596930533647537, -0.009062527678906918, 0.003129440126940608, 0.02184183895587921, 0.01757442206144333, 0.11056742817163467, -0.056458402425050735, -0.01081079337745905, -0.003189092269167304, -0.024870330467820168, 0.008117271587252617, -0.03369883820414543, -0.0946357399225235, -0.01739087700843811, -0.011884530074894428, -0.03230389580130577, -0.004808875732123852, 0.021456396207213402, 0.024062732234597206, -0.05623814836144447, 0.002092411508783698, -0.014518399722874165, 0.02340197190642357, 0.013609852641820908, 0.039168477058410645, -0.0369475819170475, -0.021493105217814445, -0.01797822117805481, 0.03210199996829033, 0.024246277287602425, 0.013316180557012558, -0.03964569419622421, 0.004301832988858223, -0.002916069235652685, 0.024943748489022255, -0.022465892136096954, 0.015546251088380814, 0.0071123638190329075, 0.06269893050193787, -0.060312844812870026, -0.017427586019039154, 0.041921649128198624, 0.011737694963812828, 0.0035240615252405405, 0.0049970089457929134, -0.03641530126333237, 0.031661491841077805, -0.06923312693834305, 0.07235338538885117, 0.0007066477555781603, -0.019602593034505844, 0.00015486599295400083, 0.07242680341005325, 0.09830663353204727, -0.007699707522988319, 0.000252230791375041, -0.019510820508003235, -0.010168385691940784, -0.0397191122174263, -0.0005388762801885605, -0.03309313952922821, 0.03979252651333809, 0.01471112109720707, 0.000845453585498035, 0.004398194141685963, 0.030982375144958496, -0.015124097466468811, 0.012040543369948864, 0.040857087820768356, -0.02125449664890766, 0.025659572333097458, 0.04346342757344246, -0.04269253835082054, 0.021217787638306618, 0.0403064526617527, 0.01572061888873577, -0.030651994049549103, 0.014344031922519207, -0.02321842685341835, -0.06211158633232117, -0.022943109273910522, 0.007025179918855429, -0.047868501394987106, 0.010553830303251743, -0.010076613165438175, 0.0185563862323761, 0.019988035783171654, -0.01660163328051567, 0.0369475819170475, 0.046583689749240875, 0.03259756788611412, 0.030266549438238144, -0.048933062702417374, -0.028210846707224846, -0.01378421951085329, 0.073050856590271, -0.0499609149992466, 0.03832416981458664, 0.04493178427219391, -0.007167427334934473, -0.013692447915673256, 0.014307322911918163, 0.04493178427219391, -0.019914617761969566, -0.03558935225009918, 0.025531092658638954, 0.004239886533468962, -0.07459263503551483, -0.022465892136096954, -0.004974065814167261, 0.04423431307077408, -0.011315541341900826, -0.02173171378672123, -0.03672732785344124, 0.029514014720916748, 0.053191304206848145, -0.04592292755842209, 0.024723494425415993, 0.02953236922621727, 0.004721691831946373, -0.029569078236818314, -0.03287288546562195, 0.03004629537463188, -0.03445137292146683, 0.042141903191804886, 0.047354575246572495, -0.025439320132136345, 0.0071123638190329075, 0.04023303464055061, -0.032065290957689285, 0.04724445194005966, 0.10447373986244202, -0.09713194519281387, -0.04515203833580017, 0.011508263647556305, 0.04757482931017876, -0.03002794086933136, 0.0006533050327561796, -0.018308600410819054, -0.002815119456499815, 0.06335969269275665, 0.05957866460084915, -0.059211574494838715, 0.031569719314575195, -0.03615833818912506, 0.0056348275393247604, 0.001228603534400463, 0.0008488950552418828, 0.0029023033566772938, -0.0016622282564640045, 0.007396858185529709, 0.013196876272559166, -0.017739612609148026, 0.001992609119042754, -0.04225203022360802, -0.03949885815382004, 0.01407789159566164, 0.03457985445857048, 0.04316975548863411, -0.02619185298681259, -0.02518235705792904, 0.028963381424546242, -0.033753901720047, -0.04269253835082054, 0.047281160950660706, -0.06185462325811386, -0.01352725736796856, 0.024136150255799294, -0.01502314768731594, 0.08560533076524734, -0.04316975548863411, 0.023383617401123047, 0.046290017664432526, -0.006814103573560715, -0.0046276249922811985, -0.005396219436079264, 0.005616473034024239, 0.02175006829202175, -0.0007737563573755324, 0.060019172728061676, -0.02301652729511261, 0.042619120329618454, 0.007447333075106144, -0.009819651022553444, 0.0254026111215353, -0.07216984033584595, 0.0037007234059274197, -0.014995615929365158, 0.07183946669101715, 0.041627977043390274, -0.029403887689113617, 0.020924115553498268, -0.029881104826927185, -0.016665874049067497, 0.05807359889149666, 0.03617669269442558, 0.04533558338880539, 0.005272326525300741, -0.028100719675421715, 0.05095205828547478, -0.025843117386102676, 0.004242180846631527, -0.0499609149992466, -0.03792037069797516, 0.023365262895822525, -0.00029424537206068635, -0.03880138695240021, 0.009507624432444572, -0.045702673494815826, 0.027917174622416496, 0.03814062476158142, 0.01437156368046999, 0.008034677244722843, 0.045886218547821045, -0.017060495913028717, 0.028394391760230064, -0.015748150646686554, 0.001861833268776536, -0.02055702544748783, -0.014344031922519207, 0.02745831198990345, 0.019217148423194885, 0.058734357357025146, 0.04012290760874748, -0.000774903513956815, 0.05994575470685959, 0.030596930533647537, 0.004134348127990961, -0.040049489587545395, 0.005015363451093435, 0.03766340762376785, -0.012545292265713215, 0.032230477780103683, 0.029293762519955635, 0.014518399722874165, -0.032946303486824036, -0.0003309543535578996, 0.03270769491791725, 0.015197515487670898, -0.008172335103154182, -0.011076932772994041, -0.01343548484146595, 0.04394064098596573, 0.04438114911317825 ]
39,368
pyspark.sql.dataframe
crossJoin
Returns the cartesian product with another :class:`DataFrame`. .. versionadded:: 2.1.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Parameters ---------- other : :class:`DataFrame` Right side of the cartesian product. Returns ------- :class:`DataFrame` Joined DataFrame. Examples -------- >>> from pyspark.sql import Row >>> df = spark.createDataFrame( ... [(14, "Tom"), (23, "Alice"), (16, "Bob")], ["age", "name"]) >>> df2 = spark.createDataFrame( ... [Row(height=80, name="Tom"), Row(height=85, name="Bob")]) >>> df.crossJoin(df2.select("height")).select("age", "name", "height").show() +---+-----+------+ |age| name|height| +---+-----+------+ | 14| Tom| 80| | 14| Tom| 85| | 23|Alice| 80| | 23|Alice| 85| | 16| Bob| 80| | 16| Bob| 85| +---+-----+------+
def crossJoin(self, other: "DataFrame") -> "DataFrame": """Returns the cartesian product with another :class:`DataFrame`. .. versionadded:: 2.1.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Parameters ---------- other : :class:`DataFrame` Right side of the cartesian product. Returns ------- :class:`DataFrame` Joined DataFrame. Examples -------- >>> from pyspark.sql import Row >>> df = spark.createDataFrame( ... [(14, "Tom"), (23, "Alice"), (16, "Bob")], ["age", "name"]) >>> df2 = spark.createDataFrame( ... [Row(height=80, name="Tom"), Row(height=85, name="Bob")]) >>> df.crossJoin(df2.select("height")).select("age", "name", "height").show() +---+-----+------+ |age| name|height| +---+-----+------+ | 14| Tom| 80| | 14| Tom| 85| | 23|Alice| 80| | 23|Alice| 85| | 16| Bob| 80| | 16| Bob| 85| +---+-----+------+ """ jdf = self._jdf.crossJoin(other._jdf) return DataFrame(jdf, self.sparkSession)
(self, other: pyspark.sql.dataframe.DataFrame) -> pyspark.sql.dataframe.DataFrame
[ -0.012486020103096962, -0.038260411471128464, 0.03521328046917915, 0.05167499557137489, -0.024503251537680626, -0.0280732624232769, -0.049619533121585846, -0.0068064588122069836, 0.01579459011554718, 0.03310373052954674, 0.007167065981775522, -0.023511581122875214, 0.05084560066461563, 0.09094510972499847, -0.010502681136131287, -0.030399177223443985, 0.04100102558732033, -0.011674654670059681, 0.10219604521989822, 0.047239527106285095, -0.003691714955493808, -0.026468560099601746, 0.001697107101790607, 0.008632032200694084, -0.05052105337381363, 0.02682916633784771, -0.06797443330287933, 0.04294830560684204, -0.01171973068267107, 0.036331165581941605, -0.03312176093459129, 0.001091963378712535, 0.05401894077658653, -0.0023845143150538206, -0.009375784546136856, 0.011972155421972275, 0.014829966239631176, -0.05318954586982727, 0.040676478296518326, -0.01642565242946148, 0.005174711812287569, -0.003031353233382106, 0.055966220796108246, -0.06061805039644241, -0.024431129917502403, 0.01111571304500103, -0.026973409578204155, 0.004117682110518217, -0.0402798131108284, -0.0191842969506979, 0.0261620432138443, 0.0041740271262824535, -0.037250712513923645, 0.0018965678755193949, -0.05445167049765587, 0.06862352788448334, 0.0002963739389088005, -0.0494752936065197, -0.01742633804678917, 0.0037660901434719563, 0.00837960746139288, -0.029227204620838165, -0.042010724544525146, 0.048573773354291916, 0.03243660554289818, 0.013910418376326561, -0.02740613929927349, -0.016371561214327812, -0.05823804438114166, -0.012585187330842018, -0.058310166001319885, 0.03454615920782089, -0.04237133264541626, 0.058310166001319885, -0.03822435066103935, 0.0011945109581574798, 0.018372930586338043, -0.002551295096054673, -0.022826427593827248, -0.03840465471148491, 0.004913271404802799, -0.05272075533866882, -0.0406043566763401, -0.06108684092760086, 0.012332762591540813, 0.04760013520717621, 0.012431928887963295, 0.056687433272600174, -0.04763619601726532, -0.03872920200228691, -0.0052423253655433655, 0.06909231841564178, -0.07266233116388321, -0.034582220017910004, 0.004397152457386255, -0.0631062388420105, -0.0207709688693285, 0.00817225780338049, 0.010962455533444881, 0.02737007848918438, 0.04323678836226463, 0.05412712320685387, -0.0011753537692129612, 0.00825339462608099, 0.016101107001304626, -0.0707150474190712, -0.06577473133802414, -0.015938833355903625, 0.026234164834022522, -0.052035603672266006, -0.03485267609357834, 0.028938718140125275, 0.043597396463155746, -0.014072691090404987, -0.017354216426610947, -0.03066963329911232, 0.00669827638193965, 0.003908079117536545, -0.03764738142490387, 0.044102247804403305, 0.0264865905046463, 0.033698733896017075, 0.046951040625572205, -0.06097865849733353, -0.004000484943389893, 0.016515804454684258, 0.005607440136373043, -0.01262124814093113, -0.007383429910987616, 0.018318839371204376, 0.0659550353884697, -0.044318608939647675, 0.0009832177311182022, 0.043525274842977524, 0.038584958761930466, -0.03402327746152878, 0.03952253609895706, 0.008600478991866112, 0.03158918023109436, 0.02883053570985794, 0.013459659181535244, -0.04031587392091751, 0.03851283714175224, 0.03692616522312164, -0.043020423501729965, 0.026540681719779968, 0.019148236140608788, -0.03348236903548241, 0.0009730756864883006, 0.026234164834022522, 0.005197249818593264, 0.03768343850970268, 0.013405567966401577, -0.030723724514245987, -0.04976377636194229, -0.003989215940237045, 0.011918064206838608, -0.005936494097113609, 0.045616794377565384, -0.038296472281217575, -0.032652970403432846, -0.015938833355903625, -0.013234280049800873, 0.053333789110183716, -0.035537827759981155, -0.011223895475268364, 0.039089806377887726, -0.00048372059245593846, 0.0019326285691931844, -0.02740613929927349, 0.03786374256014824, -0.02765856310725212, 0.11186031997203827, -0.06285381317138672, -0.07442930340766907, 0.016849366948008537, -0.004169519525021315, 0.018399976193904877, 0.007568241097033024, -0.029389478266239166, 0.006590094417333603, -0.05445167049765587, -0.008528357371687889, -0.0016441429033875465, -0.0019348823698237538, -0.025981741026043892, -0.017363231629133224, -0.028632203117012978, 0.09447905421257019, -0.004340807907283306, -0.0030696678441017866, -0.08358871936798096, 0.004926794208586216, 0.05261257290840149, 0.00015001818246673793, -0.02682916633784771, 0.0002481990959495306, 0.05153075233101845, -0.044895581901073456, 0.12383247166872025, -0.006865057162940502, 0.017309140413999557, 0.027063561603426933, -0.013576856814324856, 0.04626588895916939, -0.028524020686745644, -0.02610795386135578, -0.019779298454523087, 0.008046045899391174, -0.053009241819381714, 0.026666894555091858, -0.035952527076005936, -0.010295332409441471, 0.016642017289996147, 0.03016478195786476, 0.03050735965371132, -0.07688143104314804, -0.02670295536518097, 0.023709915578365326, -0.010250256396830082, 0.06267350912094116, -0.013423598371446133, -0.04049617424607277, 0.029804175719618797, -0.007658393122255802, -0.020374299958348274, 0.0720132365822792, 0.025260526686906815, 0.02042839117348194, -0.030327055603265762, -0.03862101957201958, -0.03739495575428009, -0.011214880272746086, -0.0063827452249825, -0.038873445242643356, 0.00962820928543806, -0.027424169704318047, 0.018643386662006378, 0.008185780607163906, 0.007031837943941355, -0.030723724514245987, 0.040135569870471954, 0.05376651510596275, -0.033536460250616074, 0.022718247026205063, -0.014875042252242565, -0.016101107001304626, 0.06346684694290161, -0.013576856814324856, 0.01692148670554161, -0.016056030988693237, -0.03505100682377815, 0.018282778561115265, 0.002636939287185669, 0.02924523502588272, -0.048032864928245544, 0.013991555199027061, -0.04074859991669655, -0.012567156925797462, 0.027388108894228935, 0.020662786439061165, 0.001992354169487953, -0.04157799854874611, 0.010115028358995914, -0.05236014723777771, -0.012296701781451702, -0.05484833940863609, 0.007599794305860996, 0.0018965678755193949, 0.016858380287885666, 0.08719479292631149, -0.023295218124985695, 0.00040202055242843926, 0.02369188517332077, 0.033536460250616074, 0.003080936847254634, -0.019671116024255753, 0.017525503411889076, -0.015163527801632881, -0.04770831763744354, 0.013450643979012966, -0.004126697313040495, -0.07248202711343765, -0.04074859991669655, -0.03142690658569336, -0.0328332744538784, 0.0011139378184452653, -0.0701020136475563, 0.038007985800504684, -0.014911103062331676, -0.014920118264853954, 0.036457374691963196, 0.05784137547016144, 0.029948418959975243, -0.01922035776078701, 0.010142073966562748, 0.023890219628810883, 0.010872303508222103, -0.02169051580131054, 0.017985278740525246, 0.04760013520717621, 0.004426451865583658, 0.030146751552820206, 0.06602715700864792, -0.024503251537680626, -0.06638776510953903, 0.057516828179359436, 0.013189204037189484, 0.013261325657367706, 0.02416067384183407, -0.01583966612815857, 0.062276843935251236, -0.010682985186576843, 0.021257787942886353, -0.06707292050123215, -0.013919433578848839, 0.003195880213752389, -0.0060311537235975266, -0.0005290781846269965, -0.0065224808640778065, 0.010015862062573433, 0.006554033607244492, -0.0015923056052997708, 0.07024625688791275, 0.02318703569471836, 0.06429624557495117, 0.035952527076005936, 0.014866027049720287, 0.03312176093459129, -0.03389706462621689, 0.026468560099601746, 0.04161405935883522, 0.0168854258954525, -0.00589141808450222, -0.00723017193377018, -0.011079652234911919, -0.011999201029539108, 0.004687892273068428, 0.053297728300094604, 0.0386931411921978, 0.02001369372010231, -0.05950016900897026, -0.028487959876656532, -0.07695355266332626, -0.005269370973110199, -0.023042792454361916, -0.026216134428977966, 0.02971402369439602, -0.04366951808333397, -0.021618394181132317, 0.0011206992203369737, 0.039594657719135284, 0.020320208743214607, -0.01758860982954502, -0.018021339550614357, 0.02895674854516983, -0.08517539501190186, 0.005751682911068201, -0.0022526674438267946, 0.03514115884900093, 0.0701020136475563, -0.03707040846347809, 0.02908296138048172, -0.0021151858381927013, 0.012341777794063091, 0.02619810402393341, -0.03443797677755356, -0.02315097488462925, -0.06869564950466156, 0.0048997486010193825, -0.002239144640043378, -0.04684286192059517, 0.04659043624997139, 0.030777813866734505, 0.015190573409199715, 0.02984023652970791, -0.05748077109456062, -0.015109436586499214, 0.03948647528886795, 0.014442313462495804, -0.015938833355903625, -0.07064292579889297, 0.021780667826533318, -0.01867944747209549, -0.0016554119065403938, 0.01925641857087612, -0.0014401745283976197, -0.06808261573314667, 0.044859521090984344, 0.012981855310499668, 0.01604701578617096, 0.017823005095124245, 0.029100991785526276, 0.013712084852159023, -0.04507588595151901, -0.044066186994314194, 0.005287401378154755, -0.010755105875432491, 0.038332533091306686, -0.03016478195786476, -0.025260526686906815, 0.012648293748497963, 0.0009663142845965922, -0.051747117191553116, -0.03158918023109436, 0.037503138184547424, 0.0162543635815382, -0.05820198357105255, -0.0063241468742489815, -0.012026246637105942, -0.036421313881874084, -0.023962341248989105, -0.07093141227960587, 0.027334017679095268, 0.03606070950627327, 0.011900033801794052, 0.020861119031906128, -0.02562113292515278, 0.06483715027570724, 0.10428757220506668, 0.03351842984557152, -0.007649377919733524, 0.01925641857087612, 0.01504633016884327, -0.021762637421488762, -0.026252195239067078, -0.043272849172353745, 0.03205797076225281, 0.004277701489627361, -0.012864657677710056, -0.03717859089374542, -0.040351931005716324, -0.0005496440571732819, 0.01867944747209549, 0.009258586913347244, 0.012567156925797462, 0.04965559393167496, 0.03142690658569336, -0.0037593289744108915, 0.01178283616900444, 0.038332533091306686, -0.05874289572238922, -0.005503765773028135, -0.04237133264541626, -0.03333812579512596, -0.04850165173411369, -0.024881888180971146, -0.025044161826372147, -0.07702567428350449, 0.022880518808960915, 0.059608351439237595, 0.06238502636551857, -0.016326485201716423, 0.012531096115708351, -0.04348921403288841, 0.03782768175005913, 0.007834188640117645, -0.08935843408107758, -0.040676478296518326, 0.07709779590368271, 0.041974663734436035, -0.044859521090984344, 0.01616421341896057, 0.0271176528185606, -0.016605956479907036, 0.0018852988723665476, -0.03952253609895706, -0.02286248840391636, -0.0033108238130807877, -0.015172543004155159, 0.018192626535892487, -0.0008372845477424562, 0.026252195239067078, -0.03613283112645149, 0.02924523502588272, 0.017056714743375778, -0.0672532245516777, 0.010493665933609009, -0.0016734421951696277, -0.013035946525633335, -0.11568275094032288, -0.042263150215148926, 0.010646924376487732, -0.029533719643950462, 0.047744378447532654, -0.005679561756551266, -0.000924619089346379, 0.014243979938328266, 0.06624352186918259, 0.0007685438613407314, 0.018949901685118675, 0.032526757568120956, -0.010863288305699825, -0.03627707436680794, 0.005882402881979942, 0.03746707737445831, -0.018751569092273712, 0.010250256396830082, -0.03898162767291069, 0.0028713338542729616, -0.03270706161856651, 0.007338354364037514, -0.032021909952163696, 0.03692616522312164, 0.043561335653066635, -0.029930388554930687, 0.04659043624997139, -0.009961770847439766, -0.005183727014809847, -0.023619763553142548, -0.04482346028089523, -0.03220221400260925, 0.017020653933286667, 0.012161473743617535, 0.014649663120508194, -0.03101220913231373, -0.0264865905046463, 0.06234896555542946, 0.07464566826820374, -0.02035626955330372, -0.009051238186657429, 0.02641446888446808, 0.02841583825647831, -0.010457605123519897, -0.08358871936798096, 0.004989900626242161, 0.003486619796603918, 0.04009950906038284, -0.010782151482999325, 0.019959602504968643, -0.09152207523584366, 0.033193882554769516, 0.005467704962939024, -0.006621647626161575, -0.023114914074540138, 0.03669176995754242, -0.038007985800504684, 0.02080702967941761, 0.026089923456311226, -0.026720985770225525, 0.002226748736575246, 0.027315987274050713, -0.02318703569471836, 0.0019495320739224553, -0.06018532067537308, -0.012819581665098667, -0.052251964807510376, -0.011142758652567863, 0.0494752936065197, -0.014649663120508194, 0.011458289809525013, 0.052504390478134155, 0.043272849172353745, -0.015497089363634586, 0.03209403157234192, -0.024016432464122772, 0.002370991511270404, -0.028632203117012978, -0.012062307447195053, 0.01528974063694477, 0.02435900829732418, -0.027189774438738823, 0.09217116981744766, -0.0694529265165329, 0.024268856272101402, -0.028271595016121864, 0.01143124420195818, -0.01671413891017437, 0.02464749477803707, -0.04442679136991501, 0.015298755839467049, -0.0018221926875412464, 0.011900033801794052, -0.01525367982685566, 0.031607210636138916, 0.013892387971282005, 0.01747141405940056, 0.04215496778488159, -0.04734770953655243, -0.028524020686745644, -0.03158918023109436, 0.06115896254777908, -0.03505100682377815, 0.03955859690904617, -0.02778477594256401, 0.008176765404641628, -0.05261257290840149, -0.003937378525733948, 0.13465069234371185, -0.036241013556718826, -0.05957229062914848, -0.012350792996585369, -0.025062192231416702, -0.005427136551588774, -0.015893757343292236, 0.021510211750864983, -0.03651146590709686, 0.01017813477665186, 0.01925641857087612, -0.04626588895916939, 0.03941435366868973, 0.056435007601976395, 0.015587241388857365, -0.0024701585061848164, -0.04868195578455925, -0.016596941277384758, -0.03862101957201958, 0.004886225797235966, 0.004074859898537397, 0.038548897951841354, -0.00029496531351469457, 0.03167933225631714, -0.0321841835975647, -0.08575236797332764, 0.031228573992848396, -0.015587241388857365, -0.043020423501729965, -0.04550861567258835, 0.0011511254124343395, -0.010899349115788937, -0.01382928155362606, -0.008073091506958008, -0.012431928887963295, 0.03259887918829918, -0.038584958761930466, 0.05416318401694298, -0.008632032200694084, 0.014658678323030472, -0.008600478991866112, 0.03952253609895706, 0.032779183238744736, -0.05088166147470474, 0.040424052625894547, -0.008785289712250233, 0.01701163873076439, -0.04421043023467064, -0.006364714819937944, -0.03472646325826645, -0.0035993093624711037, 0.034870706498622894, -0.0022278756368905306, 0.01124192588031292, -0.045616794377565384, -0.008059568703174591, -0.041938602924346924, -0.0643683671951294, -0.03894556686282158, -0.00896559376269579, -0.014793905429542065, -0.037791620939970016, -0.0021951955277472734, -0.017660731449723244, 0.041974663734436035, 0.002040810650214553, 0.0050439913757145405, 0.04922286793589592, -0.02749628946185112, 0.015497089363634586, 0.06620746105909348, 0.0523240864276886, 0.0466264970600605, 0.0176787618547678, 0.029317356646060944, 0.012161473743617535, 0.031823575496673584, 0.00762683991342783, 0.0656665489077568, -0.009961770847439766, -0.012008216232061386, 0.05008832365274429, 0.014180873520672321, 0.02156430296599865, -0.01834588497877121, -0.006418806035071611, 0.0008902487461455166, -0.07075110822916031, -0.009835558012127876, -0.059644412249326706, 0.052251964807510376, -0.03955859690904617, -0.019833389669656754, 0.036745861172676086, 0.016768230125308037, -0.012467989698052406, -0.025422800332307816, -0.011223895475268364, 0.05957229062914848, 0.014992239885032177, -0.039342232048511505, -0.10190755873918533, 0.03606070950627327, 0.007414983119815588, 0.009907679632306099, 0.05621864274144173, -0.051206205040216446, -0.003711999161168933, -0.02578340657055378, -0.08604084700345993, 0.0187155082821846, 0.04074859991669655, -0.028487959876656532, 0.041217390447854996, 0.03330206498503685, 0.03757525980472565, 0.011395184323191643, 0.0558219775557518, 0.022501882165670395, -0.002061094855889678, 0.03472646325826645, -0.015497089363634586, -0.0008750356500968337, 0.003763836342841387, 0.041722238063812256, 0.06133926659822464, 0.04078466072678566, 0.012269656173884869, -0.006495435256510973, 0.022285517305135727, -0.015848681330680847, 0.023998402059078217, -0.029822206124663353, -0.025296587496995926, 0.042551636695861816, -0.024286886677145958, -0.02911902219057083, 0.05257651209831238, 0.017823005095124245, -0.0016689347103238106, 0.03380691260099411, 0.020987331867218018, -0.002472412306815386, 0.03952253609895706, 0.07208535820245743, 0.04900650307536125, -0.0030629064422100782, -0.039378292858600616, -0.02899280935525894, -0.042551636695861816, 0.044066186994314194, 0.00045357609633356333, -0.03092205710709095, -0.041433755308389664, 0.015848681330680847, -0.029227204620838165, -0.012053292244672775, 0.007590779103338718, -0.046446193009614944, 0.02194294147193432, 0.007518657948821783, 0.04082072153687477, 0.02102339267730713, 0.019815359264612198, -0.034906767308712006, -0.07374414801597595, 0.042227089405059814, 0.02686522714793682, 0.009258586913347244, -0.031733423471450806, -0.014595571905374527, -0.09267602115869522, -0.03292342647910118, 0.07172475010156631, -0.021708546206355095, 0.05217984691262245, 0.02261006459593773, 0.0029817698523402214, 0.05210772529244423, 0.033608581870794296 ]
39,369
pyspark.sql.dataframe
crosstab
Computes a pair-wise frequency table of the given columns. Also known as a contingency table. The first column of each row will be the distinct values of `col1` and the column names will be the distinct values of `col2`. The name of the first column will be `$col1_$col2`. Pairs that have no occurrences will have zero as their counts. :func:`DataFrame.crosstab` and :func:`DataFrameStatFunctions.crosstab` are aliases. .. versionadded:: 1.4.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Parameters ---------- col1 : str The name of the first column. Distinct items will make the first item of each row. col2 : str The name of the second column. Distinct items will make the column names of the :class:`DataFrame`. Returns ------- :class:`DataFrame` Frequency matrix of two columns. Examples -------- >>> df = spark.createDataFrame([(1, 11), (1, 11), (3, 10), (4, 8), (4, 8)], ["c1", "c2"]) >>> df.crosstab("c1", "c2").sort("c1_c2").show() +-----+---+---+---+ |c1_c2| 10| 11| 8| +-----+---+---+---+ | 1| 0| 2| 0| | 3| 1| 0| 0| | 4| 0| 0| 2| +-----+---+---+---+
def crosstab(self, col1: str, col2: str) -> "DataFrame": """ Computes a pair-wise frequency table of the given columns. Also known as a contingency table. The first column of each row will be the distinct values of `col1` and the column names will be the distinct values of `col2`. The name of the first column will be `$col1_$col2`. Pairs that have no occurrences will have zero as their counts. :func:`DataFrame.crosstab` and :func:`DataFrameStatFunctions.crosstab` are aliases. .. versionadded:: 1.4.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Parameters ---------- col1 : str The name of the first column. Distinct items will make the first item of each row. col2 : str The name of the second column. Distinct items will make the column names of the :class:`DataFrame`. Returns ------- :class:`DataFrame` Frequency matrix of two columns. Examples -------- >>> df = spark.createDataFrame([(1, 11), (1, 11), (3, 10), (4, 8), (4, 8)], ["c1", "c2"]) >>> df.crosstab("c1", "c2").sort("c1_c2").show() +-----+---+---+---+ |c1_c2| 10| 11| 8| +-----+---+---+---+ | 1| 0| 2| 0| | 3| 1| 0| 0| | 4| 0| 0| 2| +-----+---+---+---+ """ if not isinstance(col1, str): raise PySparkTypeError( error_class="NOT_STR", message_parameters={"arg_name": "col1", "arg_type": type(col1).__name__}, ) if not isinstance(col2, str): raise PySparkTypeError( error_class="NOT_STR", message_parameters={"arg_name": "col2", "arg_type": type(col2).__name__}, ) return DataFrame(self._jdf.stat().crosstab(col1, col2), self.sparkSession)
(self, col1: str, col2: str) -> pyspark.sql.dataframe.DataFrame
[ -0.03575577959418297, 0.040323060005903244, 0.021726412698626518, -0.0006283418624661863, 0.036338064819574356, 0.01876041293144226, 0.010754028335213661, 0.07336758822202682, -0.032444048672914505, 0.012519072741270065, -0.020252510905265808, 0.05462536960840225, 0.018687626346945763, -0.003850797424092889, 0.013683637604117393, -0.016576852649450302, 0.0749688670039177, -0.046982914209365845, 0.07289448380470276, 0.029696404933929443, 0.009039024822413921, -0.056335825473070145, 0.01341979019343853, 0.014793612994253635, -0.026730403304100037, -0.011026973836123943, -0.05458897724747658, -0.013911091722548008, 0.018087148666381836, -0.016658736392855644, -0.03759361058473587, 0.02203575149178505, -0.027112526819109917, 0.04170598089694977, 0.020725615322589874, 0.006564324721693993, 0.03197094425559044, -0.028731998056173325, -0.000625498709268868, 0.03708411380648613, 0.027949556708335876, -0.038139499723911285, -0.05942920222878456, -0.021034952253103256, -0.008079168386757374, 0.009170948527753353, 0.031934551894664764, -0.04225187003612518, -0.03380877524614334, -0.07627899944782257, 0.0006903231260366738, -0.030315078794956207, -0.01794157736003399, 0.024037346243858337, -0.019833995029330254, 0.031297679990530014, 0.0007540102815255523, -0.032644208520650864, -0.01025362964719534, 0.05302409455180168, 0.0345730185508728, 0.03426368162035942, -0.03289895877242088, 0.036483634263277054, -0.029678208753466606, 0.02030709944665432, 0.024801593273878098, 0.02452864684164524, -0.04963957890868187, -0.03759361058473587, -0.054734550416469574, 0.022818192839622498, -0.0019197124056518078, 0.06885489821434021, 0.011381802149116993, -0.05502568930387497, 0.01954285427927971, -0.05298770219087601, -0.006041180342435837, -0.01738658919930458, 0.024455862119793892, -0.04822026565670967, -0.01530311070382595, -0.07613343000411987, 0.020216118544340134, 0.07460493594408035, 0.05182313546538353, 0.051531996577978134, -0.06514284759759903, 0.03337206318974495, -0.05105889216065407, 0.0018810451729223132, 0.0006886172341182828, 0.004671906586736441, 0.018441976979374886, -0.03087916597723961, -0.045381639152765274, -0.032626014202833176, -0.03803032264113426, -0.008902552537620068, 0.041342053562402725, 0.026821384206414223, -0.006113965529948473, 0.02101675607264042, 0.016149239614605904, -0.0332992784678936, -0.041160088032484055, -0.004803830292075872, -0.013883796520531178, -0.020470866933465004, -0.045891135931015015, 0.008588666096329689, 0.057536784559488297, 0.0009456403204239905, -0.001873084343969822, -0.023873580619692802, 0.042688582092523575, 0.0018639861373230815, -0.05884691700339317, 0.015776215121150017, 0.009434795007109642, -0.00785171426832676, 0.09214619547128677, -0.0857410877943039, -0.012864802964031696, 0.0016490420093759894, -0.017695927992463112, -0.009480285458266735, 0.021034952253103256, 0.09025377780199051, 0.04720126837491989, -0.06725361943244934, 0.006682600826025009, 0.06066654995083809, 0.027622023597359657, -0.03644724190235138, 0.09010820835828781, 0.019124338403344154, 0.009916997514665127, 0.036792971193790436, 0.026093531399965286, -0.013929287903010845, -0.02465602196753025, 0.0029478047508746386, 0.005554428324103355, 0.014165840111672878, 0.030660809949040413, 0.01521212887018919, -0.014620748348534107, 0.0442170724272728, -0.022690819576382637, -0.004785633645951748, 0.03428187966346741, -0.02620271034538746, -0.010462887585163116, 0.012864802964031696, 0.015066558495163918, -0.027713004499673843, 0.03369959443807602, -0.033590417355298996, -0.015503269620239735, 0.01130901649594307, -0.019324498251080513, 0.05160478129982948, -0.0011241917964071035, 0.044471822679042816, 0.0412328764796257, 0.010417397134006023, -0.01654955931007862, -0.07999105006456375, 0.006441499572247267, -0.013547164388000965, 0.019124338403344154, -0.01553056389093399, -0.015848999843001366, 0.003047884674742818, -0.023473260924220085, -0.0012214283924549818, 0.02927788905799389, -0.04654620215296745, 0.03722968325018883, -0.04308890178799629, -0.06772672384977341, -0.0008614822872914374, -0.02485618181526661, 0.029059533029794693, 0.02452864684164524, -0.03520989045500755, 0.08232017606496811, 0.030915558338165283, -0.04105091094970703, -0.03792114183306694, 0.02165362797677517, 0.0826113224029541, 0.09134555608034134, -0.0668896958231926, -0.00391448475420475, 0.018724018707871437, -0.0402502715587616, 0.004353471100330353, 0.04727405682206154, 0.06226782873272896, 0.05160478129982948, 0.039413243532180786, 0.08457652479410172, 0.026875974610447884, 0.003100199159234762, 0.019033357501029968, -0.042433831840753555, -0.031315878033638, 0.0010951913427561522, -0.08996263891458511, 0.011527372524142265, 0.009107260964810848, 0.005204149056226015, 0.013647244311869144, -0.004010015167295933, -0.017977969720959663, -0.0023154825903475285, -0.05360637605190277, 0.08770629018545151, 0.028040539473295212, -0.02358243800699711, 0.026621224358677864, 0.013265121728181839, -0.0320255346596241, 0.03409991413354874, 0.004967596847563982, -0.011272624135017395, -0.0005191639065742493, -0.023473260924220085, -0.04949400573968887, -0.009307420812547207, -0.009525776840746403, -0.04105091094970703, -0.005736391991376877, 0.040759772062301636, 0.03157062456011772, 0.005768235307186842, -0.03722968325018883, -0.007596966344863176, -0.016831601038575172, 0.036338064819574356, -0.030205901712179184, -0.006714444141834974, -0.00637326342985034, 0.02249065972864628, -0.016076454892754555, -0.03984995558857918, 0.032626014202833176, -0.06066654995083809, -0.04822026565670967, -0.011763924732804298, -0.07889927178621292, 0.010299121029675007, -0.057864315807819366, -0.051022499799728394, 0.048256658017635345, 0.0018981043249368668, 0.026694010943174362, 0.008474938571453094, 0.01120893657207489, 0.012509974651038647, 0.003746168687939644, -0.024455862119793892, -0.04028666764497757, 0.003423183923587203, 0.02607533521950245, -0.0072830794379115105, 0.0009427971672266722, -0.03701132908463478, -0.06452417373657227, 0.03317190334200859, 0.0000830207354738377, -0.00909816287457943, -0.009343813173472881, 0.036792971193790436, -0.011736630462110043, -0.013128649443387985, 0.00041112324106507003, 0.023473260924220085, -0.003855346702039242, -0.036137904971838, 0.018487466499209404, -0.028804784640669823, -0.0035118910018354654, -0.013747324235737324, -0.04221547767519951, 0.023982757702469826, -0.010590261779725552, -0.006664404645562172, 0.0049857934936881065, 0.03306272625923157, 0.036210689693689346, -0.030569827184081078, 0.04228826239705086, 0.027840379625558853, -0.02523830346763134, -0.05855577811598778, -0.005649959202855825, -0.0017821027431637049, 0.022272303700447083, 0.009562169201672077, 0.0654703825712204, 0.006477891933172941, -0.03766639530658722, 0.026421066373586655, -0.008565920405089855, 0.0402502715587616, -0.008092815987765789, -0.008847963996231556, 0.044799353927373886, 0.003466400085017085, 0.032189302146434784, -0.07333119213581085, 0.06416024267673492, -0.0358467623591423, -0.031243091449141502, 0.025511249899864197, 0.05433423072099686, 0.02831348404288292, -0.0033413004130125046, 0.021435271948575974, 0.08625058829784393, -0.015767116099596024, 0.06452417373657227, 0.034554824233055115, -0.04221547767519951, 0.07296726852655411, -0.011581961996853352, -0.022272303700447083, 0.05218706279993057, 0.03748443350195885, -0.006714444141834974, -0.03672018647193909, -0.006432401482015848, 0.003843973856419325, 0.020270707085728645, -0.03553742542862892, 0.016376692801713943, 0.045891135931015015, -0.04956679418683052, 0.0019754385575652122, -0.07060174643993378, 0.014629846438765526, -0.032316673547029495, -0.03351763263344765, -0.008847963996231556, 0.01822362095117569, -0.01700446754693985, 0.006527931895107031, -0.012118753045797348, 0.016003668308258057, 0.05295130982995033, 0.026439262554049492, 0.0613580122590065, -0.004103271756321192, 0.002670310903340578, 0.012082360684871674, -0.028204305097460747, 0.08770629018545151, 0.01876041293144226, 0.016995368525385857, -0.05586272105574608, 0.03022409789264202, 0.022854585200548172, 0.0064824409782886505, 0.037557218223810196, -0.07034699618816376, -0.03984995558857918, 0.03169799968600273, -0.02209034003317356, 0.061831116676330566, -0.0018275935435667634, 0.03799393028020859, 0.057609569281339645, 0.0037165996618568897, -0.006441499572247267, 0.019069749861955643, -0.028550036251544952, 0.025147322565317154, 0.011172544211149216, -0.040323060005903244, 0.02536567859351635, -0.06019344553351402, 0.014275018125772476, -0.08988985419273376, -0.007965441793203354, -0.005463446956127882, 0.05160478129982948, 0.01890598237514496, 0.06947357207536697, 0.000531105266418308, -0.04232465475797653, 0.031352270394563675, 0.014939183369278908, -0.02971460111439228, -0.02119871973991394, 0.040832556784152985, -0.0067280917428433895, -0.04323447123169899, -0.02229049988090992, -0.006027533207088709, -0.04017748683691025, -0.05193231627345085, 0.056845322251319885, -0.014729926362633705, -0.0957854613661766, -0.01694987714290619, -0.03717509284615517, 0.024928966537117958, -0.02190837636590004, -0.013019471429288387, 0.017577651888132095, -0.0005925178411416709, 0.00944389309734106, -0.04363479092717171, -0.01634030044078827, 0.06892768293619156, 0.05964755639433861, 0.03246224671602249, -0.011436390690505505, 0.02811332419514656, 0.03562840819358826, 0.034882355481386185, -0.00983511470258236, -0.03284436836838722, 0.01159106008708477, 0.038467034697532654, -0.0328807607293129, -0.013347005471587181, 0.06266814470291138, -0.04028666764497757, -0.055826328694820404, -0.04130566120147705, 0.02689417079091072, 0.004362569190561771, 0.026930563151836395, 0.04356200620532036, 0.03284436836838722, -0.004876615479588509, -0.02869560569524765, 0.01809624582529068, 0.031861767172813416, -0.020780203863978386, -0.034300073981285095, -0.05797349661588669, -0.02709432877600193, -0.12344387918710709, -0.0199795663356781, 0.038648996502161026, 0.016058258712291718, -0.009862408973276615, -0.014657140709459782, -0.011818514205515385, 0.027840379625558853, -0.03748443350195885, -0.011773022823035717, -0.036865755915641785, 0.04017748683691025, 0.0386853888630867, 0.011390900239348412, 0.016403988003730774, -0.014438784681260586, -0.03087916597723961, -0.03184356912970543, -0.05538961663842201, -0.002586152870208025, -0.01059935986995697, -0.02261803299188614, -0.01908794604241848, -0.0029887466225773096, -0.026038942858576775, -0.04174237325787544, 0.01761404424905777, 0.0026452909223735332, -0.06812704354524612, -0.04210629686713219, -0.002640741877257824, 0.0013954307651147246, -0.029750993475317955, 0.052805736660957336, 0.02587517537176609, -0.009111810475587845, 0.043016113340854645, 0.009102712385356426, -0.015084754675626755, -0.04356200620532036, 0.020452670753002167, -0.0206892229616642, -0.0012146048247814178, 0.0034709491301327944, 0.00983511470258236, -0.025911567732691765, 0.024255702272057533, 0.006314125377684832, 0.03362680971622467, 0.03431827202439308, -0.07635178416967392, 0.0412328764796257, -0.014438784681260586, 0.018460173159837723, -0.06721723079681396, 0.031479645520448685, -0.02722170390188694, -0.020980363711714745, 0.02996934950351715, -0.014375098049640656, -0.015739822760224342, -0.050185468047857285, -0.00954397302120924, -0.029478048905730247, 0.006268634460866451, 0.06092130020260811, 0.0006192437140271068, -0.0274218637496233, -0.016713324934244156, -0.029641814529895782, 0.017186429351568222, 0.015266717411577702, -0.03444564715027809, -0.003004668280482292, 0.05222345516085625, 0.07314923405647278, -0.0520051009953022, 0.003984995651990175, 0.018414681777358055, 0.013738226145505905, 0.015348601154983044, -0.003066080855205655, -0.04720126837491989, 0.034500233829021454, -0.008370310068130493, 0.022981960326433182, 0.0007124998955987394, 0.053133271634578705, -0.033408455550670624, -0.016458576545119286, -0.017705025151371956, -0.02683958038687706, 0.028131520375609398, 0.026875974610447884, -0.003314005909487605, 0.030951950699090958, -0.016867993399500847, 0.01300127524882555, 0.01412944681942463, -0.06274092942476273, 0.036611009389162064, 0.0025292893406003714, -0.0805005431175232, -0.0061776526272296906, 0.06790868937969208, -0.005590821150690317, -0.020998559892177582, 0.01331971026957035, 0.0019356341799721122, -0.041342053562402725, 0.012928489595651627, -0.007092018146067858, -0.015539662912487984, -0.03777557238936424, 0.061903901398181915, -0.024710610508918762, -0.016203828155994415, 0.0010678968392312527, 0.026038942858576775, -0.03209831938147545, -0.012801115401089191, -0.06299567967653275, 0.03604692220687866, -0.03138866275548935, 0.00763790775090456, -0.022053947672247887, -0.010908697731792927, 0.017277412116527557, -0.009598562493920326, 0.02414652518928051, -0.010690341703593731, -0.021853787824511528, -0.10364627093076706, 0.04625505954027176, -0.06266814470291138, 0.01639488898217678, -0.012136949226260185, 0.02478339709341526, -0.04287054389715195, -0.026366475969552994, 0.040759772062301636, 0.0028886666987091303, -0.06994667649269104, -0.04865697771310806, 0.015949079766869545, -0.016767915338277817, -0.011982280761003494, -0.025092734023928642, -0.05578993633389473, -0.010171745903789997, -0.004226096905767918, -0.02683958038687706, -0.025711409747600555, 0.029478048905730247, 0.00020101254631299525, -0.014784514904022217, -0.00834756437689066, 0.010371905751526356, -0.017404785379767418, 0.06870932877063751, -0.013228729367256165, 0.023418672382831573, -0.03766639530658722, 0.037557218223810196, -0.0010019352193921804, 0.010663047432899475, 0.06270454078912735, 0.011081562377512455, -0.04287054389715195, -0.0905449166893959, -0.04374396800994873, 0.022836389020085335, -0.05207788571715355, 0.00973503477871418, 0.018996965140104294, 0.020834794268012047, -0.047492410987615585, 0.06481531262397766, 0.014820907264947891, 0.026730403304100037, -0.02274540811777115, -0.022072143852710724, 0.030460650101304054, -0.03682936355471611, 0.041596800088882446, -0.028550036251544952, 0.07198466360569, -0.035901352763175964, -0.03126128762960434, -0.0011668393854051828, 0.019561050459742546, 0.0493120439350605, -0.03453662618994713, 0.023655224591493607, 0.07511443644762039, -0.004262489266693592, -0.024965358898043633, -0.09811458736658096, 0.0011099758557975292, -0.019815798848867416, 0.007351315580308437, -0.024237506091594696, 0.02043447457253933, -0.009753230959177017, 0.0002749351260717958, 0.00200841948390007, 0.028386268764734268, 0.011818514205515385, 0.01310135517269373, -0.03824867680668831, -0.02247246354818344, 0.018032560124993324, 0.03781196475028992, 0.008038227446377277, 0.038467034697532654, 0.03357222303748131, -0.010417397134006023, 0.025529446080327034, 0.11551027745008469, 0.030133116990327835, -0.04920286685228348, 0.01604006066918373, 0.07027421146631241, 0.062631756067276, 0.00015537955914624035, -0.0051950509659945965, -0.009425696916878223, 0.0012100556632503867, -0.02279999665915966, -0.038212284445762634, 0.00008820953371468931, -0.024255702272057533, 0.012701035477221012, 0.023418672382831573, 0.005199600011110306, -0.02300015650689602, -0.022272303700447083, -0.044362641870975494, 0.02716711536049843, -0.05175035074353218, -0.06466974318027496, -0.14134906232357025, -0.019833995029330254, 0.00256113288924098, 0.0019072024151682854, 0.023909972980618477, -0.06528841704130173, 0.04290693625807762, -0.030133116990327835, -0.015667036175727844, 0.09032656252384186, 0.04738323390483856, 0.01261915173381567, -0.00818379782140255, 0.05695449933409691, 0.06732640415430069, -0.017022663727402687, 0.06747197359800339, 0.022326892241835594, -0.03466400131583214, 0.03562840819358826, 0.013647244311869144, -0.004862968344241381, 0.007692496757954359, -0.032498639076948166, 0.0388309583067894, -0.0005234286654740572, 0.016058258712291718, -0.04829305037856102, 0.045891135931015015, 0.027385471388697624, -0.02702154405415058, 0.044617392122745514, -0.02478339709341526, 0.04170598089694977, 0.021344291046261787, -0.0187058225274086, 0.018059853464365005, 0.048074692487716675, 0.027312684804201126, 0.05815545842051506, -0.0773707777261734, -0.009389304555952549, -0.042506616562604904, -0.011991378851234913, 0.05699089169502258, 0.01517573557794094, 0.01669512875378132, 0.0003320829418953508, -0.02511093020439148, 0.06124883517622948, -0.011545568704605103, 0.019833995029330254, -0.013528968207538128, 0.02882298082113266, -0.01972481794655323, 0.004981244448572397, 0.02056184783577919, -0.0386853888630867, -0.029678208753466606, 0.013337907381355762, 0.02216312475502491, 0.005763686262071133, -0.024383077397942543, -0.018087148666381836, -0.04927565157413483, 0.03138866275548935, 0.01008986309170723, -0.03368140012025833, -0.04494492709636688, -0.006254987325519323, -0.058191850781440735, -0.014093054458498955, 0.04527245834469795, -0.00834756437689066, 0.02081659622490406, 0.06765393912792206, 0.02683958038687706, 0.07107485085725784, 0.008215641602873802 ]
39,370
pyspark.sql.dataframe
cube
Create a multi-dimensional cube for the current :class:`DataFrame` using the specified columns, so we can run aggregations on them. .. versionadded:: 1.4.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Parameters ---------- cols : list, str or :class:`Column` columns to create cube by. Each element should be a column name (string) or an expression (:class:`Column`) or list of them. Returns ------- :class:`GroupedData` Cube of the data by given columns. Examples -------- >>> df = spark.createDataFrame([(2, "Alice"), (5, "Bob")], schema=["age", "name"]) >>> df.cube("name", df.age).count().orderBy("name", "age").show() +-----+----+-----+ | name| age|count| +-----+----+-----+ | NULL|NULL| 2| | NULL| 2| 1| | NULL| 5| 1| |Alice|NULL| 1| |Alice| 2| 1| | Bob|NULL| 1| | Bob| 5| 1| +-----+----+-----+
def cube(self, *cols: "ColumnOrName") -> "GroupedData": # type: ignore[misc] """ Create a multi-dimensional cube for the current :class:`DataFrame` using the specified columns, so we can run aggregations on them. .. versionadded:: 1.4.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Parameters ---------- cols : list, str or :class:`Column` columns to create cube by. Each element should be a column name (string) or an expression (:class:`Column`) or list of them. Returns ------- :class:`GroupedData` Cube of the data by given columns. Examples -------- >>> df = spark.createDataFrame([(2, "Alice"), (5, "Bob")], schema=["age", "name"]) >>> df.cube("name", df.age).count().orderBy("name", "age").show() +-----+----+-----+ | name| age|count| +-----+----+-----+ | NULL|NULL| 2| | NULL| 2| 1| | NULL| 5| 1| |Alice|NULL| 1| |Alice| 2| 1| | Bob|NULL| 1| | Bob| 5| 1| +-----+----+-----+ """ jgd = self._jdf.cube(self._jcols(*cols)) from pyspark.sql.group import GroupedData return GroupedData(jgd, self)
(self, *cols: 'ColumnOrName') -> 'GroupedData'
[ -0.009582881815731525, -0.030746929347515106, 0.004094261676073074, 0.015053738839924335, -0.011341371573507786, 0.01055982057005167, 0.01508038304746151, 0.03129756823182106, 0.025613559409976006, 0.06643184274435043, -0.02520502172410488, 0.036040160804986954, -0.017567137256264687, 0.040782757103443146, 0.03211464360356331, -0.014174493961036205, 0.02017822675406933, -0.041884031146764755, 0.08930996805429459, 0.0028264615684747696, -0.01540898997336626, -0.050161369144916534, 0.04099590703845024, 0.02701679989695549, 0.008823533542454243, 0.04742594063282013, 0.03209688141942024, -0.013259724713861942, 0.014494219794869423, 0.020799916237592697, -0.0839812159538269, 0.00024964672047644854, -0.030071953311562538, 0.008850177749991417, -0.011669978499412537, -0.022291967645287514, 0.00996477622538805, -0.06128070876002312, -0.0103200264275074, -0.028615426272153854, 0.0721868947148323, 0.03858020156621933, 0.015542209148406982, -0.015133670531213284, 0.008255133405327797, -0.004662662744522095, 0.0722934752702713, -0.004234141670167446, -0.0214571300894022, -0.04351818561553955, -0.006070342846214771, -0.038260478526353836, -0.0014887215802446008, 0.014103444293141365, -0.013259724713861942, 0.00939637515693903, -0.021439366042613983, -0.01868617534637451, -0.020533477887511253, 0.03566714748740196, -0.018206587061285973, -0.012176210060715675, 0.012620273046195507, 0.019183525815606117, -0.048349589109420776, 0.007500225678086281, -0.03334025666117668, 0.017140835523605347, -0.03515203669667244, -0.035738199949264526, -0.0485982671380043, 0.060428109019994736, 0.06142280995845795, 0.06312800943851471, 0.004285208880901337, 0.00046238070353865623, -0.07517100125551224, 0.032949481159448624, 0.01902366429567337, -0.01800231821835041, 0.027265474200248718, -0.04504576325416565, -0.05531249940395355, -0.04532996192574501, 0.059291306883096695, 0.04199060797691345, 0.0257734227925539, 0.05641377717256546, 0.03149295598268509, -0.028722001239657402, 0.017922386527061462, 0.01969863846898079, -0.02392612025141716, 0.0096361692994833, 0.00002759782728389837, -0.05161789432168007, -0.03733682632446289, 0.03257646784186363, 0.02559579722583294, 0.04699964076280594, 0.03662632405757904, -0.02625301107764244, 0.02715889923274517, -0.019148001447319984, 0.004531663842499256, -0.027816113084554672, -0.011936415918171406, -0.04785224050283432, 0.013810362666845322, 0.018126655369997025, 0.008157439529895782, 0.044548410922288895, 0.03236331790685654, 0.025560272857546806, -0.012939998880028725, -0.00622132420539856, 0.006971790920943022, -0.005111166276037693, -0.07900770753622055, 0.04771013930439949, -0.018126655369997025, 0.04671543836593628, 0.038793351501226425, -0.026412872597575188, -0.013579449616372585, 0.022345256060361862, 0.002662158338353038, -0.01873946376144886, -0.0036790629383176565, 0.03953937813639641, 0.0770893543958664, -0.04490366205573082, 0.02392612025141716, -0.04671543836593628, 0.0041475496254861355, 0.049450866878032684, 0.1445869505405426, -0.018526311963796616, 0.023286668583750725, 0.038793351501226425, -0.0018717260099947453, 0.0045272232964634895, 0.002075995085760951, 0.037407875061035156, -0.026839174330234528, 0.023677444085478783, 0.06611211597919464, -0.041741933673620224, -0.0547085739672184, 0.0071183317340910435, -0.010852902196347713, -0.02392612025141716, 0.04916666820645332, -0.04600493609905243, 0.00114124221727252, -0.008268455043435097, -0.0040609571151435375, 0.0035835893359035254, -0.001351061975583434, -0.027283236384391785, -0.03566714748740196, 0.053287573158741, -0.04607598856091499, 0.08533116430044174, -0.028473326936364174, 0.0036590800154954195, -0.00656325276941061, -0.021048590540885925, -0.044122111052274704, -0.012691323645412922, 0.022718269377946854, 0.009081090800464153, 0.02730100043118, -0.0085171302780509, -0.0888836681842804, 0.030746929347515106, -0.05218629539012909, 0.021332791075110435, 0.017709236592054367, -0.053678348660469055, -0.023819545283913612, -0.05509934946894646, -0.028242412954568863, 0.01260251086205244, 0.007171619217842817, -0.014973808079957962, -0.0033038295805454254, -0.04980611801147461, 0.02826017513871193, -0.03140414133667946, -0.06057020649313927, -0.02531159669160843, -0.007593479007482529, 0.07431840151548386, 0.015773121267557144, -0.015968509018421173, -0.001164555549621582, 0.015355702489614487, -0.023411007598042488, 0.03662632405757904, -0.049024567008018494, 0.02863318845629692, 0.05630720034241676, -0.02149265445768833, 0.006088105030357838, -0.02673259936273098, -0.026341823861002922, -0.018490787595510483, 0.003952161408960819, -0.012638036161661148, 0.028562139719724655, -0.026608260348439217, 0.009174344129860401, 0.0501258447766304, 0.051156070083379745, 0.030178528279066086, -0.03236331790685654, -0.029912089928984642, 0.04071170464158058, 0.0398591049015522, 0.07375000417232513, -0.02930816449224949, -0.018668413162231445, 0.04419315978884697, -0.035507284104824066, -0.046679913997650146, 0.06525951623916626, 0.005617398303002119, -0.026714837178587914, -0.039645954966545105, 0.0038766709621995687, -0.03762102499604225, -0.004769237712025642, -0.04227480664849281, -0.06277275830507278, 0.04501023516058922, -0.0008020889945328236, 0.042310331016778946, 0.054104648530483246, -0.02259393036365509, -0.012966643087565899, -0.0020504614803940058, 0.036555275321006775, -0.0074780224822461605, 0.037549976259469986, 0.011883128434419632, -0.003981025889515877, 0.04689306393265724, -0.021581467241048813, 0.06088993325829506, -0.01500933337956667, -0.003690164303407073, 0.03776312619447708, 0.023748494684696198, 0.007331481669098139, -0.052683647722005844, 0.03010747767984867, 0.034086283296346664, 0.014787301421165466, -0.005888276733458042, -0.022913657128810883, -0.029752228409051895, 0.013099861331284046, 0.0696646198630333, 0.0023379921913146973, 0.01612837240099907, 0.023624157533049583, 0.015249126590788364, 0.014876114204525948, 0.011243677698075771, -0.029894327744841576, 0.017300698906183243, 0.0648687407374382, -0.054353322833776474, 0.024707671254873276, 0.01907695084810257, -0.005968207959085703, -0.021759092807769775, -0.0501258447766304, -0.029219351708889008, 0.03614673763513565, 0.03177715465426445, -0.017966793850064278, -0.027887163683772087, -0.022185392677783966, 0.01836645044386387, -0.04334056004881859, -0.054353322833776474, -0.03358893468976021, -0.016368165612220764, -0.03001866675913334, -0.03200806677341461, -0.05321652069687843, 0.003046272788196802, -0.05151132121682167, 0.0027221068739891052, 0.006723115220665932, 0.01783357374370098, -0.029095014557242393, 0.020764390006661415, -0.01407680008560419, -0.016829991713166237, 0.05747952684760094, 0.0517599955201149, 0.0010185698047280312, -0.020231515169143677, -0.03968147933483124, -0.015639903023838997, 0.009502950124442577, -0.00979603175073862, -0.013934699818491936, 0.019538776949048042, -0.02392612025141716, -0.03424614667892456, -0.06149385869503021, 0.01163445319980383, 0.021865667775273323, -0.027887163683772087, 0.010719683021306992, 0.000754352193325758, 0.0383315272629261, -0.09186777472496033, -0.018473025411367416, 0.05556117743253708, -0.006572133861482143, 0.08049976080656052, 0.02401493303477764, -0.0385446771979332, 0.030604830011725426, -0.020391378551721573, -0.015799764543771744, -0.011883128434419632, 0.027460861951112747, 0.02293141931295395, -0.02117292955517769, -0.079505056142807, -0.011669978499412537, 0.00487581267952919, 0.02920158952474594, 0.06259513646364212, 0.01907695084810257, -0.07346580177545547, -0.03889992833137512, -0.04191955551505089, 0.0015220262575894594, 0.010861783288419247, 0.016474740579724312, -0.028508851304650307, 0.018348688259720802, 0.07222242653369904, 0.03216793015599251, -0.054104648530483246, 0.05279022082686424, -0.01664348505437374, 0.03939727693796158, 0.02483200840651989, 0.0021270622964948416, -0.0020426902920007706, -0.007327041123062372, -0.05968208238482475, 0.0724000483751297, -0.022469593212008476, 0.04067618027329445, 0.03064035438001156, 0.001071857288479805, 0.001336629968136549, 0.003168390365317464, -0.0007654537912458181, 0.013641618192195892, -0.00312176370061934, 0.04447736218571663, -0.030267341062426567, 0.01677670329809189, 0.052541546523571014, -0.010613108053803444, 0.045827314257621765, 0.015133670531213284, 0.005941564217209816, 0.024441232904791832, -0.0199295524507761, -0.035986874252557755, -0.04092485457658768, 0.008348386734724045, -0.02863318845629692, 0.014440932311117649, 0.08028660714626312, -0.07453155517578125, -0.024192558601498604, -0.03428167104721069, -0.010613108053803444, 0.03531189635396004, 0.05545460060238838, 0.028881864622235298, -0.044832609593868256, -0.06174253299832344, 0.02278931811451912, 0.011092696338891983, -0.004769237712025642, 0.0026665988843888044, -0.008330623619258404, -0.05048109218478203, -0.04788776487112045, 0.024814246222376823, 0.006030377000570297, -0.023624157533049583, 0.012851186096668243, 0.015542209148406982, -0.12391136586666107, 0.012282785028219223, 0.0003855022951029241, 0.07133429497480392, -0.007926526479423046, -0.0114124221727252, 0.04056960344314575, 0.026519449427723885, -0.00625684903934598, -0.02103082835674286, -0.05865185335278511, 0.047496989369392395, 0.07122772186994553, 0.04199060797691345, -0.0027776146307587624, -0.01916576363146305, 0.036040160804986954, 0.002937477547675371, -0.02330443263053894, -0.07264872640371323, -0.04003673046827316, 0.03687500208616257, 0.012416004203259945, -0.05026794224977493, -0.029841041192412376, -0.0162971168756485, -0.008708077482879162, -0.023908358067274094, 0.023908358067274094, -0.044690512120723724, 0.031137704849243164, -0.022966943681240082, 0.01944996416568756, 0.04366028308868408, -0.05421122536063194, -0.04170640558004379, -0.03525860980153084, -0.017300698906183243, -0.006354542914777994, -0.0022869249805808067, -0.004334055818617344, -0.07410524785518646, 0.02525831013917923, 0.10835139453411102, 0.044690512120723724, -0.036359887570142746, -0.03129756823182106, 0.06099650636315346, 0.015089264139533043, -0.02106635458767414, 0.012282785028219223, 0.02412150800228119, 0.021439366042613983, 0.008361708372831345, -0.04056960344314575, -0.011536759324371815, -0.006825250107795, -0.05819002911448479, 0.014742895029485226, -0.04561416059732437, -0.03101336769759655, 0.029752228409051895, -0.014174493961036205, -0.01003582589328289, 0.014067918993532658, -0.05445989966392517, -0.020036127418279648, 0.012300548143684864, -0.01610172912478447, -0.05652035027742386, -0.01044436451047659, -0.006607659161090851, 0.02730100043118, -0.016430335119366646, 0.0031084418296813965, 0.038935452699661255, -0.025578035041689873, 0.015879696235060692, 0.04621808975934982, -0.014929401688277721, -0.01570207066833973, 0.03133309260010719, 0.014973808079957962, -0.026146436110138893, 0.012655798345804214, 0.012646917253732681, -0.003850027220323682, -0.01786021888256073, 0.0030729167629033327, 0.03262975811958313, 0.014236663468182087, -0.05701770260930061, 0.041031431406736374, -0.02001836523413658, 0.04252348467707634, -0.05627167597413063, 0.007304837927222252, -0.00480476301163435, -0.07858140766620636, 0.09961223602294922, -0.006643183995038271, 0.013313012197613716, -0.04604046419262886, -0.05414017289876938, -0.044832609593868256, -0.011954179033637047, 0.011305846273899078, 0.029592365026474, -0.029095014557242393, 0.0055463481694459915, 0.04124458134174347, -0.046679913997650146, 0.011581165716052055, 0.027123374864459038, -0.01604844070971012, -0.015186958014965057, 0.10913294553756714, -0.060428109019994736, 0.05048109218478203, 0.006567693315446377, -0.0032194575760513544, -0.00545753538608551, 0.03886440396308899, -0.04501023516058922, 0.03344683349132538, -0.019005900248885155, 0.07005539536476135, -0.014227781444787979, 0.011510116048157215, -0.017247410491108894, 0.03211464360356331, -0.002070444170385599, -0.012051872909069061, 0.01805560663342476, 0.018561838194727898, 0.024316895753145218, -0.014849469996988773, -0.04508128762245178, -0.03529413416981697, 0.053287573158741, -0.03334025666117668, 0.12298771739006042, 0.016421454027295113, -0.0015742037212476134, -0.008184082806110382, 0.01717636175453663, 0.009982538409531116, 0.08533116430044174, 0.01879275031387806, -0.02653721161186695, -0.05573879927396774, -0.02625301107764244, -0.03968147933483124, 0.00801089871674776, 0.017282936722040176, 0.10160163789987564, 0.0048713721334934235, -0.01272684894502163, -0.017469443380832672, -0.0026288535445928574, -0.013179793022572994, 0.004094261676073074, -0.0501258447766304, -0.007358125876635313, -0.0019294541561976075, 0.03886440396308899, -0.021794617176055908, 0.015275770798325539, -0.0030973402317613363, -0.04493918642401695, 0.022576168179512024, -0.025045158341526985, -0.028508851304650307, -0.09101517498493195, 0.007571275811642408, -0.021439366042613983, 0.008974514901638031, -0.02545369789004326, 0.023286668583750725, -0.03572043776512146, 0.0018384212162345648, 0.04984164237976074, 0.04774566367268562, 0.030267341062426567, -0.03053377941250801, -0.025791184976696968, 0.032274506986141205, -0.008783568628132343, -0.008041982538998127, -0.009289800189435482, -0.02307351864874363, -0.0057150921784341335, -0.060534682124853134, -0.02644839882850647, 0.015799764543771744, 0.009423019364476204, 0.02197224274277687, -0.028473326936364174, 0.0012245039688423276, -0.0827733650803566, 0.10906189680099487, 0.021759092807769775, 0.007411413360387087, -0.057444002479314804, 0.038828879594802856, -0.040463030338287354, 0.06749758869409561, 0.025222783908247948, -0.002997425850480795, -0.039930153638124466, -0.03177715465426445, -0.007633444853127003, -0.01748720556497574, -0.0428076833486557, -0.03280738368630409, -0.020817678421735764, -0.004809203557670116, 0.0037434520199894905, 0.007677851244807243, -0.03651975095272064, -0.005821667145937681, -0.005852751899510622, 0.016563553363084793, 0.008663671091198921, 0.008401674218475819, 0.04550758749246597, -0.046644389629364014, 0.03804732859134674, -0.029219351708889008, -0.04195508360862732, 0.011572284623980522, -0.00569732952862978, -0.03188373148441315, 0.01564878411591053, 0.027460861951112747, 0.041741933673620224, -0.013268605805933475, -0.04685753956437111, -0.03529413416981697, -0.02792268805205822, -0.015666546300053596, 0.03369550779461861, -0.051298171281814575, -0.0002947468892671168, -0.04827854037284851, 0.02930816449224949, -0.00010803222539834678, 0.04550758749246597, 0.04710621386766434, 0.010613108053803444, 0.0015764239942654967, -0.025293834507465363, 0.010595345869660378, 0.018046723678708076, 0.005572991911321878, -0.012931117787957191, -0.028508851304650307, 0.03371326997876167, 0.03087126649916172, 0.07446049898862839, -0.000040798298869049177, 0.003203915199264884, 0.06298591196537018, -0.01916576363146305, 0.0012078516883775592, -0.0013932479778304696, -0.034707970917224884, 0.0007771104574203491, 0.0016785585321485996, -0.019805215299129486, -0.0516534186899662, -0.053784921765327454, -0.06298591196537018, -0.042452432215213776, 0.006692030932754278, -0.03595134988427162, 0.04646676406264305, -0.02625301107764244, 0.009307562373578548, 0.023819545283913612, -0.027229949831962585, -0.031226517632603645, -0.09158357232809067, 0.028100313618779182, 0.009192106314003468, 0.02701679989695549, 0.03296724334359169, -0.0621333085000515, -0.011536759324371815, 0.0006438915152102709, 0.0018994798883795738, -0.002997425850480795, 0.05588090047240257, -0.032842908054590225, 0.06174253299832344, -0.01602179743349552, 0.05250602215528488, 0.025098446756601334, 0.10543834418058395, 0.03989462926983833, 0.04909561574459076, 0.014636320061981678, -0.005914920475333929, 0.0014576371759176254, 0.05421122536063194, -0.02730100043118, 0.04099590703845024, 0.029805514961481094, 0.01315314881503582, 0.04657333716750145, 0.07716040313243866, -0.013064336962997913, 0.008863499388098717, 0.027514150366187096, 0.05531249940395355, -0.014876114204525948, -0.053252048790454865, -0.024618858471512794, -0.03195478022098541, 0.002906393026933074, 0.023393243551254272, 0.054673049598932266, -0.02236301824450493, 0.0007260431884787977, 0.0096095260232687, 0.07030407339334488, 0.04486813768744469, 0.009351968765258789, -0.03545399755239487, 0.010124638676643372, -0.05048109218478203, -0.008614824153482914, -0.02074662782251835, -0.040889330208301544, -0.02140384167432785, 0.02962789125740528, -0.021155165508389473, -0.03557833656668663, -0.034032996743917465, 0.012495935894548893, 0.048349589109420776, -0.020959777757525444, -0.007211584597826004, 0.00802422035485506, 0.038260478526353836, 0.002187010832130909, 0.020870966836810112, -0.011838722042739391, -0.04969954118132591, -0.031457431614398956, -0.05062319338321686, 0.05726637691259384, -0.07879455387592316, -0.05747952684760094, -0.003605792298913002, 0.0032461013179272413, -0.002679920755326748, -0.009582881815731525, -0.00342372665181756, 0.08682321757078171, 0.006878537591546774 ]
39,371
pyspark.sql.dataframe
describe
Computes basic statistics for numeric and string columns. .. versionadded:: 1.3.1 .. versionchanged:: 3.4.0 Supports Spark Connect. This includes count, mean, stddev, min, and max. If no columns are given, this function computes statistics for all numerical or string columns. Notes ----- This function is meant for exploratory data analysis, as we make no guarantee about the backward compatibility of the schema of the resulting :class:`DataFrame`. Use summary for expanded statistics and control over which statistics to compute. Parameters ---------- cols : str, list, optional Column name or list of column names to describe by (default All columns). Returns ------- :class:`DataFrame` A new DataFrame that describes (provides statistics) given DataFrame. Examples -------- >>> df = spark.createDataFrame( ... [("Bob", 13, 40.3, 150.5), ("Alice", 12, 37.8, 142.3), ("Tom", 11, 44.1, 142.2)], ... ["name", "age", "weight", "height"], ... ) >>> df.describe(['age']).show() +-------+----+ |summary| age| +-------+----+ | count| 3| | mean|12.0| | stddev| 1.0| | min| 11| | max| 13| +-------+----+ >>> df.describe(['age', 'weight', 'height']).show() +-------+----+------------------+-----------------+ |summary| age| weight| height| +-------+----+------------------+-----------------+ | count| 3| 3| 3| | mean|12.0| 40.73333333333333| 145.0| | stddev| 1.0|3.1722757341273704|4.763402145525822| | min| 11| 37.8| 142.2| | max| 13| 44.1| 150.5| +-------+----+------------------+-----------------+ See Also -------- DataFrame.summary
def describe(self, *cols: Union[str, List[str]]) -> "DataFrame": """Computes basic statistics for numeric and string columns. .. versionadded:: 1.3.1 .. versionchanged:: 3.4.0 Supports Spark Connect. This includes count, mean, stddev, min, and max. If no columns are given, this function computes statistics for all numerical or string columns. Notes ----- This function is meant for exploratory data analysis, as we make no guarantee about the backward compatibility of the schema of the resulting :class:`DataFrame`. Use summary for expanded statistics and control over which statistics to compute. Parameters ---------- cols : str, list, optional Column name or list of column names to describe by (default All columns). Returns ------- :class:`DataFrame` A new DataFrame that describes (provides statistics) given DataFrame. Examples -------- >>> df = spark.createDataFrame( ... [("Bob", 13, 40.3, 150.5), ("Alice", 12, 37.8, 142.3), ("Tom", 11, 44.1, 142.2)], ... ["name", "age", "weight", "height"], ... ) >>> df.describe(['age']).show() +-------+----+ |summary| age| +-------+----+ | count| 3| | mean|12.0| | stddev| 1.0| | min| 11| | max| 13| +-------+----+ >>> df.describe(['age', 'weight', 'height']).show() +-------+----+------------------+-----------------+ |summary| age| weight| height| +-------+----+------------------+-----------------+ | count| 3| 3| 3| | mean|12.0| 40.73333333333333| 145.0| | stddev| 1.0|3.1722757341273704|4.763402145525822| | min| 11| 37.8| 142.2| | max| 13| 44.1| 150.5| +-------+----+------------------+-----------------+ See Also -------- DataFrame.summary """ if len(cols) == 1 and isinstance(cols[0], list): cols = cols[0] # type: ignore[assignment] jdf = self._jdf.describe(self._jseq(cols)) return DataFrame(jdf, self.sparkSession)
(self, *cols: Union[str, List[str]]) -> pyspark.sql.dataframe.DataFrame
[ 0.045966602861881256, -0.038692932575941086, 0.032187871634960175, -0.022739596664905548, 0.047391343861818314, 0.0018348211888223886, 0.06913737207651138, 0.004527298267930746, -0.0296945758163929, 0.03738067299127579, -0.038430482149124146, 0.04367952048778534, -0.018062325194478035, -0.004396072123199701, 0.0068518733605742455, 0.027407493442296982, 0.05717705562710762, -0.04225478321313858, 0.05204049497842789, 0.027370000258088112, -0.017631154507398605, -0.014125545509159565, -0.009063969366252422, 0.039967700839042664, -0.04270470142364502, 0.010038791224360466, 0.04019265994429588, -0.07821071892976761, 0.030838117003440857, 0.03415626287460327, -0.03666830435395241, -0.02710754983127117, -0.045141756534576416, 0.002123049693182111, -0.060926374047994614, 0.02961958944797516, -0.01460358314216137, -0.025739049538969994, -0.005099068861454725, -0.014828541316092014, 0.0034142201766371727, 0.002800269750878215, -0.017284343019127846, -0.08181005716323853, -0.005558359902352095, 0.026076488196849823, 0.06640037149190903, -0.024051856249570847, 0.00514124846085906, -0.053990140557289124, 0.02240215800702572, -0.004138306714594364, -0.05252790451049805, 0.014181784354150295, -0.0422922745347023, -0.003859451273456216, 0.0033696971368044615, 0.018549736589193344, 0.004086753819137812, 0.02080869860947132, -0.0035923125687986612, 0.0033486071042716503, -0.031006837263703346, -0.003911004401743412, -0.04255472868680954, 0.025214144960045815, 0.018887175247073174, 0.0006666750996373594, -0.05661465972661972, -0.04900354892015457, -0.011022986844182014, -0.015203473158180714, 0.005998904351145029, 0.11322931945323944, -0.02063998021185398, -0.047241371124982834, -0.06606293469667435, -0.0592016875743866, 0.01116358581930399, -0.05826435983181, 0.05612725019454956, -0.017771754413843155, -0.014294263906776905, -0.08091022074222565, 0.01353502832353115, -0.02242090553045273, 0.005867678206413984, -0.0039274077862501144, 0.00367198558524251, 0.03558100014925003, -0.05155308544635773, 0.008304732851684093, 0.017153117805719376, 0.023227008059620857, -0.009420154616236687, -0.01385371945798397, -0.059501633048057556, 0.0078079490922391415, 0.04199232906103134, 0.015578405000269413, 0.019402706995606422, 0.017434315755963326, 0.006556614767760038, 0.05204049497842789, -0.04094252362847328, -0.017134370282292366, -0.025345370173454285, -0.02980705536901951, -0.002370270201936364, 0.010994866490364075, -0.04086753726005554, 0.03809304162859917, 0.06197617948055267, -0.03676203638315201, 0.04825368523597717, 0.016487613320350647, 0.038542959839105606, -0.012044674716889858, -0.05080322176218033, -0.013703746721148491, -0.018718456849455833, 0.04217979684472084, 0.012204021215438843, -0.12057797610759735, 0.013516281731426716, 0.05560234561562538, -0.02189600095152855, -0.046379029750823975, 0.001957845641300082, 0.04881608486175537, 0.04217979684472084, -0.04244224727153778, 0.02926340512931347, 0.0894586592912674, 0.05706457793712616, -0.007212745025753975, 0.0697372630238533, 0.016281401738524437, 0.038842905312776566, 0.023170767351984978, -0.003116618376225233, -0.029975775629281998, 0.0059848446398973465, 0.02052750065922737, -0.0049303495325148106, 0.0031119317281991243, 0.04296715185046196, -0.031100569292902946, -0.0221771989017725, 0.011547890491783619, -0.019946357235312462, -0.03323768079280853, 0.011838463135063648, -0.06377585232257843, 0.02236466482281685, -0.02795114554464817, 0.05560234561562538, -0.04011767357587814, -0.03612465038895607, -0.02815735712647438, 0.0437920019030571, -0.006031710654497147, 0.008084461092948914, 0.05087820813059807, -0.052340440452098846, 0.04019265994429588, -0.046491507440805435, 0.005848931614309549, -0.02928215265274048, -0.015409685671329498, 0.024932947009801865, -0.002896345918998122, 0.045629166066646576, 0.012803911231458187, 0.0020785266533493996, 0.07678597420454025, 0.017218729481101036, 0.046716466546058655, -0.006017650943249464, -0.052003003656864166, 0.03726819157600403, -0.040380124002695084, -0.09890693426132202, -0.007747022435069084, -0.017481181770563126, 0.001654385356232524, -0.039067864418029785, -0.05102818086743355, 0.004539014771580696, 0.018193552270531654, -0.05736452341079712, 0.010113777592778206, -0.0025659375824034214, 0.07262423634529114, 0.02813861146569252, -0.04090502858161926, 0.019721398130059242, 0.004963155835866928, 0.019365213811397552, 0.013403802178800106, 0.03393130376935005, 0.0445418655872345, 0.053502727299928665, -0.011519771069288254, 0.05144060403108597, 0.006725334096699953, -0.05605226382613182, -0.010863641276955605, -0.018071699887514114, -0.07487382739782333, 0.004318742547184229, -0.03618089109659195, -0.02883223444223404, -0.003655582433566451, 0.038224268704652786, 0.05597727745771408, -0.010460589081048965, -0.03526230901479721, 0.011950942687690258, -0.024745481088757515, 0.10760534554719925, -0.039630260318517685, 0.004447625018656254, 0.03537479043006897, 0.012138407677412033, -0.0056145996786653996, 0.0721743181347847, -0.053690195083618164, 0.02930089831352234, -0.02810111828148365, -0.004527298267930746, -0.03520606830716133, 0.02050875499844551, 0.002940869191661477, -0.04870360344648361, 0.05818937346339226, -0.0006819067057222128, 0.03395004943013191, 0.031831685453653336, -0.07584864646196365, -0.053765181452035904, 0.03621838614344597, -0.0018160745967179537, 0.024633001536130905, -0.004468715284019709, -0.09005855023860931, -0.030856864526867867, 0.018259165808558464, -0.02725752256810665, -0.0045366715639829636, -0.0060457708314061165, -0.0270700566470623, 0.046529002487659454, -0.02815735712647438, -0.012419606558978558, 0.0027721498627215624, -0.00358528271317482, 0.013797479681670666, -0.008876503445208073, -0.02187725342810154, -0.029863296076655388, -0.08240994811058044, -0.030125748366117477, 0.09995674341917038, -0.012494592927396297, 0.00035120538086630404, 0.023077035322785378, -0.0005427719443105161, -0.0004935621982440352, -0.02041502110660076, 0.015653390437364578, 0.019871370866894722, -0.02077120542526245, -0.05102818086743355, 0.031794194132089615, -0.01361938752233982, 0.019149627536535263, -0.06306347995996475, -0.02187725342810154, -0.031044330447912216, 0.0023034855257719755, -0.052077990025281906, -0.02742624096572399, 0.013863093219697475, 0.009907565079629421, 0.04457935690879822, -0.019965102896094322, -0.025514090433716774, -0.045966602861881256, 0.0021417962852865458, 0.02916967310011387, 0.023808151483535767, -0.03723070025444031, 0.0021160198375582695, -0.00038196149398572743, 0.06703775376081467, 0.027370000258088112, -0.012597698718309402, -0.030313214287161827, 0.014622329734265804, -0.04199232906103134, -0.0221771989017725, 0.06643786281347275, 0.05848931893706322, -0.024895453825592995, -0.07577366381883621, -0.01484728790819645, -0.06520058959722519, -0.003006482031196356, 0.003964900970458984, 0.008187566883862019, 0.0447293296456337, 0.02122112363576889, 0.04187985137104988, -0.03730568662285805, 0.008032907731831074, -0.026188965886831284, -0.008918683975934982, -0.017499929293990135, 0.025757795199751854, 0.003843048121780157, -0.030088255181908607, 0.0011306528467684984, -0.015119113959372044, 0.031756699085235596, 0.04945346713066101, -0.016740692779421806, -0.013516281731426716, 0.060513947159051895, -0.018484124913811684, -0.005684899166226387, -0.039405301213264465, 0.11495400220155716, -0.016496986150741577, -0.05147809907793999, -0.007189312018454075, -0.008375032804906368, 0.019758891314268112, -0.030331959947943687, 0.06235111132264137, 0.02026504836976528, -0.054814986884593964, 0.023283246904611588, 0.02054624818265438, 0.003604029305279255, -0.053240276873111725, 0.05035330355167389, -0.05586479604244232, 0.023058287799358368, 0.023077035322785378, -0.004154710099101067, -0.03704323619604111, 0.018427884206175804, 0.02221469208598137, 0.05237793177366257, 0.04832867160439491, -0.025026679039001465, 0.06535056233406067, 0.032975226640701294, -0.04870360344648361, 0.045666661113500595, -0.006519122049212456, 0.004335145931690931, -0.01119170617312193, 0.008445332758128643, 0.02780117280781269, 0.004025827161967754, 0.014903527684509754, -0.008815577253699303, -0.018774695694446564, 0.03638710454106331, -0.02159605547785759, -0.005619286093860865, 0.015494044870138168, -0.010723041370511055, -0.008867130614817142, -0.04053009673953056, 0.0056520928628742695, 0.0019390989327803254, 0.0003333375498186797, -0.016731319949030876, -0.039217837154865265, 0.040380124002695084, -0.025832781568169594, -0.02200848050415516, -0.007737649139016867, -0.0800853744149208, -0.0451042614877224, -0.089083731174469, -0.011650997214019299, -0.0706745907664299, 0.00730647798627615, -0.08188504725694656, 0.005698959343135357, -0.05020333081483841, 0.006298849359154701, 0.008693724870681763, 0.024483028799295425, -0.001592287328094244, -0.02864476852118969, -0.03520606830716133, -0.05155308544635773, 0.012044674716889858, -0.008693724870681763, -0.030050761997699738, 0.02883223444223404, 0.051928017288446426, -0.02780117280781269, -0.023939378559589386, 0.0013345219194889069, 0.07093704491853714, -0.030238227918744087, -0.04367952048778534, 0.08653419464826584, 0.0018441943684592843, 0.030650651082396507, -0.0100106718018651, -0.0013755300315096974, 0.03754939138889313, 0.059651605784893036, 0.05076572671532631, -0.045929111540317535, 0.015597151592373848, 0.07851066440343857, -0.0016403254121541977, -0.008079774677753448, -0.05406512692570686, -0.015887722373008728, 0.02856978215277195, -0.02823234349489212, -0.026113981381058693, 0.03395004943013191, -0.0663628801703453, 0.0007381464238278568, 0.0035243562888354063, 0.008398465812206268, -0.015475298278033733, -0.045629166066646576, 0.014866034500300884, 0.0008933914941735566, 0.04367952048778534, -0.0424797423183918, 0.02225218527019024, 0.022664610296487808, -0.018971534445881844, -0.024070603772997856, 0.015344072133302689, -0.02200848050415516, -0.06205116584897041, -0.023002048954367638, 0.05503994598984718, -0.02116488479077816, 0.018718456849455833, 0.003158797975629568, 0.006153563503175974, -0.029919534921646118, 0.04157990589737892, 0.019927609711885452, -0.0010632823687046766, 0.04240475594997406, 0.008717157877981663, -0.018877802416682243, -0.02172728255391121, -0.025082919746637344, -0.042667206376791, 0.02870100736618042, -0.011782223358750343, -0.06583797186613083, 0.0018547393847256899, 0.019290227442979813, 0.03595593199133873, 0.045291729271411896, 0.004082066938281059, -0.0432296060025692, 0.024314308539032936, 0.015981456264853477, -0.015315952710807323, -0.004178143106400967, -0.004382011946290731, 0.019665157422423363, -0.009129582904279232, 0.0011294812429696321, 0.06501312553882599, -0.02092117816209793, 0.046903934329748154, 0.02251463755965233, -0.04090502858161926, -0.02941337786614895, 0.0684249997138977, -0.024183083325624466, -0.008454705588519573, 0.029788309708237648, 0.02834482304751873, -0.02804487757384777, -0.026282699778676033, 0.01422865130007267, 0.039067864418029785, -0.015325325541198254, -0.045779138803482056, 0.04139244183897972, 0.006519122049212456, -0.05444005876779556, -0.005741138942539692, 0.018568484112620354, 0.005272474605590105, -0.0580768920481205, 0.07026216387748718, 0.01446298323571682, -0.023976871743798256, -0.04217979684472084, -0.0411674827337265, 0.023414473980665207, -0.02032128907740116, 0.046678975224494934, -0.006350402720272541, -0.024220576509833336, 0.0048881699331104755, 0.017584288492798805, 0.05717705562710762, 0.002882285974919796, -0.011669743806123734, -0.001906292513012886, -0.02898220717906952, 0.039292823523283005, -0.0270700566470623, 0.0016813335241749883, 0.02172728255391121, 0.01073241513222456, 0.03389380872249603, 0.06407579779624939, -0.019683904945850372, 0.05653967335820198, 0.0007914570160210133, 0.007845441810786724, -0.011819716542959213, 0.04075505584478378, 0.0011529144831001759, -0.026151474565267563, -0.030613157898187637, 0.007559556979686022, 0.03357511758804321, 0.007493943907320499, 0.008210999891161919, -0.023526953533291817, -0.01431301049888134, -0.03486863151192665, 0.011791596189141273, -0.02148357592523098, 0.0960574522614479, -0.04465434327721596, -0.017987340688705444, -0.0029361825436353683, -0.006284789647907019, 0.02950710989534855, -0.009626367129385471, 0.053652700036764145, 0.0006573018035851419, 0.011950942687690258, 0.003503266489133239, -0.0008594133541919291, -0.004782720003277063, -0.019496439024806023, 0.09058345854282379, -0.015559658408164978, 0.02054624818265438, 0.061226315796375275, 0.03486863151192665, 0.008496885187923908, -0.0447293296456337, -0.10258126258850098, -0.008599991910159588, 0.025401610881090164, 0.04146742448210716, -0.04900354892015457, 0.010685548186302185, -0.016721945255994797, -0.005553673021495342, 0.08968362212181091, -0.032881494611501694, 0.031869180500507355, -0.07918553799390793, 0.03604966402053833, -0.001397791551426053, -0.002926809247583151, -0.02973206900060177, 0.02228967845439911, -0.03634960949420929, -0.023208260536193848, 0.009945058263838291, -0.006181683391332626, -0.012091541662812233, -0.0860842764377594, 0.006594107951968908, -0.03395004943013191, 0.05702708289027214, 0.026920083910226822, -0.09043348580598831, -0.04994088038802147, -0.011885329149663448, 0.004386698827147484, -0.04825368523597717, 0.02862602099776268, -0.0003391958598513156, -0.031962912529706955, 0.0056145996786653996, 0.038655441254377365, -0.012578952126204967, 0.0716119185090065, -0.0009894677205011249, 0.005867678206413984, -0.018634095788002014, 0.07603611052036285, -0.011229199357330799, -0.0019695621449500322, 0.04176736995577812, 0.0052396678365767, -0.006636288017034531, -0.04296715185046196, 0.006003590766340494, -0.04184235632419586, -0.023770658299326897, 0.02881348691880703, 0.019890116527676582, 0.011135466396808624, -0.02182101458311081, 0.02825109101831913, -0.05830185115337372, -0.017612408846616745, -0.04124246910214424, -0.024989185854792595, 0.031794194132089615, -0.03721195459365845, 0.030950596556067467, -0.007151818834245205, 0.007100265473127365, -0.05170305818319321, -0.020190062001347542, -0.006640974432229996, 0.009635739959776402, 0.06520058959722519, 0.012747671455144882, 0.052152976393699646, 0.03430623561143875, -0.009766966104507446, 0.015165979973971844, -0.0011464703129604459, -0.04461685195565224, -0.02896345965564251, 0.05065324902534485, -0.02727626822888851, -0.023358233273029327, 0.0026596705429255962, 0.004735853988677263, -0.005024082493036985, 0.05646468698978424, 0.04904104396700859, -0.017687395215034485, -0.031831685453653336, -0.0036626122891902924, 0.038580454885959625, -0.002255447441712022, -0.06283852458000183, 0.06715023517608643, 0.02032128907740116, -0.014837915077805519, 0.05702708289027214, 0.0005377923953346908, 0.013113229535520077, 0.024070603772997856, -0.012194647453725338, 0.03696824982762337, 0.07033715397119522, 0.054665014147758484, -0.018465377390384674, -0.003566536121070385, 0.07074958086013794, -0.05035330355167389, -0.039292823523283005, -0.011594757437705994, -0.07453638315200806, 0.059501633048057556, -0.00702059268951416, 0.0034517133608460426, -0.006580048240721226, -0.046041589230298996, -0.02871975488960743, -0.006355089135468006, -0.02832607738673687, -0.03413751348853111, -0.05837683752179146, -0.031962912529706955, -0.08870879560709, 0.019421452656388283, 0.02980705536901951, -0.019627666100859642, 0.009481080807745457, -0.006270729936659336, -0.023002048954367638, 0.06561301648616791, 0.007554870098829269, -0.03445620834827423, 0.05556485056877136, -0.0030556919518858194, 0.0812101662158966, 0.05061575397849083, 0.06924985349178314, 0.02071496658027172, 0.022702103480696678, 0.02129611000418663, -0.04975341260433197, 0.004229696001857519, 0.04446687921881676, -0.009129582904279232, 0.016056442633271217, 0.02043376863002777, -0.0032619042322039604, 0.05848931893706322, 0.00514124846085906, 0.031475502997636795, -0.016290774568915367, 0.052715372294187546, -0.01389121264219284, 0.013160096481442451, 0.032993972301483154, -0.040005192160606384, 0.007723589427769184, -0.024726733565330505, 0.039217837154865265, 0.05721455067396164, -0.024426788091659546, 0.02078995294868946, -0.004756943788379431, 0.02073371224105358, 0.023095780983567238, -0.017612408846616745, -0.024201828986406326, 0.03486863151192665, 0.003135364968329668, 0.04487930238246918, 0.007676722947508097, -0.0019039491889998317, 0.04300464689731598, 0.0296008437871933, -0.013525654561817646, -0.0017586632166057825, -0.03413751348853111, -0.007414270658046007, 0.019683904945850372, 0.02065872773528099, 0.0026104606222361326, 0.040455110371112823, -0.0736740455031395, -0.033443890511989594, 0.009265495464205742, 0.030181987211108208, -0.008721844293177128, -0.05608975514769554, 0.0007047540857456625, 0.0417298786342144, -0.06343841552734375, 0.022570878267288208, 0.007878248579800129, 0.03751190006732941, -0.0006162936915643513, -0.03621838614344597, 0.032075390219688416, 0.008679664693772793, 0.014875408262014389 ]
39,372
pyspark.sql.dataframe
distinct
Returns a new :class:`DataFrame` containing the distinct rows in this :class:`DataFrame`. .. versionadded:: 1.3.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Returns ------- :class:`DataFrame` DataFrame with distinct records. Examples -------- >>> df = spark.createDataFrame( ... [(14, "Tom"), (23, "Alice"), (23, "Alice")], ["age", "name"]) Return the number of distinct rows in the :class:`DataFrame` >>> df.distinct().count() 2
def distinct(self) -> "DataFrame": """Returns a new :class:`DataFrame` containing the distinct rows in this :class:`DataFrame`. .. versionadded:: 1.3.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Returns ------- :class:`DataFrame` DataFrame with distinct records. Examples -------- >>> df = spark.createDataFrame( ... [(14, "Tom"), (23, "Alice"), (23, "Alice")], ["age", "name"]) Return the number of distinct rows in the :class:`DataFrame` >>> df.distinct().count() 2 """ return DataFrame(self._jdf.distinct(), self.sparkSession)
(self) -> pyspark.sql.dataframe.DataFrame
[ 0.0028218557126820087, -0.01738850027322769, 0.02925410121679306, 0.0025133502203971148, 0.032239917665719986, -0.0015522363828495145, -0.005932800937443972, -0.014419942162930965, 0.022557586431503296, 0.010277768597006798, -0.016879357397556305, -0.01974436081945896, -0.019174812361598015, 0.062029048800468445, -0.003378460416570306, -0.032188139855861664, 0.022816473618149757, 0.029564764350652695, 0.03084193542599678, 0.06482502073049545, -0.017880382016301155, 0.02069360949099064, 0.042836979031562805, 0.06603315472602844, -0.054849281907081604, 0.010010252706706524, -0.012210782617330551, -0.034949589520692825, 0.044045113027095795, 0.055228982120752335, -0.029530245810747147, 0.004612483084201813, -0.028184039518237114, 0.0003896771522704512, -0.0687946006655693, 0.02716575562953949, 0.030410457402467728, -0.03096274845302105, 0.04180143401026726, -0.04000649228692055, -0.04787662252783775, -0.03267139568924904, 0.04228468984365463, -0.05888790264725685, -0.0003303491394035518, -0.011097573675215244, 0.07863226532936096, -0.040662337094545364, -0.011166609823703766, -0.011693011038005352, 0.023644907400012016, 0.06910526007413864, -0.06475598365068436, 0.027390122413635254, -0.07959876954555511, -0.02133219502866268, -0.015490003861486912, 0.001724826986901462, -0.024887559935450554, 0.03526025265455246, -0.051846206188201904, -0.015904221683740616, 0.022384997457265854, 0.020710868760943413, 0.03959227725863457, 0.007896018214523792, -0.012176265008747578, 0.011434124782681465, -0.04394155740737915, -0.022333219647407532, -0.01974436081945896, 0.014135167934000492, 0.009984364733099937, 0.09278468787670135, -0.06047573685646057, -0.0254571083933115, -0.008038405328989029, -0.005091421771794558, -0.02278195507824421, -0.06534279137849808, 0.05509090796113014, -0.0469791516661644, 0.004508928395807743, 0.002308398950845003, 0.041974026709795, 0.0449771024286747, 0.01636158674955368, 0.04135270044207573, -0.04256083443760872, 0.03555365651845932, 0.01915755309164524, 0.08049624413251877, -0.015308783389627934, 0.019088516011834145, 0.04173240065574646, -0.017172761261463165, -0.018208304420113564, 0.02224692516028881, 0.013289473950862885, 0.013315361924469471, -0.013772726990282536, 0.036623720079660416, -0.00668788468465209, -0.008016832172870636, -0.03917805850505829, -0.013185919262468815, 0.01824282296001911, -0.03146326169371605, -0.003926435485482216, 0.035622693598270416, -0.026147471740841866, 0.12350580841302872, 0.07045146822929382, 0.016991540789604187, -0.0009913170943036675, -0.00682164216414094, -0.0024421564303338528, 0.007762260735034943, -0.07010629028081894, 0.020641831681132317, -0.006636107340455055, 0.08926384150981903, 0.007404135540127754, -0.056057415902614594, -0.007447283249348402, 0.012469668872654438, 0.004798017907887697, -0.05833561345934868, 0.004336338024586439, 0.08726178854703903, 0.04128366336226463, 0.0029081511311233044, 0.06009603664278984, 0.007524948567152023, 0.016793062910437584, 0.016534175723791122, 0.0629955604672432, 0.029305879026651382, 0.03129066899418831, 0.06834586709737778, 0.00031362942536361516, 0.006843216251581907, 0.04180143401026726, 0.0649976059794426, 0.0013278686674311757, -0.014782382175326347, 0.012719924561679363, 0.016344327479600906, -0.02683783322572708, 0.017328092828392982, 0.0076975394040346146, -0.00955288764089346, 0.04770403355360031, -0.014696086756885052, -0.011900119483470917, -0.03869480639696121, 0.019675325602293015, -0.02328246831893921, 0.010959501378238201, -0.05274367704987526, 0.02404186688363552, 0.022384997457265854, 0.011900119483470917, 0.04280246049165726, -0.08905673027038574, 0.01038995198905468, 0.02278195507824421, 0.003533791983500123, -0.09092070907354355, -0.06717225164175034, 0.04086944833397865, 0.04439029470086098, 0.03246428444981575, -0.014911824837327003, -0.09409637749195099, 0.11604990065097809, 0.023765720427036285, 0.028701812028884888, 0.041974026709795, -0.020935235545039177, -0.019882433116436005, -0.048394396901130676, -0.032239917665719986, 0.0348978117108345, 0.0759398490190506, -0.01986517384648323, -0.003870343556627631, -0.04387252405285835, 0.0649976059794426, 0.01189148984849453, -0.02169463410973549, -0.026613466441631317, -0.017561091110110283, 0.056195490062236786, -0.008694250136613846, -0.04939541965723038, 0.017060577869415283, -0.017707793042063713, -0.09492481499910355, 0.015679853036999702, 0.006575700826942921, 0.0239900890737772, 0.038453180342912674, -0.045840054750442505, 0.04539132118225098, -0.011434124782681465, -0.04911927506327629, -0.01736261136829853, 0.03351708874106407, -0.052812714129686356, 0.06047573685646057, -0.05695488676428795, 0.012297078035771847, 0.011926008388400078, 0.006718087941408157, -0.04615071788430214, -0.020641831681132317, -0.04269890487194061, 0.05136295408010483, -0.05060355365276337, -0.00980314426124096, -0.02433527074754238, -0.016491029411554337, 0.00953562930226326, -0.025646958500146866, -0.0718667134642601, 0.03914353996515274, -0.0012081339955329895, -0.0229545459151268, -0.1117696538567543, 0.008853896521031857, -0.07117635011672974, 0.04511517286300659, -0.02436978742480278, -0.04528776556253433, 0.03153229504823685, -0.006605904083698988, 0.034656185656785965, 0.0469101183116436, -0.04121462628245354, -0.05795591324567795, -0.015239747241139412, 0.08912576735019684, 0.031273409724235535, -0.019140293821692467, 0.024179939180612564, -0.022885508835315704, 0.08864251524209976, 0.013315361924469471, -0.02304084040224552, -0.012426520697772503, -0.04573649913072586, 0.011434124782681465, 0.006571386009454727, 0.029185065999627113, -0.02619924768805504, -0.000984305632300675, 0.031014524400234222, -0.05015482008457184, 0.022022556513547897, -0.04639234393835068, -0.0002574026584625244, 0.0021304148249328136, 0.06996821612119675, -0.008292976766824722, -0.02783885784447193, -0.04017908498644829, 0.020417464897036552, -0.013807245530188084, 0.01543822605162859, 0.05478024482727051, 0.037279561161994934, 0.026406357064843178, -0.0479111410677433, 0.006795753724873066, -0.06209808588027954, -0.04711722582578659, -0.011339200660586357, -0.04867054149508476, -0.035035885870456696, -0.03838414326310158, -0.015636704862117767, 0.023765720427036285, 0.004754870198667049, -0.03158407285809517, 0.0013343407772481441, 0.018622523173689842, -0.08401709049940109, -0.03004801832139492, -0.028304852545261383, -0.019088516011834145, 0.006454887334257364, -0.002394694136455655, 0.008763286285102367, -0.02616473101079464, 0.03655468299984932, -0.009000598452985287, -0.02934039570391178, -0.030617566779255867, 0.06013055518269539, -0.0038056219927966595, -0.009354408830404282, 0.017172761261463165, 0.07483527064323425, -0.03237799182534218, -0.026389097794890404, -0.031187115237116814, -0.03346531093120575, 0.019468216225504875, 0.012461039237678051, -0.02775256335735321, 0.04532228410243988, 0.027027683332562447, 0.0334998294711113, -0.07835611701011658, -0.035829801112413406, -0.023938311263918877, 0.005225179251283407, -0.006735346745699644, 0.024404305964708328, 0.004023517481982708, 0.0005733242724090815, -0.02804596722126007, -0.019934210926294327, -0.0334307923913002, 0.05588482692837715, 0.014307757839560509, -0.007071898318827152, -0.015136192552745342, -0.010148325003683567, 0.0062866113148629665, 0.010148325003683567, 0.018001196905970573, -0.023316984996199608, -0.06368591636419296, -0.03298205882310867, 0.04528776556253433, -0.0002605038753245026, 0.03620950132608414, 0.03551913797855377, -0.002985816914588213, -0.048463430255651474, 0.009104152210056782, -0.029737355187535286, -0.04300956800580025, 0.008353383280336857, -0.02186722494661808, -0.03075563907623291, 0.014937713742256165, -0.04915379360318184, 0.04269890487194061, 0.029064251109957695, 0.001380724599584937, 0.03631305694580078, 0.0598544105887413, 0.019312884658575058, -0.05119036138057709, 0.08097949624061584, -0.029219582676887512, 0.024853041395545006, 0.05654067173600197, -0.035415586084127426, 0.010821429081261158, -0.052605606615543365, 0.04746240749955177, 0.04093848168849945, -0.020624572411179543, -0.02478400617837906, -0.06396206468343735, -0.04428673908114433, -0.04035167396068573, -0.01531741302460432, 0.019934210926294327, -0.018018456175923347, 0.02228144183754921, 0.0368998646736145, -0.05129391700029373, 0.007395505905151367, -0.0014756493037566543, 0.004215524531900883, 0.011960525996983051, -0.06668899208307266, 0.031273409724235535, -0.020624572411179543, -0.02074538543820381, 0.001594305387698114, -0.07248803973197937, -0.023558612912893295, -0.06030314415693283, -0.004949034657329321, -0.04128366336226463, 0.004129229113459587, -0.018329117447137833, -0.0020969754550606012, -0.00938892737030983, 0.013884911313652992, -0.03769377991557121, -0.0052812714129686356, 0.02090071700513363, 0.01268540695309639, -0.000013947138540970627, -0.010622949339449406, 0.01408339012414217, -0.024145420640707016, 0.0028261705301702023, 0.03063482604920864, 0.03959227725863457, -0.06648188829421997, 0.011554938741028309, -0.05736910551786423, 0.04635782539844513, -0.025319036096334457, -0.04887764900922775, 0.04994770884513855, 0.024507861584424973, 0.028115004301071167, 0.04439029470086098, -0.010001623071730137, 0.06996821612119675, 0.04394155740737915, 0.0031152598094195127, 0.008310236036777496, -0.02224692516028881, 0.055194463580846786, -0.01910577528178692, 0.01650828868150711, 0.002340759616345167, 0.019709842279553413, 0.03187747672200203, 0.017561091110110283, -0.02499111369252205, -0.03900546953082085, -0.04656493663787842, 0.0234550591558218, -0.007568096276372671, 0.006036355160176754, 0.026734279468655586, -0.03755570948123932, -0.030807416886091232, 0.06544634699821472, 0.0379699245095253, -0.00654981192201376, 0.006951085291802883, -0.043803486973047256, 0.01233159564435482, -0.01118386909365654, -0.000704924575984478, -0.013686432503163815, -0.06755194813013077, -0.02404186688363552, 0.09892891347408295, 0.004910201765596867, 0.01339302770793438, -0.054849281907081604, -0.09471770375967026, 0.02733834646642208, -0.03627853840589523, -0.050810664892196655, -0.032239917665719986, 0.014428571797907352, 0.061442241072654724, 0.005781784188002348, -0.0020840310025960207, 0.041456256061792374, -0.023593131452798843, -0.030151572078466415, -0.04808373376727104, -0.03852221369743347, -0.01020010281354189, 0.01024325005710125, 0.04269890487194061, -0.0012534389970824122, -0.07449009269475937, -0.06503212451934814, 0.02466319128870964, -0.006942455656826496, -0.06596411764621735, 0.004703092854470015, 0.0029189379420131445, 0.043423786759376526, -0.08850444108247757, 0.030617566779255867, -0.007041695062071085, -0.010821429081261158, 0.028184039518237114, 0.010622949339449406, 0.007611243985593319, -0.010985389351844788, 0.03141148388385773, -0.03676179051399231, -0.015351930633187294, -0.006597274448722601, -0.04256083443760872, -0.009604665450751781, -0.017586978152394295, 0.04311312362551689, 0.010087918490171432, 0.03513944149017334, -0.03658920153975487, 0.043665412813425064, 0.0157488901168108, -0.02599214017391205, -0.03481151908636093, 0.030807416886091232, 0.01592147909104824, -0.04832535982131958, 0.06755194813013077, 0.02713123708963394, -0.032774947583675385, -0.06265037506818771, -0.031187115237116814, 0.038453180342912674, -0.03417293354868889, 0.009233595803380013, 0.04760047793388367, -0.012547334656119347, -0.012840738520026207, -0.001336498185992241, 0.037072453647851944, 0.0008580987341701984, -0.007404135540127754, 0.030703861266374588, -0.019209330901503563, 0.049844156950712204, -0.052847232669591904, 0.01760423742234707, 0.0209870133548975, 0.017284944653511047, 0.027683526277542114, 0.05129391700029373, -0.08525974303483963, -0.015308783389627934, -0.022436773404479027, 0.00355320842936635, 0.018208304420113564, -0.02783885784447193, -0.06316814571619034, 0.041835952550172806, 0.023023581132292747, 0.021849965676665306, -0.007831296883523464, -0.010372692719101906, 0.011969155631959438, -0.02404186688363552, -0.03201555088162422, -0.013453435152769089, 0.017647385597229004, 0.007317840121686459, 0.03748667240142822, 0.01089046522974968, 0.011365088634192944, -0.02528451755642891, 0.03879835829138756, -0.015093045309185982, 0.060786399990320206, 0.0040041012689471245, 0.02607843466103077, 0.011977785266935825, 0.018087491393089294, -0.02625102549791336, -0.007266062777489424, -0.06316814571619034, 0.03910902142524719, -0.04207758232951164, 0.00859501026570797, 0.028011448681354523, 0.04853246733546257, 0.031100820749998093, -0.0036222445778548717, -0.034656185656785965, 0.013108253479003906, 0.0539172925055027, 0.04114559292793274, 0.00003200678474968299, 0.025888584554195404, -0.018329117447137833, 0.02633731998503208, 0.07607792317867279, -0.04452836513519287, 0.007270377594977617, -0.03275768831372261, 0.06196001544594765, 0.008948820643126965, 0.02178093045949936, -0.045011620968580246, 0.028977956622838974, -0.010942242108285427, -0.013764097355306149, 0.03700341656804085, -0.03921257704496384, 0.013151401653885841, -0.05239849537611008, -0.015049897134304047, -0.0053891404531896114, 0.010286398231983185, 0.04432125762104988, -0.037831854075193405, -0.03538106754422188, 0.023817498236894608, 0.013600137084722519, -0.017000170424580574, 0.047634996473789215, -0.030393199995160103, -0.022592104971408844, 0.030496753752231598, -0.03113533928990364, -0.04853246733546257, 0.035864319652318954, -0.007883073762059212, 0.027510937303304672, 0.006528238300234079, 0.02607843466103077, -0.0284256674349308, -0.016033664345741272, 0.01827734149992466, 0.013108253479003906, -0.032947540283203125, -0.07835611701011658, -0.03714149072766304, 0.0167153961956501, -0.03921257704496384, 0.011986414901912212, 0.042836979031562805, -0.004215524531900883, -0.034949589520692825, 0.022712917998433113, 0.00199018488638103, 0.028097745031118393, -0.043458305299282074, 0.03129066899418831, 0.04055878520011902, -0.08070334792137146, -0.009604665450751781, 0.009294002316892147, 0.03572624921798706, -0.027424640953540802, -0.04152528941631317, -0.03693438321352005, -0.005794728174805641, 0.05215686932206154, -0.013263585045933723, 0.04055878520011902, -0.015162081457674503, -0.012754443101584911, -0.01642199233174324, -0.037659261375665665, -0.03434552252292633, -0.020055023953318596, -0.0219535194337368, -0.04939541965723038, -0.00615716865286231, 0.007404135540127754, 0.04977511987090111, 0.032067328691482544, 0.02495659701526165, 0.06475598365068436, -0.05467669293284416, 0.0011563567677512765, 0.01529152411967516, 0.00616579782217741, 0.024732228368520737, 0.0013688589679077268, 0.021711893379688263, -0.041870471090078354, 0.0759398490190506, 0.03952324017882347, -0.0033094240352511406, -0.01712961308658123, -0.0037624742835760117, 0.009302631951868534, -0.014506237581372261, 0.053261447697877884, 0.009984364733099937, -0.030703861266374588, -0.012555964291095734, -0.005604878533631563, -0.06116609647870064, -0.01960628852248192, 0.0007410607649944723, -0.04594361037015915, -0.011166609823703766, 0.039626795798540115, -0.014704716391861439, -0.061856459826231, -0.05046548321843147, -0.02495659701526165, -0.03175666555762291, -0.06151127815246582, 0.021470267325639725, -0.07290225476026535, -0.0279251541942358, -0.032153621315956116, -0.01618899591267109, 0.07324744015932083, -0.00191467662807554, 0.0114772729575634, 0.014980860985815525, -0.00012067856005160138, -0.002795967273414135, 0.02619924768805504, -0.009000598452985287, 0.03759022429585457, 0.05274367704987526, 0.07041694968938828, 0.048463430255651474, 0.08477648347616196, -0.006636107340455055, 0.015110304579138756, 0.01754383184015751, -0.016033664345741272, -0.0017722893971949816, 0.025888584554195404, 0.011641234159469604, 0.06561893224716187, -0.0035273197572678328, 0.05229494348168373, -0.01337576936930418, 0.0012070552911609411, -0.005954374559223652, 0.018518967553973198, 0.010156954638659954, -0.026147471740841866, -0.0009433153318241239, 0.06703417748212814, 0.004707407671958208, 0.047427888959646225, -0.0004401059413794428, 0.0010430942056700587, 0.029357654973864555, -0.034241966903209686, -0.02140123024582863, 0.026647983118891716, -0.03084193542599678, 0.0023278153967112303, 0.05536705255508423, -0.017017429694533348, 0.02487030066549778, 0.007058954332023859, -0.005285586230456829, -0.014506237581372261, -0.03477700054645538, -0.01393668819218874, 0.003516532713547349, -0.03170488774776459, 0.04359637573361397, -0.025094669312238693, 0.02795967273414135, 0.013979836367070675, 0.0060967616736888885, -0.022626623511314392, 0.002521979622542858, -0.013194548897445202, -0.043458305299282074, -0.03434552252292633, 0.010778280906379223, 0.020521018654108047, 0.005022385623306036, 0.03900546953082085, 0.004961978644132614, -0.06254681944847107, -0.008292976766824722, 0.024611415341496468, 0.010148325003683567, 0.03941968455910683, -0.02254032902419567, 0.01763012632727623, 0.0858810693025589, 0.0019082045182585716 ]
39,373
pyspark.sql.dataframe
drop
Returns a new :class:`DataFrame` without specified columns. This is a no-op if the schema doesn't contain the given column name(s). .. versionadded:: 1.4.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Parameters ---------- cols: str or :class:`Column` a name of the column, or the :class:`Column` to drop Returns ------- :class:`DataFrame` DataFrame without given columns. Notes ----- When an input is a column name, it is treated literally without further interpretation. Otherwise, will try to match the equivalent expression. So that dropping column by its name `drop(colName)` has different semantic with directly dropping the column `drop(col(colName))`. Examples -------- >>> from pyspark.sql import Row >>> from pyspark.sql.functions import col, lit >>> df = spark.createDataFrame( ... [(14, "Tom"), (23, "Alice"), (16, "Bob")], ["age", "name"]) >>> df2 = spark.createDataFrame([Row(height=80, name="Tom"), Row(height=85, name="Bob")]) >>> df.drop('age').show() +-----+ | name| +-----+ | Tom| |Alice| | Bob| +-----+ >>> df.drop(df.age).show() +-----+ | name| +-----+ | Tom| |Alice| | Bob| +-----+ Drop the column that joined both DataFrames on. >>> df.join(df2, df.name == df2.name, 'inner').drop('name').sort('age').show() +---+------+ |age|height| +---+------+ | 14| 80| | 16| 85| +---+------+ >>> df3 = df.join(df2) >>> df3.show() +---+-----+------+----+ |age| name|height|name| +---+-----+------+----+ | 14| Tom| 80| Tom| | 14| Tom| 85| Bob| | 23|Alice| 80| Tom| | 23|Alice| 85| Bob| | 16| Bob| 80| Tom| | 16| Bob| 85| Bob| +---+-----+------+----+ Drop two column by the same name. >>> df3.drop("name").show() +---+------+ |age|height| +---+------+ | 14| 80| | 14| 85| | 23| 80| | 23| 85| | 16| 80| | 16| 85| +---+------+ Can not drop col('name') due to ambiguous reference. >>> df3.drop(col("name")).show() Traceback (most recent call last): ... pyspark.errors.exceptions.captured.AnalysisException: [AMBIGUOUS_REFERENCE] Reference... >>> df4 = df.withColumn("a.b.c", lit(1)) >>> df4.show() +---+-----+-----+ |age| name|a.b.c| +---+-----+-----+ | 14| Tom| 1| | 23|Alice| 1| | 16| Bob| 1| +---+-----+-----+ >>> df4.drop("a.b.c").show() +---+-----+ |age| name| +---+-----+ | 14| Tom| | 23|Alice| | 16| Bob| +---+-----+ Can not find a column matching the expression "a.b.c". >>> df4.drop(col("a.b.c")).show() +---+-----+-----+ |age| name|a.b.c| +---+-----+-----+ | 14| Tom| 1| | 23|Alice| 1| | 16| Bob| 1| +---+-----+-----+
def drop(self, *cols: "ColumnOrName") -> "DataFrame": # type: ignore[misc] """Returns a new :class:`DataFrame` without specified columns. This is a no-op if the schema doesn't contain the given column name(s). .. versionadded:: 1.4.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Parameters ---------- cols: str or :class:`Column` a name of the column, or the :class:`Column` to drop Returns ------- :class:`DataFrame` DataFrame without given columns. Notes ----- When an input is a column name, it is treated literally without further interpretation. Otherwise, will try to match the equivalent expression. So that dropping column by its name `drop(colName)` has different semantic with directly dropping the column `drop(col(colName))`. Examples -------- >>> from pyspark.sql import Row >>> from pyspark.sql.functions import col, lit >>> df = spark.createDataFrame( ... [(14, "Tom"), (23, "Alice"), (16, "Bob")], ["age", "name"]) >>> df2 = spark.createDataFrame([Row(height=80, name="Tom"), Row(height=85, name="Bob")]) >>> df.drop('age').show() +-----+ | name| +-----+ | Tom| |Alice| | Bob| +-----+ >>> df.drop(df.age).show() +-----+ | name| +-----+ | Tom| |Alice| | Bob| +-----+ Drop the column that joined both DataFrames on. >>> df.join(df2, df.name == df2.name, 'inner').drop('name').sort('age').show() +---+------+ |age|height| +---+------+ | 14| 80| | 16| 85| +---+------+ >>> df3 = df.join(df2) >>> df3.show() +---+-----+------+----+ |age| name|height|name| +---+-----+------+----+ | 14| Tom| 80| Tom| | 14| Tom| 85| Bob| | 23|Alice| 80| Tom| | 23|Alice| 85| Bob| | 16| Bob| 80| Tom| | 16| Bob| 85| Bob| +---+-----+------+----+ Drop two column by the same name. >>> df3.drop("name").show() +---+------+ |age|height| +---+------+ | 14| 80| | 14| 85| | 23| 80| | 23| 85| | 16| 80| | 16| 85| +---+------+ Can not drop col('name') due to ambiguous reference. >>> df3.drop(col("name")).show() Traceback (most recent call last): ... pyspark.errors.exceptions.captured.AnalysisException: [AMBIGUOUS_REFERENCE] Reference... >>> df4 = df.withColumn("a.b.c", lit(1)) >>> df4.show() +---+-----+-----+ |age| name|a.b.c| +---+-----+-----+ | 14| Tom| 1| | 23|Alice| 1| | 16| Bob| 1| +---+-----+-----+ >>> df4.drop("a.b.c").show() +---+-----+ |age| name| +---+-----+ | 14| Tom| | 23|Alice| | 16| Bob| +---+-----+ Can not find a column matching the expression "a.b.c". >>> df4.drop(col("a.b.c")).show() +---+-----+-----+ |age| name|a.b.c| +---+-----+-----+ | 14| Tom| 1| | 23|Alice| 1| | 16| Bob| 1| +---+-----+-----+ """ column_names: List[str] = [] java_columns: List[JavaObject] = [] for c in cols: if isinstance(c, str): column_names.append(c) elif isinstance(c, Column): java_columns.append(c._jc) else: raise PySparkTypeError( error_class="NOT_COLUMN_OR_STR", message_parameters={"arg_name": "col", "arg_type": type(c).__name__}, ) jdf = self._jdf if len(java_columns) > 0: first_column, *remaining_columns = java_columns jdf = jdf.drop(first_column, self._jseq(remaining_columns)) if len(column_names) > 0: jdf = jdf.drop(self._jseq(column_names)) return DataFrame(jdf, self.sparkSession)
(self, *cols: 'ColumnOrName') -> 'DataFrame'
[ 0.031110363081097603, 0.004834166262298822, 0.05114200338721275, 0.02336343191564083, -0.023588277399539948, -0.032132383435964584, -0.01268329843878746, 0.03691545128822327, 0.022198326885700226, 0.00818128976970911, -0.003988442476838827, 0.009458817541599274, -0.024160610511898994, 0.0239766463637352, -0.0038836852181702852, 0.02131938748061657, 0.07002897560596466, 0.03566858172416687, 0.07043778896331787, -0.02203480340540409, -0.016883810982108116, -0.004767734557390213, -0.001018189825117588, 0.03826452046632767, -0.04178027808666229, 0.007062174845486879, 0.007798030972480774, 0.01769120804965496, 0.002930649323388934, -0.006765788421034813, -0.007706048898398876, -0.01728239841759205, -0.02035868726670742, 0.02303638495504856, -0.05723325535655022, -0.00526341563090682, 0.010204893536865711, 0.005181653890758753, 0.06671762466430664, -0.019541068002581596, 0.028473544865846634, 0.02767636813223362, 0.012448233552277088, -0.07628375291824341, 0.005539361387491226, 0.0041672964580357075, 0.025775406509637833, -0.026736106723546982, -0.01636257953941822, 0.024548979476094246, 0.031539611518383026, -0.0042848289012908936, -0.021237626671791077, 0.02530527487397194, -0.024119729176163673, -0.007772480603307486, -0.033501897007226944, 0.04905707761645317, 0.029270721599459648, -0.0036077392287552357, 0.03301132470369339, 0.021114982664585114, -0.06271129846572876, 0.026122894138097763, 0.005462709814310074, 0.015228134579956532, 0.046563342213630676, -0.020839037373661995, -0.09680596739053726, -0.053349569439888, -0.06132134422659874, 0.001971225719898939, -0.0063058785162866116, 0.11046018451452255, 0.0037968133110553026, -0.059522587805986404, 0.027247117832303047, -0.022893302142620087, -0.027471963316202164, -0.04905707761645317, 0.04366079717874527, -0.057519420981407166, -0.0500790998339653, -0.030435828492045403, 0.06884343177080154, 0.03507580980658531, 0.02068573422729969, 0.027492403984069824, -0.032132383435964584, -0.0379374735057354, -0.013633779250085354, 0.006213896442204714, -0.046890389174222946, 0.059849634766578674, -0.024446776136755943, -0.019060717895627022, -0.007675388362258673, 0.005299186334013939, 0.02428325265645981, -0.015033950097858906, 0.06356979161500931, 0.04868914932012558, -0.026082012802362442, 0.06209808215498924, -0.004800950177013874, 0.0012481448939070106, -0.028166938573122025, -0.028187379240989685, -0.002031269483268261, -0.037549104541540146, -0.057519420981407166, -0.002956199925392866, 0.014941968023777008, 0.0011369999265298247, 0.027901211753487587, -0.0039194561541080475, -0.009750094264745712, -0.02497822791337967, -0.04090133681893349, 0.028493985533714294, 0.02438545599579811, 0.019929436966776848, 0.003646065015345812, -0.07321768999099731, 0.022423172369599342, 0.026879189535975456, -0.008211949840188026, -0.04137146845459938, -0.024221930652856827, 0.05829615890979767, 0.054821282625198364, -0.035545941442251205, -0.002023604465648532, 0.004384476225823164, 0.018907414749264717, 0.01866212859749794, 0.03241855278611183, 0.037794388830661774, 0.011824799701571465, 0.003365008858963847, 0.016475001350045204, 0.022770659998059273, 0.026879189535975456, 0.0071694874204695225, -0.019745472818613052, -0.009796084836125374, 0.019571729004383087, -0.05935906246304512, -0.04905707761645317, 0.009632561355829239, -0.07955422252416611, -0.022443613037467003, 0.012049644254148006, -0.03168269619345665, -0.014277653768658638, -0.0026955842040479183, -0.018447505310177803, -0.0276354867964983, -0.058173514902591705, -0.01671006716787815, 0.041167061775922775, -0.0057182153686881065, -0.008544107899069786, 0.03560725972056389, -0.03211194649338722, -0.0320710651576519, 0.042516134679317474, -0.007634507492184639, -0.04729919880628586, 0.02671566605567932, 0.07771458476781845, 0.0664314553141594, 0.049179717898368835, -0.008298821747303009, -0.062220726162195206, 0.044805463403463364, 0.009724543429911137, 0.008774062618613243, -0.0033573436085134745, -0.06602264940738678, 0.019449086859822273, -0.03799879550933838, -0.024140169844031334, 0.03840760141611099, 0.039490945637226105, -0.00500535499304533, -0.06500062346458435, -0.035893429070711136, 0.04247525334358215, 0.003073732368648052, -0.06508238613605499, -0.019111819565296173, 0.0035515278577804565, 0.05163257196545601, 0.05433071404695511, -0.013255630619823933, 0.05371749773621559, 0.04758536443114281, -0.02299550548195839, -0.012182507663965225, 0.02904587797820568, 0.033869821578264236, 0.040860455483198166, -0.02569364383816719, -0.014972629025578499, -0.026143332943320274, 0.006275217514485121, -0.00674534821882844, 0.05441247299313545, -0.05596594884991646, 0.037222057580947876, -0.010102692060172558, 0.05980875343084335, -0.038816411048173904, 0.06352891772985458, -0.04071737453341484, -0.040145039558410645, -0.03227546811103821, 0.09312668442726135, 0.029454685747623444, 0.03174401819705963, 0.055516257882118225, -0.004969583824276924, 0.022239208221435547, 0.025795845314860344, -0.047871530055999756, -0.0119883231818676, -0.0006962527986615896, 0.061566632241010666, -0.07567054033279419, 0.016505662351846695, -0.05494392663240433, 0.039184339344501495, -0.07006985694169998, -0.019745472818613052, 0.055802423506975174, -0.07150068879127502, -0.031192123889923096, 0.04705391079187393, -0.08969268947839737, -0.06978369504213333, 0.03667016327381134, 0.007537415251135826, 0.008268161676824093, 0.022280089557170868, 0.005416718777269125, -0.008482785895466805, 0.05126464366912842, -0.025182632729411125, -0.008406134322285652, 0.008227280341088772, -0.005518921185284853, 0.04022680222988129, 0.0614439882338047, 0.025203073397278786, 0.01603553257882595, -0.0024426335003226995, 0.029107198119163513, -0.007368781603872776, 0.03642487898468971, 0.009249302558600903, -0.08290646225214005, -0.032541193068027496, 0.037201616913080215, 0.017609447240829468, -0.016107073053717613, 0.014747783541679382, -0.018478166311979294, -0.001024577533826232, 0.009029568172991276, 0.05494392663240433, 0.015207693912088871, 0.021094541996717453, -0.026879189535975456, 0.04135102778673172, 0.01481932494789362, -0.043865203857421875, -0.028882354497909546, 0.02232096903026104, -0.019878335297107697, 0.02103322185575962, -0.03900037705898285, -0.00032034015748649836, 0.06467358022928238, -0.016454560682177544, 0.028861913830041885, 0.005204649176448584, -0.09705124795436859, -0.00950991827994585, 0.039961077272892, 0.022893302142620087, -0.03004745952785015, 0.05261371284723282, 0.030231423676013947, -0.02107410319149494, 0.03401290625333786, 0.011456871405243874, 0.00032928286236710846, -0.042516134679317474, 0.002075982978567481, 0.025795845314860344, -0.007486314512789249, 0.07755105942487717, 0.04562308266758919, 0.03568902239203453, -0.07162333279848099, -0.010138462297618389, -0.04578660428524017, 0.026920070871710777, 0.029434245079755783, -0.01052683126181364, -0.03004745952785015, -0.05036526545882225, 0.022770659998059273, -0.03170313686132431, 0.012621977366507053, 0.026838308200240135, 0.009213532321155071, -0.0029434245079755783, 0.030435828492045403, 0.02972041256725788, -0.05343133211135864, -0.04889355227351189, 0.0345647968351841, 0.004210732411593199, 0.022872861474752426, -0.024487657472491264, 0.020154282450675964, -0.016934910789132118, -0.0093412846326828, 0.010700575076043606, 0.023894883692264557, 0.03370629996061325, -0.05845968425273895, 0.009116440080106258, -0.043538156896829605, -0.001815367373637855, -0.03413555026054382, 0.044805463403463364, 0.03323616832494736, 0.025489239022135735, -0.06978369504213333, 0.06749436259269714, -0.029945258051156998, 0.0004212648782413453, 0.012857042253017426, -0.001089731464162469, 0.004118750337511301, 0.007542525418102741, 0.06839374452829361, 0.0361182726919651, 0.03893905505537987, -0.01694513112306595, -0.015422318130731583, 0.010639253072440624, -0.004320599604398012, -0.04431489109992981, 0.0735856145620346, -0.01663852483034134, -0.027594605460762978, 0.07031514495611191, -0.054821282625198364, 0.029127638787031174, -0.04803505539894104, 0.05212314426898956, -0.0014040033565834165, -0.008365253917872906, -0.04631805792450905, -0.04701303318142891, -0.04644069820642471, 0.017190417274832726, -0.05506656691431999, 0.0034774313680827618, -0.002626597648486495, -0.019520629197359085, 0.0017399932257831097, 0.009029568172991276, 0.02272977866232395, 0.02037912793457508, 0.016526103019714355, -0.008876265026628971, -0.07579318434000015, 0.03031318448483944, 0.005294076167047024, -0.020767495036125183, 0.030824195593595505, -0.07411706447601318, -0.08237500488758087, -0.013286291621625423, 0.02569364383816719, 0.004783065058290958, -0.005524031352251768, -0.0026879189535975456, 0.028473544865846634, -0.035586822777986526, 0.011467091739177704, -0.08683102577924728, -0.000940260651987046, 0.016250155866146088, -0.028391782194375992, -0.011303568258881569, -0.03380850329995155, -0.03354277461767197, -0.0019367324421182275, 0.0387142077088356, 0.05976787209510803, 0.03564814105629921, 0.005097337067127228, -0.040185920894145966, 0.0018498606514185667, 0.008973357267677784, 0.01303078606724739, -0.046481579542160034, 0.03433995321393013, 0.04897531494498253, 0.07264535129070282, 0.0512237623333931, -0.02097189985215664, 0.05559802055358887, 0.031498730182647705, -0.004570995457470417, -0.02371091954410076, 0.0193571038544178, 0.011405770666897297, -0.012121185660362244, 0.01895851641893387, -0.050487909466028214, -0.004622096195816994, -0.016188835725188255, 0.06434652954339981, -0.021258067339658737, -0.038489364087581635, -0.048116814345121384, -0.016423899680376053, 0.007128606550395489, 0.05044702813029289, -0.013889284804463387, -0.050528787076473236, -0.007399442605674267, 0.0373651385307312, 0.011344448663294315, 0.01629103720188141, -0.006970192771404982, -0.024242371320724487, -0.03431951254606247, 0.010215113870799541, -0.004392141476273537, 0.001874133595265448, -0.09271787106990814, 0.009888066910207272, 0.06070813164114952, 0.020430227741599083, 0.03190753981471062, -0.022893302142620087, -0.04868914932012558, -0.0016888920217752457, -0.03170313686132431, -0.006362089421600103, -0.0479532927274704, 0.01629103720188141, 0.02334299311041832, 0.007159267086535692, 0.027144916355609894, 0.001363122370094061, -0.009908507578074932, 0.06884343177080154, -0.021585114300251007, -0.05674268677830696, 0.0011210308875888586, 0.03446259722113609, 0.02068573422729969, -0.05666092410683632, 0.009239083155989647, -0.006244556978344917, -0.017548125237226486, 0.026879189535975456, -0.040124598890542984, -0.002470739185810089, 0.023833563551306725, 0.0017527684103697538, -0.02974085323512554, -0.047135673463344574, 0.015258794650435448, -0.021809957921504974, 0.039123017340898514, -0.002652148250490427, -0.053513094782829285, -0.03372674062848091, 0.03697676956653595, -0.03431951254606247, -0.05294076353311539, 0.0032985773868858814, 0.012959244661033154, -0.0372629389166832, 0.019265122711658478, -0.019980538636446, -0.001046934281475842, 0.005401388742029667, -0.03867333009839058, -0.02865750901401043, -0.015340556390583515, 0.01837596297264099, -0.027083594352006912, -0.022157445549964905, 0.029781732708215714, -0.06724907457828522, 0.07342208921909332, 0.013163648545742035, -0.038857292383909225, -0.07305416464805603, -0.09721477329730988, 0.02336343191564083, 0.02967953123152256, 0.033154409378767014, -0.015596061944961548, -0.014318534173071384, 0.005518921185284853, 0.056456517428159714, 0.05976787209510803, 0.02236185036599636, -0.016863370314240456, -0.03311352804303169, -0.0116510558873415, 0.07047867029905319, -0.008927365764975548, 0.00507434131577611, 0.002802896546199918, 0.005370727740228176, 0.0699063315987587, 0.047135673463344574, -0.03188709914684296, 0.0701107382774353, 0.01895851641893387, -0.02303638495504856, 0.025938929989933968, 0.002271444769576192, -0.0454595573246479, 0.0040318784303963184, -0.03738557919859886, 0.013378273695707321, 0.031437408179044724, 0.019980538636446, -0.005861298646777868, -0.01667940616607666, -0.09279963374137878, -0.009739873930811882, 0.0012736954959109426, 0.019203800708055496, 0.05657916143536568, 0.03423774987459183, -0.03530065342783928, -0.018161337822675705, 0.03963403031229973, -0.016853149980306625, 0.041187502443790436, -0.03703809157013893, -0.004678307566791773, 0.037201616913080215, 0.011937221512198448, -0.04370167851448059, -0.02595936879515648, -0.030129220336675644, 0.11953574419021606, -0.03630223497748375, 0.010271325707435608, 0.07190949469804764, 0.014471837319433689, -0.03859156742691994, 0.01566760428249836, -0.051509931683540344, -0.002322545973584056, 0.013572458177804947, 0.0649188682436943, -0.03096728026866913, -0.010935639962553978, -0.0023889774456620216, 0.004547999706119299, 0.07898189127445221, -0.045214273035526276, -0.005406498443335295, 0.031130803748965263, 0.02767636813223362, -0.05240930989384651, 0.03072199411690235, -0.04864826798439026, 0.02367004007101059, -0.0073892222717404366, -0.04693127050995827, 0.058214396238327026, -0.0033828942105174065, 0.02595936879515648, -0.06823021918535233, 0.01729261875152588, -0.03370629996061325, 0.016454560682177544, 0.0446828193962574, -0.020092960447072983, -0.006065702997148037, -0.011640835553407669, 0.026449941098690033, 0.0002055223158095032, -0.04337463155388832, 0.03162137418985367, -0.027942093089222908, -0.01865191012620926, 0.04509162902832031, -0.03444215655326843, 0.04059473052620888, 0.00004008244286524132, 0.003204040229320526, -0.029781732708215714, 0.044887226074934006, -0.03671104460954666, -0.0013350168010219932, -0.008840493857860565, 0.0136746596544981, 0.026102453470230103, -0.10817085206508636, 0.012540215626358986, -0.026490820571780205, -0.09443487226963043, -0.020225822925567627, 0.036240916699171066, 0.013582678511738777, -0.027880771085619926, 0.03536197543144226, -0.07166421413421631, 0.013214750215411186, -0.04509162902832031, 0.009469037875533104, 0.02573452517390251, -0.08895683288574219, 0.01634213887155056, 0.022504933178424835, -0.018406623974442482, -0.038121435791254044, -0.0021449695341289043, -0.09574306011199951, -0.014706903137266636, 0.015769805759191513, 0.043211109936237335, -0.00370994140394032, 0.0027006943710148335, 0.024426335468888283, -0.045541319996118546, -0.022872861474752426, 0.0209923405200243, 0.0032576965168118477, 0.027185795828700066, -0.0034774313680827618, -0.018120458349585533, 0.00009493630204815418, 0.04742183908820152, -0.02800341509282589, 0.037896592170000076, 0.028228258714079857, -0.038530245423316956, 0.004134080838412046, 0.026429500430822372, 0.024181051179766655, 0.030476707965135574, -0.04243437200784683, 0.04231172800064087, 0.04729919880628586, -0.03963403031229973, -0.018866533413529396, 0.03158049285411835, -0.02538703754544258, 0.04975205287337303, 0.035893429070711136, -0.003140163840726018, -0.018927855417132378, 0.007583406288176775, -0.05101935938000679, 0.026082012802362442, -0.026879189535975456, 0.004655312281101942, -0.054575998336076736, 0.010439959354698658, -0.04464193806052208, -0.020563092082738876, 0.05208226293325424, 0.012121185660362244, -0.053349569439888, 0.01736416108906269, 0.025857167318463326, 0.02704271301627159, 0.040860455483198166, 0.004338485188782215, -0.05473951995372772, -0.028534866869449615, -0.045500438660383224, -0.0246511809527874, 0.062138963490724564, -0.045827485620975494, -0.022913742810487747, 0.01414479035884142, -0.05371749773621559, 0.01837596297264099, 0.052572835236787796, 0.014696682803332806, 0.05776470899581909, -0.006709577050060034, 0.026204654946923256, 0.013950605876743793, 0.04312934726476669, 0.040553849190473557, 0.000730107247363776, 0.03501448780298233, -0.04496898502111435, -0.02103322185575962, 0.008891595527529716, 0.03366541862487793, 0.014952188357710838, 0.04004283994436264, 0.05756030231714249, -0.04280230030417442, -0.004231173079460859, 0.00416474137455225, 0.030517589300870895, 0.0007531027658842504, 0.020777715370059013, 0.035525500774383545, 0.006939532235264778, -0.031233005225658417, -0.008544107899069786, -0.03499404713511467, -0.03499404713511467, 0.014359415508806705, 0.042516134679317474, -0.015248574316501617, 0.02671566605567932, 0.02303638495504856, 0.006040152627974749, -0.026940511539578438, -0.046808626502752304, 0.024467216804623604, 0.021523792296648026, 0.01831464283168316, -0.015728924423456192, -0.08846626430749893, 0.02996569685637951, -0.010066920891404152, -0.001886908896267414, -0.01765032671391964, -0.0230159442871809, -0.03900037705898285, 0.038550686091184616, 0.026470381766557693, 0.018283981829881668, 0.022954624146223068, -0.04803505539894104, -0.05494392663240433, -0.02540747821331024, -0.007532305084168911, -0.010123131796717644, -0.0156471636146307, -0.0023455414921045303, -0.007205258123576641, -0.08576811850070953, 0.004238837864249945, 0.07076483219861984, 0.019980538636446, -0.005268525797873735, 0.05343133211135864, -0.026899630203843117, -0.010976521298289299, 0.007271689362823963 ]
39,374
pyspark.sql.dataframe
dropDuplicates
Return a new :class:`DataFrame` with duplicate rows removed, optionally only considering certain columns. For a static batch :class:`DataFrame`, it just drops duplicate rows. For a streaming :class:`DataFrame`, it will keep all data across triggers as intermediate state to drop duplicates rows. You can use :func:`withWatermark` to limit how late the duplicate data can be and the system will accordingly limit the state. In addition, data older than watermark will be dropped to avoid any possibility of duplicates. :func:`drop_duplicates` is an alias for :func:`dropDuplicates`. .. versionadded:: 1.4.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Parameters ---------- subset : List of column names, optional List of columns to use for duplicate comparison (default All columns). Returns ------- :class:`DataFrame` DataFrame without duplicates. Examples -------- >>> from pyspark.sql import Row >>> df = spark.createDataFrame([ ... Row(name='Alice', age=5, height=80), ... Row(name='Alice', age=5, height=80), ... Row(name='Alice', age=10, height=80) ... ]) Deduplicate the same rows. >>> df.dropDuplicates().show() +-----+---+------+ | name|age|height| +-----+---+------+ |Alice| 5| 80| |Alice| 10| 80| +-----+---+------+ Deduplicate values on 'name' and 'height' columns. >>> df.dropDuplicates(['name', 'height']).show() +-----+---+------+ | name|age|height| +-----+---+------+ |Alice| 5| 80| +-----+---+------+
def dropDuplicates(self, subset: Optional[List[str]] = None) -> "DataFrame": """Return a new :class:`DataFrame` with duplicate rows removed, optionally only considering certain columns. For a static batch :class:`DataFrame`, it just drops duplicate rows. For a streaming :class:`DataFrame`, it will keep all data across triggers as intermediate state to drop duplicates rows. You can use :func:`withWatermark` to limit how late the duplicate data can be and the system will accordingly limit the state. In addition, data older than watermark will be dropped to avoid any possibility of duplicates. :func:`drop_duplicates` is an alias for :func:`dropDuplicates`. .. versionadded:: 1.4.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Parameters ---------- subset : List of column names, optional List of columns to use for duplicate comparison (default All columns). Returns ------- :class:`DataFrame` DataFrame without duplicates. Examples -------- >>> from pyspark.sql import Row >>> df = spark.createDataFrame([ ... Row(name='Alice', age=5, height=80), ... Row(name='Alice', age=5, height=80), ... Row(name='Alice', age=10, height=80) ... ]) Deduplicate the same rows. >>> df.dropDuplicates().show() +-----+---+------+ | name|age|height| +-----+---+------+ |Alice| 5| 80| |Alice| 10| 80| +-----+---+------+ Deduplicate values on 'name' and 'height' columns. >>> df.dropDuplicates(['name', 'height']).show() +-----+---+------+ | name|age|height| +-----+---+------+ |Alice| 5| 80| +-----+---+------+ """ if subset is not None and (not isinstance(subset, Iterable) or isinstance(subset, str)): raise PySparkTypeError( error_class="NOT_LIST_OR_TUPLE", message_parameters={"arg_name": "subset", "arg_type": type(subset).__name__}, ) if subset is None: jdf = self._jdf.dropDuplicates() else: jdf = self._jdf.dropDuplicates(self._jseq(subset)) return DataFrame(jdf, self.sparkSession)
(self, subset: Optional[List[str]] = None) -> pyspark.sql.dataframe.DataFrame
[ 0.013424077071249485, -0.015782488510012627, 0.018669184297323227, 0.025319904088974, -0.050149258226156235, -0.04713049158453941, -0.024508610367774963, 0.058526333421468735, 0.021867189556360245, -0.012376942671835423, -0.009933628141880035, 0.011697719804942608, 0.0060139489360153675, 0.02115023322403431, 0.02403692714869976, -0.043017420917749405, 0.021697383373975754, 0.05629999563097954, 0.03796098753809929, 0.013018430210649967, 0.004403153900057077, -0.007697854656726122, 0.008221421390771866, 0.09056299179792404, -0.03796098753809929, 0.03516862913966179, 0.03262154385447502, -0.0028159432113170624, 0.006532799452543259, 0.04275327920913696, 0.014669318683445454, -0.027150031179189682, -0.02805566042661667, 0.037564776837825775, -0.0681486502289772, 0.020338939502835274, -0.005886594764888287, 0.04633806645870209, -0.003207439323887229, -0.0426400750875473, -0.016725853085517883, -0.0080987848341465, 0.020131397992372513, -0.042979687452316284, 0.010650585405528545, 0.025942524895071983, 0.04109295830130577, -0.01604663021862507, -0.034659214317798615, 0.005513965617865324, 0.04943230003118515, 0.07418618351221085, -0.057016950100660324, 0.039055291563272476, -0.058639537543058395, 0.0024150132667273283, -0.012754288502037525, -0.006311108823865652, 0.013216536492109299, 0.005098885390907526, 0.004853610415011644, 0.00299989921040833, -0.0017900342354550958, 0.03507429361343384, 0.03230080008506775, -0.01711263321340084, -0.0195465125143528, -0.034395068883895874, -0.07109194993972778, -0.048639874905347824, -0.04064014181494713, 0.0015695227775722742, -0.0019209260353818536, 0.08475186675786972, -0.03935716673731804, -0.024885956197977066, 0.00042657763697206974, 0.0030730098951607943, -0.041696712374687195, -0.07901620864868164, 0.0539981834590435, -0.023565245792269707, -0.029131095856428146, -0.008905361406505108, 0.03658367693424225, 0.021810587495565414, 0.013810856267809868, 0.05788484588265419, 0.033112093806266785, -0.041696712374687195, 0.010933594778180122, 0.050224728882312775, -0.0398477166891098, 0.013084465637803078, 0.012452411465346813, -0.011509046889841557, -0.041658978909254074, 0.0054998151026666164, 0.004971531219780445, -0.02709342911839485, 0.0005778107442893088, 0.016452277079224586, -0.006386577617377043, 0.04135710000991821, 0.009858159348368645, -0.026470808312296867, 0.013584448955953121, -0.01748054474592209, -0.006245072931051254, 0.010820390656590462, -0.03284795209765434, 0.044564541429281235, 0.010575116612017155, 0.01496176142245531, -0.00849971454590559, -0.02107476256787777, -0.005042283330112696, -0.0020777604077011347, -0.10112867504358292, -0.012537314556539059, -0.014924027025699615, 0.04954550415277481, 0.0017912134062498808, -0.06037532910704613, 0.014593848958611488, -0.005740372929722071, 0.03875341638922691, -0.003813551040366292, -0.01271655410528183, 0.07346922904253006, 0.02245207503437996, -0.0227162167429924, 0.02713116444647312, 0.02831980213522911, 0.023206766694784164, -0.03243287280201912, 0.06090361252427101, 0.07048819959163666, -0.013008996844291687, 0.014358008280396461, 0.0004141959943808615, 0.013093899935483932, 0.03409319370985031, 0.031659312546253204, 0.003412621095776558, -0.05263974145054817, 0.010876992717385292, -0.03694215416908264, -0.00783935934305191, 0.03522523120045662, -0.03973451256752014, -0.0141032999381423, -0.008612917736172676, -0.027621712535619736, -0.03222533315420151, -0.009660053066909313, 0.004252215381711721, -0.01212223432958126, 0.007212021853774786, -0.006513931788504124, 0.05252653732895851, 0.015867391601204872, 0.021848322823643684, 0.013716519810259342, -0.06686567515134811, -0.004021091386675835, 0.010443044826388359, 0.0016921601491048932, -0.07618612051010132, -0.018405042588710785, 0.04411172494292259, 0.061394162476062775, 0.08354435861110687, -0.025753851979970932, -0.085657499730587, 0.11607157438993454, 0.01763148233294487, 0.033281899988651276, 0.00799501407891512, -0.022263402119278908, -0.022244535386562347, -0.05067754164338112, -0.007212021853774786, 0.034508273005485535, 0.05762070417404175, 0.00957043282687664, -0.03158384561538696, -0.05263974145054817, 0.051507703959941864, 0.007773323450237513, -0.006131869275122881, -0.023282235488295555, -0.022904889658093452, 0.03690442070364952, 0.003273474983870983, -0.02273508533835411, 0.019282370805740356, -0.019018229097127914, -0.03105556033551693, 0.01856541447341442, 0.0015223545487970114, 0.02984805405139923, 0.055922649800777435, -0.007197871338576078, -0.016640949994325638, -0.0024197299499064684, -0.020527612417936325, -0.007079950533807278, 0.029093362390995026, -0.03343283757567406, 0.0211313646286726, -0.06116775423288345, 0.06082814559340477, 0.010367576032876968, 0.06916748732328415, -0.047432366758584976, -0.03158384561538696, -0.010763789527118206, 0.06505441665649414, -0.009471380151808262, 0.0008236751309596002, -0.007617668714374304, -0.02973484992980957, 0.04573431238532066, 0.04335703328251839, -0.026565145701169968, 0.036055393517017365, -0.0008036286453716457, 0.011037364602088928, -0.0793180912733078, 0.016971128061413765, -0.06743169575929642, 0.07512955367565155, -0.04218726232647896, -0.06735622882843018, 0.05833766236901283, -0.047432366758584976, -0.0370553582906723, 0.054224591702222824, -0.07294094562530518, -0.06946936249732971, 0.01856541447341442, 0.08195950835943222, 0.030282001942396164, -0.017254136502742767, 0.013282572850584984, -0.017244704067707062, 0.11297733336687088, 0.032074395567178726, -0.008976113051176071, 0.006839392706751823, 0.005160204134881496, 0.02105589583516121, 0.03701762482523918, 0.05056433752179146, 0.041696712374687195, 0.004014016129076481, 0.028546210378408432, -0.01981065422296524, 0.009461945854127407, -0.013046731241047382, -0.03650820627808571, -0.027319837361574173, 0.03356491029262543, -0.011122267693281174, -0.011122267693281174, -0.01139584369957447, 0.01845221035182476, -0.015169301070272923, 0.028565077111124992, 0.03660254180431366, 0.02384825423359871, 0.036111995577812195, -0.03256494179368019, 0.03490448743104935, -0.004707389045506716, -0.03856474161148071, -0.026319870725274086, 0.02837640419602394, -0.054639674723148346, 0.03781004995107651, -0.03701762482523918, 0.028697147965431213, 0.006108285393565893, -0.009914761409163475, 0.02945183962583542, 0.010329841636121273, -0.06818638741970062, -0.02262188121676445, 0.0020989859476685524, -0.023093562573194504, 0.0006662511732429266, 0.031923454254865646, 0.005825276020914316, -0.06988444179296494, 0.05071527510881424, 0.013575015589594841, -0.02550857700407505, -0.05637546256184578, 0.011037364602088928, -0.00951383076608181, 0.007164853624999523, 0.04252687096595764, 0.04648900404572487, -0.01969745196402073, -0.057432033121585846, -0.0363006666302681, -0.0396590456366539, 0.026055727154016495, 0.00023878914362285286, -0.015980595722794533, 0.014291972853243351, -0.040262795984745026, 0.00008387100388063118, -0.05954516679048538, -0.00014297867892310023, 0.024961424991488457, 0.01602776348590851, -0.012980695813894272, 0.04154577478766441, -0.009362893179059029, -0.03130083531141281, -0.04830026254057884, 0.01707489788532257, -0.013292006216943264, 0.027621712535619736, 0.014141034334897995, 0.0015117416623979807, -0.021527579054236412, 0.026546277105808258, -0.003315926296636462, 0.009372326545417309, 0.037489306181669235, -0.008065766654908657, -0.020867222920060158, -0.05894141644239426, 0.030640479177236557, -0.02958391048014164, 0.02958391048014164, 0.016339072957634926, 0.003648462239652872, -0.057092420756816864, 0.061394162476062775, -0.01749941147863865, 0.0105656823143363, 0.033130962401628494, -0.03550824150443077, 0.014924027025699615, 0.018763519823551178, 0.017546579241752625, 0.06475254148244858, 0.04943230003118515, 0.011876959353685379, 0.018744653090834618, 0.09833631664514542, -0.016688117757439613, -0.05682827904820442, 0.061545100063085556, -0.0363006666302681, -0.024584079161286354, 0.05226239562034607, -0.07992184162139893, 0.030489541590213776, -0.012461845763027668, 0.08671406656503677, 0.023357706144452095, -0.030565010383725166, -0.03233853727579117, -0.05513022094964981, -0.0623752623796463, -0.025829320773482323, -0.037413835525512695, 0.005429062992334366, -0.026282135397195816, -0.007466730196028948, 0.020508743822574615, -0.016490012407302856, 0.012424110434949398, 0.010065698996186256, 0.02426333539187908, 0.0021744552068412304, -0.09078940004110336, 0.01977292075753212, -0.030395204201340675, -0.03988545015454292, 0.0026461374945938587, -0.045621108263731, -0.05403592064976692, -0.0065044984221458435, -0.004532866645604372, 0.0035093161277472973, 0.013207103125751019, 0.031772516667842865, 0.01482969056814909, -0.031621579080820084, -0.015310806222259998, -0.07071460783481598, 0.009641185402870178, 0.018603147938847542, -0.0030942356679588556, 0.00784879270941019, -0.045998454093933105, -0.017716385424137115, -0.020621947944164276, 0.051583170890808105, 0.002639062236994505, 0.01677302084863186, -0.05822445824742317, 0.0297914519906044, -0.03688555210828781, 0.07863886654376984, -0.03943263739347458, -0.04260234162211418, 0.0597715750336647, 0.026301002129912376, 0.10226071625947952, 0.0480361208319664, 0.015801355242729187, 0.044640008360147476, 0.051734112203121185, 0.033093228936195374, 0.026187799870967865, -0.031753648072481155, 0.013358041644096375, -0.016631515696644783, -0.026131197810173035, 0.0010247296886518598, 0.01564098335802555, -0.020471010357141495, 0.033225297927856445, -0.026357604190707207, -0.05546983331441879, -0.06792224198579788, 0.024999160319566727, 0.0014067923184484243, 0.043319299817085266, -0.015244770795106888, -0.0037522322963923216, -0.0030187664087861776, 0.055884912610054016, 0.011537347920238972, -0.021640781313180923, -0.007641252595931292, -0.05241333320736885, -0.013075032271444798, -0.007032782305032015, -0.009726088494062424, 0.0028654697816818953, -0.059960249811410904, -0.012244871817529202, 0.09161955863237381, -0.0024527476634830236, 0.01479195524007082, -0.03545163944363594, -0.06705435365438461, -0.029225433245301247, -0.05109262093901634, -0.03431960195302963, -0.04418719559907913, -0.02101816236972809, 0.05335669592022896, 0.02279168739914894, -0.013725954107940197, 0.034583743661642075, -0.031866852194070816, 0.02835753746330738, -0.02424446865916252, -0.03243287280201912, 0.003568276297301054, 0.01826353743672371, 0.027244366705417633, -0.06501667946577072, -0.030753683298826218, -0.02396145835518837, 0.024602945894002914, -0.004721539560705423, -0.04079108312726021, 0.01604663021862507, 0.02396145835518837, 0.04554563760757446, -0.06350729614496231, -0.012593916617333889, 0.007773323450237513, -0.02837640419602394, 0.043055158108472824, -0.02558404579758644, -0.008094067685306072, -0.03430073335766792, -0.006207338534295559, 0.02275395207107067, -0.03988545015454292, -0.040225062519311905, 0.003077726811170578, -0.03577238321304321, -0.005976214073598385, 0.005820558872073889, -0.01602776348590851, 0.09094034135341644, -0.013546714559197426, -0.0026555710937827826, 0.023602981120347977, 0.011707154102623463, -0.018055997788906097, 0.02126343548297882, 0.03264041244983673, -0.0623752623796463, 0.06977123767137527, 0.021584181115031242, -0.09146862477064133, -0.05962063744664192, -0.09637411683797836, 0.03437620401382446, 0.008193121291697025, 0.054337795823812485, 0.021735118702054024, -0.01826353743672371, -0.03214986249804497, 0.041847649961709976, 0.053017087280750275, 0.0030069744680076838, 0.0062214890494942665, 0.032998889684677124, -0.00011268784146523103, 0.06286580860614777, -0.02701796032488346, -0.010584549978375435, 0.05214919149875641, 0.01994272507727146, 0.05788484588265419, 0.0370553582906723, -0.06577137112617493, 0.03558370843529701, -0.005188504699617624, -0.018008828163146973, -0.000600510451477021, -0.018254103139042854, -0.07569556683301926, 0.03118763118982315, 0.03662141039967537, 0.007372393738478422, 0.010810957290232182, 0.06909202039241791, 0.01212223432958126, -0.02679155208170414, -0.07346922904253006, 0.04014959558844566, 0.02533877082169056, 0.05505475401878357, 0.011829790659248829, 0.03939490392804146, -0.0015541930915787816, -0.033357370644807816, 0.04814932495355606, -0.03924396261572838, 0.016763588413596153, -0.024225600063800812, 0.006287524476647377, 0.03781004995107651, 0.01847107708454132, -0.023263368755578995, -0.023527510464191437, -0.05071527510881424, 0.07226172089576721, -0.04414945840835571, -0.004839459899812937, 0.0396590456366539, 0.017678651958703995, -0.00739597762003541, -0.002238132292404771, -0.024716150015592575, 0.0038277015555649996, 0.015207036398351192, 0.01638624258339405, -0.023338837549090385, -0.018093731254339218, 0.00812708493322134, 0.047356899827718735, 0.027395306155085564, -0.07641252875328064, 0.008023315109312534, -0.014688185416162014, 0.05116809159517288, -0.0035093161277472973, 0.014207069762051105, -0.03477241471409798, 0.04252687096595764, -0.0037852502427995205, -0.03281021863222122, -0.012263738550245762, 0.0031767799519002438, 0.047356899827718735, -0.029942389577627182, 0.012263738550245762, -0.044262662529945374, -0.014697618782520294, 0.04399852082133293, -0.010829824954271317, -0.07165797054767609, 0.019282370805740356, 0.025753851979970932, -0.04433813318610191, 0.01761261560022831, -0.020904958248138428, -0.07154476642608643, 0.015357973985373974, -0.002919713268056512, -0.07773323357105255, 0.017140934243798256, 0.015169301070272923, -0.006947879679501057, -0.03571578115224838, 0.05501702055335045, -0.009763822890818119, -0.055809445679187775, 0.011782622896134853, 0.020640816539525986, 0.011018497869372368, -0.09561942517757416, 0.00988646037876606, -0.0675826370716095, -0.060073453933000565, 0.026017993688583374, 0.03664027899503708, -0.0021591256372630596, -0.028716016560792923, 0.024829354137182236, -0.027433039620518684, 0.02120683528482914, -0.0428287498652935, 0.03152724355459213, 0.01550891250371933, -0.070374995470047, 0.030187664553523064, 0.030678214505314827, 0.05279067903757095, -0.051771845668554306, -0.020018195733428, -0.05475287511944771, -0.006584684364497662, 0.02250867709517479, -0.010952462442219257, -0.012301472947001457, 0.04252687096595764, 0.020961560308933258, -0.023791654035449028, -0.04109295830130577, -0.014386309310793877, 0.0014150467468425632, 0.018942760303616524, -0.030168797820806503, 0.01284862495958805, 0.024980291724205017, -0.0068629770539700985, 0.0038843033835291862, 0.048790812492370605, 0.09546849131584167, -0.045621108263731, -0.007910111919045448, 0.02390485629439354, 0.014744787476956844, 0.03980998322367668, -0.01841447502374649, 0.023621847853064537, 0.01207506563514471, 0.023735051974654198, 0.019527645781636238, -0.01990499161183834, -0.02960277907550335, 0.04248913750052452, 0.023546379059553146, -0.05279067903757095, 0.01841447502374649, -0.045621108263731, 0.0035140328109264374, 0.015169301070272923, -0.06958256661891937, -0.03973451256752014, -0.04939456656575203, -0.06248846650123596, -0.02705569379031658, -0.029319768771529198, 0.027734916657209396, -0.022055862471461296, -0.04924362897872925, -0.010518514551222324, 0.01054681558161974, 0.013952361419796944, -0.02516896463930607, 0.002076581120491028, -0.051620908081531525, 0.003910245839506388, -0.0513944998383522, -0.01906539686024189, 0.06841279566287994, 0.003440922126173973, -0.008740272372961044, -0.015150434337556362, -0.0383572019636631, -0.0013690578052774072, 0.016612648963928223, -0.03488561883568764, 0.041809916496276855, 0.01709376461803913, 0.0996192917227745, 0.058715008199214935, 0.037489306181669235, -0.06063947081565857, 0.027527377009391785, 0.07418618351221085, -0.027734916657209396, -0.02130117081105709, 0.00125113723333925, 0.01908426359295845, 0.07878980785608292, 0.002806509379297495, 0.005320576019585133, -0.012235437519848347, -0.005820558872073889, 0.02248981036245823, 0.03088575415313244, -0.008693103678524494, -0.027489641681313515, -0.00916950311511755, 0.02105589583516121, -0.02554631046950817, 0.012971262447535992, 0.031998924911022186, -0.005952630192041397, 0.023470908403396606, -0.008348776027560234, -0.0026909473817795515, 0.03399885818362236, 0.009155352599918842, -0.018669184297323227, 0.057281095534563065, -0.047168225049972534, 0.03477241471409798, -0.00009883217717288062, -0.016801321879029274, -0.03501769155263901, -0.013575015589594841, -0.05535662919282913, -0.006584684364497662, -0.005844143219292164, 0.024357672780752182, -0.01850881241261959, 0.019376708194613457, 0.03669688105583191, 0.008141235448420048, -0.05331896245479584, -0.010754355229437351, -0.034715812653303146, -0.013480679132044315, -0.018829556182026863, -0.001195124932564795, 0.005212089046835899, -0.007009198423475027, 0.007881810888648033, 0.0011738992761820555, -0.061469633132219315, -0.01998046040534973, 0.04788518324494362, 0.040036391466856, 0.019433308392763138, 0.01646171137690544, 0.00995249580591917, 0.05226239562034607, 0.005740372929722071 ]
39,375
pyspark.sql.dataframe
dropDuplicatesWithinWatermark
Return a new :class:`DataFrame` with duplicate rows removed, optionally only considering certain columns, within watermark. This only works with streaming :class:`DataFrame`, and watermark for the input :class:`DataFrame` must be set via :func:`withWatermark`. For a streaming :class:`DataFrame`, this will keep all data across triggers as intermediate state to drop duplicated rows. The state will be kept to guarantee the semantic, "Events are deduplicated as long as the time distance of earliest and latest events are smaller than the delay threshold of watermark." Users are encouraged to set the delay threshold of watermark longer than max timestamp differences among duplicated events. Note: too late data older than watermark will be dropped. .. versionadded:: 3.5.0 Parameters ---------- subset : List of column names, optional List of columns to use for duplicate comparison (default All columns). Returns ------- :class:`DataFrame` DataFrame without duplicates. Notes ----- Supports Spark Connect. Examples -------- >>> from pyspark.sql import Row >>> from pyspark.sql.functions import timestamp_seconds >>> df = spark.readStream.format("rate").load().selectExpr( ... "value % 5 AS value", "timestamp") >>> df.select("value", df.timestamp.alias("time")).withWatermark("time", '10 minutes') DataFrame[value: bigint, time: timestamp] Deduplicate the same rows. >>> df.dropDuplicatesWithinWatermark() # doctest: +SKIP Deduplicate values on 'value' columns. >>> df.dropDuplicatesWithinWatermark(['value']) # doctest: +SKIP
def dropDuplicatesWithinWatermark(self, subset: Optional[List[str]] = None) -> "DataFrame": """Return a new :class:`DataFrame` with duplicate rows removed, optionally only considering certain columns, within watermark. This only works with streaming :class:`DataFrame`, and watermark for the input :class:`DataFrame` must be set via :func:`withWatermark`. For a streaming :class:`DataFrame`, this will keep all data across triggers as intermediate state to drop duplicated rows. The state will be kept to guarantee the semantic, "Events are deduplicated as long as the time distance of earliest and latest events are smaller than the delay threshold of watermark." Users are encouraged to set the delay threshold of watermark longer than max timestamp differences among duplicated events. Note: too late data older than watermark will be dropped. .. versionadded:: 3.5.0 Parameters ---------- subset : List of column names, optional List of columns to use for duplicate comparison (default All columns). Returns ------- :class:`DataFrame` DataFrame without duplicates. Notes ----- Supports Spark Connect. Examples -------- >>> from pyspark.sql import Row >>> from pyspark.sql.functions import timestamp_seconds >>> df = spark.readStream.format("rate").load().selectExpr( ... "value % 5 AS value", "timestamp") >>> df.select("value", df.timestamp.alias("time")).withWatermark("time", '10 minutes') DataFrame[value: bigint, time: timestamp] Deduplicate the same rows. >>> df.dropDuplicatesWithinWatermark() # doctest: +SKIP Deduplicate values on 'value' columns. >>> df.dropDuplicatesWithinWatermark(['value']) # doctest: +SKIP """ if subset is not None and (not isinstance(subset, Iterable) or isinstance(subset, str)): raise PySparkTypeError( error_class="NOT_LIST_OR_TUPLE", message_parameters={"arg_name": "subset", "arg_type": type(subset).__name__}, ) if subset is None: jdf = self._jdf.dropDuplicatesWithinWatermark() else: jdf = self._jdf.dropDuplicatesWithinWatermark(self._jseq(subset)) return DataFrame(jdf, self.sparkSession)
(self, subset: Optional[List[str]] = None) -> pyspark.sql.dataframe.DataFrame
[ 0.01613333821296692, -0.0104829091578722, 0.030950438231229782, 0.04591796547174454, -0.02515898272395134, -0.05449232459068298, -0.01934872381389141, 0.060283780097961426, 0.019057272002100945, 0.009693165309727192, -0.010276071727275848, -0.00225171004422009, 0.01193077303469181, 0.004317736253142357, 0.000777991721406579, -0.02310940995812416, -0.001607692800462246, 0.06487181782722473, 0.035820525139570236, 0.0006622330984100699, -0.010313678532838821, -0.04719659686088562, 0.013378636911511421, 0.09822909533977509, -0.02107863873243332, 0.030705992132425308, 0.014911116100847721, -0.0012821585405617952, -0.006435472052544355, 0.041743602603673935, 0.013181201182305813, -0.04422565549612045, -0.01698889397084713, 0.008564960211515427, -0.05242395028471947, 0.03540685027837753, -0.016753852367401123, 0.04565471410751343, -0.015879493206739426, -0.05107010155916214, -0.022244451567530632, 0.0051474375650286674, 0.013237611390650272, -0.035670097917318344, 0.024952145293354988, 0.029859839007258415, 0.040502578020095825, -0.023617101833224297, -0.01726154424250126, 0.022564109414815903, 0.03666668012738228, 0.07152822613716125, -0.020984621718525887, 0.041743602603673935, -0.07641711831092834, -0.001619444927200675, -0.006397865246981382, 0.0034739328548312187, 0.0013350432273000479, 0.0032059838995337486, -0.007436754647642374, 0.02047692984342575, -0.005373078864067793, 0.052649591118097305, 0.0355948843061924, -0.014563252218067646, -0.05441711097955704, -0.02978462539613247, -0.07032480835914612, -0.009288892149925232, -0.016782056540250778, -0.023729922249913216, 0.003241240279749036, 0.062164124101400375, -0.07844788581132889, -0.024764111265540123, -0.02692650444805622, 0.014553850516676903, -0.053251300007104874, -0.07092651724815369, 0.06442053616046906, -0.006082907784730196, 0.008677780628204346, 0.024914538487792015, 0.07920002937316895, 0.006242737174034119, 0.000698664749506861, 0.06878292560577393, 0.039637621492147446, -0.04546668007969856, 0.01360427774488926, 0.04618121311068535, -0.012786328792572021, -0.005960685666650534, 0.004437608178704977, -0.01794786937534809, -0.03796411678195, 0.02940855734050274, 0.013895731419324875, -0.005890172906219959, 0.013557269237935543, -0.003854702226817608, 0.01399915013462305, 0.038847874850034714, 0.039374370127916336, 0.006590600591152906, 0.01693248376250267, -0.008024361915886402, -0.024011973291635513, 0.007192309945821762, 0.002437393879517913, 0.022827357053756714, -0.011300858110189438, -0.012419662438333035, 0.0019931630231440067, -0.015794876962900162, -0.007671797182410955, 0.002804060699418187, -0.08032823354005814, -0.03574531152844429, 0.03202223405241966, 0.05193505808711052, -0.029258130118250847, -0.04509061202406883, -0.0026395306922495365, -0.036629073321819305, 0.06885813921689987, 0.002705342834815383, 0.02042051963508129, 0.06035899370908737, 0.018568381667137146, 0.009406412951648235, 0.01650000549852848, 0.03736240416765213, 0.006515386514365673, -0.04257095232605934, 0.08025301992893219, 0.06389404088258743, -0.04366155341267586, -0.028449581936001778, 0.009787182323634624, 0.012626499868929386, 0.043887194246053696, 0.02498975209891796, 0.014187184162437916, -0.047008562833070755, 0.017176927998661995, -0.02715214528143406, 0.0318342000246048, 0.03149573504924774, -0.018464963883161545, -0.02316582016646862, -0.027829069644212723, -0.017007697373628616, -0.004602138418704271, -0.04445129632949829, 0.0209658183157444, 0.008071370422840118, 0.028242744505405426, 0.012908550910651684, 0.05580856651067734, 0.027547016739845276, -0.008217096328735352, -0.004806625656783581, -0.07085130363702774, 0.0012269234284758568, 0.018897442147135735, 0.019000861793756485, -0.04753505811095238, -0.019611971452832222, 0.06513506174087524, 0.05938121676445007, 0.07348378747701645, -0.008908122777938843, -0.0931897759437561, 0.10274191200733185, -0.0031284198630601168, 0.03741881623864174, 0.004888890311121941, 0.005311967339366674, -0.02698291465640068, -0.018023082986474037, -0.016058124601840973, 0.05592138692736626, 0.04242052510380745, 0.005791455041617155, -0.01816410757601261, -0.037550438195466995, 0.012222225777804852, -0.003598505398258567, 0.003922864329069853, -0.021379495039582253, -0.02730257250368595, 0.014196585863828659, -0.024331631138920784, 0.003450428368523717, 0.00724401930347085, -0.037005141377449036, -0.05998292565345764, 0.04121710732579231, -0.029051290825009346, 0.03510599583387375, 0.04354873299598694, -0.025083769112825394, -0.0007345087942667305, -0.010238464921712875, -0.002554915379732847, 0.01946154423058033, -0.03111966885626316, -0.02391795627772808, 0.019856417551636696, -0.0660376250743866, 0.03202223405241966, 0.019235903397202492, 0.05434189736843109, -0.03574531152844429, -0.0461059994995594, 0.004294231999665499, 0.0646461769938469, 0.010811969637870789, -0.010614532977342606, 0.009843592531979084, -0.045880358666181564, 0.041254714131355286, 0.08724789321422577, -0.008400429971516132, 0.060509420931339264, -0.009213678538799286, 0.023128213360905647, -0.0915350690484047, 0.03305641934275627, -0.02429402433335781, 0.0447145439684391, -0.06017095968127251, -0.06915899366140366, 0.029822232201695442, -0.03499317541718483, -0.06208891049027443, 0.046745315194129944, -0.08047866076231003, -0.023353854194283485, -0.0017205133335664868, 0.07423592358827591, 0.027941890060901642, -0.009519234299659729, -0.0199880413711071, -0.029634198173880577, 0.1195145696401596, 0.03834018483757973, 0.027058128267526627, 0.016594022512435913, 0.007446156349033117, 0.019611971452832222, 0.039637621492147446, 0.057651299983263016, 0.01806068979203701, 0.012476072646677494, 0.0020777785684913397, -0.031533341854810715, -0.0001662927825236693, -0.032661549746990204, -0.04204445704817772, -0.04877608269453049, 0.029897445812821388, 0.0026700864546000957, -0.007558976765722036, -0.015296585857868195, 0.016274364665150642, -0.029389753937721252, 0.01461966335773468, -0.03952480107545853, 0.030141890048980713, 0.031157275661826134, -0.021699152886867523, 0.0259111188352108, -0.04084103927016258, -0.023993169888854027, -0.006694019306451082, 0.0353880450129509, -0.03514360263943672, 0.04091625288128853, -0.014826500788331032, 0.011705132201313972, 0.0221504345536232, -0.006289745680987835, -0.0014854705659672618, 0.0052414545789361, -0.05219830945134163, -0.017487185075879097, -0.029164111241698265, -0.052386343479156494, 0.001594765461049974, 0.04606839269399643, 0.006675215903669596, -0.08837609738111496, 0.06069745495915413, 0.029389753937721252, -0.053627368062734604, -0.029540181159973145, -0.0032670951914042234, 0.011714533902704716, 0.010247866623103619, 0.01505214162170887, 0.048362407833337784, -0.026418812572956085, -0.02764103375375271, -0.064495749771595, -0.02478291466832161, 0.03189060837030411, 0.009439319372177124, -0.008621370419859886, -0.012297440320253372, -0.03433505445718765, -0.02923932671546936, -0.0279983002692461, -0.022169237956404686, 0.036685481667518616, 0.03264274448156357, -0.028788043186068535, 0.06411968171596527, 0.016650432720780373, -0.032811976969242096, -0.020345306023955345, 0.006971369963139296, -0.019856417551636696, -0.0066141048446297646, 0.02950257435441017, -0.001154647790826857, -0.018427357077598572, 0.00023563041759189218, -0.017233338207006454, 0.01561624463647604, 0.04031454399228096, 0.006929062306880951, -0.04114189371466637, -0.012410260736942291, 0.028694026172161102, -0.027189752086997032, 0.02542223036289215, 0.020288895815610886, -0.018747014924883842, -0.03741881623864174, 0.02984103560447693, 0.015146158635616302, 0.022864963859319687, 0.031213685870170593, -0.019611971452832222, -0.008287609554827213, 0.0419316366314888, 0.015898296609520912, 0.09439319372177124, 0.06299147009849548, 0.013068380765616894, 0.02918291464447975, 0.12019149214029312, -0.006938464008271694, -0.04031454399228096, 0.06987352669239044, -0.05821540206670761, 0.0005787929403595626, 0.0470837764441967, -0.05735044553875923, 0.019047869369387627, -0.029540181159973145, 0.07179147750139236, 0.0369863361120224, -0.0202700924128294, 0.005650429055094719, -0.05798976123332977, -0.05659830942749977, -0.019593168050050735, -0.05768890678882599, 0.015832483768463135, -0.022394878789782524, -0.013237611390650272, -0.01210000365972519, -0.0504307858645916, 0.008677780628204346, -0.00704188272356987, 0.06336754560470581, 0.004143804777413607, -0.0597572848200798, 0.015475219115614891, -0.02423761412501335, -0.017712825909256935, 0.034805141389369965, -0.05170941725373268, -0.06663934141397476, 0.0044023520313203335, -0.010840174742043018, 0.002646581968292594, 0.025083769112825394, 0.04008890315890312, -0.0036831209436059, -0.015465817414224148, -0.0004289531207177788, -0.07784617692232132, 0.019555561244487762, 0.031138472259044647, 0.007323934230953455, 0.017458980903029442, -0.03279317170381546, -0.06054702773690224, -0.003847650717943907, 0.06332993507385254, -0.014582055620849133, 0.022770946845412254, -0.06483420729637146, 0.03510599583387375, -0.02273334003984928, 0.045880358666181564, -0.0504307858645916, -0.02843077853322029, 0.0650598481297493, 0.02177436649799347, 0.06498463451862335, 0.030442744493484497, -0.009044446982443333, 0.00062991474987939, 0.0025008555967360735, 0.014826500788331032, 0.02703932486474514, -0.027866676449775696, -0.0075824810191988945, -0.02542223036289215, -0.048512835055589676, -0.019687185063958168, -0.006524788681417704, -0.014262397773563862, 0.048512835055589676, -0.0365726612508297, -0.09687524288892746, -0.06536070257425308, 0.046256426721811295, 0.00291688134893775, 0.04697095602750778, -0.016424791887402534, 0.0017440177034586668, -0.008908122777938843, 0.031270094215869904, 0.029822232201695442, 0.00782692525535822, 0.04144274815917015, -0.05686155706644058, -0.020495733246207237, -0.00023401450016535819, -0.03328206390142441, 0.0532136932015419, -0.061411984264850616, -0.005025215446949005, 0.12079320102930069, 0.005161540117114782, 0.020984621718525887, -0.01907607540488243, -0.0663008764386177, -0.033037617802619934, -0.0490393340587616, -0.022188041359186172, -0.039637621492147446, -0.03155214712023735, 0.0183897502720356, 0.018417954444885254, -0.03273676335811615, 0.01308718416839838, 0.002384509425610304, 0.049753863364458084, -0.037813685834407806, -0.04554189369082451, 0.008442738093435764, 0.010370088741183281, 0.03548206388950348, -0.06791797280311584, -0.054379504173994064, -0.023560691624879837, 0.05336412042379379, 0.006961968261748552, -0.03960001468658447, 0.027133341878652573, 0.05065642669796944, 0.05343933403491974, -0.05091967433691025, -0.014347013086080551, 0.0024068383499979973, -0.042871810495853424, 0.029164111241698265, -0.039487190544605255, -0.01918889582157135, -0.027829069644212723, -0.011629918590188026, 0.04433847591280937, -0.03822736442089081, -0.015682056546211243, 0.01865299791097641, -0.007869233377277851, -0.04606839269399643, -0.006054702680557966, 0.00020786598906852305, 0.09537097066640854, 0.041856423020362854, -0.013839321210980415, 0.016311971470713615, 0.02628718875348568, -0.034805141389369965, 0.010266670025885105, 0.04008890315890312, -0.04554189369082451, 0.03683590888977051, 0.033883772790431976, -0.07325814664363861, -0.0367795005440712, -0.0686701089143753, 0.03664787486195564, -0.01623675785958767, 0.06859489530324936, 0.0027899581473320723, -0.011761542409658432, -0.02075898088514805, 0.06321711838245392, 0.04546668007969856, -0.004355343524366617, -0.0019073723815381527, 0.0575384795665741, 0.025384623557329178, 0.02914530783891678, -0.01308718416839838, -0.011893166229128838, 0.04742223769426346, -0.006176925264298916, 0.04343591257929802, 0.03820855915546417, -0.08378805965185165, 0.016706842929124832, -0.0012739320518448949, -0.031364113092422485, 0.0026512828189879656, -0.04354873299598694, -0.07134019583463669, 0.002313996432349086, 0.02779146283864975, -0.020288895815610886, -0.0021459409035742283, 0.03444787487387657, 0.03944958373904228, -0.04321027174592018, -0.03160855919122696, 0.07028720527887344, 0.016575219109654427, 0.06314189732074738, 0.008973934687674046, 0.039637621492147446, 0.015870090574026108, -0.05783933401107788, 0.06009574607014656, -0.01800427958369255, -0.006435472052544355, -0.012306842021644115, -0.00962735339999199, 0.05231112986803055, -0.005500001832842827, 0.00009423747542314231, -0.029634198173880577, -0.03709915652871132, 0.09303934872150421, -0.00624743802472949, -0.025459837168455124, 0.016368381679058075, 0.0010347759816795588, 0.0008308763499371707, 0.0051850443705916405, -0.015766670927405357, 0.01634957827627659, 0.015512825921177864, 0.02574188821017742, -0.0597572848200798, -0.032717958092689514, -0.002507906872779131, 0.018051287159323692, 0.009199575521051884, -0.060133352875709534, -0.01252308115363121, -0.02154872566461563, 0.026136761531233788, 0.04967864975333214, 0.001001282362267375, -0.02269573323428631, 0.03629060834646225, 0.008809404447674751, -0.022827357053756714, -0.03753163665533066, 0.03649744763970375, 0.038453005254268646, 0.011282054707407951, 0.007526070810854435, -0.010774362832307816, 0.009552139788866043, 0.00822179764509201, 0.03597095236182213, -0.05046839267015457, 0.018211117014288902, 0.004009830299764872, -0.0456923209130764, 0.030141890048980713, -0.04971625655889511, -0.0559966005384922, -0.004383548628538847, -0.02004445157945156, -0.06618805229663849, 0.018634194508194923, 0.006167523562908173, -0.013952141627669334, -0.028882060199975967, 0.07739489525556564, -0.004705557134002447, -0.06257779896259308, 0.02908889763057232, 0.02036410942673683, -0.00548119843006134, -0.0830359235405922, 0.017618808895349503, -0.06498463451862335, -0.043623946607112885, 0.04682052880525589, 0.020721374079585075, -0.009533336386084557, -0.025309409946203232, 0.009900003671646118, 0.0049453009851276875, 0.005636326503008604, -0.03692992776632309, 0.03258633613586426, 0.006059403531253338, -0.05396582931280136, 0.03268035128712654, -0.004188463091850281, 0.03869744762778282, -0.016641031950712204, -0.02628718875348568, -0.06043420732021332, -0.020834194496273994, 0.02188718691468239, -0.017223937436938286, -0.019555561244487762, 0.05343933403491974, -0.027170948684215546, 0.0020730774849653244, -0.026211975142359734, 0.0017263893969357014, 0.013049577362835407, -0.009928208775818348, -0.025779495015740395, 0.010492310859262943, 0.027340179309248924, 0.011507696472108364, 0.01411197055131197, 0.03446667641401291, 0.10409575700759888, -0.049528222531080246, 0.010708550922572613, 0.03627180680632591, 0.0040991464629769325, 0.05046839267015457, -0.023297443985939026, -0.004458762239664793, 0.026964111253619194, 0.03457949683070183, -0.00806666910648346, -0.035444457083940506, -0.012739320285618305, 0.0310632586479187, 0.03315043821930885, -0.04640685394406319, -0.008372224867343903, -0.049866683781147, -0.026362402364611626, 0.02299658954143524, -0.08070430159568787, -0.04659488797187805, -0.034598302096128464, -0.06220173090696335, -0.013105987571179867, -0.02128547616302967, 0.011940174736082554, -0.022244451567530632, -0.02579829841852188, -0.012570089660584927, 0.0214547086507082, -0.02192479372024536, -0.021755563095211983, 0.014685475267469883, -0.02961539477109909, 0.03348889946937561, -0.056899163872003555, -0.0033705139067023993, 0.05445471778512001, -0.011225644499063492, -0.02258291281759739, -0.014252996072173119, -0.0013538466300815344, -0.009613251313567162, -0.021755563095211983, -0.052273523062467575, 0.06054702773690224, 0.007088891230523586, 0.0771692544221878, 0.03031112067401409, 0.030292317271232605, -0.08032823354005814, 0.010182054713368416, 0.05242395028471947, -0.04008890315890312, -0.03730599582195282, 0.003123719012364745, -0.00865897722542286, 0.06562395393848419, -0.025140179321169853, -0.009871797636151314, -0.027340179309248924, -0.012438465841114521, 0.03617778792977333, 0.023335050791502, 0.008212395943701267, -0.010896584950387478, -0.03021710366010666, 0.033789753913879395, -0.03425984084606171, 0.008113677613437176, 0.0023010692093521357, -0.005420087371021509, -0.007055985275655985, -0.023447871208190918, 0.02515898272395134, 0.057162411510944366, 0.01726154424250126, -0.007624788675457239, 0.06445813924074173, -0.013848722912371159, 0.003678420092910528, 0.0018873937660828233, -0.015089748427271843, -0.0365726612508297, 0.0030203000642359257, -0.05392822250723839, -0.040878646075725555, -0.01590769737958908, 0.030837617814540863, -0.005532907787710428, 0.03288719058036804, 0.036309413611888885, 0.0132000045850873, -0.03226667642593384, -0.02623077854514122, -0.014873509295284748, -0.033902574330568314, -0.04065300524234772, 0.0074555580504238605, 0.013068380765616894, 0.00016776181291788816, 0.007742310408502817, -0.027020521461963654, -0.025234196335077286, -0.020194878801703453, 0.00962735339999199, 0.04242052510380745, 0.021116245537996292, 0.0355948843061924, 0.02553505077958107, 0.028468385338783264, 0.027753856033086777 ]
39,376
pyspark.sql.dataframe
dropDuplicates
:func:`drop_duplicates` is an alias for :func:`dropDuplicates`. .. versionadded:: 1.4
def dropDuplicates(self, subset: Optional[List[str]] = None) -> "DataFrame": """Return a new :class:`DataFrame` with duplicate rows removed, optionally only considering certain columns. For a static batch :class:`DataFrame`, it just drops duplicate rows. For a streaming :class:`DataFrame`, it will keep all data across triggers as intermediate state to drop duplicates rows. You can use :func:`withWatermark` to limit how late the duplicate data can be and the system will accordingly limit the state. In addition, data older than watermark will be dropped to avoid any possibility of duplicates. :func:`drop_duplicates` is an alias for :func:`dropDuplicates`. .. versionadded:: 1.4.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Parameters ---------- subset : List of column names, optional List of columns to use for duplicate comparison (default All columns). Returns ------- :class:`DataFrame` DataFrame without duplicates. Examples -------- >>> from pyspark.sql import Row >>> df = spark.createDataFrame([ ... Row(name='Alice', age=5, height=80), ... Row(name='Alice', age=5, height=80), ... Row(name='Alice', age=10, height=80) ... ]) Deduplicate the same rows. >>> df.dropDuplicates().show() +-----+---+------+ | name|age|height| +-----+---+------+ |Alice| 5| 80| |Alice| 10| 80| +-----+---+------+ Deduplicate values on 'name' and 'height' columns. >>> df.dropDuplicates(['name', 'height']).show() +-----+---+------+ | name|age|height| +-----+---+------+ |Alice| 5| 80| +-----+---+------+ """ if subset is not None and (not isinstance(subset, Iterable) or isinstance(subset, str)): raise PySparkTypeError( error_class="NOT_LIST_OR_TUPLE", message_parameters={"arg_name": "subset", "arg_type": type(subset).__name__}, ) if subset is None: jdf = self._jdf.dropDuplicates() else: jdf = self._jdf.dropDuplicates(self._jseq(subset)) return DataFrame(jdf, self.sparkSession)
(self, subset=None)
[ 0.013424077071249485, -0.015782488510012627, 0.018669184297323227, 0.025319904088974, -0.050149258226156235, -0.04713049158453941, -0.024508610367774963, 0.058526333421468735, 0.021867189556360245, -0.012376942671835423, -0.009933628141880035, 0.011697719804942608, 0.0060139489360153675, 0.02115023322403431, 0.02403692714869976, -0.043017420917749405, 0.021697383373975754, 0.05629999563097954, 0.03796098753809929, 0.013018430210649967, 0.004403153900057077, -0.007697854656726122, 0.008221421390771866, 0.09056299179792404, -0.03796098753809929, 0.03516862913966179, 0.03262154385447502, -0.0028159432113170624, 0.006532799452543259, 0.04275327920913696, 0.014669318683445454, -0.027150031179189682, -0.02805566042661667, 0.037564776837825775, -0.0681486502289772, 0.020338939502835274, -0.005886594764888287, 0.04633806645870209, -0.003207439323887229, -0.0426400750875473, -0.016725853085517883, -0.0080987848341465, 0.020131397992372513, -0.042979687452316284, 0.010650585405528545, 0.025942524895071983, 0.04109295830130577, -0.01604663021862507, -0.034659214317798615, 0.005513965617865324, 0.04943230003118515, 0.07418618351221085, -0.057016950100660324, 0.039055291563272476, -0.058639537543058395, 0.0024150132667273283, -0.012754288502037525, -0.006311108823865652, 0.013216536492109299, 0.005098885390907526, 0.004853610415011644, 0.00299989921040833, -0.0017900342354550958, 0.03507429361343384, 0.03230080008506775, -0.01711263321340084, -0.0195465125143528, -0.034395068883895874, -0.07109194993972778, -0.048639874905347824, -0.04064014181494713, 0.0015695227775722742, -0.0019209260353818536, 0.08475186675786972, -0.03935716673731804, -0.024885956197977066, 0.00042657763697206974, 0.0030730098951607943, -0.041696712374687195, -0.07901620864868164, 0.0539981834590435, -0.023565245792269707, -0.029131095856428146, -0.008905361406505108, 0.03658367693424225, 0.021810587495565414, 0.013810856267809868, 0.05788484588265419, 0.033112093806266785, -0.041696712374687195, 0.010933594778180122, 0.050224728882312775, -0.0398477166891098, 0.013084465637803078, 0.012452411465346813, -0.011509046889841557, -0.041658978909254074, 0.0054998151026666164, 0.004971531219780445, -0.02709342911839485, 0.0005778107442893088, 0.016452277079224586, -0.006386577617377043, 0.04135710000991821, 0.009858159348368645, -0.026470808312296867, 0.013584448955953121, -0.01748054474592209, -0.006245072931051254, 0.010820390656590462, -0.03284795209765434, 0.044564541429281235, 0.010575116612017155, 0.01496176142245531, -0.00849971454590559, -0.02107476256787777, -0.005042283330112696, -0.0020777604077011347, -0.10112867504358292, -0.012537314556539059, -0.014924027025699615, 0.04954550415277481, 0.0017912134062498808, -0.06037532910704613, 0.014593848958611488, -0.005740372929722071, 0.03875341638922691, -0.003813551040366292, -0.01271655410528183, 0.07346922904253006, 0.02245207503437996, -0.0227162167429924, 0.02713116444647312, 0.02831980213522911, 0.023206766694784164, -0.03243287280201912, 0.06090361252427101, 0.07048819959163666, -0.013008996844291687, 0.014358008280396461, 0.0004141959943808615, 0.013093899935483932, 0.03409319370985031, 0.031659312546253204, 0.003412621095776558, -0.05263974145054817, 0.010876992717385292, -0.03694215416908264, -0.00783935934305191, 0.03522523120045662, -0.03973451256752014, -0.0141032999381423, -0.008612917736172676, -0.027621712535619736, -0.03222533315420151, -0.009660053066909313, 0.004252215381711721, -0.01212223432958126, 0.007212021853774786, -0.006513931788504124, 0.05252653732895851, 0.015867391601204872, 0.021848322823643684, 0.013716519810259342, -0.06686567515134811, -0.004021091386675835, 0.010443044826388359, 0.0016921601491048932, -0.07618612051010132, -0.018405042588710785, 0.04411172494292259, 0.061394162476062775, 0.08354435861110687, -0.025753851979970932, -0.085657499730587, 0.11607157438993454, 0.01763148233294487, 0.033281899988651276, 0.00799501407891512, -0.022263402119278908, -0.022244535386562347, -0.05067754164338112, -0.007212021853774786, 0.034508273005485535, 0.05762070417404175, 0.00957043282687664, -0.03158384561538696, -0.05263974145054817, 0.051507703959941864, 0.007773323450237513, -0.006131869275122881, -0.023282235488295555, -0.022904889658093452, 0.03690442070364952, 0.003273474983870983, -0.02273508533835411, 0.019282370805740356, -0.019018229097127914, -0.03105556033551693, 0.01856541447341442, 0.0015223545487970114, 0.02984805405139923, 0.055922649800777435, -0.007197871338576078, -0.016640949994325638, -0.0024197299499064684, -0.020527612417936325, -0.007079950533807278, 0.029093362390995026, -0.03343283757567406, 0.0211313646286726, -0.06116775423288345, 0.06082814559340477, 0.010367576032876968, 0.06916748732328415, -0.047432366758584976, -0.03158384561538696, -0.010763789527118206, 0.06505441665649414, -0.009471380151808262, 0.0008236751309596002, -0.007617668714374304, -0.02973484992980957, 0.04573431238532066, 0.04335703328251839, -0.026565145701169968, 0.036055393517017365, -0.0008036286453716457, 0.011037364602088928, -0.0793180912733078, 0.016971128061413765, -0.06743169575929642, 0.07512955367565155, -0.04218726232647896, -0.06735622882843018, 0.05833766236901283, -0.047432366758584976, -0.0370553582906723, 0.054224591702222824, -0.07294094562530518, -0.06946936249732971, 0.01856541447341442, 0.08195950835943222, 0.030282001942396164, -0.017254136502742767, 0.013282572850584984, -0.017244704067707062, 0.11297733336687088, 0.032074395567178726, -0.008976113051176071, 0.006839392706751823, 0.005160204134881496, 0.02105589583516121, 0.03701762482523918, 0.05056433752179146, 0.041696712374687195, 0.004014016129076481, 0.028546210378408432, -0.01981065422296524, 0.009461945854127407, -0.013046731241047382, -0.03650820627808571, -0.027319837361574173, 0.03356491029262543, -0.011122267693281174, -0.011122267693281174, -0.01139584369957447, 0.01845221035182476, -0.015169301070272923, 0.028565077111124992, 0.03660254180431366, 0.02384825423359871, 0.036111995577812195, -0.03256494179368019, 0.03490448743104935, -0.004707389045506716, -0.03856474161148071, -0.026319870725274086, 0.02837640419602394, -0.054639674723148346, 0.03781004995107651, -0.03701762482523918, 0.028697147965431213, 0.006108285393565893, -0.009914761409163475, 0.02945183962583542, 0.010329841636121273, -0.06818638741970062, -0.02262188121676445, 0.0020989859476685524, -0.023093562573194504, 0.0006662511732429266, 0.031923454254865646, 0.005825276020914316, -0.06988444179296494, 0.05071527510881424, 0.013575015589594841, -0.02550857700407505, -0.05637546256184578, 0.011037364602088928, -0.00951383076608181, 0.007164853624999523, 0.04252687096595764, 0.04648900404572487, -0.01969745196402073, -0.057432033121585846, -0.0363006666302681, -0.0396590456366539, 0.026055727154016495, 0.00023878914362285286, -0.015980595722794533, 0.014291972853243351, -0.040262795984745026, 0.00008387100388063118, -0.05954516679048538, -0.00014297867892310023, 0.024961424991488457, 0.01602776348590851, -0.012980695813894272, 0.04154577478766441, -0.009362893179059029, -0.03130083531141281, -0.04830026254057884, 0.01707489788532257, -0.013292006216943264, 0.027621712535619736, 0.014141034334897995, 0.0015117416623979807, -0.021527579054236412, 0.026546277105808258, -0.003315926296636462, 0.009372326545417309, 0.037489306181669235, -0.008065766654908657, -0.020867222920060158, -0.05894141644239426, 0.030640479177236557, -0.02958391048014164, 0.02958391048014164, 0.016339072957634926, 0.003648462239652872, -0.057092420756816864, 0.061394162476062775, -0.01749941147863865, 0.0105656823143363, 0.033130962401628494, -0.03550824150443077, 0.014924027025699615, 0.018763519823551178, 0.017546579241752625, 0.06475254148244858, 0.04943230003118515, 0.011876959353685379, 0.018744653090834618, 0.09833631664514542, -0.016688117757439613, -0.05682827904820442, 0.061545100063085556, -0.0363006666302681, -0.024584079161286354, 0.05226239562034607, -0.07992184162139893, 0.030489541590213776, -0.012461845763027668, 0.08671406656503677, 0.023357706144452095, -0.030565010383725166, -0.03233853727579117, -0.05513022094964981, -0.0623752623796463, -0.025829320773482323, -0.037413835525512695, 0.005429062992334366, -0.026282135397195816, -0.007466730196028948, 0.020508743822574615, -0.016490012407302856, 0.012424110434949398, 0.010065698996186256, 0.02426333539187908, 0.0021744552068412304, -0.09078940004110336, 0.01977292075753212, -0.030395204201340675, -0.03988545015454292, 0.0026461374945938587, -0.045621108263731, -0.05403592064976692, -0.0065044984221458435, -0.004532866645604372, 0.0035093161277472973, 0.013207103125751019, 0.031772516667842865, 0.01482969056814909, -0.031621579080820084, -0.015310806222259998, -0.07071460783481598, 0.009641185402870178, 0.018603147938847542, -0.0030942356679588556, 0.00784879270941019, -0.045998454093933105, -0.017716385424137115, -0.020621947944164276, 0.051583170890808105, 0.002639062236994505, 0.01677302084863186, -0.05822445824742317, 0.0297914519906044, -0.03688555210828781, 0.07863886654376984, -0.03943263739347458, -0.04260234162211418, 0.0597715750336647, 0.026301002129912376, 0.10226071625947952, 0.0480361208319664, 0.015801355242729187, 0.044640008360147476, 0.051734112203121185, 0.033093228936195374, 0.026187799870967865, -0.031753648072481155, 0.013358041644096375, -0.016631515696644783, -0.026131197810173035, 0.0010247296886518598, 0.01564098335802555, -0.020471010357141495, 0.033225297927856445, -0.026357604190707207, -0.05546983331441879, -0.06792224198579788, 0.024999160319566727, 0.0014067923184484243, 0.043319299817085266, -0.015244770795106888, -0.0037522322963923216, -0.0030187664087861776, 0.055884912610054016, 0.011537347920238972, -0.021640781313180923, -0.007641252595931292, -0.05241333320736885, -0.013075032271444798, -0.007032782305032015, -0.009726088494062424, 0.0028654697816818953, -0.059960249811410904, -0.012244871817529202, 0.09161955863237381, -0.0024527476634830236, 0.01479195524007082, -0.03545163944363594, -0.06705435365438461, -0.029225433245301247, -0.05109262093901634, -0.03431960195302963, -0.04418719559907913, -0.02101816236972809, 0.05335669592022896, 0.02279168739914894, -0.013725954107940197, 0.034583743661642075, -0.031866852194070816, 0.02835753746330738, -0.02424446865916252, -0.03243287280201912, 0.003568276297301054, 0.01826353743672371, 0.027244366705417633, -0.06501667946577072, -0.030753683298826218, -0.02396145835518837, 0.024602945894002914, -0.004721539560705423, -0.04079108312726021, 0.01604663021862507, 0.02396145835518837, 0.04554563760757446, -0.06350729614496231, -0.012593916617333889, 0.007773323450237513, -0.02837640419602394, 0.043055158108472824, -0.02558404579758644, -0.008094067685306072, -0.03430073335766792, -0.006207338534295559, 0.02275395207107067, -0.03988545015454292, -0.040225062519311905, 0.003077726811170578, -0.03577238321304321, -0.005976214073598385, 0.005820558872073889, -0.01602776348590851, 0.09094034135341644, -0.013546714559197426, -0.0026555710937827826, 0.023602981120347977, 0.011707154102623463, -0.018055997788906097, 0.02126343548297882, 0.03264041244983673, -0.0623752623796463, 0.06977123767137527, 0.021584181115031242, -0.09146862477064133, -0.05962063744664192, -0.09637411683797836, 0.03437620401382446, 0.008193121291697025, 0.054337795823812485, 0.021735118702054024, -0.01826353743672371, -0.03214986249804497, 0.041847649961709976, 0.053017087280750275, 0.0030069744680076838, 0.0062214890494942665, 0.032998889684677124, -0.00011268784146523103, 0.06286580860614777, -0.02701796032488346, -0.010584549978375435, 0.05214919149875641, 0.01994272507727146, 0.05788484588265419, 0.0370553582906723, -0.06577137112617493, 0.03558370843529701, -0.005188504699617624, -0.018008828163146973, -0.000600510451477021, -0.018254103139042854, -0.07569556683301926, 0.03118763118982315, 0.03662141039967537, 0.007372393738478422, 0.010810957290232182, 0.06909202039241791, 0.01212223432958126, -0.02679155208170414, -0.07346922904253006, 0.04014959558844566, 0.02533877082169056, 0.05505475401878357, 0.011829790659248829, 0.03939490392804146, -0.0015541930915787816, -0.033357370644807816, 0.04814932495355606, -0.03924396261572838, 0.016763588413596153, -0.024225600063800812, 0.006287524476647377, 0.03781004995107651, 0.01847107708454132, -0.023263368755578995, -0.023527510464191437, -0.05071527510881424, 0.07226172089576721, -0.04414945840835571, -0.004839459899812937, 0.0396590456366539, 0.017678651958703995, -0.00739597762003541, -0.002238132292404771, -0.024716150015592575, 0.0038277015555649996, 0.015207036398351192, 0.01638624258339405, -0.023338837549090385, -0.018093731254339218, 0.00812708493322134, 0.047356899827718735, 0.027395306155085564, -0.07641252875328064, 0.008023315109312534, -0.014688185416162014, 0.05116809159517288, -0.0035093161277472973, 0.014207069762051105, -0.03477241471409798, 0.04252687096595764, -0.0037852502427995205, -0.03281021863222122, -0.012263738550245762, 0.0031767799519002438, 0.047356899827718735, -0.029942389577627182, 0.012263738550245762, -0.044262662529945374, -0.014697618782520294, 0.04399852082133293, -0.010829824954271317, -0.07165797054767609, 0.019282370805740356, 0.025753851979970932, -0.04433813318610191, 0.01761261560022831, -0.020904958248138428, -0.07154476642608643, 0.015357973985373974, -0.002919713268056512, -0.07773323357105255, 0.017140934243798256, 0.015169301070272923, -0.006947879679501057, -0.03571578115224838, 0.05501702055335045, -0.009763822890818119, -0.055809445679187775, 0.011782622896134853, 0.020640816539525986, 0.011018497869372368, -0.09561942517757416, 0.00988646037876606, -0.0675826370716095, -0.060073453933000565, 0.026017993688583374, 0.03664027899503708, -0.0021591256372630596, -0.028716016560792923, 0.024829354137182236, -0.027433039620518684, 0.02120683528482914, -0.0428287498652935, 0.03152724355459213, 0.01550891250371933, -0.070374995470047, 0.030187664553523064, 0.030678214505314827, 0.05279067903757095, -0.051771845668554306, -0.020018195733428, -0.05475287511944771, -0.006584684364497662, 0.02250867709517479, -0.010952462442219257, -0.012301472947001457, 0.04252687096595764, 0.020961560308933258, -0.023791654035449028, -0.04109295830130577, -0.014386309310793877, 0.0014150467468425632, 0.018942760303616524, -0.030168797820806503, 0.01284862495958805, 0.024980291724205017, -0.0068629770539700985, 0.0038843033835291862, 0.048790812492370605, 0.09546849131584167, -0.045621108263731, -0.007910111919045448, 0.02390485629439354, 0.014744787476956844, 0.03980998322367668, -0.01841447502374649, 0.023621847853064537, 0.01207506563514471, 0.023735051974654198, 0.019527645781636238, -0.01990499161183834, -0.02960277907550335, 0.04248913750052452, 0.023546379059553146, -0.05279067903757095, 0.01841447502374649, -0.045621108263731, 0.0035140328109264374, 0.015169301070272923, -0.06958256661891937, -0.03973451256752014, -0.04939456656575203, -0.06248846650123596, -0.02705569379031658, -0.029319768771529198, 0.027734916657209396, -0.022055862471461296, -0.04924362897872925, -0.010518514551222324, 0.01054681558161974, 0.013952361419796944, -0.02516896463930607, 0.002076581120491028, -0.051620908081531525, 0.003910245839506388, -0.0513944998383522, -0.01906539686024189, 0.06841279566287994, 0.003440922126173973, -0.008740272372961044, -0.015150434337556362, -0.0383572019636631, -0.0013690578052774072, 0.016612648963928223, -0.03488561883568764, 0.041809916496276855, 0.01709376461803913, 0.0996192917227745, 0.058715008199214935, 0.037489306181669235, -0.06063947081565857, 0.027527377009391785, 0.07418618351221085, -0.027734916657209396, -0.02130117081105709, 0.00125113723333925, 0.01908426359295845, 0.07878980785608292, 0.002806509379297495, 0.005320576019585133, -0.012235437519848347, -0.005820558872073889, 0.02248981036245823, 0.03088575415313244, -0.008693103678524494, -0.027489641681313515, -0.00916950311511755, 0.02105589583516121, -0.02554631046950817, 0.012971262447535992, 0.031998924911022186, -0.005952630192041397, 0.023470908403396606, -0.008348776027560234, -0.0026909473817795515, 0.03399885818362236, 0.009155352599918842, -0.018669184297323227, 0.057281095534563065, -0.047168225049972534, 0.03477241471409798, -0.00009883217717288062, -0.016801321879029274, -0.03501769155263901, -0.013575015589594841, -0.05535662919282913, -0.006584684364497662, -0.005844143219292164, 0.024357672780752182, -0.01850881241261959, 0.019376708194613457, 0.03669688105583191, 0.008141235448420048, -0.05331896245479584, -0.010754355229437351, -0.034715812653303146, -0.013480679132044315, -0.018829556182026863, -0.001195124932564795, 0.005212089046835899, -0.007009198423475027, 0.007881810888648033, 0.0011738992761820555, -0.061469633132219315, -0.01998046040534973, 0.04788518324494362, 0.040036391466856, 0.019433308392763138, 0.01646171137690544, 0.00995249580591917, 0.05226239562034607, 0.005740372929722071 ]
39,377
pyspark.sql.dataframe
dropna
Returns a new :class:`DataFrame` omitting rows with null values. :func:`DataFrame.dropna` and :func:`DataFrameNaFunctions.drop` are aliases of each other. .. versionadded:: 1.3.1 .. versionchanged:: 3.4.0 Supports Spark Connect. Parameters ---------- how : str, optional 'any' or 'all'. If 'any', drop a row if it contains any nulls. If 'all', drop a row only if all its values are null. thresh: int, optional default None If specified, drop rows that have less than `thresh` non-null values. This overwrites the `how` parameter. subset : str, tuple or list, optional optional list of column names to consider. Returns ------- :class:`DataFrame` DataFrame with null only rows excluded. Examples -------- >>> from pyspark.sql import Row >>> df = spark.createDataFrame([ ... Row(age=10, height=80, name="Alice"), ... Row(age=5, height=None, name="Bob"), ... Row(age=None, height=None, name="Tom"), ... Row(age=None, height=None, name=None), ... ]) >>> df.na.drop().show() +---+------+-----+ |age|height| name| +---+------+-----+ | 10| 80|Alice| +---+------+-----+
def dropna( self, how: str = "any", thresh: Optional[int] = None, subset: Optional[Union[str, Tuple[str, ...], List[str]]] = None, ) -> "DataFrame": """Returns a new :class:`DataFrame` omitting rows with null values. :func:`DataFrame.dropna` and :func:`DataFrameNaFunctions.drop` are aliases of each other. .. versionadded:: 1.3.1 .. versionchanged:: 3.4.0 Supports Spark Connect. Parameters ---------- how : str, optional 'any' or 'all'. If 'any', drop a row if it contains any nulls. If 'all', drop a row only if all its values are null. thresh: int, optional default None If specified, drop rows that have less than `thresh` non-null values. This overwrites the `how` parameter. subset : str, tuple or list, optional optional list of column names to consider. Returns ------- :class:`DataFrame` DataFrame with null only rows excluded. Examples -------- >>> from pyspark.sql import Row >>> df = spark.createDataFrame([ ... Row(age=10, height=80, name="Alice"), ... Row(age=5, height=None, name="Bob"), ... Row(age=None, height=None, name="Tom"), ... Row(age=None, height=None, name=None), ... ]) >>> df.na.drop().show() +---+------+-----+ |age|height| name| +---+------+-----+ | 10| 80|Alice| +---+------+-----+ """ if how is not None and how not in ["any", "all"]: raise PySparkValueError( error_class="VALUE_NOT_ANY_OR_ALL", message_parameters={"arg_name": "how", "arg_type": how}, ) if subset is None: subset = self.columns elif isinstance(subset, str): subset = [subset] elif not isinstance(subset, (list, tuple)): raise PySparkTypeError( error_class="NOT_LIST_OR_STR_OR_TUPLE", message_parameters={"arg_name": "subset", "arg_type": type(subset).__name__}, ) if thresh is None: thresh = len(subset) if how == "any" else 1 return DataFrame(self._jdf.na().drop(thresh, self._jseq(subset)), self.sparkSession)
(self, how: str = 'any', thresh: Optional[int] = None, subset: Union[str, Tuple[str, ...], List[str], NoneType] = None) -> pyspark.sql.dataframe.DataFrame
[ 0.017226990312337875, 0.016169879585504532, 0.06996507197618484, -0.020691964775323868, -0.05121114104986191, -0.03169374540448189, -0.05598771572113037, 0.04686524346470833, -0.0002760539355222136, -0.02640819177031517, -0.017412962391972542, 0.04506424069404602, 0.0461605042219162, -0.002787150675430894, 0.012460203841328621, 0.02818962000310421, 0.017912155017256737, 0.05841515585780144, 0.07474164664745331, 0.0003422762965783477, -0.01798067055642605, -0.036215830594301224, -0.038134291768074036, 0.06679373979568481, -0.020946454256772995, 0.02632988803088665, 0.017951305955648422, 0.0002714658039622009, -0.019605489447712898, 0.060607682913541794, 0.03470847010612488, -0.05438247323036194, -0.025272777304053307, -0.0011488738236948848, -0.03901521861553192, -0.025135744363069534, 0.00936717540025711, -0.014339511282742023, -0.023373892530798912, 0.008300277404487133, 0.04451610893011093, -0.04451610893011093, -0.010189373046159744, -0.02439185231924057, -0.039680805057287216, -0.0230802521109581, 0.055635347962379456, -0.03051917813718319, -0.016140514984726906, 0.04486847668886185, 0.034571435302495956, 0.08981525897979736, -0.05359942838549614, 0.04463356360793114, -0.028679022565484047, 0.04702185094356537, -0.025057440623641014, 0.007145285606384277, 0.03676396235823631, -0.015621747821569443, 0.013595618307590485, -0.012577660381793976, -0.0033254942391067743, 0.03707718104124069, 0.006758657284080982, 0.03553066775202751, 0.004443780519068241, -0.03795810788869858, -0.06796830892562866, -0.06785085052251816, -0.027680641040205956, 0.0054323747754096985, 0.045181695371866226, 0.1352318674325943, -0.013947988860309124, -0.06295681744813919, -0.011951223947107792, -0.002213325584307313, -0.019801249727606773, -0.05810193717479706, 0.04373306408524513, -0.03376881405711174, -0.060137856751680374, -0.019223755225539207, 0.06096005439758301, 0.010326405987143517, -0.03746870160102844, 0.03461058810353279, 0.07591621577739716, -0.04259764775633812, -0.039994023740291595, 0.028757328167557716, -0.002833644161000848, 0.009357388131320477, 0.002557131228968501, 0.022747457027435303, 0.0230802521109581, 0.020691964775323868, -0.020887725055217743, -0.006058810744434595, 0.012832149863243103, -0.049684204161167145, -0.011853343807160854, 0.10524124652147293, 0.004504955839365721, -0.012920242734253407, 0.026036245748400688, 0.012626600451767445, -0.03173289820551872, -0.005177884828299284, -0.00862817745655775, -0.008182819932699203, 0.008486250415444374, 0.020926877856254578, -0.011843555606901646, -0.01490721944719553, -0.02153373695909977, 0.01950760930776596, -0.08049702644348145, -0.03284873813390732, -0.01565111242234707, 0.03502168878912926, -0.027524031698703766, -0.07184437662363052, 0.026447344571352005, 0.003154203062877059, 0.020731115713715553, -0.025957942008972168, -0.04005275294184685, 0.06295681744813919, 0.02695632353425026, 0.0027186344377696514, -0.011050722561776638, 0.027935130521655083, -0.04749168083071709, 0.0287377517670393, 0.04181460291147232, 0.03831047564744949, 0.014486332423985004, -0.04349815100431442, -0.014065445400774479, -0.03433652222156525, 0.03754700720310211, -0.003810003399848938, 0.024802951142191887, -0.02703462913632393, 0.042636800557374954, -0.04749168083071709, 0.01780448481440544, -0.026447344571352005, -0.005848367232829332, -0.03609837591648102, -0.02045704983174801, -0.029285883530974388, 0.023138979449868202, 0.027152085676789284, 0.02200356498360634, -0.03222230076789856, -0.05211164429783821, 0.028209196403622627, 0.025605570524930954, 0.05410841107368469, 0.03715548664331436, -0.010375346057116985, -0.009489526972174644, 0.04251934215426445, 0.012039316818118095, -0.005280659534037113, -0.005241507664322853, -0.00005008735024603084, 0.03819302096962929, 0.003641159273684025, 0.04972335696220398, -0.006420969031751156, -0.027073780074715614, 0.07485910505056381, -0.004071834031492472, 0.004705611150711775, -0.06479697674512863, 0.008623283356428146, -0.009881049394607544, -0.06186055392026901, -0.023060675710439682, 0.04071833938360214, 0.024607188999652863, -0.023961177095770836, -0.02850283868610859, -0.07344961911439896, -0.014251419343054295, 0.017178049311041832, -0.0017141344724223018, 0.003910331055521965, -0.04690439626574516, 0.05731889232993126, -0.007507443893700838, -0.041070710867643356, 0.04788320139050484, 0.002723528305068612, -0.03214399889111519, 0.0014143750304356217, 0.03196781128644943, 0.01572941616177559, 0.01328240055590868, -0.027524031698703766, -0.008706481195986271, -0.008540084585547447, -0.028679022565484047, -0.0027063991874456406, 0.025214048102498055, -0.04749168083071709, 0.04396797716617584, -0.020398322492837906, 0.036137524992227554, -0.02037874609231949, 0.049762509763240814, -0.008897348307073116, -0.05571364983916283, -0.009925095364451408, 0.06276105344295502, 0.003822238417342305, -0.03774276748299599, -0.004306747578084469, -0.05708397924900055, 0.042323581874370575, 0.06460121273994446, -0.042245276272296906, 0.03004935197532177, -0.013448798097670078, 0.03196781128644943, -0.10696394741535187, 0.003318153088912368, -0.05438247323036194, 0.04075749218463898, -0.04306747391819954, -0.06679373979568481, 0.07646434754133224, -0.02090730145573616, -0.030186384916305542, 0.03592218831181526, -0.06914287060499191, -0.0291880015283823, -0.014466756023466587, -0.0028311971109360456, -0.023354316130280495, 0.015425986610352993, 0.024117786437273026, -0.06491442769765854, 0.07016082853078842, 0.042871713638305664, -0.011217119172215462, -0.001837708754464984, 0.006460121367126703, 0.028248347342014313, 0.039700381457805634, -0.0001280095020774752, 0.06178224831819534, -0.00689079612493515, -0.021259671077132225, 0.007022934965789318, -0.014858278445899487, 0.022962793707847595, -0.09600131958723068, -0.050232335925102234, 0.0005426257266663015, 0.0230802521109581, 0.009934883564710617, 0.018176432698965073, -0.049292683601379395, 0.05798448249697685, -0.01889096014201641, 0.01873435080051422, 0.05845430865883827, 0.02206229232251644, -0.024196090176701546, 0.02858114242553711, 0.030186384916305542, -0.0137815922498703, -0.03470847010612488, 0.04110986366868019, -0.017461903393268585, 0.024665918201208115, -0.038839031010866165, 0.021670769900083542, 0.026310311630368233, -0.01695292443037033, 0.021514160558581352, 0.02889436110854149, -0.03304449841380119, -0.003579983953386545, 0.023276012390851974, 0.012362322770059109, 0.029520796611905098, 0.05461739003658295, 0.025057440623641014, -0.03919140249490738, 0.005696652457118034, -0.008432416245341301, -0.039915718138217926, -0.04392882436513901, 0.00832474697381258, 0.008486250415444374, -0.05900244042277336, 0.045808132737874985, 0.019576124846935272, 0.011882707476615906, -0.030617060139775276, -0.043263234198093414, -0.03478677570819855, 0.021788226440548897, 0.008011529222130775, -0.005177884828299284, -0.057123132050037384, 0.041070710867643356, -0.05226825177669525, -0.016140514984726906, 0.006523743737488985, 0.06311342865228653, 0.029403340071439743, 0.0013324000174179673, 0.013644559308886528, -0.00867711752653122, -0.015249800868332386, -0.055557042360305786, 0.022884489968419075, -0.0005560842691920698, 0.00774725154042244, -0.0380951389670372, 0.031106462702155113, -0.058336853981018066, 0.02944249100983143, 0.023413045331835747, 0.05931565910577774, 0.03817344456911087, -0.06096005439758301, -0.059981245547533035, -0.015925178304314613, 0.02268872782588005, -0.018783291801810265, -0.028463685885071754, 0.0412273183465004, -0.0033621995244175196, -0.04764828830957413, 0.06820321828126907, 0.0021986435167491436, 0.002789597725495696, 0.03141967952251434, -0.006465015467256308, -0.020339593291282654, 0.044790174812078476, 0.02394160069525242, 0.03410160914063454, 0.04173629730939865, 0.01758914813399315, 0.02740657515823841, 0.0312630720436573, -0.007673840969800949, -0.006455227266997099, 0.06648051738739014, -0.03143925592303276, -0.04385051876306534, 0.009068639948964119, -0.04075749218463898, 0.0247050691395998, 0.01796109415590763, 0.08308107405900955, -0.02059408277273178, 0.049684204161167145, -0.019184602424502373, -0.06702864915132523, -0.020339593291282654, -0.01967400498688221, -0.03386669605970383, -0.03051917813718319, 0.0025742603465914726, -0.008853302337229252, -0.0017361575737595558, -0.014691881835460663, -0.027817673981189728, -0.013292188756167889, 0.015778357163071632, -0.0071991197764873505, -0.04424204304814339, 0.0041354564018547535, -0.012019740417599678, -0.042793408036231995, -0.029931895434856415, -0.0624086856842041, 0.00681738555431366, -0.03893691301345825, -0.011951223947107792, -0.02936418727040291, 0.008339429274201393, 0.012920242734253407, -0.005080004222691059, -0.02632988803088665, 0.01154012605547905, -0.08276785910129547, 0.009225249290466309, 0.04725676402449608, -0.02632988803088665, -0.0010454874718561769, -0.07771721482276917, -0.0004508626298047602, -0.016248183324933052, 0.048744551837444305, 0.05504806339740753, -0.0008160797297023237, -0.0665588229894638, 0.02214059792459011, -0.0413447767496109, 0.03770361840724945, 0.01804918795824051, 0.004649329464882612, 0.04792235419154167, 0.04220612347126007, 0.06424884498119354, 0.044555261731147766, 0.02695632353425026, 0.020261289551854134, 0.0034821031149476767, 0.014868066646158695, -0.026212431490421295, 0.005863049533218145, -0.032496366649866104, 0.012616812251508236, -0.04024851322174072, 0.023882871493697166, -0.03872157633304596, -0.0010626164730638266, 0.032946616411209106, -0.036039646714925766, -0.026525648310780525, -0.06882965564727783, 0.01475061010569334, -0.006460121367126703, 0.06702864915132523, -0.05164181813597679, -0.05446077883243561, 0.017226990312337875, -0.0010020529152825475, -0.018176432698965073, 0.024450579658150673, 0.008867984637618065, -0.05755380541086197, -0.03701845183968544, 0.030773667618632317, 0.021572889760136604, -0.021944835782051086, -0.10696394741535187, -0.03872157633304596, 0.05653584748506546, 0.013566254638135433, 0.028463685885071754, 0.013830532319843769, -0.042793408036231995, -0.028679022565484047, -0.07086557149887085, -0.002181514399126172, -0.03778192028403282, -0.005593877751380205, 0.0027186344377696514, 0.03175247460603714, 0.002537555294111371, 0.004504955839365721, 0.007850025780498981, 0.049136072397232056, 0.019096510484814644, -0.018910536542534828, -0.04005275294184685, -0.002787150675430894, 0.0062349955551326275, -0.013879472389817238, -0.025214048102498055, 0.013987141661345959, 0.06738102436065674, 0.0359613411128521, -0.02192525938153267, -0.014535272493958473, 0.0295795239508152, 0.02779809758067131, -0.03410160914063454, 0.04815726727247238, 0.02533150650560856, 0.0062496778555214405, -0.027700217440724373, -0.021435856819152832, -0.04451610893011093, -0.02981443889439106, 0.03688142076134682, -0.01586644910275936, -0.02315855585038662, -0.02376541495323181, 0.0074144573882222176, -0.006254571955651045, 0.016228606924414635, 0.02973613329231739, 0.005011487752199173, 0.07752145826816559, 0.01673758588731289, 0.016091573983430862, 0.006802703253924847, -0.01663970574736595, -0.028013434261083603, 0.02533150650560856, -0.0067292931489646435, -0.07117878645658493, 0.031791627407073975, 0.030460450798273087, -0.08206311613321304, -0.042245276272296906, -0.05305129662156105, 0.055909413844347, 0.02045704983174801, 0.02726954221725464, 0.01025788951665163, -0.010404710657894611, -0.011941435746848583, 0.041932061314582825, 0.022590847685933113, 0.016238395124673843, -0.02601666934788227, 0.0049013723619282246, -0.003445398062467575, 0.0719226822257042, -0.02632988803088665, 0.04506424069404602, 0.03770361840724945, 0.048901159316301346, 0.035746004432439804, 0.028307076543569565, -0.033259835094213486, -0.020026376470923424, 0.010228524915874004, -0.0332794114947319, -0.011177967302501202, -0.00402778759598732, -0.07051320374011993, 0.02190568298101425, 0.03885860741138458, 0.00231365323998034, 0.004013105761259794, 0.026153702288866043, -0.029305458068847656, 0.011647794395685196, -0.03445398062467575, 0.04710015654563904, -0.00468848180025816, 0.04373306408524513, 0.014378664083778858, 0.04780489578843117, 0.021964412182569504, -0.04878370463848114, 0.07254911959171295, 0.012264442630112171, 0.026212431490421295, 0.005378540139645338, 0.03701845183968544, 0.05379519239068031, 0.0067292931489646435, -0.023726264014840126, -0.03020596131682396, -0.06973015516996384, 0.0615081861615181, -0.017863214015960693, -0.04956674948334694, 0.019801249727606773, 0.07572045177221298, 0.000174349857843481, -0.01475061010569334, 0.020789844915270805, -0.015034464187920094, 0.04001360014081001, 0.0332794114947319, -0.04330238699913025, -0.02376541495323181, 0.0019111192086711526, -0.018450498580932617, 0.055909413844347, -0.07493740320205688, -0.020085103809833527, -0.020887725055217743, 0.013321553356945515, -0.03253551945090294, -0.0059511419385671616, -0.03934800997376442, 0.007727675139904022, -0.02501828782260418, -0.0542258657515049, 0.017638089135289192, 0.024744221940636635, 0.07638604193925858, -0.0566924586892128, 0.0340624563395977, 0.003763509914278984, 0.007204013876616955, 0.009592301212251186, -0.06096005439758301, -0.0819065049290657, 0.02711293287575245, 0.032104846090078354, -0.010639623738825321, -0.045103393495082855, -0.016081785783171654, -0.05273808166384697, -0.004955206532031298, 0.08558681607246399, -0.06859473884105682, -0.0014779974007979035, -0.021651193499565125, -0.018333040177822113, -0.010698352009057999, 0.03214399889111519, 0.03521744906902313, -0.007257848512381315, 0.010561319068074226, 0.03795810788869858, 0.01873435080051422, -0.0761902779340744, -0.0017838743515312672, -0.02562514692544937, -0.009866367094218731, -0.00735572911798954, 0.03474762290716171, 0.003579983953386545, 0.018156856298446655, -0.005956036038696766, -0.01642436906695366, 0.01665928214788437, -0.07885263115167618, 0.053012147545814514, 0.018930112943053246, -0.05841515585780144, 0.01802961155772209, 0.046826090663671494, -0.021122638136148453, -0.027621911838650703, 0.037057604640722275, -0.06573662906885147, 0.010199161246418953, 0.011912072077393532, -0.03128264844417572, -0.01611115038394928, 0.10109110921621323, 0.030147232115268707, 0.001134803518652916, -0.10649412125349045, -0.019536972045898438, 0.014447180554270744, -0.012685328722000122, -0.031106462702155113, 0.01842113398015499, 0.014975735917687416, -0.03261382505297661, -0.0275631844997406, 0.05179842561483383, 0.07063066214323044, -0.021514160558581352, 0.024274395778775215, 0.06009870395064354, 0.023882871493697166, -0.015974117442965508, -0.006068598944693804, 0.02593836560845375, 0.04165799543261528, 0.011500973254442215, 0.001273671630769968, -0.04157968983054161, -0.04980166256427765, 0.06354410201311111, 0.020026376470923424, -0.04259764775633812, 0.042715106159448624, -0.04486847668886185, 0.031145615503191948, -0.0016321594594046474, -0.07536808401346207, -0.01758914813399315, -0.053716886788606644, -0.052855536341667175, -0.021944835782051086, -0.016150303184986115, 0.012636388652026653, -0.011755462735891342, -0.05128944665193558, 0.035589393228292465, -0.0074144573882222176, -0.019840402528643608, -0.0029633359517902136, 0.04811811447143555, -0.031635016202926636, 0.019223755225539207, -0.06428799778223038, 0.028698598966002464, 0.07129624485969543, 0.008907136507332325, -0.033886272460222244, -0.0069005838595330715, -0.030480027198791504, 0.030029775574803352, 0.0013629876775667071, 0.017148684710264206, 0.012372110970318317, -0.020535355433821678, 0.03639201447367668, 0.057358045130968094, -0.011246483772993088, 0.003998423460870981, 0.017843637615442276, 0.08652646839618683, -0.014329723082482815, -0.0336122065782547, 0.0671069547533989, 0.004057151731103659, 0.028170043602585793, -0.02184695564210415, 0.027210813015699387, -0.05367773398756981, -0.030793244019150734, 0.00398618821054697, -0.028698598966002464, 0.039210978895425797, -0.02609497494995594, 0.017677240073680878, 0.007771721575409174, 0.002843432128429413, 0.035804733633995056, -0.00918120238929987, -0.034512709826231, 0.010013188235461712, 0.014809338375926018, 0.031145615503191948, 0.015817508101463318, 0.03261382505297661, -0.06201716512441635, -0.0064160749316215515, -0.0380951389670372, 0.029246730729937553, 0.01718783751130104, 0.0027749156579375267, -0.025214048102498055, -0.05637924000620842, 0.018783291801810265, 0.0633091852068901, 0.0151812843978405, 0.06334833800792694, 0.014799550175666809, -0.00551557308062911, -0.014995311386883259, 0.03515871986746788, -0.023060675710439682, -0.008319852873682976, 0.0026329888496547937, -0.009000123478472233, -0.027210813015699387, 0.016757162287831306, 0.02059408277273178, 0.002411533845588565, 0.02020256035029888, 0.004979676567018032, -0.059119898825883865, -0.02865944616496563, 0.07278402894735336, -0.004076728131622076, 0.007174649741500616, 0.008275806903839111, 0.005628135986626148, 0.04623880609869957, -0.017089957371354103 ]
39,378
pyspark.sql.dataframe
exceptAll
Return a new :class:`DataFrame` containing rows in this :class:`DataFrame` but not in another :class:`DataFrame` while preserving duplicates. This is equivalent to `EXCEPT ALL` in SQL. As standard in SQL, this function resolves columns by position (not by name). .. versionadded:: 2.4.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Parameters ---------- other : :class:`DataFrame` The other :class:`DataFrame` to compare to. Returns ------- :class:`DataFrame` Examples -------- >>> df1 = spark.createDataFrame( ... [("a", 1), ("a", 1), ("a", 1), ("a", 2), ("b", 3), ("c", 4)], ["C1", "C2"]) >>> df2 = spark.createDataFrame([("a", 1), ("b", 3)], ["C1", "C2"]) >>> df1.exceptAll(df2).show() +---+---+ | C1| C2| +---+---+ | a| 1| | a| 1| | a| 2| | c| 4| +---+---+
def exceptAll(self, other: "DataFrame") -> "DataFrame": """Return a new :class:`DataFrame` containing rows in this :class:`DataFrame` but not in another :class:`DataFrame` while preserving duplicates. This is equivalent to `EXCEPT ALL` in SQL. As standard in SQL, this function resolves columns by position (not by name). .. versionadded:: 2.4.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Parameters ---------- other : :class:`DataFrame` The other :class:`DataFrame` to compare to. Returns ------- :class:`DataFrame` Examples -------- >>> df1 = spark.createDataFrame( ... [("a", 1), ("a", 1), ("a", 1), ("a", 2), ("b", 3), ("c", 4)], ["C1", "C2"]) >>> df2 = spark.createDataFrame([("a", 1), ("b", 3)], ["C1", "C2"]) >>> df1.exceptAll(df2).show() +---+---+ | C1| C2| +---+---+ | a| 1| | a| 1| | a| 2| | c| 4| +---+---+ """ return DataFrame(self._jdf.exceptAll(other._jdf), self.sparkSession)
(self, other: pyspark.sql.dataframe.DataFrame) -> pyspark.sql.dataframe.DataFrame
[ -0.0035274592228233814, -0.0437946617603302, 0.010913146659731865, 0.052141573280096054, -0.062157873064279556, -0.039177220314741135, -0.021115917712450027, -0.0011532504577189684, 0.057149723172187805, -0.007725335657596588, 0.0004392674600239843, -0.06176716461777687, -0.01609000936150551, 0.030581673607230186, 0.012245100922882557, -0.04851865768432617, 0.022430112585425377, 0.05480548366904259, 0.07657849788665771, -0.02823743224143982, -0.020547617226839066, -0.003989203367382288, 0.004595242440700531, 0.0344887375831604, -0.029942335560917854, 0.028255192562937737, -0.058108728379011154, 0.01386120542883873, 0.01252037100493908, 0.06095023453235626, -0.02779344841837883, -0.04301324859261513, -0.003984763752669096, -0.010691153816878796, -0.08694998174905777, -0.032055702060461044, 0.01738644391298294, 0.017466362565755844, 0.038893066346645355, 0.007334629073739052, -0.0058428398333489895, -0.019517572596669197, 0.03615812212228775, -0.06233546510338783, 0.023691028356552124, -0.025786636397242546, 0.02372654713690281, -0.031327567994594574, 0.011410409584641457, 0.03740127757191658, 0.01691582053899765, 0.06606493890285492, -0.03999415040016174, 0.05697212740778923, -0.05711420252919197, 0.029498349875211716, -0.024312607944011688, 0.011747837997972965, -0.005039227660745382, 0.0007669837214052677, -0.051999498158693314, -0.03178931027650833, -0.025431448593735695, 0.02946283109486103, 0.0015095482813194394, -0.011170657351613045, -0.025573523715138435, -0.028912289068102837, -0.05746939033269882, 0.002413057256489992, -0.06205131486058235, 0.019304458051919937, -0.020423300564289093, 0.10236513614654541, -0.03978103771805763, -0.020760729908943176, 0.02758033573627472, 0.03971000015735626, -0.06176716461777687, -0.025946471840143204, 0.03530567139387131, -0.08219046890735626, -0.009465755894780159, 0.013035393320024014, 0.029356274753808975, 0.035838451236486435, 0.0023309201933443546, 0.034453220665454865, 0.02713635005056858, -0.0669529065489769, -0.004644080996513367, 0.0344887375831604, -0.05778906121850014, -0.03303246945142746, 0.040562450885772705, -0.0044465078972280025, -0.046884793788194656, 0.03374284505844116, 0.023744307458400726, -0.006970561109483242, 0.04162801429629326, 0.011037462390959263, 0.01498892717063427, 0.0065665352158248425, 0.026035267859697342, -0.0430842861533165, -0.013070912100374699, -0.049371108412742615, 0.00689508393406868, 0.011144018732011318, -0.06478626281023026, 0.04240942746400833, 0.010495800524950027, 0.003716152859851718, 0.006100350990891457, -0.029001086950302124, -0.02583991549909115, -0.006411140318959951, -0.08453470468521118, 0.018949270248413086, 0.033210061490535736, 0.0902177095413208, 0.060062263160943985, -0.023158246651291847, 0.030794786289334297, -0.001588355633430183, 0.00036850737524218857, -0.01287555880844593, 0.009297041222453117, 0.05093393474817276, 0.034009236842393875, -0.022394593805074692, 0.016977978870272636, 0.02946283109486103, 0.008355793543159962, -0.005736283492296934, 0.051040492951869965, 0.006118110381066799, 0.02248338982462883, 0.006935042329132557, 0.014713656157255173, -0.030528394505381584, 0.08148009330034256, 0.04620993882417679, -0.05128912255167961, -0.013035393320024014, 0.0038560079410672188, -0.015424031764268875, -0.028326230123639107, 0.0034808407071977854, -0.00037322472780942917, 0.02415277250111103, -0.03409803286194801, -0.058392878621816635, -0.037294723093509674, 0.0033809442538768053, 0.04414984956383705, 0.03155843913555145, -0.015441791154444218, -0.006979440804570913, -0.017066774889826775, 0.008906334638595581, 0.03152292221784592, 0.03187811002135277, -0.05334921181201935, -0.023264802992343903, 0.03239313140511513, -0.034364424645900726, -0.04578371345996857, -0.007028279360383749, 0.04432744160294533, 0.03289039433002472, 0.06247754022479057, -0.05608415976166725, -0.0737369954586029, 0.06045297160744667, -0.011561363935470581, 0.0006831816281192005, 0.03404475376009941, 0.013896724209189415, 0.040491413325071335, -0.061802685260772705, -0.010922025889158249, 0.011650160886347294, 0.08659479767084122, -0.025147298350930214, -0.03836028650403023, -0.03566085919737816, 0.02814863622188568, 0.0037494516000151634, -0.005039227660745382, -0.011516965925693512, -0.005305618513375521, 0.05626175180077553, -0.012378295883536339, -0.035110317170619965, -0.0049548703245818615, 0.024774352088570595, -0.046245455741882324, 0.058677032589912415, -0.021257992833852768, 0.03899962455034256, 0.039248257875442505, -0.026887718588113785, 0.012049747630953789, -0.0285215824842453, -0.031824830919504166, -0.06784087419509888, 0.01414535567164421, -0.016383038833737373, 0.05427270010113716, -0.029018845409154892, 0.030155448243021965, -0.040988676249980927, 0.032055702060461044, 0.008968492969870567, -0.03360076993703842, -0.005869478918612003, 0.04997492954134941, 0.007041598670184612, -0.005691885016858578, -0.04095315933227539, -0.052496761083602905, 0.00015733711188659072, 0.009900861419737339, -0.005199062172323465, 0.056794535368680954, -0.004388789646327496, 0.00794288795441389, -0.06496385484933853, -0.023460157215595245, -0.035252392292022705, -0.0012653566664084792, -0.043119803071022034, -0.04723998159170151, 0.03878651186823845, -0.02873469516634941, -0.03747231513261795, 0.019322218373417854, -0.03718816488981247, -0.04599682614207268, -0.0049504307098686695, 0.0471334271132946, 0.02568008005619049, 0.03669090196490288, -0.026106305420398712, -0.027846725657582283, 0.0737369954586029, 0.01778603158891201, 0.02932075597345829, -0.00048810578300617635, -0.0682670995593071, 0.0015450670616701245, 0.005278979428112507, 0.013950002379715443, -0.035838451236486435, -0.04706238955259323, 0.026887718588113785, -0.0032566285226494074, 0.0410597138106823, 0.00585615960881114, -0.022803058847784996, -0.033654049038887024, -0.018753917887806892, -0.029871298000216484, 0.019002549350261688, -0.018096819519996643, 0.025520246475934982, 0.004306652583181858, 0.006371181923896074, -0.0006687521236017346, -0.02306945063173771, 0.029267478734254837, 0.017652835696935654, 0.023673269897699356, 0.037720948457717896, -0.03534118831157684, 0.01564602367579937, -0.005825080443173647, -0.061518535017967224, 0.06570974737405777, -0.023904141038656235, 0.003933705389499664, -0.0006476628477685153, -0.048341065645217896, -0.006975001189857721, -0.014713656157255173, -0.1346161961555481, -0.01912686415016651, -0.03661986440420151, -0.007103756535798311, 0.012085266411304474, 0.025697840377688408, 0.021577661857008934, -0.06482177972793579, 0.028681417927145958, 0.025289373472332954, -0.06933266669511795, -0.024614516645669937, 0.05580000951886177, 0.030208725482225418, -0.009936380200088024, 0.03019096702337265, 0.04123730957508087, 0.02029898576438427, -0.07274246960878372, -0.0031922506168484688, 0.031114455312490463, -0.015912415459752083, 0.012529251165688038, -0.01787482760846615, 0.0025151739828288555, 0.01771499402821064, -0.023300321772694588, -0.042231835424900055, 0.014758055098354816, 0.026301659643650055, 0.013807927258312702, 0.005345576908439398, 0.0172443687915802, 0.01328402478247881, -0.013115311041474342, -0.06990096718072891, 0.011881032958626747, -0.024703314527869225, -0.004122398793697357, 0.03347645327448845, 0.018860474228858948, -0.012342777103185654, -0.0033298858907073736, 0.0047994754277169704, -0.005674125626683235, 0.012973235920071602, -0.055693451315164566, 0.01957084983587265, -0.031025657430291176, 0.025200577452778816, 0.00924376305192709, 0.08730517327785492, 0.039248257875442505, 0.035483263432979584, -0.05054323002696037, 0.03441770002245903, -0.04780828207731247, -0.03669090196490288, -0.0042911130003631115, -0.03661986440420151, 0.026354936882853508, -0.015424031764268875, 0.007765294052660465, -0.02829071134328842, 0.03297919034957886, -0.016498474404215813, 0.01691582053899765, 0.00848010927438736, 0.049442145973443985, -0.07466048002243042, 0.03265952318906784, -0.046245455741882324, -0.020565375685691833, 0.05849943682551384, -0.012928836978971958, 0.019197901710867882, -0.024792110547423363, 0.03761439025402069, 0.04763069003820419, 0.030670469626784325, -0.042089760303497314, -0.10279136151075363, -0.06393381208181381, -0.05793113633990288, -0.015033325180411339, 0.029622666537761688, -0.029231959953904152, 0.007157034706324339, -0.014775814488530159, -0.05935188755393028, 0.030102169141173363, 0.007720895577222109, 0.02459675818681717, 0.006189147941768169, -0.07323972880840302, -0.0017015717457979918, -0.02626614086329937, -0.004723998252302408, -0.013887844048440456, -0.03047511726617813, -0.047772765159606934, 0.012751243077218533, 0.02713635005056858, 0.013266265392303467, -0.03836028650403023, 0.0017914786003530025, 0.03344093635678291, -0.028699176385998726, -0.006109230685979128, -0.0630103200674057, 0.015939055010676384, 0.014314069412648678, -0.0040047429502010345, 0.03571413829922676, 0.0008480109390802681, 0.0036495549138635397, -0.04468262940645218, 0.016338640823960304, 0.05349128693342209, 0.029480591416358948, -0.08886799961328506, 0.006957241799682379, -0.004530864767730236, 0.01371025014668703, 0.0029857978224754333, -0.03194914758205414, 0.054166145622730255, 0.030812544748187065, 0.03628243878483772, 0.05086289718747139, -0.01928669959306717, 0.05064978450536728, 0.05661693960428238, 0.02974698133766651, -0.041805610060691833, 0.006135869771242142, -0.013266265392303467, -0.004932671319693327, 0.004157917574048042, -0.04663616418838501, 0.01520203985273838, -0.023992938920855522, 0.030155448243021965, -0.004484246484935284, -0.020920563489198685, -0.06112782657146454, 0.02102711983025074, -0.02058313600718975, 0.015841377899050713, 0.038395803421735764, -0.05185742303729057, -0.005589768756181002, 0.09469307959079742, -0.0035074797924607992, 0.0009312581387348473, 0.02306945063173771, -0.025715598836541176, -0.046813756227493286, 0.01254701055586338, -0.007987286895513535, 0.024703314527869225, -0.028983326628804207, 0.011650160886347294, 0.07125067710876465, 0.022660983726382256, 0.011481447145342827, -0.042373910546302795, -0.08936525881290436, 0.009376958943903446, -0.010007417760789394, -0.049086958169937134, -0.04894488304853439, 0.04066900908946991, 0.04400777444243431, 0.013186348602175713, -0.031611718237400055, 0.035696376115083694, -0.0026528092566877604, -0.013266265392303467, -0.026905478909611702, -0.0714993104338646, -0.0071747940964996815, 0.02967594377696514, 0.0012376076774671674, -0.09419581294059753, -0.019819481298327446, -0.06269065290689468, -0.014251912012696266, 0.012502611614763737, -0.0445050373673439, -0.003241088939830661, 0.009217124432325363, 0.049797333776950836, -0.06116334721446037, 0.012378295883536339, -0.02546696737408638, -0.07551293075084686, 0.03099013864994049, -0.057433873414993286, -0.018665120005607605, 0.020849525928497314, 0.01520203985273838, -0.0014118716353550553, -0.017475241795182228, -0.012085266411304474, -0.034009236842393875, 0.00048394344048574567, 0.03935481235384941, 0.012342777103185654, -0.020334504544734955, 0.02793552353978157, 0.0018780557438731194, 0.010460281744599342, -0.00452864496037364, -0.022678744047880173, -0.05725627765059471, 0.025733359158039093, 0.02443692274391651, -0.07522878050804138, 0.023904141038656235, 0.005083626136183739, 0.0023375798482447863, -0.04677823930978775, -0.03768542781472206, 0.04191216453909874, 0.009563432075083256, 0.039532408118247986, 0.028130875900387764, -0.05171534791588783, -0.042160797864198685, 0.03928377479314804, 0.07728887349367142, 0.033796124160289764, -0.027757929638028145, 0.020938323810696602, 0.020068112760782242, 0.02736722305417061, -0.03347645327448845, 0.012786761857569218, 0.01854080520570278, -0.006415580399334431, 0.03258848562836647, -0.01738644391298294, -0.0940537378191948, -0.019002549350261688, 0.03885754942893982, -0.03457753732800484, -0.0235667135566473, 0.012680205516517162, -0.0074900235049426556, 0.05366888269782066, -0.004262254107743502, 0.022803058847784996, 0.009110568091273308, 0.02924971841275692, 0.018736157566308975, -0.02248338982462883, -0.06105678901076317, 0.023602232336997986, -0.07203209400177002, 0.030794786289334297, 0.00745894480496645, 0.0490514412522316, 0.009794305078685284, -0.025218335911631584, 0.06570974737405777, -0.02530713379383087, 0.03342317417263985, -0.021151436492800713, -0.021701976656913757, 0.05629727244377136, 0.00570964440703392, 0.01335506234318018, 0.0035851772408932447, -0.04894488304853439, 0.11174209415912628, -0.04010070860385895, -0.017803790047764778, 0.009767665527760983, 0.01759955659508705, 0.010566838085651398, -0.016027851030230522, 0.02227027714252472, -0.00001714370955596678, 0.05182190611958504, 0.022394593805074692, -0.05849943682551384, 0.029942335560917854, 0.033654049038887024, 0.013079792261123657, 0.05608415976166725, -0.052354685962200165, -0.031167732551693916, -0.010344846174120903, 0.02816639468073845, -0.00401140283793211, -0.010229409672319889, 0.0182033758610487, 0.034151311963796616, -0.0391416996717453, -0.014882370829582214, 0.11010822653770447, 0.026390455663204193, 0.024863148108124733, -0.02582215517759323, 0.04425640404224396, -0.042231835424900055, -0.014882370829582214, 0.07870962470769882, -0.03789854049682617, -0.043474990874528885, 0.02530713379383087, -0.015796979889273643, 0.03141636401414871, 0.025733359158039093, -0.023833103477954865, -0.05587104707956314, 0.03557206317782402, 0.010602356866002083, -0.03276607766747475, 0.007831891998648643, -0.00005230695751379244, 0.04113075137138367, 0.010078455321490765, 0.06514144688844681, 0.002031230367720127, -0.0689774751663208, 0.04226735234260559, 0.022572187706828117, -0.012937717139720917, -0.045073337852954865, -0.0245257206261158, 0.027704650536179543, -0.035483263432979584, 0.0015239778440445662, 0.02225251868367195, 0.004994829185307026, -0.020902805030345917, 0.017404204234480858, -0.011863273568451405, 0.08481885492801666, -0.05068530514836311, 0.061802685260772705, 0.0065665352158248425, -0.05313609912991524, 0.00800060573965311, 0.019819481298327446, -0.017137812450528145, -0.04692031443119049, -0.010717793367803097, -0.04553508013486862, -0.03178931027650833, 0.09668213129043579, -0.0015483970055356622, 0.0036872937344014645, -0.007667617406696081, -0.0014740295009687543, -0.0603819340467453, -0.03697505220770836, -0.01371025014668703, -0.01192543189972639, -0.00917272549122572, -0.039390332996845245, 0.012795642018318176, 0.03333437815308571, 0.013044273480772972, -0.02205716446042061, -0.052354685962200165, 0.038005098700523376, -0.06499937176704407, 0.038395803421735764, 0.05164431035518646, -0.0007320199511013925, 0.07714679837226868, -0.002450796077027917, 0.03159395977854729, 0.002055649645626545, 0.06283272802829742, 0.024792110547423363, 0.030439598485827446, -0.026230622082948685, 0.057966653257608414, 0.06293928623199463, -0.011108499951660633, 0.03114997409284115, -0.035039279609918594, -0.010557958856225014, -0.023016171529889107, -0.03676193952560425, -0.06407588720321655, -0.038964107632637024, 0.009501274675130844, -0.007507782895117998, -0.023602232336997986, 0.028326230123639107, -0.0020390001591295004, -0.013523777015507221, -0.037934061139822006, 0.004715118557214737, 0.024117253720760345, 0.01178335677832365, 0.03587397187948227, -0.08552923053503036, -0.00006937262514838949, -0.028184155002236366, 0.024277089163661003, 0.046174418181180954, 0.023229284211993217, 0.037934061139822006, -0.00885749701410532, -0.052141573280096054, -0.014154234901070595, 0.05739835277199745, -0.04184112697839737, 0.01811457984149456, 0.027313943952322006, 0.04418536648154259, 0.04343947395682335, 0.03406251221895218, 0.040278300642967224, 0.005962715949863195, 0.03409803286194801, -0.042089760303497314, -0.04283565282821655, 0.018967030569911003, 0.03690401464700699, 0.05580000951886177, -0.023477915674448013, 0.03995863348245621, 0.009900861419737339, -0.0410597138106823, 0.011605762876570225, 0.015352994203567505, -0.016809264197945595, 0.01839873008430004, 0.0062823849730193615, 0.0490514412522316, -0.0021455565001815557, 0.04137938469648361, 0.011650160886347294, -0.04240942746400833, 0.009048409759998322, 0.012751243077218533, 0.026035267859697342, 0.08368225395679474, 0.01196982990950346, 0.014660377986729145, 0.03253520652651787, -0.025626802816987038, -0.018789436668157578, -0.027527056634426117, -0.001749300048686564, 0.007365707773715258, -0.005971595644950867, -0.014900130219757557, -0.013319543562829494, 0.012822280637919903, 0.028912289068102837, 0.007343508768826723, -0.029018845409154892, 0.05675901472568512, -0.013319543562829494, 0.021222474053502083, 0.005749603267759085, 0.022021645680069923, -0.029338516294956207, -0.03289039433002472, 0.025289373472332954, 0.07444737106561661, 0.04635201394557953, -0.002153326291590929, 0.012866679579019547, -0.027846725657582283, -0.010682274587452412, 0.05022355914115906, -0.040633488446474075, 0.054983075708150864, 0.01505996473133564, 0.05079185962677002, 0.02814863622188568, 0.014491663314402103 ]
39,379
pyspark.sql.dataframe
explain
Prints the (logical and physical) plans to the console for debugging purposes. .. versionadded:: 1.3.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Parameters ---------- extended : bool, optional default ``False``. If ``False``, prints only the physical plan. When this is a string without specifying the ``mode``, it works as the mode is specified. mode : str, optional specifies the expected output format of plans. * ``simple``: Print only a physical plan. * ``extended``: Print both logical and physical plans. * ``codegen``: Print a physical plan and generated codes if they are available. * ``cost``: Print a logical plan and statistics if they are available. * ``formatted``: Split explain output into two sections: a physical plan outline and node details. .. versionchanged:: 3.0.0 Added optional argument `mode` to specify the expected output format of plans. Examples -------- >>> df = spark.createDataFrame( ... [(14, "Tom"), (23, "Alice"), (16, "Bob")], ["age", "name"]) Print out the physical plan only (default). >>> df.explain() # doctest: +SKIP == Physical Plan == *(1) Scan ExistingRDD[age...,name...] Print out all of the parsed, analyzed, optimized and physical plans. >>> df.explain(True) == Parsed Logical Plan == ... == Analyzed Logical Plan == ... == Optimized Logical Plan == ... == Physical Plan == ... Print out the plans with two sections: a physical plan outline and node details >>> df.explain(mode="formatted") # doctest: +SKIP == Physical Plan == * Scan ExistingRDD (...) (1) Scan ExistingRDD [codegen id : ...] Output [2]: [age..., name...] ... Print a logical plan and statistics if they are available. >>> df.explain("cost") == Optimized Logical Plan == ...Statistics... ...
def explain( self, extended: Optional[Union[bool, str]] = None, mode: Optional[str] = None ) -> None: """Prints the (logical and physical) plans to the console for debugging purposes. .. versionadded:: 1.3.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Parameters ---------- extended : bool, optional default ``False``. If ``False``, prints only the physical plan. When this is a string without specifying the ``mode``, it works as the mode is specified. mode : str, optional specifies the expected output format of plans. * ``simple``: Print only a physical plan. * ``extended``: Print both logical and physical plans. * ``codegen``: Print a physical plan and generated codes if they are available. * ``cost``: Print a logical plan and statistics if they are available. * ``formatted``: Split explain output into two sections: a physical plan outline \ and node details. .. versionchanged:: 3.0.0 Added optional argument `mode` to specify the expected output format of plans. Examples -------- >>> df = spark.createDataFrame( ... [(14, "Tom"), (23, "Alice"), (16, "Bob")], ["age", "name"]) Print out the physical plan only (default). >>> df.explain() # doctest: +SKIP == Physical Plan == *(1) Scan ExistingRDD[age...,name...] Print out all of the parsed, analyzed, optimized and physical plans. >>> df.explain(True) == Parsed Logical Plan == ... == Analyzed Logical Plan == ... == Optimized Logical Plan == ... == Physical Plan == ... Print out the plans with two sections: a physical plan outline and node details >>> df.explain(mode="formatted") # doctest: +SKIP == Physical Plan == * Scan ExistingRDD (...) (1) Scan ExistingRDD [codegen id : ...] Output [2]: [age..., name...] ... Print a logical plan and statistics if they are available. >>> df.explain("cost") == Optimized Logical Plan == ...Statistics... ... """ if extended is not None and mode is not None: raise PySparkValueError( error_class="CANNOT_SET_TOGETHER", message_parameters={"arg_list": "extended and mode"}, ) # For the no argument case: df.explain() is_no_argument = extended is None and mode is None # For the cases below: # explain(True) # explain(extended=False) is_extended_case = isinstance(extended, bool) and mode is None # For the case when extended is mode: # df.explain("formatted") is_extended_as_mode = isinstance(extended, str) and mode is None # For the mode specified: # df.explain(mode="formatted") is_mode_case = extended is None and isinstance(mode, str) if not (is_no_argument or is_extended_case or is_extended_as_mode or is_mode_case): if (extended is not None) and (not isinstance(extended, (bool, str))): raise PySparkTypeError( error_class="NOT_BOOL_OR_STR", message_parameters={ "arg_name": "extended", "arg_type": type(extended).__name__, }, ) if (mode is not None) and (not isinstance(mode, str)): raise PySparkTypeError( error_class="NOT_STR", message_parameters={"arg_name": "mode", "arg_type": type(mode).__name__}, ) # Sets an explain mode depending on a given argument if is_no_argument: explain_mode = "simple" elif is_extended_case: explain_mode = "extended" if extended else "simple" elif is_mode_case: explain_mode = cast(str, mode) elif is_extended_as_mode: explain_mode = cast(str, extended) assert self._sc._jvm is not None print(self._sc._jvm.PythonSQLUtils.explainString(self._jdf.queryExecution(), explain_mode))
(self, extended: Union[bool, str, NoneType] = None, mode: Optional[str] = None) -> NoneType
[ 0.06752662360668182, -0.034353066235780716, 0.1019534096121788, -0.02403240092098713, 0.07165489345788956, 0.003457882907241583, 0.0013488277327269316, -0.02451157569885254, -0.048027943819761276, -0.02832653559744358, -0.044931743294000626, 0.03873934596776962, -0.003319659736007452, 0.02384810335934162, -0.015637647360563278, -0.00478252163156867, -0.008698845282196999, -0.03726496547460556, 0.007708245422691107, 0.04865455627441406, 0.025359343737363815, 0.005349236540496349, 0.0012486160267144442, 0.049207448959350586, -0.0027114779222756624, 0.041614387184381485, 0.007422584109008312, -0.04688530042767525, -0.018125664442777634, 0.01801508665084839, -0.035753726959228516, -0.026501988992094994, -0.06288232654333115, 0.0030178725719451904, -0.05363059043884277, 0.013527440838515759, -0.0006473451503552496, 0.04146695137023926, 0.012209713459014893, -0.02077033556997776, -0.04640612378716469, 0.005206406116485596, -0.01673421822488308, -0.02213413640856743, -0.07375588268041611, 0.0034532754216343164, 0.029837774112820625, -0.03293397277593613, -0.03628819063305855, -0.03394760936498642, 0.05753769725561142, -0.008408576250076294, -0.029616618528962135, 0.02150752581655979, -0.04953918233513832, -0.05750083923339844, -0.0331919901072979, -0.013969754800200462, 0.06564678996801376, -0.058606624603271484, -0.00630297651514411, 0.02047545835375786, -0.05193505063652992, 0.043273065239191055, -0.0329892635345459, 0.011076283641159534, -0.04426827281713486, 0.02124950848519802, -0.023755954578518867, -0.011997771449387074, -0.008408576250076294, -0.004379370715469122, 0.0067913648672401905, 0.0016344889299944043, -0.06601538509130478, -0.044452570378780365, -0.05963869020342827, -0.028179096058011055, -0.03345000743865967, -0.0657573714852333, 0.021360086277127266, -0.017978226765990257, 0.022097276523709297, -0.045632075518369675, -0.012154423631727695, -0.003172221826389432, 0.025064468383789062, -0.023461079224944115, 0.015416490845382214, -0.015628432855010033, 0.00494378199800849, -0.018162524327635765, 0.0024235129822045565, 0.04242529720067978, -0.018337607383728027, -0.023774385452270508, -0.024806451052427292, -0.06284546852111816, 0.022594880312681198, -0.010965704917907715, -0.03896050527691841, 0.029284881427884102, 0.02008843421936035, -0.010956489481031895, 0.0006778694805689156, -0.008873927406966686, -0.06151852384209633, 0.0349796786904335, 0.021599674597382545, -0.0355878584086895, -0.051050424575805664, 0.04931802675127983, -0.04216727986931801, -0.0797639861702919, 0.028418684378266335, 0.08101720362901688, -0.005676364991813898, -0.03420562669634819, -0.04773306846618652, -0.0015262141823768616, 0.024124549701809883, -0.004411622881889343, 0.02290818654000759, -0.11352729797363281, 0.010311448015272617, -0.017287110909819603, -0.011619960889220238, -0.02596752531826496, 0.016688143834471703, -0.0006565600633621216, 0.04692215844988823, -0.008781778626143932, -0.01737004518508911, 0.07902679592370987, 0.007523947861045599, 0.026778435334563255, 0.037854719907045364, 0.04640612378716469, -0.06771092116832733, 0.05079240724444389, 0.0038656413089483976, -0.019461821764707565, -0.008063018321990967, 0.01851269043982029, -0.041172076016664505, -0.0033519119024276733, -0.00518797617405653, -0.0353851318359375, 0.040877196937799454, 0.032915543764829636, 0.0645778626203537, -0.04533720016479492, -0.02733132801949978, -0.015158474445343018, 0.013536655344069004, -0.010928845033049583, 0.014181696809828281, 0.00012936824350617826, 0.00451298663392663, -0.013232564553618431, 0.02714703045785427, -0.04718017578125, -0.022318433970212936, 0.028658270835876465, -0.052451085299253464, 0.010523390956223011, -0.022484302520751953, -0.008749526925384998, -0.007952439598739147, -0.0117950439453125, 0.06800580024719238, -0.01130665559321642, 0.009629547595977783, 0.04990777745842934, -0.02124950848519802, 0.10622911155223846, -0.00901675783097744, 0.04651670530438423, 0.0030731617007404566, -0.05573158338665962, -0.011804258450865746, 0.005409133154898882, -0.06059703603386879, -0.023239921778440475, 0.00842700619250536, -0.016909301280975342, 0.019682979211211205, -0.052451085299253464, 0.03656463697552681, 0.02071504481136799, -0.04028744623064995, -0.02265016920864582, 0.014089548029005527, 0.013518226332962513, -0.03792843967676163, -0.0509767048060894, -0.0062753320671617985, -0.03767042234539986, 0.026575708761811256, 0.009583473205566406, 0.00891539454460144, 0.05149273946881294, 0.06347207725048065, -0.01617211103439331, 0.04692215844988823, 0.027294468134641647, -0.02029116079211235, 0.02167339250445366, 0.016107607632875443, -0.014845168218016624, 0.035735297948122025, -0.053446292877197266, 0.022816037759184837, 0.019977856427431107, 0.03015108034014702, 0.09362316131591797, -0.00014549428306054324, 0.04054546356201172, -0.03888678550720215, -0.007639133837074041, 0.027276039123535156, -0.01795058324933052, -0.002490320708602667, 0.013269424438476562, 0.040434885770082474, -0.04500546306371689, 0.08544034510850906, -0.048470258712768555, -0.0014398247003555298, -0.04039802402257919, -0.019756698980927467, -0.07180233299732208, -0.027183890342712402, 0.016743432730436325, -0.0061970055103302, 0.05831174924969673, -0.0004299316497053951, 0.039771415293216705, 0.0046350834891200066, -0.050092075020074844, -0.0010908112162724137, 0.030095791444182396, 0.01649463176727295, -0.01627347432076931, -0.04725389555096626, -0.04345736280083656, -0.0020952329505234957, 0.02851083315908909, -0.014356779865920544, -0.05093984678387642, 0.012771820649504662, -0.06291918456554413, 0.01571136713027954, -0.02664942666888237, -0.02591223642230034, 0.006906550843268633, -0.027460336685180664, 0.0429781898856163, -0.011887192726135254, -0.026815295219421387, -0.05683736875653267, -0.049207448959350586, -0.051087282598018646, -0.010228514671325684, 0.05927009508013725, -0.00589752197265625, -0.030519675463438034, -0.03632504865527153, 0.027921080589294434, -0.0429781898856163, 0.014283061027526855, 0.0018233939772471786, -0.044231414794921875, 0.06332464516162872, -0.042351577430963516, 0.03090670146048069, -0.040877196937799454, -0.02335050143301487, -0.03663835674524307, -0.02331364154815674, 0.01685401238501072, -0.022981906309723854, -0.026280831545591354, 0.004093709401786327, 0.00897529162466526, -0.0033450007904320955, 0.0033703416120260954, -0.007399546913802624, 0.028197526931762695, -0.0045360238291323185, 0.020438598468899727, 0.06402496993541718, 0.0443788506090641, 0.0007498607155866921, 0.05503125116229057, 0.054588936269283295, 0.03297083452343941, -0.040434885770082474, -0.043309926986694336, 0.00005449736272566952, 0.0064043402671813965, -0.07110200077295303, 0.06490959972143173, 0.0129929780960083, 0.006786757614463568, -0.011868762783706188, -0.024622153490781784, -0.04224099963903427, 0.07445621490478516, -0.017323970794677734, -0.0069710551761090755, 0.0033242672216147184, 0.019240666180849075, 0.06741604954004288, -0.058864641934633255, -0.006021922919899225, -0.025119757279753685, -0.011647605337202549, 0.017406905069947243, 0.04592695087194443, -0.021618103608489037, 0.03980827331542969, 0.008408576250076294, 0.006399732548743486, -0.00826574582606554, -0.04010314866900444, 0.007344257552176714, -0.019867276772856712, 0.052451085299253464, -0.03490595892071724, 0.0016782596940174699, -0.006984877400100231, 0.05046067014336586, 0.02969033643603325, -0.08042745292186737, 0.00020330325060058385, 0.00701252231374383, -0.006127893924713135, -0.042830754071474075, 0.05385174602270126, 0.07143373787403107, 0.019664550200104713, 0.012624382972717285, 0.018263887614011765, 0.07405076175928116, 0.0022207857109606266, 0.046332407742738724, -0.008026158437132835, 0.02333207055926323, 0.01713045872747898, -0.01783078908920288, -0.06302976608276367, -0.03232579305768013, -0.03639876842498779, 0.03249166160821915, 0.004148998763412237, -0.015591573901474476, 0.05274596065282822, -0.02312934398651123, -0.02970876730978489, 0.007616096641868353, -0.05739026144146919, -0.009878349490463734, 0.033136703073978424, -0.005644112825393677, 0.004828596021980047, -0.011048638261854649, -0.0017634972464293242, 0.03564314916729927, -0.03604860231280327, -0.017720211297273636, -0.07180233299732208, 0.04014000669121742, -0.0006375543889589608, -0.013822317123413086, 0.031754471361637115, -0.033136703073978424, 0.0020744993817061186, 0.02570950984954834, 0.02406926080584526, 0.04861769452691078, -0.0026746182702481747, 0.0401768684387207, -0.0019005686044692993, -0.07464051246643066, 0.012182069011032581, -0.0745667964220047, 0.047991085797548294, -0.03472166135907173, -0.011758184060454369, -0.05591588094830513, 0.013545870780944824, -0.04810166358947754, -0.004628172609955072, -0.016909301280975342, 0.05591588094830513, -0.03556942939758301, 0.022521162405610085, -0.09568729251623154, -0.00917801819741726, -0.020125294104218483, -0.03394760936498642, -0.0024119943846017122, -0.01599702797830105, 0.005759298801422119, 0.004245755262672901, 0.06748976558446884, 0.03829703480005264, -0.0197935588657856, 0.01815330982208252, 0.047290753573179245, -0.042572736740112305, -0.07309241592884064, 0.08263902366161346, -0.05680050700902939, 0.009412998333573341, 0.05396232381463051, 0.045189760625362396, 0.035292983055114746, 0.035993315279483795, 0.06343521922826767, -0.008090662769973278, 0.013794672675430775, 0.04714331403374672, 0.04080348089337349, 0.011076283641159534, -0.014780663885176182, -0.0280869472771883, 0.03356058523058891, -0.008712667040526867, -0.0365830659866333, 0.02071504481136799, -0.013260209001600742, -0.006427377462387085, -0.006620889995247126, -0.019203806295990944, 0.030132651329040527, -0.016107607632875443, -0.017268681898713112, -0.0041812509298324585, 0.08374480903148651, -0.05211934819817543, 0.0056947944685816765, -0.011730539612472057, -0.05429406091570854, 0.01721339300274849, 0.02360851690173149, -0.027534054592251778, -0.042572736740112305, 0.006367480847984552, 0.09082183986902237, 0.019240666180849075, 0.004241147544234991, 0.05904893949627876, -0.03844447061419487, -0.06549935042858124, 0.030759261921048164, 0.03215992450714111, -0.029321741312742233, 0.03274967521429062, 0.026981161907315254, -0.004174339585006237, -0.07519340515136719, -0.0009295507916249335, 0.008998328819870949, 0.04906000941991806, 0.02029116079211235, 0.016688143834471703, -0.06273488700389862, -0.01404347363859415, 0.042535874992609024, -0.017720211297273636, -0.03448207303881645, -0.013066696934401989, 0.0639881119132042, 0.0669737309217453, -0.02405083179473877, -0.02336893044412136, 0.03866562992334366, 0.04143008962273598, -0.049170587211847305, -0.03144116327166557, 0.008984506130218506, -0.04684843868017197, 0.04286761209368706, -0.0433836467564106, -0.00967562198638916, -0.0012866273755207658, -0.009647977538406849, -0.04194612428545952, 0.03555100038647652, 0.05090298503637314, 0.05023951455950737, -0.01567450724542141, 0.006086426787078381, 0.017978226765990257, 0.005123472306877375, 0.024898599833250046, -0.001068925834260881, 0.04474744573235512, 0.03164388984441757, -0.04522662237286568, -0.020217442885041237, -0.005266302730888128, 0.0074548362754285336, -0.02663099765777588, 0.04275703430175781, 0.04106149449944496, -0.028602981939911842, 0.02427198924124241, 0.012753390707075596, 0.03746769577264786, 0.030298518016934395, 0.002633151365444064, -0.008721882477402687, 0.058385465294122696, 0.04555835574865341, 0.01723182201385498, 0.09288597106933594, -0.027202319353818893, -0.011702895164489746, -0.01298376265913248, -0.03064868412911892, -0.0024212091229856014, 0.000241890549659729, 0.00027903803857043386, 0.001497417688369751, -0.01936967298388481, 0.031256865710020065, 0.05786943435668945, 0.0003628358244895935, 0.01475301943719387, -0.021378517150878906, 0.0216918233782053, 0.020659755915403366, 0.05779571458697319, -0.028197526931762695, 0.04054546356201172, 0.021765541285276413, -0.005713224411010742, 0.0014202430611476302, -0.013435292057693005, -0.0351824052631855, -0.01938810385763645, -0.010108721442520618, -0.00977698527276516, 0.026317691430449486, 0.006473451852798462, 0.08042745292186737, -0.04172496870160103, -0.012163639068603516, -0.013638019561767578, 0.029874633997678757, 0.06056017801165581, 0.0044692158699035645, 0.04356794431805611, 0.040656041353940964, 0.013978970237076283, -0.04102463647723198, -0.007901757955551147, -0.007703638169914484, -0.03015108034014702, 0.02952446974813938, -0.03837075084447861, 0.09568729251623154, 0.017637277022004128, 0.050866127014160156, 0.0375782735645771, 0.023719096556305885, -0.05304083600640297, -0.012688887305557728, 0.022060418501496315, 0.03682265430688858, -0.03282339498400688, -0.05422034114599228, -0.02078876458108425, 0.027294468134641647, 0.08101720362901688, 0.01731475628912449, 0.016586780548095703, -0.0505712516605854, -0.0057454765774309635, -0.01805194653570652, 0.014531862922012806, -0.018208598718047142, 0.039292238652706146, 0.02615182287991047, -0.00518797617405653, 0.004658120684325695, -0.014587151817977428, -0.023884963244199753, -0.059601832181215286, 0.029911493882536888, -0.029782485216856003, 0.009712481871247292, 0.03193876892328262, -0.03789157792925835, -0.027699923142790794, 0.06443043053150177, 0.017517482861876488, -0.11352729797363281, 0.015729796141386032, 0.016605209559202194, -0.06649456173181534, -0.0036606101784855127, 0.050092075020074844, -0.00030293912277556956, 0.03991885110735893, -0.05440463870763779, 0.02550678141415119, -0.012292646802961826, 0.049428604543209076, -0.012716531753540039, -0.058348607271909714, 0.0077727497555315495, -0.033173561096191406, -0.0009635306778363883, 0.014928102493286133, 0.025396203622221947, -0.02661256678402424, -0.043752241879701614, 0.10379638522863388, -0.0063075837679207325, -0.004625868983566761, -0.05263538286089897, 0.07784728705883026, -0.031238436698913574, -0.05724282190203667, -0.01496496144682169, -0.0067913648672401905, 0.011269795708358288, -0.002658492187038064, 0.001117879874072969, 0.015093970112502575, -0.022945046424865723, -0.10608167201280594, -0.019295955076813698, 0.008546799421310425, 0.004130569286644459, 0.015066325664520264, -0.03376331180334091, 0.05665307119488716, 0.034039758145809174, -0.05164017528295517, 0.038333892822265625, 0.013462936505675316, -0.029174303635954857, -0.048470258712768555, 0.023000335320830345, -0.0030616431031376123, -0.007648348808288574, 0.014190912246704102, -0.02261331118643284, 0.03118314780294895, 0.039513397961854935, 0.070770263671875, -0.0555841438472271, 0.0240876916795969, 0.04574265331029892, 0.005266302730888128, -0.006081819534301758, -0.05451521649956703, 0.016780292615294456, -0.007182997185736895, -0.003927841782569885, 0.059601832181215286, -0.0021090551745146513, 0.008380931802093983, 0.04976034164428711, -0.002835878636687994, 0.0038449077401310205, 0.00021079032740090042, 0.06041273847222328, 0.014909672550857067, 0.0039693089202046394, 0.027202319353818893, -0.045152902603149414, -0.0069710551761090755, -0.023774385452270508, -0.09008464962244034, 0.04666414111852646, -0.01713045872747898, 0.055547285825014114, -0.04651670530438423, -0.019885707646608353, 0.011877977289259434, -0.014098763465881348, -0.002994835376739502, 0.004897707607597113, -0.0769626647233963, -0.08381853252649307, -0.03943967819213867, -0.016817152500152588, 0.0051649389788508415, 0.059822987765073776, -0.06343521922826767, -0.027736783027648926, -0.025893807411193848, 0.05875406041741371, -0.01026537362486124, 0.013896035961806774, 0.06107621267437935, 0.00619239779189229, -0.01236636657267809, 0.014412068761885166, 0.0627717524766922, -0.0030155687127262354, -0.006008100230246782, 0.0401768684387207, -0.05171389505267143, -0.007901757955551147, 0.09671936184167862, -0.002183926058933139, -0.02196826972067356, 0.0008195482078008354, -0.010578679852187634, 0.0005914799985475838, 0.013674878515303135, -0.0009116969886235893, -0.010302233509719372, 0.015490209683775902, -0.015278267674148083, 0.014670086093246937, 0.007044774014502764, -0.005363058764487505, 0.047769926488399506, -0.04272017255425453, 0.031496454030275345, 0.0489862896502018, -0.029653476551175117, -0.005621075630187988, 0.025525212287902832, 0.002400475786998868, -0.022115707397460938, 0.0008195482078008354, 0.013582729734480381, 0.00619239779189229, -0.030482815578579903, 0.03400290012359619, -0.0019132390152662992, 0.013389217667281628, 0.07644663006067276, -0.02567264996469021, -0.0005825530970469117, 0.011767399497330189, 0.005183368921279907, 0.011767399497330189, 0.02333207055926323, 0.040434885770082474, -0.01557314395904541, -0.01440285425633192, -0.0579800121486187, 0.01440285425633192, 0.03136744350194931, -0.011113142594695091, 0.008192026987671852, -0.00791558064520359, 0.01935124397277832, 0.004916137550026178, -0.07932166755199432, -0.027423476800322533, 0.029893064871430397, 0.012163639068603516, 0.029100583866238594, -0.016743432730436325, -0.018448185175657272, -0.0036329657305032015, 0.007537770085036755 ]
39,380
pyspark.sql.dataframe
fillna
Replace null values, alias for ``na.fill()``. :func:`DataFrame.fillna` and :func:`DataFrameNaFunctions.fill` are aliases of each other. .. versionadded:: 1.3.1 .. versionchanged:: 3.4.0 Supports Spark Connect. Parameters ---------- value : int, float, string, bool or dict Value to replace null values with. If the value is a dict, then `subset` is ignored and `value` must be a mapping from column name (string) to replacement value. The replacement value must be an int, float, boolean, or string. subset : str, tuple or list, optional optional list of column names to consider. Columns specified in subset that do not have matching data types are ignored. For example, if `value` is a string, and subset contains a non-string column, then the non-string column is simply ignored. Returns ------- :class:`DataFrame` DataFrame with replaced null values. Examples -------- >>> df = spark.createDataFrame([ ... (10, 80.5, "Alice", None), ... (5, None, "Bob", None), ... (None, None, "Tom", None), ... (None, None, None, True)], ... schema=["age", "height", "name", "bool"]) Fill all null values with 50 for numeric columns. >>> df.na.fill(50).show() +---+------+-----+----+ |age|height| name|bool| +---+------+-----+----+ | 10| 80.5|Alice|NULL| | 5| 50.0| Bob|NULL| | 50| 50.0| Tom|NULL| | 50| 50.0| NULL|true| +---+------+-----+----+ Fill all null values with ``False`` for boolean columns. >>> df.na.fill(False).show() +----+------+-----+-----+ | age|height| name| bool| +----+------+-----+-----+ | 10| 80.5|Alice|false| | 5| NULL| Bob|false| |NULL| NULL| Tom|false| |NULL| NULL| NULL| true| +----+------+-----+-----+ Fill all null values with to 50 and "unknown" for 'age' and 'name' column respectively. >>> df.na.fill({'age': 50, 'name': 'unknown'}).show() +---+------+-------+----+ |age|height| name|bool| +---+------+-------+----+ | 10| 80.5| Alice|NULL| | 5| NULL| Bob|NULL| | 50| NULL| Tom|NULL| | 50| NULL|unknown|true| +---+------+-------+----+
def fillna( self, value: Union["LiteralType", Dict[str, "LiteralType"]], subset: Optional[Union[str, Tuple[str, ...], List[str]]] = None, ) -> "DataFrame": """Replace null values, alias for ``na.fill()``. :func:`DataFrame.fillna` and :func:`DataFrameNaFunctions.fill` are aliases of each other. .. versionadded:: 1.3.1 .. versionchanged:: 3.4.0 Supports Spark Connect. Parameters ---------- value : int, float, string, bool or dict Value to replace null values with. If the value is a dict, then `subset` is ignored and `value` must be a mapping from column name (string) to replacement value. The replacement value must be an int, float, boolean, or string. subset : str, tuple or list, optional optional list of column names to consider. Columns specified in subset that do not have matching data types are ignored. For example, if `value` is a string, and subset contains a non-string column, then the non-string column is simply ignored. Returns ------- :class:`DataFrame` DataFrame with replaced null values. Examples -------- >>> df = spark.createDataFrame([ ... (10, 80.5, "Alice", None), ... (5, None, "Bob", None), ... (None, None, "Tom", None), ... (None, None, None, True)], ... schema=["age", "height", "name", "bool"]) Fill all null values with 50 for numeric columns. >>> df.na.fill(50).show() +---+------+-----+----+ |age|height| name|bool| +---+------+-----+----+ | 10| 80.5|Alice|NULL| | 5| 50.0| Bob|NULL| | 50| 50.0| Tom|NULL| | 50| 50.0| NULL|true| +---+------+-----+----+ Fill all null values with ``False`` for boolean columns. >>> df.na.fill(False).show() +----+------+-----+-----+ | age|height| name| bool| +----+------+-----+-----+ | 10| 80.5|Alice|false| | 5| NULL| Bob|false| |NULL| NULL| Tom|false| |NULL| NULL| NULL| true| +----+------+-----+-----+ Fill all null values with to 50 and "unknown" for 'age' and 'name' column respectively. >>> df.na.fill({'age': 50, 'name': 'unknown'}).show() +---+------+-------+----+ |age|height| name|bool| +---+------+-------+----+ | 10| 80.5| Alice|NULL| | 5| NULL| Bob|NULL| | 50| NULL| Tom|NULL| | 50| NULL|unknown|true| +---+------+-------+----+ """ if not isinstance(value, (float, int, str, bool, dict)): raise PySparkTypeError( error_class="NOT_BOOL_OR_DICT_OR_FLOAT_OR_INT_OR_STR", message_parameters={"arg_name": "value", "arg_type": type(value).__name__}, ) # Note that bool validates isinstance(int), but we don't want to # convert bools to floats if not isinstance(value, bool) and isinstance(value, int): value = float(value) if isinstance(value, dict): return DataFrame(self._jdf.na().fill(value), self.sparkSession) elif subset is None: return DataFrame(self._jdf.na().fill(value), self.sparkSession) else: if isinstance(subset, str): subset = [subset] elif not isinstance(subset, (list, tuple)): raise PySparkTypeError( error_class="NOT_LIST_OR_TUPLE", message_parameters={"arg_name": "subset", "arg_type": type(subset).__name__}, ) return DataFrame(self._jdf.na().fill(value, self._jseq(subset)), self.sparkSession)
(self, value: Union[ForwardRef('LiteralType'), Dict[str, ForwardRef('LiteralType')]], subset: Union[str, Tuple[str, ...], List[str], NoneType] = None) -> 'DataFrame'
[ 0.02346205897629261, -0.03946247696876526, 0.0780632421374321, -0.015246421098709106, -0.04437815025448799, -0.006639096420258284, -0.048530034720897675, 0.00024679346824996173, -0.020152302458882332, -0.02898484654724598, -0.014218241907656193, 0.019476640969514847, 0.026066778227686882, 0.036994848400354385, 0.017224440351128578, 0.0012362624984234571, 0.0037406119517982006, 0.08123590797185898, 0.07473389804363251, 0.05894891172647476, 0.012220637872815132, -0.01658794842660427, -0.016969844698905945, 0.08554446697235107, -0.010105527937412262, -0.020837754011154175, 0.03323465213179588, -0.006276785861700773, -0.05836138129234314, 0.07614397257566452, 0.0528777614235878, -0.06298328936100006, -0.02587093412876129, 0.003525184001773596, -0.01004677452147007, -0.06012397259473801, -0.0340963639318943, -0.021209856495261192, -0.034781817346811295, -0.020779000595211983, -0.018918488174676895, -0.04277223348617554, -0.041988857090473175, -0.05111517012119293, -0.018027398735284805, 0.007143393624573946, 0.03769988566637039, -0.017361531034111977, -0.0115156015381217, 0.014071359299123287, -0.003309756051748991, 0.07218793779611588, -0.01675441674888134, 0.03057117946445942, -0.06690015643835068, 0.08750290423631668, -0.06360998749732971, 0.04351643845438957, 0.029024014249444008, 0.0025606544222682714, -0.014022398740053177, -0.0028397315181791782, -0.07536060363054276, 0.02234574966132641, -0.005772488657385111, 0.029709467664361, 0.0011334446026012301, -0.03202041983604431, -0.03023824468255043, -0.029004430398344994, -0.02432376891374588, 0.011035784147679806, 0.018389709293842316, 0.047041621059179306, -0.003858118085190654, 0.018546385690569878, -0.04868670925498009, 0.03787614405155182, -0.0379936508834362, -0.026282206177711487, 0.051702700555324554, 0.0329800546169281, -0.029866142198443413, -0.02763352543115616, 0.030492842197418213, 0.04159717261791229, -0.030061986297369003, 0.10403209924697876, 0.04402563348412514, -0.007481223903596401, 0.001996380276978016, -0.04038294032216072, 0.04817751422524452, -0.003221626626327634, 0.007256003562361002, 0.02336413599550724, 0.05099766328930855, -0.027653111144900322, -0.025831764563918114, -0.02735934406518936, -0.025126729160547256, -0.07888578623533249, -0.025949271395802498, 0.058243874460458755, -0.01629418320953846, -0.04273306578397751, 0.020113132894039154, 0.017860932275652885, 0.012886506505310535, -0.06893692910671234, -0.03672066703438759, -0.03644648566842079, 0.02792729064822197, -0.038679104298353195, -0.046023234724998474, 0.0009730976889841259, -0.06987698376178741, 0.008421272970736027, -0.0425763875246048, 0.008455545641481876, 0.009606126695871353, 0.04335976392030716, 0.01785114035010338, -0.049626756459474564, 0.08570113778114319, 0.025596752762794495, 0.01758675090968609, 0.017332155257463455, 0.021405700594186783, 0.05225105956196785, 0.032803796231746674, 0.018448462709784508, 0.0023733791895210743, 0.05644211173057556, -0.016568364575505257, -0.0019694517832249403, -0.02495046891272068, -0.005620710086077452, 0.022717852145433426, -0.0026291997637599707, -0.002290145494043827, -0.059066418558359146, 0.03873785585165024, -0.03711235523223877, 0.04339893162250519, -0.0022473048884421587, 0.06646930426359177, -0.024735040962696075, -0.0460624061524868, 0.0004452380817383528, 0.02111193537712097, 0.017606336623430252, -0.03384176641702652, -0.00006525568460347131, 0.021131519228219986, -0.022247828543186188, 0.05503204092383385, -0.03268628939986229, 0.025851350277662277, -0.0011695532593876123, -0.011770198121666908, -0.009052868001163006, -0.010330747812986374, 0.03178540989756584, -0.025988439098000526, 0.05095849186182022, -0.001380697125568986, -0.019985834136605263, 0.03378301486372948, 0.0013868171954527497, 0.039971668273210526, -0.010653889738023281, 0.03570228070020676, 0.0025728947948664427, 0.028926093131303787, 0.08123590797185898, -0.020406898111104965, -0.037092771381139755, 0.00015239077038131654, 0.0144728384912014, -0.03307797759771347, -0.017234232276678085, -0.014237826690077782, 0.034350961446762085, -0.006717434152960777, -0.014316163957118988, 0.0001670790370553732, -0.053191110491752625, 0.0006683161482214928, 0.0566379576921463, 0.018321163952350616, -0.005023387260735035, 0.007750508841127157, 0.06329663842916489, -0.004619460087269545, -0.06004563346505165, 0.06643013656139374, -0.026282206177711487, -0.027476850897073746, 0.029435286298394203, 0.03489932045340538, -0.007231523282825947, 0.07489057630300522, -0.011584145948290825, -0.02234574966132641, -0.018977241590619087, -0.029924895614385605, 0.011760405264794827, 0.008078547194600105, -0.06172988936305046, 0.0009498412255197763, -0.01369925681501627, -0.06294412165880203, 0.003253451082855463, 0.0011591491056606174, -0.013758010230958462, 0.00180543283931911, -0.019838951528072357, 0.015030993148684502, 0.03399844095110893, 0.029337365180253983, -0.025361740961670876, -0.012054170481860638, 0.03989333286881447, 0.044534824788570404, 0.014159489423036575, 0.01001250185072422, -0.007843534462153912, 0.016274599358439445, -0.02773144841194153, -0.026086362078785896, -0.05268191546201706, 0.009757905267179012, -0.047472476959228516, -0.016705455258488655, 0.020974844694137573, 0.09251649677753448, -0.032999638468027115, -0.011290380731225014, -0.03685775771737099, -0.011848535388708115, -0.05111517012119293, -0.0011585369938984513, 0.0106440968811512, 0.0031604254618287086, 0.012338143773376942, -0.03640731796622276, 0.06768353283405304, 0.0038067090790718794, -0.0331171452999115, -0.018164489418268204, 0.012573156505823135, 0.029729051515460014, 0.026086362078785896, 0.008328246884047985, -0.008768895640969276, 0.009439659304916859, 0.029024014249444008, 0.013826555572450161, 0.0041788117960095406, 0.004935257602483034, -0.1032487228512764, -0.04292890802025795, 0.05546289682388306, -0.03209875896573067, -0.016401898115873337, -0.037954483181238174, 0.00024694649619050324, 0.029141521081328392, -0.009591437876224518, 0.016078755259513855, 0.0475899837911129, 0.047237467020750046, 0.006624408531934023, 0.026987241581082344, 0.03268628939986229, 0.016734831035137177, -0.017136311158537865, 0.013904892839491367, -0.07050368189811707, 0.008641596883535385, -0.012720039114356041, 0.00044340206659398973, 0.008318454958498478, -0.012103131972253323, -0.03331298753619194, -0.022463256493210793, -0.011231628246605396, -0.01784134842455387, -0.03525184094905853, -0.009038180112838745, 0.06545091420412064, 0.00809813104569912, 0.038267832249403, -0.025440078228712082, 0.029356949031352997, -0.026517217978835106, -0.03390051797032356, -0.013062764890491962, -0.03644648566842079, -0.0006732122274115682, -0.03493849188089371, 0.06529424339532852, 0.04504401981830597, 0.024265017360448837, -0.0699944868683815, -0.060985684394836426, 0.007446951232850552, 0.01001250185072422, 0.06607761979103088, 0.021934477612376213, -0.015941666439175606, -0.03264712169766426, -0.05961477756500244, 0.03380259871482849, -0.043673112988471985, -0.01473722793161869, 0.020641911774873734, 0.010252410545945168, -0.013434868305921555, -0.007588937878608704, -0.009297672659158707, -0.006364915519952774, 0.03536934778094292, -0.05984979122877121, 0.024147510528564453, 0.05330861732363701, 0.030649516731500626, -0.03846367448568344, 0.01764550432562828, 0.03188333287835121, 0.02726142294704914, 0.018125321716070175, -0.016764208674430847, -0.059340596199035645, 0.00933684129267931, -0.04116631671786308, -0.062278252094984055, 0.006320850923657417, 0.04488734155893326, -0.01295505091547966, 0.008347831666469574, 0.009831346571445465, -0.009527789428830147, 0.0500967800617218, 0.02273743785917759, 0.0491175651550293, -0.04206719622015953, 0.03096286579966545, 0.03615272045135498, -0.012152092531323433, 0.025733843445777893, 0.010732227005064487, -0.01252419501543045, 0.031902916729450226, -0.019780199974775314, 0.010673473589122295, 0.031452476978302, -0.011417679488658905, -0.03628981113433838, 0.036466069519519806, -0.059497274458408356, 0.008646492846310139, -0.0115156015381217, 0.05855722352862358, 0.009140998125076294, 0.00910182949155569, 0.028240641579031944, -0.06979864090681076, -0.01893807202577591, 0.03341091051697731, -0.05620710179209709, -0.016137508675456047, -0.055737078189849854, -0.020406898111104965, 0.007711340207606554, -0.014844941906630993, -0.02491130121052265, -0.03779780492186546, 0.004389343783259392, 0.04504401981830597, -0.05710798129439354, -0.009459244087338448, -0.0004293257952667773, -0.0318637453019619, -0.04379061982035637, -0.021640712395310402, 0.002355018863454461, -0.04715912789106369, -0.03756279498338699, -0.009762801229953766, 0.029317781329154968, 0.05597208812832832, -0.03568269684910774, -0.027946876361966133, 0.012289183214306831, 0.008837440051138401, 0.0044187200255692005, 0.029964063316583633, -0.0435556061565876, -0.007848430424928665, -0.06560759246349335, 0.06427585333585739, 0.018017606809735298, 0.028828172013163567, 0.019819367676973343, 0.06047648936510086, -0.09188979864120483, 0.007726028095930815, -0.0050576599314808846, 0.07175707817077637, -0.03346966207027435, -0.01267107855528593, 0.05217272415757179, -0.010693058371543884, 0.049979276955127716, 0.013562166132032871, -0.0219148937612772, 0.017929477617144585, 0.03480140119791031, 0.010614721104502678, -0.029161104932427406, -0.047041621059179306, 0.08679786324501038, -0.01820365898311138, -0.06114235892891884, 0.05777385085821152, -0.038914114236831665, 0.006604823749512434, 0.02451961301267147, -0.016744624823331833, -0.03205959126353264, -0.03556519001722336, 0.038816191256046295, 0.003444398520514369, 0.032999638468027115, -0.005459139123558998, -0.033626340329647064, -0.002810355043038726, -0.007402886636555195, 0.001766264089383185, -0.021699465811252594, 0.024362938478589058, -0.03495807573199272, -0.051898542791604996, -0.010036982595920563, 0.010183865204453468, 0.013924476690590382, -0.10536383092403412, 0.003086984157562256, 0.03560435771942139, 0.013004012405872345, 0.00963550340384245, 0.07073869556188583, -0.05644211173057556, 0.025107143446803093, -0.06176905706524849, 0.03176582604646683, 0.011349134147167206, -0.002099198056384921, 0.0037650924641638994, 0.014825357124209404, -0.019780199974775314, 0.04676743969321251, -0.018301580101251602, 0.09956686198711395, -0.011114121414721012, -0.027868539094924927, -0.020308976992964745, 0.003079639980569482, -0.01626480743288994, -0.04900005832314491, 0.00778967747464776, -0.040696289390325546, 0.02158196084201336, 0.014756811782717705, -0.042419712990522385, -0.008421272970736027, -0.02075941674411297, 0.002000052249059081, -0.09933185577392578, 0.030179491266608238, 0.036231059581041336, -0.011584145948290825, 0.027183085680007935, -0.03961915150284767, 0.014384709298610687, 0.006213136948645115, -0.026223452761769295, 0.02649763412773609, -0.006296370178461075, -0.0013011356350034475, -0.00009830428462009877, -0.02307037077844143, -0.03850284218788147, 0.030316581949591637, 0.004134747199714184, 0.036505237221717834, 0.008646492846310139, -0.010575552470982075, -0.0008659957093186677, 0.007481223903596401, -0.0647067129611969, 0.05855722352862358, 0.016245223581790924, -0.07022950053215027, 0.00212367856875062, 0.019878121092915535, -0.04880421608686447, -0.015040785074234009, -0.022619931027293205, 0.016676079481840134, 0.004673317074775696, -0.02888692542910576, 0.0067712911404669285, 0.039207879453897476, 0.026360543444752693, -0.012210845947265625, -0.0038703582249581814, -0.04191052168607712, -0.012886506505310535, 0.03654440864920616, 0.04798167198896408, 0.026908904314041138, -0.06047648936510086, 0.023540396243333817, 0.08288099616765976, 0.002424787962809205, -0.009777490049600601, -0.010575552470982075, -0.022247828543186188, 0.007226627320051193, 0.005405282136052847, 0.010262202471494675, 0.017763011157512665, -0.009708944708108902, 0.029435286298394203, 0.014913487248122692, -0.01143726333975792, 0.008480026386678219, -0.02167988196015358, 0.08248930424451828, -0.035408515483140945, -0.025890517979860306, 0.03442929685115814, -0.04778582975268364, -0.0009180166525766253, 0.03611355274915695, 0.08444774150848389, 0.0329800546169281, -0.04488734155893326, -0.03519308567047119, 0.06028064712882042, 0.07700568437576294, -0.05734299495816231, -0.046454090625047684, 0.017567167058587074, 0.0340963639318943, 0.005625606048852205, -0.020269807428121567, -0.019554980099201202, -0.014081152155995369, 0.05115433782339096, -0.05370030179619789, -0.014560968615114689, 0.01896744780242443, 0.022130321711301804, 0.012220637872815132, 0.03182457759976387, 0.01108474563807249, -0.015843743458390236, 0.02197364717721939, -0.0015263557434082031, -0.03615272045135498, 0.01632356084883213, -0.02888692542910576, -0.05542372539639473, -0.01764550432562828, -0.08742456138134003, -0.0014578105183318257, -0.0498226024210453, 0.0329800546169281, 0.02812313474714756, -0.038522426038980484, 0.0025116936303675175, 0.02124902606010437, -0.043868955224752426, 0.06231741979718208, -0.0032950679305940866, 0.014600137248635292, 0.0020049484446644783, -0.03262753784656525, 0.013376114889979362, 0.002304833848029375, -0.0035741450265049934, 0.024676287546753883, -0.06274827569723129, -0.06004563346505165, 0.06380583345890045, -0.031844161450862885, -0.03368509188294411, 0.003987864591181278, -0.07786739617586136, -0.018448462709784508, -0.024147510528564453, 0.02577301301062107, 0.01701880432665348, 0.03303880989551544, 0.023207461461424828, -0.05624626949429512, 0.03707318380475044, 0.04042211174964905, 0.031844161450862885, -0.0006181312492117286, 0.014100736007094383, -0.020348144695162773, -0.029454870149493217, -0.029435286298394203, -0.0049572899006307125, -0.05056680738925934, -0.02571425959467888, -0.03307797759771347, -0.003801813116297126, 0.003228970570489764, 0.02600802481174469, 0.004563154652714729, -0.009503308683633804, 0.043633945286273956, -0.06968113780021667, -0.004866712260991335, 0.04880421608686447, 0.00996354129165411, -0.037719469517469406, 0.019486434757709503, 0.003990312572568655, -0.029396118596196175, -0.0028372835367918015, -0.04715912789106369, 0.015030993148684502, 0.07359801232814789, 0.0016120373038575053, 0.01004677452147007, 0.1014469638466835, 0.022149905562400818, 0.008661181665956974, -0.069015271961689, -0.03168748691678047, -0.03914912790060043, -0.018262412399053574, 0.002319522202014923, -0.0304732583463192, 0.01206396333873272, -0.0013439763570204377, -0.005899786949157715, 0.03773905336856842, 0.09604167938232422, -0.02649763412773609, -0.022228242829442024, 0.04292890802025795, 0.0049866666086018085, -0.04484817385673523, 0.007001406978815794, -0.007050368003547192, 0.03687734156847, 0.0044480967335402966, 0.019525602459907532, -0.052368566393852234, -0.04222387075424194, 0.07316715270280838, 0.0674876868724823, -0.07163957506418228, 0.03566311299800873, -0.003982968162745237, 0.05307360365986824, 0.018595345318317413, -0.06180822476744652, -0.032705873250961304, -0.03192250058054924, -0.038052402436733246, 0.029121937230229378, 0.0516243614256382, -0.03374384343624115, -0.04292890802025795, 0.02677181363105774, 0.003390541533008218, -0.00798062514513731, -0.009331945329904556, -0.06263077259063721, 0.036799006164073944, -0.003938903566449881, 0.04774665832519531, -0.06313996016979218, -0.00013295940880198032, 0.029631130397319794, -0.021621128544211388, -0.05409198999404907, -0.05056680738925934, 0.036563992500305176, -0.0005186794442124665, 0.03323465213179588, -0.010585344396531582, 0.030081570148468018, -0.04128382354974747, 0.03290171921253204, 0.05800886079668999, 0.010624513030052185, -0.036661915481090546, 0.05252524092793465, -0.0009988021338358521, -0.013895099982619286, -0.009787281975150108, 0.07908162474632263, -0.07101287692785263, 0.017234232276678085, -0.030727853998541832, 0.03133497014641762, -0.0367402508854866, -0.02072024904191494, -0.007373509928584099, 0.018027398735284805, 0.043046414852142334, -0.03936455398797989, -0.038718272000551224, 0.008695454336702824, 0.01718527264893055, 0.05131101235747337, -0.0889129713177681, -0.0006322074914351106, -0.004572947043925524, 0.023912498727440834, 0.07301047444343567, 0.08397771418094635, 0.06474588066339493, -0.029141521081328392, 0.012485026381909847, -0.07410719990730286, 0.00587530666962266, 0.030786607414484024, -0.03482098504900932, -0.007779885083436966, -0.014120320789515972, -0.04782499745488167, 0.018448462709784508, 0.006198448594659567, 0.05209438502788544, 0.024872131645679474, -0.0008702797931618989, -0.009782386012375355, -0.006281682290136814, 0.059418935328722, -0.02696765772998333, -0.005023387260735035, -0.02048523537814617, 0.027104748412966728, 0.0566379576921463, -0.014884110540151596, -0.0017723841592669487, 0.07669233530759811, 0.030982451513409615, -0.005072348285466433, -0.0500967800617218, 0.03346966207027435, 0.005160477943718433, 0.01016428042203188, -0.009410282596945763, 0.031237047165632248, 0.02571425959467888, 0.031080372631549835 ]
39,381
pyspark.sql.dataframe
filter
Filters rows using the given condition. :func:`where` is an alias for :func:`filter`. .. versionadded:: 1.3.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Parameters ---------- condition : :class:`Column` or str a :class:`Column` of :class:`types.BooleanType` or a string of SQL expressions. Returns ------- :class:`DataFrame` Filtered DataFrame. Examples -------- >>> df = spark.createDataFrame([ ... (2, "Alice"), (5, "Bob")], schema=["age", "name"]) Filter by :class:`Column` instances. >>> df.filter(df.age > 3).show() +---+----+ |age|name| +---+----+ | 5| Bob| +---+----+ >>> df.where(df.age == 2).show() +---+-----+ |age| name| +---+-----+ | 2|Alice| +---+-----+ Filter by SQL expression in a string. >>> df.filter("age > 3").show() +---+----+ |age|name| +---+----+ | 5| Bob| +---+----+ >>> df.where("age = 2").show() +---+-----+ |age| name| +---+-----+ | 2|Alice| +---+-----+
def filter(self, condition: "ColumnOrName") -> "DataFrame": """Filters rows using the given condition. :func:`where` is an alias for :func:`filter`. .. versionadded:: 1.3.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Parameters ---------- condition : :class:`Column` or str a :class:`Column` of :class:`types.BooleanType` or a string of SQL expressions. Returns ------- :class:`DataFrame` Filtered DataFrame. Examples -------- >>> df = spark.createDataFrame([ ... (2, "Alice"), (5, "Bob")], schema=["age", "name"]) Filter by :class:`Column` instances. >>> df.filter(df.age > 3).show() +---+----+ |age|name| +---+----+ | 5| Bob| +---+----+ >>> df.where(df.age == 2).show() +---+-----+ |age| name| +---+-----+ | 2|Alice| +---+-----+ Filter by SQL expression in a string. >>> df.filter("age > 3").show() +---+----+ |age|name| +---+----+ | 5| Bob| +---+----+ >>> df.where("age = 2").show() +---+-----+ |age| name| +---+-----+ | 2|Alice| +---+-----+ """ if isinstance(condition, str): jdf = self._jdf.filter(condition) elif isinstance(condition, Column): jdf = self._jdf.filter(condition._jc) else: raise PySparkTypeError( error_class="NOT_COLUMN_OR_STR", message_parameters={"arg_name": "condition", "arg_type": type(condition).__name__}, ) return DataFrame(jdf, self.sparkSession)
(self, condition: 'ColumnOrName') -> 'DataFrame'
[ 0.056118763983249664, -0.03943578898906708, 0.08047081530094147, 0.014983782544732094, 0.01076760608702898, -0.02397041767835617, -0.042888689786195755, 0.09326472878456116, -0.008232448250055313, -0.026769084855914116, -0.0007291986257769167, -0.034201912581920624, 0.002439748728647828, 0.009586349129676819, -0.037127796560525894, 0.040562525391578674, 0.01788240298628807, 0.01124010793864727, 0.03056727908551693, 0.044996779412031174, -0.011667178012430668, -0.04888583719730377, 0.030749011784791946, 0.0753096342086792, 0.002546516014263034, 0.010976597666740417, -0.044596970081329346, 0.018027788028120995, 0.020281262695789337, -0.010113371536135674, -0.0011210576631128788, -0.012303238734602928, -0.005029425956308842, -0.03841809183359146, -0.054737601429224014, 0.05182989314198494, 0.023334356024861336, -0.031366899609565735, 0.03776385635137558, 0.005797242745757103, -0.049576420336961746, 0.000017339054465992376, 0.018627503886818886, -0.012803001329302788, -0.04136214405298233, -0.0010063395602628589, -0.0038527129217982292, -0.08563199639320374, 0.009422791190445423, 0.03289344534277916, 0.006197052542120218, 0.035583075135946274, 0.0054792119190096855, 0.018809234723448753, -0.03005843050777912, -0.053247399628162384, -0.02148069255053997, -0.0016719320556148887, 0.044596970081329346, 0.01184890978038311, 0.040780603885650635, -0.027132548391819, -0.003546040738001466, 0.023225316777825356, -0.01578340120613575, 0.06956691294908524, 0.029495062306523323, 0.04666871204972267, -0.07291077822446823, -0.02115357480943203, -0.041725609451532364, -0.007160230539739132, 0.004518305417150259, 0.06876729428768158, -0.07265634834766388, -0.004915843717753887, -0.036909718066453934, 0.01632859744131565, -0.01115832943469286, -0.05942628160119057, 0.12037910521030426, -0.009395531378686428, -0.04048983380198479, 0.010067938826978207, -0.002196682384237647, 0.030094776302576065, -0.021844156086444855, 0.02891352027654648, -0.005229331087321043, -0.007650906220078468, -0.049140263348817825, 0.01383887231349945, -0.00877764355391264, 0.005174811463803053, 0.07494617253541946, 0.007355592213571072, 0.011258281767368317, -0.0038390830159187317, 0.06545977294445038, 0.049758151173591614, 0.013629880733788013, 0.0166193675249815, 0.0476137176156044, 0.01502921525388956, 0.024006763473153114, -0.03422008827328682, -0.039835598319768906, -0.024133974686264992, -0.0012187385000288486, -0.04735929146409035, 0.0021444344893097878, 0.08883047848939896, -0.05266585946083069, -0.04528754949569702, 0.00957726314663887, 0.04158022254705429, 0.009559089317917824, -0.05084853991866112, -0.057608962059020996, -0.0017821069341152906, -0.0032461832743138075, 0.0058472189120948315, 0.04932199418544769, -0.057608962059020996, 0.010431402362883091, 0.022189445793628693, -0.03849078342318535, -0.06662286072969437, 0.005933541338890791, 0.01390247792005539, 0.01362079381942749, -0.030530933290719986, 0.024497438222169876, 0.009922552853822708, 0.006237942259758711, 0.0185457244515419, 0.013884305022656918, 0.0720021203160286, -0.006060753483325243, 0.06495092809200287, -0.017064610496163368, -0.007619103416800499, -0.02258925512433052, -0.0005832453025504947, -0.021117229014635086, -0.07069364935159683, 0.0337839312851429, -0.01877288892865181, -0.019427122548222542, 0.005915368441492319, -0.05477394908666611, 0.021353479474782944, 0.011203762143850327, -0.011621745303273201, 0.0072647263295948505, 0.003484706161543727, 0.02540609799325466, -0.01982693374156952, 0.0459417849779129, -0.0047568283043801785, 0.0012698505306616426, 0.004974906332790852, -0.05070315673947334, 0.036073751747608185, -0.04645063355565071, 0.029858525842428207, -0.008727666921913624, 0.018809234723448753, -0.011885255575180054, -0.016192298382520676, 0.07222019135951996, 0.025060808286070824, 0.03698240965604782, 0.017873317003250122, -0.05935358628630638, 0.08003465831279755, 0.05182989314198494, 0.012312325648963451, 0.043942734599113464, -0.0659322738647461, 0.03460172563791275, -0.028368325904011726, -0.04528754949569702, 0.06433303654193878, 0.05215701088309288, -0.05437413603067398, -0.03205747902393341, -0.013248244300484657, 0.038454435765743256, 0.01412055641412735, -0.03300248458981514, -0.022171271964907646, 0.03725500777363777, 0.030639972537755966, -0.040053676813840866, -0.034965187311172485, 0.04063521698117256, -0.005302023608237505, -0.05840858072042465, 0.017764277756214142, 0.03914501890540123, 0.02402493730187416, 0.04601447656750679, -0.006842200178653002, -0.01949981600046158, -0.005361086223274469, 0.012739394791424274, 0.04270695894956589, -0.03327508270740509, -0.07229288667440414, -0.01566527597606182, -0.044051773846149445, 0.024551957845687866, -0.026896297931671143, 0.03783654794096947, 0.054955679923295975, -0.033420465886592865, -0.02048116736114025, 0.03418374061584473, -0.02104453556239605, 0.004613714758306742, 0.03260267525911331, -0.026096677407622337, 0.018282214179635048, 0.016146864742040634, -0.06233398616313934, 0.01390247792005539, -0.045541975647211075, 0.04125310480594635, -0.05299297720193863, 0.024788210168480873, -0.011494533158838749, 0.08061619848012924, -0.07051191478967667, -0.045105818659067154, -0.005738179665058851, -0.0014811137225478888, 0.03423826023936272, 0.009104760363698006, -0.05608241632580757, -0.0039731101132929325, -0.013084685429930687, 0.03460172563791275, 0.005892651621252298, 0.018627503886818886, -0.034583549946546555, 0.0034029269590973854, 0.0415438748896122, 0.011621745303273201, -0.05677299574017525, -0.05197528004646301, -0.02856823056936264, 0.006124359555542469, 0.00029815363814122975, 0.0226982943713665, 0.010358708910644054, 0.026260236278176308, -0.00027884464361704886, -0.03400200977921486, 0.055791646242141724, -0.026387449353933334, -0.04187099263072014, -0.023188970983028412, -0.016410376876592636, -0.0185457244515419, -0.06073474884033203, -0.03665529191493988, 0.026096677407622337, 0.039835598319768906, 0.03743673861026764, 0.05215701088309288, 0.023243490606546402, 0.007160230539739132, -0.004141211975365877, 0.02209858037531376, -0.036964237689971924, -0.056954726576805115, -0.005533731542527676, -0.03354768082499504, -0.058444928377866745, -0.0038345397915691137, -0.006228855345398188, -0.011040203273296356, 0.028695441782474518, -0.02729610726237297, -0.03641904145479202, -0.015519890934228897, -0.025624176487326622, 0.001256220624782145, -0.016901051625609398, -0.025060808286070824, -0.013847959227859974, -0.02884082682430744, 0.015319986268877983, -0.05597337707877159, 0.020353956148028374, -0.013220984488725662, -0.06873094290494919, 0.01600147970020771, -0.05059411749243736, 0.02913159877061844, -0.025315232574939728, 0.04237984120845795, 0.06320630013942719, -0.022243965417146683, -0.0013788895448669791, -0.02342522144317627, -0.019281737506389618, -0.031312379986047745, -0.002412488916888833, 0.03698240965604782, -0.051684506237506866, -0.007737229112535715, -0.048486027866601944, -0.01582883484661579, 0.005933541338890791, -0.0282411128282547, -0.001895689289085567, -0.02148069255053997, 0.04357927292585373, 0.030658144503831863, -0.019517989829182625, -0.008305140770971775, 0.008396006189286709, -0.018254954367876053, 0.02264377474784851, 0.025569656863808632, -0.010013419203460217, -0.0027532358653843403, 0.03921771049499512, 0.028477363288402557, 0.10598595440387726, 0.06989403069019318, -0.01733720861375332, 0.007391938474029303, -0.021971367299556732, 0.0014515822986140847, 0.03525595739483833, 0.0041525703854858875, 0.017755191773176193, 0.03979925066232681, -0.03505605459213257, 0.07894426584243774, -0.010485921986401081, -0.013111945241689682, -0.0078053781762719154, -0.0045682815834879875, -0.024933595210313797, 0.03998098522424698, 0.023825030773878098, 0.04655967280268669, 0.03303883224725723, -0.036618947982788086, 0.0028395585250109434, -0.00646510673686862, -0.03372941166162491, -0.04118041321635246, 0.08439622074365616, -0.04623255506157875, -0.016301337629556656, 0.09064779430627823, 0.0007178403902798891, 0.002887262962758541, -0.03870886191725731, 0.0199359729886055, 0.051248352974653244, 0.025042634457349777, 0.007296529598534107, -0.05691838264465332, -0.03193026781082153, 0.0023965872824192047, -0.04270695894956589, 0.05026699975132942, -0.012285065837204456, 0.024243013933300972, -0.015265466645359993, -0.019972318783402443, 0.0026782716158777475, 0.02258925512433052, 0.04336119443178177, 0.03449268639087677, -0.024551957845687866, -0.01389339193701744, -0.05164816230535507, -0.007155687548220158, -0.014593059197068214, -0.09101125597953796, -0.026841778308153152, -0.018082307651638985, -0.047759100794792175, -0.05840858072042465, -0.019445296376943588, -0.0034051984548568726, -0.008977548219263554, -0.030440067872405052, 0.009295579046010971, -0.04710486903786659, 0.027314281091094017, -0.025733215734362602, -0.042779650539159775, -0.05012161657214165, -0.013475408777594566, -0.005924454890191555, -0.04048983380198479, 0.006751334294676781, 0.009586349129676819, 0.04557831957936287, -0.00957726314663887, -0.026441968977451324, -0.023570606485009193, 0.07596386969089508, -0.008182471618056297, -0.10613133758306503, 0.05906281620264053, 0.020553860813379288, 0.05132104456424713, 0.08265160024166107, -0.026114851236343384, 0.02342522144317627, 0.024043109267950058, -0.02142617292702198, -0.005333826877176762, 0.03140324354171753, 0.02929515764117241, -0.0085822818800807, 0.041216760873794556, 0.00003918590664397925, 0.004391093272715807, -0.015047388151288033, 0.03316604346036911, -0.06825844198465347, -0.025369752198457718, -0.08868508785963058, 0.017955096438527107, -0.01520186010748148, 0.04852237552404404, 0.04038079455494881, -0.07229288667440414, 0.0012323684059083462, 0.03005843050777912, 0.044706009328365326, -0.020572032779455185, -0.005610967520624399, -0.0009069549851119518, -0.10140631347894669, -0.007737229112535715, -0.0006826298777014017, 0.024079455062747, -0.05015796050429344, -0.03260267525911331, 0.09370088577270508, 0.026114851236343384, 0.044269852340221405, 0.019590681418776512, -0.03714596852660179, 0.024333881214261055, -0.03910867124795914, -0.01486565638333559, -0.004450155887752771, 0.018173174932599068, -0.005015796050429344, 0.049685459583997726, -0.021280787885189056, -0.05691838264465332, -0.018173174932599068, 0.017927836626768112, -0.03418374061584473, -0.0814158245921135, 0.017818797379732132, 0.030912568792700768, 0.025006288662552834, -0.00866860430687666, -0.06527804583311081, 0.007809921633452177, 0.08003465831279755, 0.05746357887983322, -0.09253780543804169, -0.02069924585521221, 0.010840298607945442, 0.05619145557284355, -0.07945311814546585, 0.03621913492679596, -0.03914501890540123, -0.007923504337668419, 0.053356438875198364, -0.06135263666510582, 0.008123409003019333, -0.011076549999415874, 0.05281124636530876, -0.010067938826978207, 0.0002561281726229936, 0.05408336594700813, 0.04525120556354523, -0.024660997092723846, 0.015101907774806023, 0.01655576191842556, -0.038854245096445084, 0.06142532825469971, -0.015183687210083008, 0.014411327429115772, -0.04103502631187439, 0.031148821115493774, -0.058444928377866745, 0.018336733803153038, -0.028604576364159584, -0.07567309588193893, 0.07850811630487442, -0.019590681418776512, -0.007873527705669403, -0.01971789449453354, 0.0017150932690128684, 0.012639442458748817, -0.011194675229489803, -0.015110994689166546, 0.00728289969265461, -0.005792699288576841, 0.0035982884000986814, 0.08047081530094147, -0.008841249160468578, -0.030694492161273956, 0.005365629680454731, -0.0013130118604749441, -0.0018604787765070796, 0.0007274948875419796, -0.0011960220290347934, -0.016646627336740494, 0.01638311706483364, -0.048922184854745865, 0.03687337040901184, -0.0003401791036594659, -0.050630465149879456, 0.05946262553334236, 0.009440964087843895, -0.02059020660817623, 0.017073696479201317, 0.0409623347222805, -0.030367374420166016, 0.02913159877061844, -0.016792012378573418, 0.018400339409708977, -0.016873791813850403, 0.08817624300718307, 0.01888192817568779, 0.007773575372993946, -0.055791646242141724, -0.04939468950033188, 0.009440964087843895, 0.02115357480943203, 0.0009932775283232331, -0.0041525703854858875, -0.011612658388912678, -0.046268902719020844, 0.024152148514986038, 0.03621913492679596, 0.026514660567045212, -0.010703999549150467, 0.006415130570530891, 0.05332009494304657, -0.07349231839179993, -0.019427122548222542, -0.012021554633975029, -0.019517989829182625, 0.0647691935300827, -0.0016094617312774062, 0.007219293620437384, -0.0024738232605159283, 0.06680458784103394, -0.024388400837779045, -0.0076963393948972225, -0.02780495584011078, 0.04165291413664818, 0.05626414716243744, 0.05437413603067398, 0.0035233241505920887, 0.015601670369505882, -0.02680543251335621, 0.05604606866836548, 0.06451477110385895, -0.06876729428768158, 0.03040372021496296, -0.014765704050660133, 0.008477785624563694, -0.07327423989772797, 0.0359828844666481, -0.08490507304668427, -0.02540609799325466, 0.03899963200092316, 0.018536638468503952, -0.01821860671043396, 0.014438587240874767, 0.056336838752031326, -0.060662057250738144, 0.0032439115457236767, -0.012457710690796375, 0.01728268899023533, 0.014947435818612576, -0.04456062242388725, -0.03521961346268654, 0.021008189767599106, 0.020662900060415268, -0.06429669260978699, -0.017982356250286102, -0.014583972282707691, -0.04932199418544769, -0.014084209688007832, -0.01433863490819931, -0.03805462643504143, 0.013248244300484657, -0.025769561529159546, -0.000356932490831241, 0.0017116859089583158, 0.024333881214261055, -0.005143008194863796, 0.03312969580292702, 0.042888689786195755, 0.015456284396350384, -0.014347720891237259, -0.04012636840343475, 0.016955571249127388, -0.04267061501741409, -0.06207956373691559, 0.021789636462926865, 0.04259791970252991, 0.0343291275203228, 0.013057425618171692, -0.014129643328487873, 0.008809446357190609, -0.015274552628397942, -0.043433886021375656, -0.01977241411805153, 0.016982831060886383, -0.01988145336508751, 0.044269852340221405, 0.031094301491975784, -0.030221989378333092, -0.021117229014635086, -0.05851761996746063, -0.012784828431904316, -0.007691795937716961, 0.02120809443295002, 0.03943578898906708, 0.041725609451532364, 0.026423795148730278, -0.02784130349755287, 0.017582546919584274, -0.028877174481749535, 0.021789636462926865, -0.003075809683650732, 0.01367531344294548, -0.04932199418544769, -0.03965386748313904, 0.01931808516383171, 0.0020512971095740795, 0.022062232717871666, -0.007160230539739132, 0.0218805018812418, -0.047759100794792175, -0.027641398832201958, 0.009822600521147251, -0.005347456317394972, 0.026987163349986076, -0.001773020369000733, 0.0065423427149653435, 0.04688679054379463, -0.0038163666613399982, -0.03193026781082153, 0.011121982708573341, -0.04143483564257622, 0.027895823121070862, 0.03316604346036911, 0.019536161795258522, 0.04147118330001831, -0.008932115510106087, -0.03561942279338837, 0.024352053180336952, -0.0238068588078022, -0.030221989378333092, -0.06229764223098755, -0.001815045834518969, -0.019390776753425598, -0.017855143174529076, -0.0016707961913198233, -0.016183212399482727, -0.008950288407504559, 0.030585452914237976, 0.014611232094466686, -0.03816366568207741, -0.026151197031140327, 0.0043161287903785706, -0.04841333627700806, -0.021298959851264954, -0.019281737506389618, -0.007060278207063675, 0.025660522282123566, 0.01323007047176361, -0.032311905175447464, -0.015574410557746887, 0.010331450030207634, 0.04728659987449646, 0.08243352174758911, 0.016901051625609398, 0.07610925287008286, 0.014265941455960274, -0.0002322758809896186, 0.03910867124795914, -0.0276777446269989, -0.01910000666975975, 0.0036482647992670536, 0.08941201865673065, -0.010731259360909462, -0.008355116471648216, 0.028640922158956528, 0.013402716256678104, -0.015574410557746887, -0.0007893972797319293, 0.066477470099926, -0.07262000441551208, -0.02331618219614029, 0.014838396571576595, 0.041325800120830536, 0.037127796560525894, -0.0476137176156044, 0.012530404143035412, 0.017418988049030304, -0.020862804725766182, 0.027314281091094017, 0.010567700490355492, -0.03262084722518921, 0.0013732104562222958, -0.0038458979688584805, 0.0002493132487870753, 0.067531518638134, -0.018900102004408836, -0.005497385282069445, 0.034074701368808746, -0.049358341842889786, -0.002732791006565094, -0.01888192817568779, 0.00019308997434563935, -0.0009154736762866378, 0.03200295940041542, 0.05212066322565079, 0.004509218968451023, -0.054955679923295975, 0.03051275946199894, -0.004865867551416159, 0.010413228534162045, 0.007614559959620237, 0.02353426069021225, 0.07112980633974075, 0.009082043543457985, -0.020244916900992393, -0.011258281767368317, -0.0012176026357337832, 0.004466057755053043, 0.04932199418544769, 0.015047388151288033, 0.048158910125494, -0.03583750128746033, -0.033529505133628845, -0.06516900658607483, 0.09755360335111618, 0.03100343607366085, -0.03494701534509659, 0.006001690868288279, -0.05055776983499527, -0.0011023166589438915, 0.02989487163722515 ]
39,382
pyspark.sql.dataframe
first
Returns the first row as a :class:`Row`. .. versionadded:: 1.3.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Returns ------- :class:`Row` First row if :class:`DataFrame` is not empty, otherwise ``None``. Examples -------- >>> df = spark.createDataFrame([ ... (2, "Alice"), (5, "Bob")], schema=["age", "name"]) >>> df.first() Row(age=2, name='Alice')
def first(self) -> Optional[Row]: """Returns the first row as a :class:`Row`. .. versionadded:: 1.3.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Returns ------- :class:`Row` First row if :class:`DataFrame` is not empty, otherwise ``None``. Examples -------- >>> df = spark.createDataFrame([ ... (2, "Alice"), (5, "Bob")], schema=["age", "name"]) >>> df.first() Row(age=2, name='Alice') """ return self.head()
(self) -> Optional[pyspark.sql.types.Row]
[ 0.02990051545202732, -0.027937527745962143, 0.03259962424635887, -0.011471211910247803, 0.019419562071561813, -0.024712618440389633, 0.026132280007004738, 0.03028610348701477, 0.05892469733953476, -0.01751791685819626, -0.00878524873405695, 0.008877263404428959, -0.023363064974546432, 0.023503277450799942, -0.01054229773581028, 0.0018096297280862927, 0.017307596281170845, 0.020926855504512787, -0.00953451357781887, 0.06747771799564362, 0.019822675734758377, 0.004955668933689594, 0.03400176018476486, 0.053456373512744904, -0.05478840321302414, 0.039645351469516754, 0.022504257038235664, -0.018140112981200218, 0.043045524507761, 0.004517501685768366, 0.05454302951693535, -0.008539875037968159, -0.05682149529457092, 0.011786692775785923, -0.06106295436620712, 0.04511367529630661, -0.00226970505900681, -0.04655086249113083, 0.04462292790412903, -0.005621682852506638, -0.03240683302283287, 0.024519825354218483, 0.03975050896406174, -0.06898501515388489, -0.06225476786494255, -0.0037857629358768463, 0.04136296361684799, -0.04637559503316879, -0.008824683725833893, 0.004237074870616198, 0.06800352036952972, 0.07802878320217133, -0.03813805431127548, -0.019805148243904114, -0.07431312650442123, -0.04262488707900047, -0.03939997777342796, -0.025624006986618042, -0.0403464175760746, 0.016869429498910904, 0.03510593995451927, -0.02783236838877201, -0.006441054865717888, 0.05850405991077423, 0.06355173885822296, -0.027744734659790993, 0.0376473106443882, -0.013153773732483387, -0.002771406201645732, -0.006156246177852154, -0.039890725165605545, 0.05258003994822502, -0.019244294613599777, 0.06712718307971954, -0.06250014156103134, -0.048513852059841156, -0.02031342312693596, -0.019717514514923096, -0.021680504083633423, -0.03869890794157982, 0.042064033448696136, 0.017929794266819954, -0.029006656259298325, 0.0026465286500751972, -0.02196093089878559, -0.00861436314880848, 0.04935513064265251, 0.05952060595154762, -0.06260529905557632, -0.012452705763280392, 0.001923553179949522, 0.026079699397087097, -0.0013407910009846091, 0.02728904038667679, 0.09198001772165298, -0.012426416389644146, -0.006397238001227379, -0.008754576556384563, -0.041958872228860855, -0.013618230819702148, -0.053316161036491394, 0.03943502902984619, -0.016019385308027267, 0.01061240490525961, -0.026254966855049133, -0.0028612306341528893, 0.019612355157732964, -0.004666478373110294, 0.01526573859155178, 0.03894428163766861, -0.00782566238194704, -0.0012487759813666344, -0.03852364420890808, 0.023292958736419678, -0.00007133906183298677, -0.04924996942281723, 0.0014032297767698765, 0.020208261907100677, -0.029970623552799225, 0.05107274651527405, 0.026605499908328056, 0.027026141062378883, 0.015064181759953499, -0.07438322901725769, 0.006708336994051933, 0.012733133509755135, 0.028638595715165138, -0.049705665558576584, 0.009464407339692116, 0.010524771176278591, 0.08868499845266342, -0.006712718401104212, 0.015519875101745129, 0.013013560324907303, -0.04756740853190422, 0.001958606531843543, 0.08104337006807327, 0.053456373512744904, -0.01138357911258936, 0.03901439160108566, 0.037051402032375336, -0.0192092414945364, 0.02373112551867962, 0.036034855991601944, -0.01353059709072113, -0.04216919094324112, -0.004692768678069115, 0.0005348375998437405, 0.04462292790412903, 0.05506882816553116, 0.027657100930809975, -0.04539410024881363, 0.026027120649814606, 0.0102793974801898, -0.03968040272593498, -0.021838244050741196, 0.003798907855525613, -0.04294036701321602, 0.008171814493834972, -0.056260641664266586, 0.0027955055702477694, 0.00500824861228466, 0.042239297181367874, -0.011585135944187641, -0.06148359552025795, 0.04560442268848419, -0.08623126894235611, 0.03452755883336067, -0.03400176018476486, -0.0035557253286242485, 0.09723801910877228, 0.038453537970781326, 0.007199083920568228, -0.021785663440823555, -0.04683128744363785, 0.1036878377199173, 0.019664935767650604, 0.04213413968682289, 0.023187797516584396, -0.017798343673348427, 0.045323994010686874, -0.024432191625237465, -0.03373885899782181, 0.0069449469447135925, 0.04462292790412903, -0.01528326515108347, 0.010340740904211998, -0.061553701758384705, 0.0630960464477539, 0.003012398025020957, 0.013521833345293999, 0.008145524188876152, -0.015204395167529583, 0.048408690840005875, -0.01574772223830223, -0.021347496658563614, 0.038208164274692535, 0.01201453898102045, -0.05633075162768364, 0.01565132476389408, 0.01530955545604229, -0.013889893889427185, 0.05159854516386986, 0.02990051545202732, -0.01475746463984251, 0.006699573248624802, -0.030215997248888016, 0.009008713997900486, -0.0706675723195076, -0.0020440490916371346, -0.045323994010686874, -0.03033868409693241, -0.05713697895407677, -0.013293987140059471, 0.007426930591464043, -0.03328316658735275, -0.03125007078051567, -0.05440281331539154, 0.02339811809360981, -0.018315380439162254, 0.030251050367951393, -0.043641433119773865, 0.012505286373198032, -0.00032369588734582067, 0.03188103064894676, -0.03876901790499687, 0.02590443380177021, -0.06278056651353836, -0.02118975669145584, -0.006449818145483732, 0.02488788589835167, -0.06611064076423645, 0.04423734173178673, -0.05594516173005104, -0.021785663440823555, 0.02292489819228649, -0.0009141259361058474, 0.010437138378620148, 0.004221739247441292, -0.04861900955438614, -0.01628228649497032, 0.03831332176923752, 0.014880151487886906, 0.010051551274955273, -0.018613334745168686, 0.020961908623576164, -0.023082638159394264, 0.03452755883336067, -0.041573286056518555, -0.046095170080661774, -0.0018413967918604612, 0.01642249897122383, 0.10859531164169312, 0.0065330700017511845, 0.020821696147322655, -0.056260641664266586, 0.037051402032375336, -0.008434714749455452, -0.03635033592581749, 0.02907676249742508, -0.0012805430451408029, -0.03715656325221062, 0.030005676671862602, 0.017754526808857918, -0.051107797771692276, -0.01015671156346798, -0.09387289732694626, 0.05682149529457092, 0.020138155668973923, 0.062465086579322815, 0.0921202301979065, 0.023030057549476624, 0.007676685694605112, -0.03442240133881569, 0.07319141924381256, -0.05853911116719246, -0.03915460407733917, 0.00296200904995203, 0.01612454652786255, -0.00741378590464592, -0.06607558578252792, -0.012934690341353416, -0.015896698459982872, 0.009017476812005043, -0.037717416882514954, -0.021750610321760178, -0.001575210364535451, -0.05328110605478287, -0.024204345420002937, -0.01646631583571434, 0.023958971723914146, 0.052019186317920685, -0.036490548402071, -0.03386154770851135, -0.01232125610113144, 0.022697050124406815, -0.004881180357187986, -0.013127483427524567, 0.0384184829890728, -0.0022357471752911806, 0.017307596281170845, -0.05559463053941727, 0.02411671169102192, 0.03158307820558548, -0.03947008401155472, -0.03130264952778816, -0.05310584232211113, 0.004990722052752972, -0.011681532487273216, 0.008202486671507359, -0.01796484738588333, 0.00588458264246583, -0.004644570406526327, 0.00006127491360530257, -0.08314657211303711, -0.01776329055428505, -0.019559774547815323, 0.028445802628993988, 0.03712150827050209, -0.00256984937004745, -0.03119749017059803, -0.00527114886790514, 0.00029877512133680284, -0.019472140818834305, -0.07094800472259521, 0.016448788344860077, -0.030075782909989357, -0.018070006743073463, -0.07879995554685593, 0.056646231561899185, 0.04094232618808746, -0.011111915111541748, 0.03386154770851135, 0.011979485861957073, -0.05804836377501488, 0.0028678029775619507, 0.012531576678156853, 0.0005244311178103089, -0.016361156478524208, 0.025290999561548233, 0.03288005292415619, -0.10249602794647217, 0.08055262267589569, -0.0010713182855397463, 0.021312443539500237, 0.035509053617715836, 0.05696171149611473, -0.0280777420848608, 0.0349481999874115, -0.06341152638196945, 0.020716536790132523, -0.014108977280557156, -0.030461369082331657, -0.021592870354652405, -0.008881645277142525, 0.013521833345293999, -0.04991598427295685, 0.05591011047363281, 0.023380590602755547, 0.028270535171031952, 0.06281562149524689, -0.038103003054857254, -0.07718750089406967, -0.006401619873940945, -0.03573689982295036, 0.043045524507761, -0.05303573235869408, 0.05520904064178467, -0.0652693584561348, 0.01015671156346798, -0.009438117034733295, 0.03230167180299759, -0.002324475906789303, -0.03592969477176666, -0.0004228311590850353, 0.017649367451667786, 0.0019093126757070422, 0.02378370426595211, 0.013486780226230621, -0.03975050896406174, 0.02965514361858368, -0.05233466625213623, -0.011988249607384205, -0.011234601959586143, -0.0484437420964241, -0.008456623181700706, -0.05310584232211113, -0.05738234892487526, -0.04988093301653862, -0.05902985855937004, -0.013039849698543549, -0.0271137747913599, -0.014021344482898712, -0.06474355608224869, -0.015160578303039074, 0.03042631596326828, 0.019121607765555382, 0.03277489170432091, 0.02036600187420845, -0.014371877536177635, -0.012365072965621948, -0.031022224575281143, 0.03817310929298401, -0.010551061481237411, -0.006033559795469046, -0.002920383121818304, 0.02797258086502552, -0.056891605257987976, 0.0029751539696007967, -0.012198569253087044, 0.013881131075322628, -0.011935668997466564, -0.029287083074450493, 0.03813805431127548, 0.028042688965797424, 0.060922738164663315, 0.046340543776750565, 0.086091049015522, 0.0001608894526725635, 0.04301047325134277, -0.041047483682632446, 0.03181092441082001, -0.060922738164663315, 0.07739781588315964, -0.020208261907100677, -0.0034812367521226406, 0.005389454308897257, 0.010726328007876873, 0.02706119418144226, 0.01732512377202511, -0.021242335438728333, -0.07578536123037338, -0.040030937641859055, 0.016212178394198418, -0.02031342312693596, 0.045323994010686874, 0.01626475900411606, -0.017132330685853958, -0.020436108112335205, 0.01612454652786255, 0.09240065515041351, -0.015607508830726147, -0.02122480981051922, -0.03614001348614693, 0.01008660439401865, -0.022328989580273628, -0.010726328007876873, -0.003192046657204628, -0.029041709378361702, 0.010629931464791298, 0.02022578939795494, -0.033966705203056335, 0.06099284812808037, 0.007238518912345171, -0.046095170080661774, -0.02383628487586975, -0.043045524507761, -0.025553898885846138, 0.017176145687699318, -0.015029128640890121, 0.020436108112335205, 0.011295945383608341, 0.046726129949092865, -0.022837264463305473, 0.02041858248412609, -0.0046095168218016624, -0.027797315269708633, 0.0055077592842280865, -0.06810867786407471, -0.003161374945193529, 0.04090727120637894, -0.030303629115223885, -0.012934690341353416, -0.06817878782749176, 0.08076294511556625, -0.013933710753917694, -0.02879633568227291, -0.027096247300505638, 0.02576421946287155, 0.013775970786809921, -0.06944070756435394, -0.010954175144433975, 0.02720140665769577, 0.0011063716374337673, -0.001713232952170074, 0.007663541007786989, -0.03715656325221062, -0.03191608563065529, 0.047251928597688675, -0.0035140994004905224, 0.0124965226277709, 0.05527915060520172, -0.01799990050494671, 0.02522089332342148, -0.015081708319485188, -0.009061293676495552, 0.04125780612230301, 0.03890923038125038, -0.0010017593158409, 0.07192949205636978, 0.025063153356313705, -0.02383628487586975, -0.042344458401203156, 0.02436208538711071, -0.016536422073841095, -0.05044178664684296, -0.007146503776311874, -0.013434200547635555, -0.02190835028886795, -0.017588023096323013, 0.00013507867697626352, 0.0752946212887764, -0.05349142849445343, 0.0027144446503371, -0.01969998888671398, 0.02806021459400654, 0.063341423869133, 0.03370380401611328, 0.06327131390571594, -0.005314965732395649, -0.000917412166018039, 0.000798011664301157, -0.014555907808244228, 0.06810867786407471, -0.05818857625126839, 0.018280327320098877, 0.027411727234721184, -0.027096247300505638, 0.02883138880133629, 0.056541070342063904, -0.03866385668516159, 0.00885973684489727, -0.04553431645035744, -0.006476108450442553, -0.026798292994499207, -0.029199449345469475, -0.01940203458070755, 0.008811538107693195, -0.00036148776416666806, -0.028533434495329857, -0.002878757193684578, -0.028586015105247498, -0.008110471069812775, 0.007689830847084522, -0.00953451357781887, -0.07249034941196442, -0.01651013270020485, 0.046585917472839355, -0.02537863329052925, -0.009403063915669918, -0.029304608702659607, -0.023187797516584396, 0.07382237911224365, -0.00017526680312585086, -0.042589832097291946, -0.00577942281961441, -0.01259292010217905, 0.026903454214334488, 0.027797315269708633, -0.03288005292415619, 0.03585958853363991, -0.05783804506063461, 0.0335986465215683, 0.0001651341881370172, 0.012934690341353416, -0.01636991836130619, 0.04332595318555832, 0.040171150118112564, 0.015581218525767326, 0.013364093378186226, 0.011935668997466564, 0.02406413108110428, 0.00699314521625638, 0.01333780400454998, 0.024957992136478424, -0.02383628487586975, -0.015248212032020092, 0.0799216628074646, -0.07382237911224365, 0.011751638725399971, 0.0349481999874115, -0.019033974036574364, 0.0380328968167305, -0.049565453082323074, -0.035403892397880554, 0.0173777025192976, -0.05836384370923042, 0.02147018350660801, -0.054192494601011276, -0.04413218051195145, 0.01805248111486435, -0.07410280406475067, -0.028288060799241066, 0.00938553735613823, 0.06505903601646423, 0.03566679358482361, 0.016781795769929886, -0.04591990262269974, 0.019437087699770927, 0.03715656325221062, -0.076065793633461, 0.0384184829890728, 0.00492061534896493, -0.03326563909649849, 0.02234651707112789, -0.018700968474149704, -0.05478840321302414, 0.04718182235956192, 0.00912263710051775, -0.023328011855483055, 0.023328011855483055, 0.0093154301866889, -0.02797258086502552, -0.0043641431257128716, -0.01709727570414543, -0.017062222585082054, -0.013653283938765526, -0.01950719580054283, 0.005700552836060524, -0.0018622097559273243, -0.014398167841136456, 0.022451676428318024, 0.010174238122999668, -0.017263779416680336, 0.005569102708250284, 0.02657044678926468, 0.012908400036394596, -0.013031086884438992, 0.011190785095095634, 0.00527114886790514, 0.055384308099746704, -0.054087333381175995, 0.025588952004909515, -0.008982423692941666, 0.04472808912396431, -0.022504257038235664, -0.03936492279171944, -0.03408939391374588, -0.0051221721805632114, 0.02700861357152462, -0.05696171149611473, 0.06306099146604538, -0.002104297047480941, 0.01420537382364273, 0.04395691305398941, -0.023275431245565414, -0.03663076087832451, -0.006366566754877567, 0.0368761345744133, -0.02772720716893673, -0.045954953879117966, 0.01857828162610531, -0.002506315242499113, 0.03461519256234169, 0.05647096410393715, 0.02513325959444046, -0.022364044561982155, -0.029935570433735847, -0.030391262844204903, 0.018858708441257477, 0.005437652580440044, -0.046726129949092865, 0.03182845190167427, -0.012470233254134655, 0.030443843454122543, -0.024870358407497406, -0.05713697895407677, -0.0072429003193974495, -0.0016343629686161876, 0.010051551274955273, -0.04423734173178673, 0.05734729766845703, -0.008737049996852875, -0.006717100273817778, 0.04928502440452576, -0.0017099467804655433, -0.026149807497859, -0.04367648810148239, -0.015519875101745129, 0.02455487847328186, 0.021557817235589027, -0.023661017417907715, -0.002508506178855896, 0.01714109256863594, -0.09401310980319977, -0.04798804968595505, -0.007426930591464043, -0.011479975655674934, 0.007010672241449356, -0.04297541826963425, 0.014222901314496994, -0.08777361363172531, 0.045954953879117966, 0.05990619212388992, -0.015300791710615158, -0.03200371935963631, -0.038628801703453064, 0.021838244050741196, -0.03042631596326828, 0.06726739555597305, 0.0349481999874115, 0.0351409949362278, -0.022013509646058083, 0.04244961962103844, 0.03715656325221062, 0.05994124710559845, 0.0007530995062552392, 0.02758699469268322, 0.02180319093167782, -0.023433171212673187, -0.0057049342431128025, 0.05584000423550606, 0.01201453898102045, 0.03431724011898041, -0.004289655014872551, 0.05545441433787346, -0.02883138880133629, 0.0036236410960555077, -0.01857828162610531, 0.041818659752607346, -0.0496005043387413, -0.0907180979847908, -0.0019301256397739053, 0.047882888466119766, 0.029532456770539284, 0.07466365396976471, 0.0018359196837991476, -0.027026141062378883, -0.02860354259610176, 0.0671972930431366, -0.011418632231652737, 0.004081525839865208, 0.0018622097559273243, 0.04276509955525398, 0.07333163172006607, -0.005827621091157198, 0.037577200680971146, 0.0013407910009846091, 0.04907470569014549, -0.04924996942281723, -0.06786330789327621, -0.01179545558989048, 0.009885047562420368, -0.027849894016981125, 0.030829429626464844, -0.01543224137276411, 0.013881131075322628, -0.0001430889096809551, 0.021207282319664955, 0.05026651918888092, 0.007142122369259596, -0.015511112287640572, 0.0160281490534544, 0.03817310929298401, -0.017176145687699318, 0.006384093314409256, -0.032284144312143326, 0.05405228212475777, 0.016702925786376, -0.020856749266386032, 0.0051396987400949, 0.010069077834486961, 0.01176916528493166, 0.04539410024881363, -0.019910309463739395, -0.015256974846124649, 0.04146812483668327, 0.0546131357550621 ]
39,383
pyspark.sql.dataframe
foreach
Applies the ``f`` function to all :class:`Row` of this :class:`DataFrame`. This is a shorthand for ``df.rdd.foreach()``. .. versionadded:: 1.3.0 Parameters ---------- f : function A function that accepts one parameter which will receive each row to process. Examples -------- >>> df = spark.createDataFrame( ... [(14, "Tom"), (23, "Alice"), (16, "Bob")], ["age", "name"]) >>> def func(person): ... print(person.name) ... >>> df.foreach(func)
def foreach(self, f: Callable[[Row], None]) -> None: """Applies the ``f`` function to all :class:`Row` of this :class:`DataFrame`. This is a shorthand for ``df.rdd.foreach()``. .. versionadded:: 1.3.0 Parameters ---------- f : function A function that accepts one parameter which will receive each row to process. Examples -------- >>> df = spark.createDataFrame( ... [(14, "Tom"), (23, "Alice"), (16, "Bob")], ["age", "name"]) >>> def func(person): ... print(person.name) ... >>> df.foreach(func) """ self.rdd.foreach(f)
(self, f: Callable[[pyspark.sql.types.Row], NoneType]) -> NoneType
[ 0.09742261469364166, -0.03680409863591194, -0.04071497172117233, 0.03416775166988373, -0.046267010271549225, 0.022609727457165718, -0.011479456909000874, 0.020951099693775177, 0.005268328357487917, 0.020322566851973534, -0.029750561341643333, -0.04186727851629257, 0.08317586779594421, 0.015626028180122375, 0.00045912369387224317, 0.021719306707382202, -0.03886428847908974, 0.011968315578997135, 0.02592698484659195, 0.05391416326165199, -0.008917312137782574, 0.008555032312870026, 0.018698856234550476, 0.01126121636480093, -0.01089457143098116, 0.03556448966264725, 0.03147902712225914, 0.0018681397195905447, 0.04801293462514877, 0.04228630289435387, -0.0005723360227420926, 0.011575482785701752, -0.03408045694231987, -0.0028436752036213875, -0.023063668981194496, 0.036245401948690414, -0.04696538299322128, -0.022243084385991096, 0.03662950545549393, 0.010222390294075012, -0.007049172185361385, 0.04605749994516373, 0.027795124799013138, 0.016385504975914955, 0.007760636508464813, 0.047698669135570526, 0.020078137516975403, -0.024547705426812172, 0.04382271692156792, -0.015896646305918694, -0.017860813066363335, 0.021492335945367813, -0.006525394506752491, -0.017712408676743507, 0.005333800800144672, 0.03938806802034378, -0.05709174647927284, -0.0647738128900528, 0.001952162361703813, -0.028598250821232796, 0.051714297384023666, -0.05485696345567703, -0.021073313429951668, 0.07444623857736588, 0.04134350270032883, -0.03516292944550514, -0.017555275931954384, 0.014395151287317276, -0.017965568229556084, 0.017363224178552628, -0.023744579404592514, 0.03254404291510582, 0.03228215128183365, 0.0027847501914948225, -0.06526267528533936, 0.041099075227975845, -0.058872587978839874, 0.042146626859903336, -0.01631566882133484, 0.0006230769795365632, 0.053460221737623215, -0.009855746291577816, -0.02816176973283291, -0.031077465042471886, -0.030588604509830475, 0.009506561793386936, 0.0021158428862690926, -0.006180574186146259, -0.03868969529867172, 0.04846687614917755, 0.041797444224357605, 0.02594444528222084, -0.022836698219180107, 0.008991513401269913, 0.0362803190946579, -0.03168853744864464, -0.03397569805383682, -0.009052621200680733, -0.02781258523464203, 0.00547783961519599, -0.0011097535025328398, 0.03123459778726101, 0.04183236137032509, -0.044032227247953415, 0.039353147149086, -0.08666771650314331, -0.04396238923072815, -0.04881606251001358, 0.047698669135570526, 0.039213474839925766, -0.036734260618686676, 0.07556363195180893, -0.009104998782277107, 0.03243928402662277, -0.07053536921739578, -0.03938806802034378, -0.026939621195197105, -0.002791297622025013, -0.06875452399253845, 0.008205846883356571, 0.03549465537071228, 0.0241810604929924, 0.04832720384001732, -0.05339038372039795, -0.034464556723833084, -0.01908295974135399, -0.0018615925218909979, 0.029558509588241577, 0.031094923615455627, 0.008079268038272858, 0.047803424298763275, -0.0375024676322937, 0.04326402023434639, -0.025385748594999313, 0.00486240116879344, -0.018559182062745094, 0.0422164648771286, 0.025158777832984924, -0.044975027441978455, 0.016734691336750984, 0.03596605360507965, -0.0024006469175219536, 0.03764214366674423, 0.07004650682210922, 0.04982869699597359, -0.01944960467517376, -0.03486612066626549, 0.048641469329595566, -0.029506132006645203, -0.013522189110517502, -0.001496039447374642, 0.05897734314203262, 0.06407544761896133, 0.03690885379910469, -0.0645643025636673, 0.03746755048632622, 0.020898722112178802, 0.0050108046270906925, -0.007110279519110918, -0.056428294628858566, -0.02002575993537903, 0.03432488441467285, -0.03261387720704079, 0.03593113645911217, -0.020078137516975403, 0.03064098209142685, -0.09071826189756393, 0.010746167972683907, -0.014255477115511894, -0.02570001594722271, 0.04850179702043533, -0.05572992563247681, 0.029453754425048828, 0.016010131686925888, 0.00966369453817606, 0.10664109885692596, 0.01780843362212181, -0.001705550472252071, 0.05946620553731918, -0.0163942351937294, 0.01013509463518858, -0.01645534299314022, 0.022923994809389114, -0.019955921918153763, 0.0145522840321064, 0.016883093863725662, -0.041099075227975845, -0.039562661200761795, 0.05056198686361313, -0.009183565154671669, 0.03593113645911217, -0.03559941053390503, -0.023360475897789, 0.022784320637583733, 0.011924667283892632, -0.04287991672754288, 0.004639795515686274, 0.036140646785497665, -0.011706426739692688, 0.018436968326568604, 0.04270532354712486, -0.031426649540662766, 0.02617141418159008, 0.015468895435333252, -0.039422985166311264, 0.004871130455285311, -0.011051705107092857, 0.0011113903019577265, -0.01519827637821436, -0.04228630289435387, 0.036035891622304916, -0.024966726079583168, -0.02014797367155552, 0.07158292084932327, 0.042251382023096085, 0.027620533481240273, -0.018436968326568604, -0.04808277264237404, 0.00979463942348957, 0.0022075038868933916, 0.017511626705527306, -0.015320491045713425, -0.059815388172864914, -0.04054037854075432, 0.050876252353191376, -0.07514461129903793, 0.018000485375523567, -0.056044191122055054, 0.024617541581392288, 0.016839446499943733, -0.018454426899552345, -0.0044739325530827045, 0.036140646785497665, -0.002200956689193845, 0.013897562399506569, -0.014403880573809147, -0.03008228726685047, 0.04134350270032883, -0.025158777832984924, -0.052622176706790924, 0.023185882717370987, 0.03193296864628792, 0.004046181216835976, -0.02215578779578209, 0.023639824241399765, 0.0055651357397437096, -0.004482662305235863, 0.13806775212287903, -0.03875953331589699, -0.015399058349430561, -0.0072019402869045734, -0.022731943055987358, 0.012692874297499657, -0.018436968326568604, -0.02004321850836277, -0.041448257863521576, 0.0037319145631045103, 0.028458576649427414, 0.0049322377890348434, 0.058907508850097656, 0.036035891622304916, 0.012413525953888893, 0.016481531783938408, 0.05681239813566208, -0.019851166754961014, 0.0015255019534379244, -0.06264378875494003, -0.010466819629073143, -0.019659115001559258, 0.031182220205664635, -0.007066631224006414, -0.0032626972533762455, 0.031880591064691544, 0.01873377524316311, 0.005198491737246513, -0.005739728454500437, -0.03526768460869789, -0.016411693766713142, 0.008528843522071838, -0.031775835901498795, 0.0420069545507431, -0.015992673113942146, -0.07011634856462479, 0.014176910743117332, -0.025769852101802826, -0.03980708867311478, -0.005892496556043625, 0.0026319818571209908, 0.010021609254181385, -0.03984200581908226, -0.012457174248993397, -0.026782488450407982, -0.007472558878362179, 0.030152123421430588, 0.01643788255751133, -0.011950856074690819, -0.003352175932377577, 0.02805701456964016, 0.028790302574634552, -0.02014797367155552, 0.020444780588150024, -0.04424173757433891, 0.03666442260146141, 0.053111035376787186, -0.016368046402931213, -0.013976129703223705, 0.022958913818001747, 0.04766375198960304, -0.0711289793252945, -0.00518539734184742, 0.010108905844390392, 0.038515105843544006, -0.03203772380948067, 0.005953603889793158, -0.04158793389797211, -0.0031164761167019606, -0.009436724707484245, 0.0483621209859848, -0.02973310276865959, -0.012038152664899826, -0.014403880573809147, -0.00680910749360919, 0.02772528864443302, 0.04469567909836769, -0.0006476290291175246, 0.026363465934991837, 0.05880275368690491, -0.029802938923239708, -0.030099745839834213, 0.03582638129591942, 0.09763212502002716, -0.009070079773664474, 0.005464745219796896, 0.015617298893630505, -0.07842694967985153, 0.014971306547522545, -0.012334959581494331, 0.06079310551285744, 0.008851839229464531, 0.04832720384001732, -0.014430069364607334, 0.039318230003118515, 0.03500579670071602, -0.004491392057389021, -0.05209840089082718, 0.07605249434709549, -0.054507777094841, -0.005063182208687067, 0.030501309782266617, -0.02805701456964016, 0.049584269523620605, -0.0033107101917266846, -0.03903888165950775, 0.0098382867872715, -0.027201510965824127, -0.007463829126209021, 0.002501037437468767, -0.001961983274668455, -0.012334959581494331, -0.005469109863042831, -0.0058575780130922794, -0.05443793907761574, 0.004059275612235069, -0.030693361535668373, 0.05719650164246559, 0.07682070136070251, -0.047105055302381516, 0.011950856074690819, -0.022592268884181976, 0.00318413064815104, -0.011252486146986485, 0.0066956221126019955, 0.04305450990796089, -0.0258222296833992, 0.033085279166698456, 0.009270861744880676, 0.020078137516975403, 0.049444593489170074, -0.004648525267839432, 0.026119036599993706, 0.0547172874212265, -0.057126663625240326, 0.07409705221652985, -0.04860655218362808, 0.015887917950749397, -0.01896074414253235, -0.031444109976291656, -0.04134350270032883, -0.008694706484675407, -0.011392160318791866, -0.03641999512910843, 0.04399731010198593, -0.023866795003414154, -0.03582638129591942, -0.049444593489170074, -0.025141319260001183, 0.006564677692949772, -0.0013705510646104813, -0.004526310600340366, -0.05552041530609131, -0.048397038131952286, -0.020671751350164413, -0.04619717597961426, 0.0026538060046732426, -0.00856812670826912, 0.04455600306391716, -0.042740244418382645, 0.008284414187073708, -0.011392160318791866, -0.014753066003322601, 0.06061851605772972, -0.016359316185116768, -0.04312434792518616, -0.009943042881786823, -0.01362694427371025, 0.06603088229894638, 0.035407356917858124, 0.04134350270032883, 0.02287161722779274, 0.029401376843452454, 0.004971521440893412, 0.005023899022489786, -0.04825736582279205, 0.07989352941513062, -0.011837371625006199, -0.07140833139419556, 0.01592283509671688, 0.008210211992263794, 0.053949080407619476, 0.011217568069696426, -0.05611402913928032, -0.07654134929180145, -0.047105055302381516, 0.02816176973283291, 0.017101334407925606, 0.016132347285747528, -0.004277516156435013, 0.017555275931954384, -0.003583510871976614, 0.00293533643707633, 0.05719650164246559, -0.014691958203911781, -0.011575482785701752, -0.10992343723773956, -0.041692689061164856, 0.027201510965824127, -0.04434649273753166, -0.00038437629700638354, -0.05600927397608757, 0.025280993431806564, 0.04040070250630379, 0.024215979501605034, -0.022260542958974838, 0.05010804533958435, -0.026730110868811607, -0.005521487444639206, 0.021614551544189453, -0.09791146963834763, 0.038270674645900726, 0.006433733273297548, 0.014604662545025349, -0.023185882717370987, 0.017895730212330818, -0.04808277264237404, -0.027061836794018745, -0.02886013872921467, -0.049444593489170074, -0.009881935082376003, -0.008541937917470932, -0.05572992563247681, 0.046755868941545486, -0.05391416326165199, -0.01698784902691841, -0.047908179461956024, 0.07011634856462479, 0.03291068598628044, -0.06505316495895386, -0.028266524896025658, -0.03491849824786186, -0.015224465169012547, -0.0707099586725235, 0.030483849346637726, 0.030344175174832344, -0.006992429494857788, 0.058418650180101395, -0.02770782820880413, 0.011051705107092857, -0.02662535570561886, 0.007799919694662094, 0.003308527870103717, -0.0015505995834246278, 0.034255046397447586, 0.01838458888232708, 0.011802452616393566, -0.023290639743208885, -0.02816176973283291, 0.029994990676641464, 0.0163942351937294, -0.028371280059218407, -0.003657712833955884, 0.01760765351355076, 0.03112984262406826, -0.03704852610826492, 0.020793966948986053, -0.007345979101955891, 0.02121298760175705, 0.03886428847908974, 0.028563331812620163, -0.033905863761901855, -0.008092362433671951, -0.00428406335413456, -0.038515105843544006, -0.026904704049229622, 0.01297222264111042, -0.011863560415804386, -0.049549348652362823, -0.03167107701301575, -0.000871871248818934, 0.01320792268961668, 0.021020935848355293, 0.02180660329759121, -0.02027018927037716, 0.008515749126672745, 0.0717225968837738, -0.05621878430247307, 0.030937790870666504, 0.04357828572392464, -0.006673797965049744, 0.03511055186390877, -0.0049933455884456635, -0.062085092067718506, 0.014124533161520958, -0.00887366384267807, -0.018087781965732574, 0.001538596348837018, 0.02404138632118702, 0.029052190482616425, -0.029087109491229057, -0.04228630289435387, 0.025647638365626335, 0.015835538506507874, 0.02805701456964016, 0.04123874753713608, -0.010423172265291214, -0.018000485375523567, -0.0872962474822998, -0.0291045680642128, -0.10482533276081085, 0.08568999916315079, -0.030134664848446846, -0.03910871967673302, -0.0211082324385643, 0.010152553208172321, 0.04281007871031761, -0.011479456909000874, -0.0336090549826622, 0.0058182948268949986, 0.020724128931760788, -0.017450520768761635, -0.05077149718999863, -0.033172573894262314, 0.014002318494021893, 0.03855002298951149, -0.04937475919723511, 0.078287273645401, 0.007350344210863113, 0.05541565641760826, 0.023954089730978012, 0.010405712760984898, -0.029506132006645203, 0.02653805911540985, 0.059605877846479416, 0.012273852713406086, -0.10524435341358185, -0.016595017164945602, -0.018471885472536087, -0.0035245860926806927, -0.03666442260146141, -0.04043562337756157, -0.08142994344234467, -0.11467234790325165, -0.025525422766804695, 0.03371381014585495, 0.00856812670826912, -0.05600927397608757, 0.0035747813526540995, -0.018314752727746964, 0.05531090125441551, -0.030798116698861122, 0.007843567989766598, 0.0026538060046732426, -0.1164182722568512, -0.03313765674829483, -0.022243084385991096, 0.010920760221779346, -0.026957081630825996, -0.004940967541188002, -0.012099259532988071, 0.008389169350266457, -0.006555948406457901, -0.04102923721075058, 0.07633183896541595, 0.000780210189986974, -0.0008489559986628592, -0.023971550166606903, -0.020374944433569908, -0.04441633075475693, 0.018087781965732574, -0.005971063394099474, 0.048047855496406555, -0.024495327845215797, 0.055939435958862305, 0.04040070250630379, -0.011575482785701752, 0.044835351407527924, 0.020706670358777046, -0.031199678778648376, 0.04151809588074684, 0.00759913818910718, -0.009864475578069687, -0.01420309953391552, -0.023133505135774612, -0.029907694086432457, 0.033556677401065826, -0.049584269523620605, 0.009401805698871613, -0.005713539198040962, -0.03945790231227875, -0.01631566882133484, 0.03125205636024475, -0.02996007166802883, -0.06568169593811035, 0.0608629435300827, 0.002856769599020481, 0.06812599301338196, -0.07119882106781006, -0.030448930338025093, -0.005578230135142803, -0.053460221737623215, -0.04553372412919998, 0.02100347727537155, 0.06404052674770355, 0.032840847969055176, -0.05056198686361313, 0.046371765434741974, -0.022557349875569344, -0.034708987921476364, 0.0038694061804562807, 0.04829228296875954, -0.0344296395778656, -0.04340369254350662, 0.012780170887708664, -0.05045723170042038, 0.042740244418382645, 0.027201510965824127, 0.07605249434709549, -0.003201589919626713, -0.014779254794120789, 0.004183672834187746, 0.022557349875569344, -0.04696538299322128, -0.009541479870676994, -0.014543554745614529, -0.001468759379349649, 0.05552041530609131, -0.033766187727451324, -0.011479456909000874, 0.014255477115511894, -0.02594444528222084, -0.007411451544612646, -0.02039240300655365, 0.09546718001365662, -0.027515776455402374, -0.0010835647117346525, -0.016018861904740334, -0.027306266129016876, -0.046616196632385254, -0.033766187727451324, 0.015818079933524132, 0.006198033690452576, -0.03757230564951897, 0.025507964193820953, -0.027463398873806, 0.022190706804394722, -0.05244758725166321, -0.017712408676743507, 0.000860413652844727, 0.024442950263619423, 0.005813930183649063, -0.0758429765701294, 0.028214147314429283, -0.04106415435671806, 0.012011963874101639, 0.011645319871604443, -0.035791460424661636, 0.008816921152174473, 0.012753982096910477, 0.0025643273256719112, 0.07032585889101028, 0.0678466409444809, 0.000524595903698355, 0.03292814642190933, 0.005953603889793158, 0.03219485655426979, 0.05066674202680588, 0.014430069364607334, -0.04560355842113495, -0.00010052708239527419, -0.010039068758487701, 0.0070273480378091335, -0.006394450087100267, 0.006800377741456032, -0.031426649540662766, 0.03301544114947319, 0.004613606724888086, 0.07912532240152359, 0.010396983474493027, -0.0362803190946579, 0.004445561207830906, -0.007153927348554134, -0.009244672954082489, -0.029261702671647072, 0.02535082958638668, 0.0009471643134020269, 0.0009809916373342276, 0.013478540815412998, 0.03303290158510208, 0.05859323963522911, 0.03385348618030548, 0.05744092911481857, 0.047209810465574265, -0.02994261309504509, 0.0023962820414453745, -0.01955435983836651, 0.022679565474390984, 0.00006942779873497784, 0.011226297356188297, -0.0027149133384227753, -0.032718632370233536, -0.025158777832984924, -0.006285329815000296, -0.04612733796238899, -0.014822903089225292, -0.02969818376004696, -0.012439715676009655, -0.004076734650880098, 0.004600512329488993, 0.024215979501605034, 0.02772528864443302, 0.0485716313123703, 0.015076061710715294, 0.03502325341105461, -0.024128682911396027, 0.056428294628858566, 0.034464556723833084, 0.010850923135876656, 0.02332555688917637, -0.04455600306391716, 0.006468651816248894, -0.007197575643658638, -0.028598250821232796, 0.05269201472401619, -0.009462913498282433, 0.03427250683307648, 0.03004736825823784, -0.0053818137384951115, 0.06379609555006027, 0.0721416175365448 ]
39,384
pyspark.sql.dataframe
foreachPartition
Applies the ``f`` function to each partition of this :class:`DataFrame`. This a shorthand for ``df.rdd.foreachPartition()``. .. versionadded:: 1.3.0 Parameters ---------- f : function A function that accepts one parameter which will receive each partition to process. Examples -------- >>> df = spark.createDataFrame( ... [(14, "Tom"), (23, "Alice"), (16, "Bob")], ["age", "name"]) >>> def func(itr): ... for person in itr: ... print(person.name) ... >>> df.foreachPartition(func)
def foreachPartition(self, f: Callable[[Iterator[Row]], None]) -> None: """Applies the ``f`` function to each partition of this :class:`DataFrame`. This a shorthand for ``df.rdd.foreachPartition()``. .. versionadded:: 1.3.0 Parameters ---------- f : function A function that accepts one parameter which will receive each partition to process. Examples -------- >>> df = spark.createDataFrame( ... [(14, "Tom"), (23, "Alice"), (16, "Bob")], ["age", "name"]) >>> def func(itr): ... for person in itr: ... print(person.name) ... >>> df.foreachPartition(func) """ self.rdd.foreachPartition(f) # type: ignore[arg-type]
(self, f: Callable[[Iterator[pyspark.sql.types.Row]], NoneType]) -> NoneType
[ 0.08448316901922226, 0.012560669332742691, -0.0819675400853157, 0.02681589312851429, -0.023549072444438934, 0.03249352425336838, 0.02618698589503765, 0.0270080603659153, -0.033436886966228485, 0.028143586590886116, 0.0018266689730808139, -0.023129800334572792, 0.03857295960187912, -0.00791811291128397, -0.006913608871400356, 0.019583463668823242, -0.018150953575968742, -0.0004615805810317397, 0.033262189477682114, 0.04989328607916832, -0.00600518798455596, -0.021312957629561424, 0.01231609471142292, 0.00037013794644735754, -0.010079980827867985, 0.04035486280918121, 0.04122834652662277, -0.009468543343245983, 0.03179474174976349, 0.036791056394577026, 0.00319476006552577, 0.027706844732165337, -0.024929173290729523, 0.02538338303565979, -0.016133209690451622, 0.04318494349718094, -0.03425795957446098, 0.006241028197109699, 0.01328565925359726, 0.006979120429605246, 0.0016530645079910755, 0.07162551581859589, 0.009730587713420391, 0.027899011969566345, 0.023129800334572792, 0.0641135722398758, 0.0495089516043663, -0.018867209553718567, 0.030501987785100937, 0.023776177316904068, -0.023252088576555252, -0.014674495905637741, -0.005978983361274004, -0.03626696765422821, -0.006979120429605246, 0.04908968135714531, -0.01265675202012062, -0.09880827367305756, -0.0331399030983448, -0.011739596724510193, -0.0004176335351075977, -0.05377154424786568, 0.003819299628958106, 0.10034559667110443, 0.03293026611208916, -0.03588263690471649, -0.012892592698335648, 0.005778082646429539, -0.04398854821920395, 0.013766074553132057, 0.000988126383163035, -0.0007397299632430077, 0.03500915318727493, -0.005354444030672312, -0.07267369329929352, 0.04863547161221504, -0.028108647093176842, 0.05062700808048248, 0.030467048287391663, -0.001481643645092845, 0.01879733055830002, 0.0027951421216130257, -0.045875269919633865, -0.04063437879085541, 0.008302445523440838, 0.030257413163781166, 0.03060680441558361, 0.003151085926219821, -0.0042276522144675255, 0.07749531418085098, 0.03948138281702995, 0.04189218953251839, 0.005730041302740574, 0.0042582242749631405, 0.026850832626223564, -0.040284983813762665, -0.05429563298821449, -0.009625770151615143, -0.04025004431605339, -0.017548251897096634, 0.006834995932877064, 0.027025530114769936, 0.05338721349835396, -0.02817852608859539, 0.04758729413151741, -0.09314810484647751, -0.026082169264554977, -0.027095407247543335, -0.011818209663033485, 0.02351413294672966, -0.01194049697369337, 0.09727094322443008, -0.026221925392746925, 0.020806338638067245, -0.05971122160553932, -0.017740417271852493, -0.010455578565597534, 0.0015700836665928364, -0.0540161207318306, -0.015661530196666718, 0.00994895864278078, 0.025593020021915436, 0.02606469951570034, -0.04381385073065758, -0.07029782235622406, -0.021679820492863655, 0.013390476815402508, 0.05202458053827286, 0.0033235985320061445, 0.0036555216647684574, 0.02650143951177597, -0.05150049179792404, 0.020387066528201103, -0.031200772151350975, -0.008424732834100723, -0.02152259275317192, 0.041962068527936935, 0.01574014313519001, -0.040844012051820755, -0.01996779628098011, 0.011844414286315441, -0.007874439470469952, 0.02487676404416561, 0.05433057248592377, 0.049858346581459045, -0.029471278190612793, -0.03277304023504257, 0.0020548661705106497, -0.00980046670883894, 0.0029392666183412075, -0.036232028156518936, 0.08636988699436188, 0.06327502429485321, -0.009258908219635487, -0.06145818531513214, 0.041018709540367126, 0.010149859823286533, -0.011302855797111988, -0.0012501709861680865, -0.027724314481019974, -0.029471278190612793, 0.025243626907467842, -0.01732114516198635, 0.061248548328876495, -0.023234618827700615, 0.02961103618144989, -0.06673401594161987, -0.021819576621055603, -0.010132390074431896, -0.04549093544483185, 0.06945928186178207, -0.033751338720321655, 0.023409314453601837, -0.0031161466613411903, 0.00672144303098321, 0.08993369340896606, 0.039900653064250946, -0.017032897099852562, 0.0497884675860405, -0.014761843718588352, -0.007909378036856651, -0.008001093752682209, 0.004046404734253883, 0.013364273123443127, 0.013862157240509987, 0.012246215716004372, -0.01923407055437565, -0.01710277609527111, 0.03867777809500694, -0.018517816439270973, -0.00387389212846756, -0.015652794390916824, -0.023601479828357697, 0.03413567319512367, 0.009817936457693577, -0.0319170281291008, 0.010036306455731392, 0.0255755502730608, -0.005747510585933924, 0.045386116951704025, 0.031445346772670746, -0.015652794390916824, 0.02239607460796833, 0.030694153159856796, -0.02637915313243866, 0.014237754978239536, -0.0523739717900753, 0.009416135028004646, 0.020334657281637192, -0.0495089516043663, -0.0002627269714139402, -0.04311506450176239, -0.00433683767914772, 0.08259644359350204, 0.06617498397827148, 0.02487676404416561, -0.03333206847310066, -0.036057330667972565, 0.04367409273982048, 0.005813022144138813, 0.007953052408993244, 0.0017633415991440415, -0.04577045142650604, -0.02985561080276966, 0.047063205391168594, -0.06701353192329407, 0.037035632878541946, -0.0736519917845726, -0.007699742913246155, 0.031951967626810074, -0.04797162488102913, -0.023601479828357697, 0.012176337651908398, -0.018500346690416336, 0.0706472173333168, 0.026588788256049156, -0.04154279828071594, 0.005223421845585108, -0.001299304305575788, -0.019618403166532516, 0.01091852318495512, 0.02133042737841606, 0.001799372723326087, -0.03577781841158867, 0.006075066514313221, 0.009817936457693577, -0.011285386048257351, 0.14381006360054016, -0.0020898054353892803, 0.011128159239888191, -0.03320978209376335, -0.060130491852760315, -0.017260001972317696, -0.028912249952554703, -0.0018670675344765186, -0.017574455589056015, -0.008691145107150078, 0.015897370874881744, 0.02251836284995079, 0.08329523354768753, -0.017094040289521217, 0.004690597765147686, -0.010586600750684738, 0.06474247574806213, 0.022623181343078613, -0.0037930950056761503, -0.05911725386977196, 0.010804970748722553, -0.013163371942937374, 0.01415040623396635, -0.013783544301986694, 0.03142787888646126, 0.04430299997329712, 0.019635872915387154, 0.013582643121480942, -0.006791321560740471, -0.033192310482263565, -0.007302308455109596, 0.008616899140179157, -0.02550567127764225, 0.056077536195516586, -0.018133483827114105, -0.07777483016252518, 0.015207319520413876, -0.0018343119882047176, -0.04287049174308777, -0.0013014880241826177, -0.039097048342227936, -0.005389383062720299, -0.02999536693096161, -0.06296057254076004, -0.001527501386590302, -0.0014412450836971402, 0.00958209577947855, 0.010403169319033623, 0.01960093341767788, -0.019059374928474426, 0.003928484860807657, 0.009320051409304142, -0.008057869970798492, 0.027724314481019974, -0.010184798389673233, 0.02064911089837551, 0.0621919110417366, -0.023863524198532104, 0.002565853064879775, 0.019111784175038338, 0.06201721355319023, -0.04199700802564621, -0.013573908247053623, 0.01574014313519001, 0.014892865903675556, -0.040284983813762665, 0.036616358906030655, -0.024422554299235344, -0.019548524171113968, 0.03182968124747276, 0.04168255627155304, -0.05506429821252823, 0.006834995932877064, -0.01780156046152115, 0.023094860836863518, 0.024300266057252884, 0.06764243543148041, 0.016875669360160828, 0.025593020021915436, 0.0345025360584259, -0.01555671263486147, -0.03469470143318176, 0.03572540730237961, 0.0593268908560276, 0.007625496946275234, -0.015347076579928398, 0.02499905228614807, -0.08678916096687317, 0.011267916299402714, -0.0067345453426241875, 0.04821620136499405, 0.010796235874295235, 0.033559173345565796, 0.013407946564257145, 0.03616214916110039, 0.029209233820438385, -0.007752151694148779, -0.019321419298648834, 0.06170276179909706, -0.05380648374557495, 0.003788727568462491, -0.0005983351147733629, 0.014700700528919697, 0.02842310070991516, -0.001429234747774899, -0.00958209577947855, 0.014482329599559307, 0.015119971707463264, -0.018692512065172195, -0.0029873079620301723, -0.04073919355869293, -0.03453747183084488, -0.007608027197420597, 0.02477194555103779, -0.0626111775636673, 0.04433793947100639, -0.018028665333986282, 0.022920165210962296, 0.038922350853681564, -0.0697038546204567, 0.009372460655868053, -0.00021209231636021286, -0.005712571553885937, -0.01073509268462658, -0.012150133028626442, 0.03776935487985611, -0.03352423384785652, 0.03811874985694885, -0.015626590698957443, -0.022256318479776382, 0.0426957942545414, -0.010656478814780712, 0.0852518305182457, 0.06446295976638794, -0.06208709254860878, 0.08287595957517624, -0.019932856783270836, -0.0191641915589571, -0.005061827600002289, -0.016910608857870102, -0.07407126575708389, 0.024737006053328514, -0.034939274191856384, -0.0368259958922863, 0.08357474952936172, -0.009346256032586098, -0.02426532655954361, -0.01816842332482338, -0.0466439314186573, -0.008678042329847813, -0.038223568350076675, -0.006358948070555925, -0.06121360883116722, -0.017190122976899147, -0.04346445947885513, -0.04080907255411148, 0.038538020104169846, 0.03707057237625122, 0.018255772069096565, -0.02382858656346798, 0.02319967932999134, 0.008175790309906006, 0.0002827897551469505, 0.04660899192094803, -0.03584769740700722, -0.023217149078845978, -0.008822167292237282, -0.002648833906278014, 0.045071665197610855, 0.010935992933809757, 0.011486286297440529, 0.017190122976899147, 0.028597796335816383, 0.028108647093176842, -0.010970932431519032, -0.008140850812196732, 0.07805433869361877, 0.00045502945431508124, -0.07882300764322281, 0.02388099394738674, -0.003526683198288083, 0.06844604015350342, -0.0240032821893692, -0.05506429821252823, -0.04940413683652878, -0.0627509355545044, 0.023059921339154243, 0.04280061274766922, 0.011765801347792149, 0.005887268111109734, 0.03794405236840248, -0.02064911089837551, 0.001332059851847589, 0.05995579808950424, -0.008424732834100723, 0.0156877338886261, -0.09622276574373245, -0.001689095632173121, 0.045630693435668945, -0.056951019912958145, -0.02499905228614807, -0.06460271775722504, 0.027916481718420982, 0.0131284324452281, 0.010245942510664463, -0.0156877338886261, 0.028772493824362755, -0.0050923991948366165, -0.004839089699089527, 0.019810568541288376, -0.07819409668445587, -0.0025440158788114786, 0.03242364898324013, 0.013958240859210491, 0.02159247174859047, -0.010525456629693508, -0.02064911089837551, 0.01590610481798649, -0.028073707595467567, -0.04790174588561058, 0.018238302320241928, 0.036686237901449203, -0.0381886288523674, 0.03850308060646057, -0.029279112815856934, -0.007498841732740402, -0.026780953630805016, 0.0641135722398758, 0.02351413294672966, -0.02550567127764225, 0.004234203603118658, -0.037245266139507294, 0.01602839305996895, -0.04080907255411148, 0.02402075193822384, 0.021365366876125336, 0.008909515105187893, 0.051780007779598236, -0.056776322424411774, -0.005909104831516743, 0.016194354742765427, -0.025400852784514427, -0.010411904193460941, -0.002066876506432891, 0.015076297335326672, -0.00011621403245953843, 0.01770547777414322, -0.004480962175875902, -0.03563806042075157, 0.03937656432390213, 0.04049462080001831, -0.007293573580682278, -0.04430299997329712, -0.0071450816467404366, 0.07372187077999115, -0.011861884035170078, -0.0012064968468621373, -0.03581275790929794, 0.04884510859847069, 0.03762960061430931, 0.06034012883901596, -0.022727997973561287, -0.008970659226179123, -0.011818209663033485, -0.030344760045409203, -0.009617035277187824, 0.017478372901678085, -0.02526109665632248, -0.02681589312851429, -0.049299318343400955, -0.012429647147655487, 0.010062511079013348, 0.012167602777481079, 0.01726873591542244, -0.045141544193029404, 0.039411503821611404, 0.06551114469766617, -0.040669314563274384, 0.02961103618144989, 0.029471278190612793, -0.03626696765422821, 0.012141398154199123, 0.009695649147033691, -0.0692845806479454, 0.042031947523355484, 0.05855822563171387, 0.006105638574808836, -0.007704110350459814, 0.010001367889344692, -0.02817852608859539, -0.03142787888646126, -0.012918797321617603, 0.04622466117143631, -0.00034284163848496974, 0.009503482840955257, 0.03525372967123985, -0.023741237819194794, -0.028597796335816383, -0.04611984267830849, 0.00028115196619182825, -0.09237944334745407, 0.06334490329027176, -0.014491064473986626, 0.011329060420393944, -0.03864283859729767, -0.0005284565268084407, -0.00544179230928421, 0.0072105927392840385, -0.0013353354297578335, -0.010001367889344692, -0.014036853797733784, 0.003913198597729206, -0.03752478212118149, -0.04891498386859894, 0.014822987839579582, 0.04559575393795967, -0.04234640300273895, 0.08671928197145462, -0.012883857823908329, 0.01979309879243374, -0.01872745156288147, 0.004347756039351225, -0.020981034263968468, 0.04157773777842522, 0.04790174588561058, 0.02929658256471157, -0.05820883437991142, -0.025051459670066833, -0.0006059780716896057, 0.013582643121480942, -0.0626111775636673, -0.030379699543118477, -0.05202458053827286, -0.13276924192905426, -0.03465976193547249, 0.03432783856987953, 0.018867209553718567, -0.06163288280367851, -0.0020363046787679195, -0.0191641915589571, 0.005232156254351139, -0.03223147988319397, -0.004238571040332317, 0.0026684871409088373, -0.07917239516973495, -0.012761570513248444, 0.010307086631655693, 0.0031794740352779627, -0.05597271770238876, -0.009346256032586098, -0.060444947332143784, -0.01430763304233551, -0.05174506828188896, -0.03528866916894913, 0.10586600750684738, 0.002450116677209735, 0.025680366903543472, 0.04325482249259949, -0.01344288606196642, -0.06502199172973633, 0.02389846369624138, 0.02159247174859047, 0.019129253923892975, -0.037804294377565384, 0.05342215299606323, 0.02375870756804943, -0.02917429432272911, 0.06351960450410843, 0.027881542220711708, -0.01318957656621933, -0.03637178614735603, 0.006363315507769585, -0.042276524007320404, -0.01646513305604458, -0.006725810468196869, -0.04122834652662277, 0.04042474180459976, -0.05261854827404022, 0.0020155594684183598, -0.017565719783306122, -0.08860599994659424, -0.021138262003660202, 0.012796510010957718, -0.01829070970416069, -0.02419544756412506, 0.03086884878575802, -0.009713118895888329, 0.08294583857059479, -0.096292644739151, -0.027584558352828026, -0.02744480036199093, -0.06226179003715515, -0.06446295976638794, -0.015233524143695831, 0.0709267258644104, 0.03902716934680939, -0.06593041121959686, 0.012691691517829895, -0.05055713281035423, -0.010691418312489986, -0.011154363863170147, 0.04238134250044823, -0.007332880515605211, -0.041717495769262314, 0.019828038290143013, -0.03895729035139084, 0.0440584272146225, 0.008123381063342094, 0.1047479435801506, 0.009223968721926212, -0.006804423872381449, -0.0033760075457394123, 0.008883310481905937, -0.03577781841158867, -0.013914566487073898, -0.06421838700771332, 0.005236523691564798, 0.04430299997329712, 0.00037423238973133266, 0.0035878268536180258, -0.016683503985404968, -0.04608490318059921, -0.017312411218881607, -0.0017207593191415071, 0.08406389504671097, -0.01654374599456787, -0.02892971970140934, -0.022186439484357834, -0.04702826589345932, -0.06296057254076004, -0.02999536693096161, -0.01303234975785017, -0.004869661293923855, -0.036616358906030655, 0.010272147133946419, -0.021994274109601974, 0.00037341349525377154, -0.02188945561647415, 0.01303234975785017, 0.007839499972760677, -0.028213465586304665, -0.016211824491620064, -0.045001786202192307, 0.025121338665485382, 0.00964323990046978, -0.010970932431519032, 0.029471278190612793, -0.027165286242961884, 0.003559438744559884, 0.017600659281015396, -0.013958240859210491, 0.07071709632873535, 0.04790174588561058, -0.017260001972317696, 0.0320567861199379, 0.00885273888707161, 0.03558565303683281, 0.032563403248786926, 0.009066741913557053, -0.08776745945215225, -0.03181220963597298, -0.028161056339740753, 0.008485876023769379, -0.007704110350459814, -0.004642556421458721, -0.03776935487985611, 0.0074682701379060745, -0.007166918832808733, 0.06876049190759659, 0.03745490312576294, -0.0353236086666584, 0.03439771756529808, 0.019461175426840782, 0.01297120563685894, -0.03141040727496147, 0.02941886894404888, 0.015058827586472034, -0.021435245871543884, 0.0012447116896510124, 0.025715306401252747, 0.06987854838371277, 0.03258087486028671, 0.02943633869290352, 0.036301907151937485, -0.028667675331234932, -0.011250446550548077, -0.00939866527915001, 0.04224158450961113, -0.006852465216070414, 0.05593777820467949, -0.0040966300293803215, -0.05488960072398186, -0.022658120840787888, 0.03899222984910011, -0.06844604015350342, -0.005096766632050276, -0.006752015091478825, -0.01923407055437565, 0.0017666170606389642, -0.014089263044297695, 0.028720084577798843, 0.04056449979543686, 0.04266085475683212, 0.009678179398179054, -0.02108585275709629, -0.030100185424089432, 0.04437287896871567, 0.000531459110789001, -0.005044357851147652, 0.031637512147426605, -0.034624822437763214, -0.009983898140490055, 0.0056951018050313, -0.06526656448841095, 0.05143061280250549, 0.0099576935172081, 0.02499905228614807, 0.04206688702106476, -0.017155183479189873, 0.09014333039522171, 0.03864283859729767 ]
39,385
pyspark.sql.dataframe
freqItems
Finding frequent items for columns, possibly with false positives. Using the frequent element count algorithm described in "https://doi.org/10.1145/762471.762473, proposed by Karp, Schenker, and Papadimitriou". :func:`DataFrame.freqItems` and :func:`DataFrameStatFunctions.freqItems` are aliases. .. versionadded:: 1.4.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Parameters ---------- cols : list or tuple Names of the columns to calculate frequent items for as a list or tuple of strings. support : float, optional The frequency with which to consider an item 'frequent'. Default is 1%. The support must be greater than 1e-4. Returns ------- :class:`DataFrame` DataFrame with frequent items. Notes ----- This function is meant for exploratory data analysis, as we make no guarantee about the backward compatibility of the schema of the resulting :class:`DataFrame`. Examples -------- >>> df = spark.createDataFrame([(1, 11), (1, 11), (3, 10), (4, 8), (4, 8)], ["c1", "c2"]) >>> df.freqItems(["c1", "c2"]).show() # doctest: +SKIP +------------+------------+ |c1_freqItems|c2_freqItems| +------------+------------+ | [4, 1, 3]| [8, 11, 10]| +------------+------------+
def freqItems( self, cols: Union[List[str], Tuple[str]], support: Optional[float] = None ) -> "DataFrame": """ Finding frequent items for columns, possibly with false positives. Using the frequent element count algorithm described in "https://doi.org/10.1145/762471.762473, proposed by Karp, Schenker, and Papadimitriou". :func:`DataFrame.freqItems` and :func:`DataFrameStatFunctions.freqItems` are aliases. .. versionadded:: 1.4.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Parameters ---------- cols : list or tuple Names of the columns to calculate frequent items for as a list or tuple of strings. support : float, optional The frequency with which to consider an item 'frequent'. Default is 1%. The support must be greater than 1e-4. Returns ------- :class:`DataFrame` DataFrame with frequent items. Notes ----- This function is meant for exploratory data analysis, as we make no guarantee about the backward compatibility of the schema of the resulting :class:`DataFrame`. Examples -------- >>> df = spark.createDataFrame([(1, 11), (1, 11), (3, 10), (4, 8), (4, 8)], ["c1", "c2"]) >>> df.freqItems(["c1", "c2"]).show() # doctest: +SKIP +------------+------------+ |c1_freqItems|c2_freqItems| +------------+------------+ | [4, 1, 3]| [8, 11, 10]| +------------+------------+ """ if isinstance(cols, tuple): cols = list(cols) if not isinstance(cols, list): raise PySparkTypeError( error_class="NOT_LIST_OR_TUPLE", message_parameters={"arg_name": "cols", "arg_type": type(cols).__name__}, ) if not support: support = 0.01 return DataFrame( self._jdf.stat().freqItems(_to_seq(self._sc, cols), support), self.sparkSession )
(self, cols: Union[List[str], Tuple[str]], support: Optional[float] = None) -> pyspark.sql.dataframe.DataFrame
[ 0.02394036576151848, -0.027439769357442856, -0.007753308862447739, 0.031864941120147705, 0.06254489719867706, 0.05054694414138794, 0.016941558569669724, 0.05991571769118309, 0.006378543097525835, 0.07046947628259659, 0.02490316517651081, 0.024088488891720772, 0.0020864501129835844, -0.008327284827828407, 0.0006185288657434285, 0.004677443765103817, 0.0011965554440394044, -0.0046080113388597965, 0.04080786183476448, 0.03480888530611992, 0.003293420420959592, 0.010840745642781258, 0.02364411950111389, 0.02534753456711769, -0.03597535192966461, 0.028828421607613564, -0.007582041900604963, -0.0011722539784386754, 0.004489975981414318, -0.0020621486473828554, -0.05154677480459213, 0.033161018043756485, -0.005471290089190006, 0.020552054047584534, -0.010155676864087582, -0.02405145764350891, 0.02047799341380596, -0.02353302761912346, -0.014201284386217594, -0.03708627447485924, -0.028939515352249146, -0.04732527211308479, 0.05861964449286461, -0.06547033041715622, -0.027698984369635582, 0.04380735382437706, 0.07350599765777588, 0.01176651380956173, 0.016524963080883026, -0.020792754366993904, 0.0031892715487629175, -0.0356050468981266, -0.029587551951408386, -0.003635954577475786, -0.014525303617119789, 0.04388141259551048, -0.012340490706264973, -0.0342349074780941, 0.023292329162359238, 0.009989039041101933, 0.041844721883535385, 0.007295053452253342, 0.05302800238132477, -0.0022079572081565857, -0.03623456880450249, 0.01979292370378971, 0.04128926247358322, 0.009711308404803276, -0.07309865951538086, -0.004406656604260206, -0.008415233343839645, 0.005091725382953882, 0.009729824028909206, 0.09376180171966553, 0.002974030328914523, -0.0277545303106308, 0.001240529352799058, -0.05439814180135727, 0.014747487381100655, -0.04799182340502739, 0.0694696456193924, -0.02868029847741127, 0.0250327717512846, -0.04465905949473381, 0.03784540295600891, 0.0356050468981266, 0.04128926247358322, 0.037456583231687546, 0.013923553749918938, 0.03143908828496933, -0.043140798807144165, 0.023384904488921165, 0.04217800125479698, -0.009924234822392464, -0.016200942918658257, -0.03817868232727051, -0.015710286796092987, -0.012072017416357994, 0.02227398380637169, 0.011488783173263073, -0.0030642927158623934, -0.00743391877040267, -0.03086511231958866, -0.016006533056497574, -0.0008227765210904181, -0.024199580773711205, -0.01897824928164482, -0.06850684434175491, -0.025254957377910614, -0.025291986763477325, -0.04328892007470131, 0.06069336459040642, 0.11131437122821808, 0.026421424001455307, -0.005651814863085747, 0.016987847164273262, -0.006966406013816595, -0.01711745373904705, 0.002536604879423976, 0.047806669026613235, -0.043955475091934204, 0.004508491139858961, 0.048621345311403275, -0.051768958568573, 0.009535412304103374, -0.058101214468479156, -0.005332424771040678, -0.0010380175663158298, 0.05102834478020668, 0.09220651537179947, 0.07739422470331192, -0.016895269975066185, 0.039771001785993576, 0.05943432077765465, 0.05950837954878807, -0.01308110449463129, 0.06943261623382568, -0.00648037763312459, 0.006771994289010763, 0.03038371354341507, -0.007410774473100901, -0.015802863985300064, 0.0017288721865043044, 0.050732098519802094, -0.0027518460992723703, 0.01744147390127182, 0.05362049490213394, 0.012766343541443348, -0.03749361261725426, -0.017784006893634796, -0.01275708619505167, -0.009961266070604324, -0.02108900062739849, -0.007406145799905062, -0.014756745658814907, 0.0027958201244473457, -0.013108878396451473, 0.0026708412915468216, 0.009391918778419495, -0.029143182560801506, 0.0003353016800247133, -0.0020193320233374834, -0.06361879408359528, 0.1022048145532608, -0.03586426004767418, 0.0551757849752903, -0.013849492184817791, -0.02166297659277916, 0.009887204505503178, -0.03590129315853119, 0.08265258371829987, 0.03869711235165596, 0.037419550120830536, -0.0630263015627861, -0.028624752536416054, 0.06721077114343643, -0.03021707385778427, -0.040178339928388596, 0.031698305159807205, -0.02203328348696232, 0.030809566378593445, -0.08220821619033813, -0.031494636088609695, -0.06235974654555321, -0.01622871682047844, 0.0231627207249403, -0.0013747657649219036, -0.000973792455624789, 0.018070995807647705, 0.05643482878804207, -0.05136162042617798, -0.02755086123943329, 0.04247424751520157, 0.029032090678811073, 0.012340490706264973, -0.033327654004096985, -0.003929886035621166, 0.005193559918552637, -0.05399080365896225, -0.03828977420926094, 0.01739518530666828, 0.05469438433647156, 0.020292839035391808, -0.003300363663583994, 0.025532687082886696, 0.013247743248939514, 0.003939143847674131, 0.003554950002580881, -0.06580360233783722, -0.026551032438874245, 0.0022635033819824457, -0.057175446301698685, -0.02721758559346199, -0.01578434742987156, -0.003878968767821789, 0.05487953871488571, -0.014803033322095871, 0.013219970278441906, -0.015377010218799114, -0.07039541751146317, 0.04510342702269554, 0.011627648957073689, -0.03688260540366173, 0.02077423967421055, 0.05780496820807457, -0.07924576103687286, 0.03164275735616684, 0.005813824478536844, -0.008327284827828407, -0.01955222524702549, -0.03545692190527916, -0.025180894881486893, 0.025606749579310417, -0.03580871596932411, -0.028772875666618347, -0.03338320180773735, 0.04936196282505989, 0.042252060025930405, 0.0328647717833519, -0.016450900584459305, -0.005077838432043791, 0.003307306906208396, 0.048176977783441544, 0.02830999158322811, -0.013738400302827358, 0.0015564478235319257, 0.0014766003005206585, 0.02145930752158165, -0.016654569655656815, 0.014192027039825916, -0.006832169368863106, -0.03654932975769043, -0.02142227627336979, -0.047029025852680206, 0.010118646547198296, -0.032346341758966446, -0.031142842024564743, 0.0459921658039093, -0.040548648685216904, 0.006420202553272247, 0.035308800637722015, 0.04725120961666107, 0.014210541732609272, 0.04221503064036369, -0.05736059695482254, -0.02295905165374279, 0.010785199701786041, -0.004022462759166956, -0.05425001680850983, 0.04965820536017418, -0.07432067394256592, -0.0072487653233110905, 0.04477015137672424, -0.034383032470941544, -0.04080786183476448, -0.02108900062739849, 0.022125860676169395, -0.04217800125479698, -0.08294883370399475, -0.006656273268163204, -0.012414551340043545, -0.0514356829226017, 0.01861719973385334, 0.05906401202082634, -0.015534390695393085, 0.02482910268008709, -0.021311184391379356, 0.05180598795413971, 0.004395084455609322, -0.0036313259042799473, -0.018635714426636696, 0.03143908828496933, 0.004943602252751589, 0.0630263015627861, -0.002599094295874238, 0.04169660061597824, 0.0476955771446228, -0.0001361168542644009, 0.02186664566397667, 0.035031069070100784, -0.037252914160490036, -0.011479525826871395, -0.01432163454592228, 0.034827399998903275, 0.03858602046966553, -0.043103769421577454, 0.030291136354207993, -0.04477015137672424, -0.017941387370228767, 0.01947816275060177, -0.006892344448715448, 0.034864429384469986, 0.003159184008836746, -0.023421935737133026, -0.046584658324718475, -0.025569718331098557, -0.064063161611557, 0.022699836641550064, 0.004732990171760321, 0.018117284402251244, 0.044473905116319656, 0.022255467250943184, -0.005188930779695511, 0.02182961441576481, 0.004837139043956995, 0.07406146079301834, 0.03225376456975937, -0.02660657837986946, 0.033568356186151505, -0.04554779455065727, -0.019755894318223, 0.034420061856508255, 0.03347577899694443, -0.05902698263525963, -0.04588107392191887, -0.021477822214365005, 0.035105131566524506, 0.04006724804639816, 0.009253052994608879, 0.04584404081106186, 0.0018272349843755364, -0.02993934415280819, -0.028902484104037285, 0.018117284402251244, -0.04236315190792084, -0.031420573592185974, -0.0076098148711025715, -0.015099279582500458, 0.04177066311240196, 0.04680684208869934, 0.061804287135601044, -0.04277049005031586, 0.01723780483007431, 0.026421424001455307, 0.034179363399744034, 0.027476800605654716, -0.018691260367631912, 0.05650889128446579, 0.023625604808330536, 0.0073644863441586494, 0.04754745587706566, 0.0006405158783309162, 0.02705094777047634, -0.004753819666802883, 0.03354984149336815, 0.010248254053294659, 0.006915488746017218, 0.06702561676502228, -0.037252914160490036, -0.008003266528248787, 0.027643438428640366, 0.018598683178424835, 0.05232441797852516, 0.03242040425539017, 0.02608814835548401, 0.054842509329319, -0.01740444265305996, 0.03180939704179764, -0.020015109330415726, -0.025180894881486893, -0.02616220898926258, -0.02803226187825203, 0.011109218932688236, -0.039771001785993576, 0.006859942339360714, 0.023588573560118675, -0.08287476748228073, -0.04380735382437706, 0.0006752322078682482, -0.010044584982097149, -0.04340001568198204, 0.03504958376288414, -0.052916910499334335, 0.0014164253370836377, -0.043214861303567886, -0.00005012167093809694, -0.0023040056694298983, -0.0016686972230672836, 0.012497871182858944, 0.005392599850893021, -0.029791221022605896, -0.039252571761608124, -0.029846766963601112, -0.025791902095079422, -0.031698305159807205, 0.0742466077208519, 0.025495655834674835, -0.05558312311768532, -0.04251127690076828, 0.005642557051032782, 0.017228545621037483, 0.0112388264387846, -0.07339490205049515, 0.01907082460820675, -0.037456583231687546, -0.04136332497000694, -0.040215373039245605, -0.029754189774394035, 0.05469438433647156, 0.010451923124492168, 0.024995742365717888, 0.006063781678676605, -0.0016247231978923082, 0.07924576103687286, -0.002897654427215457, -0.0398450642824173, -0.04676980897784233, 0.03858602046966553, 0.038511957973241806, -0.00648037763312459, -0.03854898735880852, -0.0042029875330626965, -0.009516897611320019, -0.030809566378593445, 0.01219236757606268, -0.025773387402296066, -0.0308280810713768, -0.04758448526263237, -0.046473562717437744, -0.010127903893589973, 0.002020489191636443, -0.007632959168404341, 0.039771001785993576, 0.015830636024475098, 0.02619924023747444, -0.02725461684167385, -0.024532858282327652, -0.01350695826113224, -0.12464543431997299, -0.00985943153500557, 0.03497552499175072, 0.0009078314760699868, 0.017746977508068085, -0.011822059750556946, -0.0016582823591306806, 0.012118306010961533, -0.05099131166934967, 0.048695407807826996, -0.011340660974383354, -0.009225280024111271, 0.0565459243953228, -0.005045436788350344, -0.006022122222930193, -0.0606193020939827, -0.04391844570636749, 0.006730334833264351, -0.06691452860832214, -0.06080445647239685, 0.001299547147937119, -0.020959392189979553, 0.05980462580919266, 0.019737377762794495, -0.026254786178469658, -0.07132118195295334, 0.005114869214594364, -0.02101493813097477, -0.07865326851606369, 0.007674618624150753, 0.03458670154213905, -0.014414210803806782, 0.004186786711215973, 0.03640120476484299, 0.05699029192328453, -0.02060759998857975, 0.025977056473493576, -0.04384438320994377, -0.028013745322823524, -0.0711730569601059, 0.019089341163635254, 0.015812121331691742, 0.0072672804817557335, -0.002462543547153473, 0.004367311485111713, -0.005300023127347231, 0.038030557334423065, -0.009803885594010353, 0.04847322404384613, 0.01028528530150652, -0.03123541921377182, 0.045658890157938004, 0.006748850457370281, -0.010664849542081356, -0.05573124811053276, 0.03647526726126671, -0.009572443552315235, -0.07028432190418243, 0.06698858737945557, -0.020015109330415726, -0.020052138715982437, -0.064063161611557, -0.042696431279182434, -0.04365922883152962, 0.03240188583731651, 0.020626116544008255, 0.038474928587675095, -0.00789217371493578, -0.00831802748143673, 0.003622068092226982, 0.017052650451660156, 0.003402198199182749, -0.013534731231629848, -0.005309280939400196, 0.03367944806814194, 0.041400354355573654, -0.0013608792796730995, -0.004948230925947428, 0.07383926957845688, 0.021644460037350655, 0.0371418222784996, 0.03225376456975937, -0.04502936452627182, 0.045288581401109695, -0.01971886307001114, -0.0154140405356884, 0.026032602414488792, 0.03541989251971245, 0.033975694328546524, -0.018598683178424835, -0.00713767297565937, 0.0463254414498806, 0.007258022669702768, 0.04714011773467064, 0.016460159793496132, -0.04880649968981743, -0.017867326736450195, -0.07021026313304901, 0.020922360941767693, -0.09087340533733368, 0.10761129856109619, -0.02494019642472267, -0.06661827862262726, -0.03706775978207588, 0.035234738141298294, 0.02864326909184456, 0.005989720579236746, 0.0223110131919384, 0.036530815064907074, -0.02084830030798912, -0.0029832881409674883, -0.015358494594693184, -0.04913977533578873, -0.005549980327486992, 0.06806247681379318, 0.019607771188020706, 0.012831147760152817, -0.010961095802485943, 0.03325359523296356, -0.008628159761428833, -0.010183450765907764, -0.010183450765907764, 0.02353302761912346, 0.025940025225281715, -0.00849855225533247, -0.029661614447832108, -0.015913955867290497, -0.03153166547417641, -0.014210541732609272, -0.03304992616176605, -0.019422616809606552, -0.03965990990400314, -0.10872221738100052, 0.06487783789634705, -0.030902143567800522, 0.0098779471591115, -0.020940877497196198, -0.0016062078066170216, -0.017904357984662056, 0.022810928523540497, -0.03651229664683342, 0.04588107392191887, -0.008970693685114384, -0.10124201327562332, -0.030402228236198425, -0.017302608117461205, 0.03458670154213905, 0.022903505712747574, -0.08235634118318558, -0.01085000392049551, -0.010192708112299442, -0.045214518904685974, -0.009627989493310452, 0.04473312199115753, 0.0006995336152613163, -0.04047458618879318, 0.01221088320016861, -0.021126030012965202, -0.01704339310526848, 0.09153996407985687, 0.003538748947903514, 0.03106878139078617, -0.05769387632608414, 0.05136162042617798, 0.02442176640033722, 0.03740103542804718, 0.0055916402488946915, -0.006827540695667267, -0.019200433045625687, -0.03042074292898178, -0.0019070825073868036, -0.011442495509982109, -0.08709627389907837, -0.017552565783262253, 0.04332595318555832, -0.004957488738000393, 0.015839893370866776, 0.013090362772345543, -0.025977056473493576, 0.011812802404165268, -0.012812632136046886, 0.009109559468925, 0.05095428228378296, -0.028569206595420837, 0.0640261322259903, 0.006054524332284927, 0.023921851068735123, 0.001496272860094905, -0.06943261623382568, -0.013229227624833584, 0.0057073612697422504, 0.010720395483076572, 0.04332595318555832, 0.07887545228004456, 0.028328508138656616, -0.01691378466784954, -0.0035040327347815037, -0.04754745587706566, -0.024773556739091873, 0.0023977397941052914, 0.049473054707050323, 0.003999318461865187, -0.01425683032721281, -0.06843278557062149, 0.037826888263225555, -0.017830295488238335, 0.029346851631999016, 0.01982995495200157, 0.031142842024564743, -0.027976715937256813, -0.04336298257112503, 0.01566399820148945, 0.004925087094306946, -0.004316394217312336, 0.04377032071352005, -0.008854973129928112, -0.011442495509982109, 0.014358664862811565, 0.08235634118318558, -0.00598509144037962, -0.032105643302202225, 0.05010257661342621, 0.06150804087519646, 0.061915379017591476, 0.011285114102065563, 0.02036690153181553, 0.014673425815999508, 0.04551076516509056, -0.06809951364994049, -0.01590469852089882, -0.004832509905099869, -0.008243965916335583, 0.038474928587675095, -0.0371418222784996, -0.05013960599899292, 0.058508552610874176, -0.03018004447221756, -0.03899335861206055, -0.011498041450977325, -0.034012723714113235, -0.058508552610874176, -0.08531879633665085, 0.008975323289632797, -0.02016323246061802, 0.023347875103354454, -0.0030712359584867954, -0.06091554835438728, 0.009317857213318348, -0.031179873272776604, 0.004832509905099869, 0.09398399293422699, 0.015358494594693184, 0.023458966985344887, 0.0674329549074173, 0.09702050685882568, 0.01873754896223545, 0.006179502699524164, 0.0694696456193924, -0.04373329132795334, 0.019218947738409042, -0.03416084870696068, 0.02425512671470642, -0.008364316076040268, 0.038511957973241806, -0.03899335861206055, 0.02718055434525013, -0.07672767341136932, -0.0014731286792084575, 0.0063322545029222965, -0.003800278529524803, 0.006017493549734354, 0.012849662452936172, 0.016895269975066185, 0.013969842344522476, -0.015451071783900261, 0.014978929422795773, -0.027717500925064087, -0.017145227640867233, 0.010785199701786041, 0.06809951364994049, 0.04517748951911926, -0.06602578610181808, 0.00444137305021286, -0.02442176640033722, 0.006929375231266022, -0.003115209983661771, 0.006494264118373394, -0.03862304985523224, 0.0026407537516206503, -0.016034305095672607, 0.02442176640033722, -0.009202135726809502, 0.00654981005936861, 0.016941558569669724, 0.014636395499110222, 0.024440281093120575, 0.016811950132250786, -0.004196044523268938, -0.044436875730752945, -0.022903505712747574, 0.004418228752911091, -0.012396036647260189, 0.004635784309357405, -0.004242332652211189, -0.055064693093299866, -0.010822230018675327, 0.03686409071087837, 0.04077083244919777, -0.054212987422943115, -0.05321315675973892, -0.025625264272093773, -0.04984335973858833, 0.007429290097206831, 0.0012231712462380528, 0.02738422341644764, -0.0015645482344552875, -0.06650719046592712, 0.025180894881486893, 0.05402783304452896, 0.009618732146918774 ]
39,386
pyspark.sql.dataframe
groupBy
Groups the :class:`DataFrame` using the specified columns, so we can run aggregation on them. See :class:`GroupedData` for all the available aggregate functions. :func:`groupby` is an alias for :func:`groupBy`. .. versionadded:: 1.3.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Parameters ---------- cols : list, str or :class:`Column` columns to group by. Each element should be a column name (string) or an expression (:class:`Column`) or list of them. Returns ------- :class:`GroupedData` Grouped data by given columns. Examples -------- >>> df = spark.createDataFrame([ ... (2, "Alice"), (2, "Bob"), (2, "Bob"), (5, "Bob")], schema=["age", "name"]) Empty grouping columns triggers a global aggregation. >>> df.groupBy().avg().show() +--------+ |avg(age)| +--------+ | 2.75| +--------+ Group-by 'name', and specify a dictionary to calculate the summation of 'age'. >>> df.groupBy("name").agg({"age": "sum"}).sort("name").show() +-----+--------+ | name|sum(age)| +-----+--------+ |Alice| 2| | Bob| 9| +-----+--------+ Group-by 'name', and calculate maximum values. >>> df.groupBy(df.name).max().sort("name").show() +-----+--------+ | name|max(age)| +-----+--------+ |Alice| 2| | Bob| 5| +-----+--------+ Group-by 'name' and 'age', and calculate the number of rows in each group. >>> df.groupBy(["name", df.age]).count().sort("name", "age").show() +-----+---+-----+ | name|age|count| +-----+---+-----+ |Alice| 2| 1| | Bob| 2| 2| | Bob| 5| 1| +-----+---+-----+
def groupBy(self, *cols: "ColumnOrName") -> "GroupedData": # type: ignore[misc] """Groups the :class:`DataFrame` using the specified columns, so we can run aggregation on them. See :class:`GroupedData` for all the available aggregate functions. :func:`groupby` is an alias for :func:`groupBy`. .. versionadded:: 1.3.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Parameters ---------- cols : list, str or :class:`Column` columns to group by. Each element should be a column name (string) or an expression (:class:`Column`) or list of them. Returns ------- :class:`GroupedData` Grouped data by given columns. Examples -------- >>> df = spark.createDataFrame([ ... (2, "Alice"), (2, "Bob"), (2, "Bob"), (5, "Bob")], schema=["age", "name"]) Empty grouping columns triggers a global aggregation. >>> df.groupBy().avg().show() +--------+ |avg(age)| +--------+ | 2.75| +--------+ Group-by 'name', and specify a dictionary to calculate the summation of 'age'. >>> df.groupBy("name").agg({"age": "sum"}).sort("name").show() +-----+--------+ | name|sum(age)| +-----+--------+ |Alice| 2| | Bob| 9| +-----+--------+ Group-by 'name', and calculate maximum values. >>> df.groupBy(df.name).max().sort("name").show() +-----+--------+ | name|max(age)| +-----+--------+ |Alice| 2| | Bob| 5| +-----+--------+ Group-by 'name' and 'age', and calculate the number of rows in each group. >>> df.groupBy(["name", df.age]).count().sort("name", "age").show() +-----+---+-----+ | name|age|count| +-----+---+-----+ |Alice| 2| 1| | Bob| 2| 2| | Bob| 5| 1| +-----+---+-----+ """ jgd = self._jdf.groupBy(self._jcols(*cols)) from pyspark.sql.group import GroupedData return GroupedData(jgd, self)
(self, *cols: 'ColumnOrName') -> 'GroupedData'
[ 0.03236059844493866, -0.045619986951351166, -0.003821682883426547, 0.04250691458582878, 0.002450104570016265, -0.06552828848361969, 0.01682405173778534, 0.03212999925017357, 0.020465580746531487, 0.07486750930547714, -0.0014520472614094615, -0.00466720899567008, 0.039067160338163376, 0.018524711951613426, 0.02106129191815853, -0.03701099380850792, 0.004873786587268114, -0.040585264563560486, 0.0562659315764904, -0.01445081364363432, -0.005174044519662857, -0.02870946191251278, 0.026345830410718918, -0.000013952610061096493, -0.02040793001651764, 0.06591261923313141, 0.05384465306997299, -0.040738996118307114, 0.016679927706718445, 0.005904271733015776, -0.04796440154314041, -0.02486616000533104, -0.0339747853577137, 0.0006773818749934435, -0.03274492919445038, -0.03353280574083328, 0.011433822102844715, -0.019533580169081688, 0.02657642960548401, -0.0384906642138958, 0.048233430832624435, 0.03624233230948448, -0.005817797500640154, -0.07087048143148422, 0.017813701182603836, 0.06110849231481552, 0.01886100135743618, -0.0024861355777829885, 0.004251652397215366, -0.03526229038834572, -0.025750119239091873, -0.0254810880869627, -0.017909783869981766, 0.01686248555779457, -0.007071674335747957, 0.005053941160440445, 0.0070332414470613, -0.02154170349240303, 0.0071437363512814045, 0.016036175191402435, 0.013730194419622421, 0.011875801719725132, 0.01425864826887846, -0.01178932748734951, -0.06245364621281624, 0.022195065394043922, -0.03595408424735069, -0.008801160380244255, -0.09454521536827087, -0.037030208855867386, -0.054305847734212875, 0.013297823257744312, 0.01983143575489521, 0.06844919919967651, -0.04596588388085365, 0.0040018376894295216, -0.03355202078819275, 0.013384297490119934, 0.06026296690106392, -0.0259038507938385, 0.03726080805063248, -0.0419304184615612, -0.026211315765976906, -0.029977750033140182, 0.042737510055303574, 0.005025116726756096, 0.029016925022006035, 0.04223788157105446, -0.00838320143520832, -0.04512035846710205, 0.010309656150639057, 0.05526667460799217, -0.0031707235611975193, 0.022195065394043922, -0.01715073175728321, -0.0698712170124054, -0.06007080152630806, 0.04827186465263367, 0.047195740044116974, 0.07367608696222305, 0.024328097701072693, -0.016170689836144447, 0.017967434599995613, -0.041738253086805344, 0.0033821051474660635, -0.0410848930478096, 0.015123390592634678, -0.03474344313144684, -0.045197226107120514, 0.011539512313902378, -0.011270481161773205, 0.013557245954871178, 0.03382105380296707, 0.014700627885758877, 0.024539479985833168, 0.013096049427986145, 0.023732386529445648, -0.01940867118537426, -0.06572045385837555, 0.020753826946020126, -0.04043152928352356, 0.06802643835544586, 0.026134449988603592, -0.03320612385869026, -0.0024981459137052298, 0.02609601616859436, 0.028171399608254433, -0.02680702693760395, -0.01527712307870388, 0.05926370620727539, 0.04834873229265213, 0.007696210872381926, 0.012846235185861588, -0.02632661536335945, 0.02257939614355564, 0.007196581922471523, 0.1099952831864357, 0.047042008489370346, 0.02965107001364231, 0.04658081382513046, 0.02031184732913971, -0.036991775035858154, 0.0052316938526928425, 0.027133706957101822, 0.03910559043288231, 0.0028320327401161194, 0.07509811222553253, -0.032956309616565704, -0.07333019375801086, -0.009420892223715782, -0.024462614208459854, -0.024923808872699738, 0.04269907996058464, -0.01345155481249094, 0.0027167336083948612, 0.03291787579655647, -0.010232790373265743, 0.00621654000133276, -0.02774863690137863, -0.036184683442115784, 0.009574624709784985, 0.04569685459136963, 0.01112635713070631, 0.04070056229829788, -0.037183940410614014, 0.029785586521029472, -0.012567595578730106, 0.027940800413489342, -0.02140718884766102, -0.03445519879460335, 0.011145574040710926, 0.00439337408170104, 0.01447002962231636, -0.018591970205307007, -0.0645674616098404, 0.08009440451860428, 0.002248331205919385, 0.0456584207713604, 0.03272571042180061, -0.0634913370013237, 0.015594195574522018, -0.04127705842256546, -0.0367419607937336, 0.03084249421954155, 0.01575753651559353, 0.005519941449165344, -0.013086440972983837, -0.03931697458028793, -0.00202614045701921, -0.03966287150979042, -0.018937867134809494, -0.03443598002195358, -0.03820241615176201, 0.061800286173820496, 0.02040793001651764, -0.036088600754737854, -0.0013259389670565724, 0.025039108470082283, 0.013528420589864254, 0.07840334624052048, -0.014441205188632011, 0.01672796905040741, 0.04223788157105446, -0.0036991776432842016, -0.019370239228010178, -0.023790035396814346, -0.0374721884727478, 0.009137448854744434, -0.01824607327580452, -0.047618504613637924, 0.042737510055303574, -0.03816398233175278, -0.006274189334362745, 0.04608118534088135, 0.053883086889982224, 0.007475221063941717, 0.02774863690137863, -0.009127840399742126, 0.02719135768711567, 0.030592679977416992, 0.05407525226473808, 0.012557987123727798, -0.008493696339428425, 0.027863934636116028, 0.05549727380275726, -0.06303014606237411, 0.030592679977416992, 0.0024861355777829885, 0.02444339729845524, -0.06026296690106392, 0.005236498080193996, -0.08639741688966751, 0.017352506518363953, -0.030150700360536575, -0.04043152928352356, 0.027364306151866913, 0.02722978964447975, -0.007859551347792149, 0.03664587810635567, -0.03966287150979042, -0.029055358842015266, 0.05861034616827965, 0.0438520684838295, 0.0046744151040911674, -0.011308914050459862, -0.034705013036727905, -0.0048329513520002365, 0.06706561148166656, 0.017544670030474663, 0.022906076163053513, 0.0010809284867718816, -0.00014464925334323198, 0.020100466907024384, 0.02267547883093357, -0.02196446806192398, -0.041392356157302856, -0.009079799987375736, 0.05499764159321785, 0.019658487290143967, 0.025019891560077667, 0.012260131537914276, -0.016776010394096375, -0.048233430832624435, 0.045812152326107025, 0.040124066174030304, -0.007624149322509766, 0.05534353852272034, -0.010963017120957375, 0.031111525371670723, 0.0027863935101777315, 0.00712932413443923, 0.021503271535038948, 0.024943025782704353, -0.07037084549665451, -0.012654069811105728, 0.005332580767571926, -0.0019240527180954814, -0.05561257153749466, -0.039355404675006866, -0.06779583543539047, 0.060570430010557175, 0.01335547212511301, -0.015363597311079502, -0.0437367707490921, -0.008839593268930912, 0.057764820754528046, -0.03372497111558914, -0.03364810347557068, -0.07617423683404922, -0.0020297435112297535, -0.022329581901431084, -0.015911268070340157, -0.06425999850034714, 0.008743510581552982, -0.027345089241862297, 0.006701756734400988, 0.029785586521029472, -0.019005125388503075, -0.05403681844472885, -0.023213541135191917, -0.03549288958311081, 0.00038913427852094173, 0.09416088461875916, 0.07413728535175323, -0.03116917423903942, -0.06791113317012787, -0.008450458757579327, -0.034666579216718674, 0.011453038081526756, -0.006879509426653385, 0.027114491909742355, 0.020388713106513023, 0.030342863872647285, -0.03164958581328392, -0.07163913547992706, -0.009973366744816303, 0.015267514623701572, 0.011395388282835484, 0.01586322672665119, 0.019206898286938667, 0.03107309155166149, -0.07298429310321808, -0.052499495446681976, -0.0034013218246400356, 0.04596588388085365, 0.09339222311973572, 0.047426339238882065, -0.017900176346302032, 0.029362821951508522, 0.0017198773566633463, 0.03359045460820198, -0.009468933567404747, 0.044812895357608795, 0.0032571980264037848, -0.0544595792889595, -0.06979435682296753, -0.0037856518756598234, -0.03658822923898697, -0.004823343362659216, 0.0383753627538681, -0.02167621999979019, -0.09093251079320908, 0.00046840234426781535, -0.030496597290039062, 0.012490729801356792, -0.01091497577726841, 0.026768594980239868, -0.020004384219646454, -0.0039009510073810816, 0.05718832463026047, 0.03804868459701538, -0.00459514744579792, 0.02477007731795311, -0.002920909086242318, 0.04166138544678688, 0.013211348094046116, -0.005270127207040787, 0.06525925546884537, 0.021983683109283447, -0.02945890463888645, 0.09954150766134262, -0.051653970032930374, 0.06356820464134216, -0.03180331736803055, 0.012557987123727798, 0.021176591515541077, -0.006802643649280071, 0.009017345495522022, 0.0010863331845030189, -0.012827018275856972, 0.030727194622159004, -0.00912303663790226, 0.029113007709383965, 0.06425999850034714, -0.006567241158336401, 0.030957791954278946, 0.03207235038280487, -0.01057868730276823, -0.003014589427039027, 0.004016249906271696, 0.012778976932168007, -0.05100060999393463, 0.07094734162092209, 0.009632274508476257, 0.01637246459722519, 0.07183130085468292, -0.012048750184476376, -0.05861034616827965, -0.049463290721178055, -0.050846878439188004, -0.006240560673177242, 0.03977816924452782, 0.02011968195438385, 0.012846235185861588, -0.06191558390855789, -0.01857275329530239, -0.011885409243404865, -0.01675679348409176, -0.014412379823625088, -0.012567595578730106, -0.034897178411483765, -0.023309623822569847, 0.03274492919445038, -0.03947070613503456, 0.01692013442516327, 0.013710977509617805, 0.02576933614909649, -0.09854225069284439, -0.029170658439397812, -0.026134449988603592, 0.050039783120155334, -0.0009452119120396674, -0.02509675733745098, 0.028786327689886093, 0.05549727380275726, 0.027364306151866913, 0.03268727660179138, -0.006264581345021725, 0.057303622364997864, 0.029958534985780716, 0.02557717077434063, -0.009574624709784985, -0.04727260768413544, 0.07863394916057587, -0.012375430203974247, -0.04834873229265213, -0.023232756182551384, -0.012730935588479042, -0.016872093081474304, 0.004057085141539574, -0.0250583253800869, -0.005640044808387756, -0.05303755775094032, 0.0149984834715724, -0.006033983081579208, 0.02874789386987686, -0.0031923421192914248, -0.008263098075985909, 0.013461163267493248, 0.02932438999414444, 0.016776010394096375, -0.032956309616565704, -0.038413796573877335, -0.013912751339375973, 0.01928376406431198, -0.03051581233739853, 0.012019924819469452, -0.008974108844995499, -0.06787270307540894, 0.0021714651957154274, 0.10430719703435898, 0.013096049427986145, -0.0140664828941226, 0.0013859905302524567, -0.0037880539894104004, 0.02819061651825905, 0.018140383064746857, -0.035665836185216904, -0.01558458711951971, 0.036184683442115784, 0.0304197296500206, -0.012692502699792385, 0.02186838537454605, 0.025557953864336014, -0.045197226107120514, 0.009108624421060085, -0.04873306304216385, -0.06948688626289368, 0.050885312259197235, -0.004559116438031197, -0.02874789386987686, -0.011501079425215721, -0.06802643835544586, -0.0057937768287956715, -0.02657642960548401, -0.007696210872381926, -0.010290439240634441, 0.006903530098497868, -0.016257164999842644, 0.05791855230927467, -0.0039754146710038185, -0.009262355975806713, 0.03772200271487236, -0.047618504613637924, 0.040393099188804626, -0.0025365790352225304, -0.014056874439120293, -0.03820241615176201, -0.00042786754784174263, -0.02703762613236904, -0.028075316920876503, 0.016929741948843002, 0.016285989433526993, -0.009488150477409363, -0.0322260819375515, 0.0527685284614563, 0.006423117592930794, 0.007590520195662975, -0.03545445576310158, -0.01712190732359886, -0.0030914556700736284, 0.007191777694970369, -0.08332277089357376, -0.024923808872699738, 0.022656261920928955, -0.07886454463005066, 0.10884229838848114, 0.005140415392816067, -0.013538029044866562, -0.03624233230948448, -0.05599690228700638, -0.04046996310353279, -0.033667318522930145, 0.05319129303097725, 0.04046996310353279, -0.0446975938975811, 0.016026567667722702, 0.03320612385869026, -0.003021795768290758, -0.0002438094379613176, 0.03341750428080559, -0.004129147157073021, -0.011308914050459862, 0.08739667385816574, -0.020753826946020126, 0.04492819309234619, 0.013941575773060322, 0.003110672114416957, 0.018428629264235497, 0.017996259033679962, -0.014287472702562809, 0.0651823952794075, -0.0051356116309762, 0.024366531521081924, -0.015536545775830746, 0.03910559043288231, -0.03658822923898697, 0.04162295535206795, -0.07582833617925644, 0.021003643050789833, 0.006442334037274122, -0.007710623554885387, -0.002005722839385271, -0.04365990310907364, -0.04731104150414467, -0.010530645959079266, 0.041161756962537766, -0.05142337083816528, 0.09600567072629929, -0.025750119239091873, 0.0015685473335906863, -0.0005113392253406346, 0.023021375760436058, 0.007528066635131836, 0.09439148008823395, -0.008046912029385567, -0.02177230268716812, -0.02467399463057518, -0.019139640033245087, -0.05034724995493889, -0.008085344918072224, 0.020388713106513023, 0.0704861506819725, -0.03595408424735069, -0.030880926176905632, 0.041392356157302856, 0.013538029044866562, -0.013528420589864254, -0.033475156873464584, -0.05599690228700638, -0.008296727202832699, 0.018467063084244728, 0.024116715416312218, -0.0519230030477047, 0.013461163267493248, 0.034147731959819794, -0.028440430760383606, 0.06045513227581978, -0.07033241540193558, -0.04169981926679611, -0.07375295460224152, 0.033052392303943634, -0.01017514057457447, 0.025634819641709328, -0.060570430010557175, 0.01324017345905304, -0.024789294227957726, 0.011433822102844715, 0.007014025002717972, 0.05949430540204048, 0.0001779028243618086, -0.05557413771748543, -0.03435911610722542, 0.039028726518154144, -0.002908898750320077, 0.03633841499686241, -0.04684984311461449, 0.0012646863469853997, -0.019514363259077072, -0.03787573426961899, -0.014844751916825771, 0.01604578271508217, -0.03362888842821121, 0.013211348094046116, 0.015709495171904564, 0.010847718454897404, -0.0830153077840805, 0.085782490670681, 0.025980716571211815, 0.01020396500825882, -0.08370710164308548, 0.0661432147026062, -0.004414992406964302, 0.03453206270933151, 0.023732386529445648, -0.0025822180323302746, -0.01969691924750805, -0.045543123036623, 0.03664587810635567, -0.04181512072682381, -0.042583778500556946, 0.027018409222364426, 0.018678445369005203, 0.0357234850525856, -0.0011163589078933, -0.013605287298560143, -0.03706864267587662, 0.015132999047636986, -0.0054286629892885685, -0.009757181629538536, -0.022041333839297295, -0.024135932326316833, 0.05299912765622139, -0.04773380234837532, 0.055689435452222824, -0.034416764974594116, -0.038740478456020355, -0.03624233230948448, -0.009022150188684464, -0.034186165779829025, -0.007528066635131836, -0.01243308000266552, 0.02444339729845524, 0.008018087595701218, -0.028305914252996445, -0.04020093381404877, -0.050885312259197235, 0.02092677541077137, 0.04335243999958038, -0.06837233155965805, -0.01314409077167511, -0.03862518072128296, 0.031534288078546524, -0.044005800038576126, 0.04877149313688278, 0.05822601541876793, -0.030381297692656517, 0.015296339988708496, -0.04423639923334122, 0.0303620807826519, 0.0012154440628364682, -0.007374334614723921, 0.0005710905534215271, 0.0045374976471066475, -0.02192603424191475, 0.009127840399742126, 0.01425864826887846, -0.00980041828006506, 0.04070056229829788, 0.03401321917772293, -0.005332580767571926, 0.04731104150414467, 0.020753826946020126, 0.023232756182551384, 0.04354460537433624, -0.041738253086805344, 0.0026783007197082043, -0.08309217542409897, -0.04665767773985863, -0.06671971082687378, -0.010790068656206131, 0.03958600386977196, -0.015315555967390537, 0.007566499523818493, -0.031342122703790665, 0.022617828100919724, 0.0156326275318861, -0.03924010694026947, -0.00933441799134016, -0.07755782455205917, 0.028363564983010292, -0.019139640033245087, -0.0006020171567797661, 0.04512035846710205, -0.06883352994918823, 0.00043567424290813506, 0.0035934867337346077, -0.013749410398304462, 0.00432851817458868, 0.06303014606237411, -0.04427483305335045, 0.05764951929450035, 0.01928376406431198, 0.046427082270383835, 0.036991775035858154, 0.08524442464113235, 0.006903530098497868, 0.014200998470187187, 0.0016970577416941524, -0.03209156543016434, -0.003970610909163952, 0.03230294957756996, -0.06971748918294907, 0.015776751562952995, 0.06475962698459625, 0.01490240078419447, 0.04350617155432701, 0.029977750033140182, 0.00456151831895113, 0.0050347247160971165, 0.007355118170380592, 0.012971142306923866, 0.016228340566158295, -0.028786327689886093, -0.0312652550637722, -0.05100060999393463, -0.0034950021654367447, -0.010780460201203823, 0.03370575234293938, -0.004806528799235821, 0.010655553080141544, 0.026115233078598976, 0.043967366218566895, -0.002860857406631112, 0.011424213647842407, -0.053075991570949554, 0.013124873861670494, -0.03647293150424957, -0.005121198948472738, 0.01416256558150053, -0.020427146926522255, -0.03791416808962822, 0.0047392710112035275, -0.06149282306432724, -0.005937900859862566, -0.06376037001609802, 0.025135191157460213, 0.04089272767305374, -0.039931900799274445, 0.014988875016570091, 0.009276769123971462, 0.0015361194964498281, 0.008215056732296944, 0.0054334672167897224, -0.0070332414470613, 0.008407222107052803, -0.010386521928012371, -0.011212831363081932, 0.06925629079341888, -0.04093116149306297, -0.022464096546173096, 0.045543123036623, 0.03714550659060478, -0.03877891227602959, 0.013970400206744671, -0.009171077981591225, 0.01128969807177782, 0.013374689035117626 ]
39,387
pyspark.sql.dataframe
groupBy
:func:`groupby` is an alias for :func:`groupBy`. .. versionadded:: 1.4
def groupBy(self, *cols: "ColumnOrName") -> "GroupedData": # type: ignore[misc] """Groups the :class:`DataFrame` using the specified columns, so we can run aggregation on them. See :class:`GroupedData` for all the available aggregate functions. :func:`groupby` is an alias for :func:`groupBy`. .. versionadded:: 1.3.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Parameters ---------- cols : list, str or :class:`Column` columns to group by. Each element should be a column name (string) or an expression (:class:`Column`) or list of them. Returns ------- :class:`GroupedData` Grouped data by given columns. Examples -------- >>> df = spark.createDataFrame([ ... (2, "Alice"), (2, "Bob"), (2, "Bob"), (5, "Bob")], schema=["age", "name"]) Empty grouping columns triggers a global aggregation. >>> df.groupBy().avg().show() +--------+ |avg(age)| +--------+ | 2.75| +--------+ Group-by 'name', and specify a dictionary to calculate the summation of 'age'. >>> df.groupBy("name").agg({"age": "sum"}).sort("name").show() +-----+--------+ | name|sum(age)| +-----+--------+ |Alice| 2| | Bob| 9| +-----+--------+ Group-by 'name', and calculate maximum values. >>> df.groupBy(df.name).max().sort("name").show() +-----+--------+ | name|max(age)| +-----+--------+ |Alice| 2| | Bob| 5| +-----+--------+ Group-by 'name' and 'age', and calculate the number of rows in each group. >>> df.groupBy(["name", df.age]).count().sort("name", "age").show() +-----+---+-----+ | name|age|count| +-----+---+-----+ |Alice| 2| 1| | Bob| 2| 2| | Bob| 5| 1| +-----+---+-----+ """ jgd = self._jdf.groupBy(self._jcols(*cols)) from pyspark.sql.group import GroupedData return GroupedData(jgd, self)
(self, *cols)
[ 0.03236059844493866, -0.045619986951351166, -0.003821682883426547, 0.04250691458582878, 0.002450104570016265, -0.06552828848361969, 0.01682405173778534, 0.03212999925017357, 0.020465580746531487, 0.07486750930547714, -0.0014520472614094615, -0.00466720899567008, 0.039067160338163376, 0.018524711951613426, 0.02106129191815853, -0.03701099380850792, 0.004873786587268114, -0.040585264563560486, 0.0562659315764904, -0.01445081364363432, -0.005174044519662857, -0.02870946191251278, 0.026345830410718918, -0.000013952610061096493, -0.02040793001651764, 0.06591261923313141, 0.05384465306997299, -0.040738996118307114, 0.016679927706718445, 0.005904271733015776, -0.04796440154314041, -0.02486616000533104, -0.0339747853577137, 0.0006773818749934435, -0.03274492919445038, -0.03353280574083328, 0.011433822102844715, -0.019533580169081688, 0.02657642960548401, -0.0384906642138958, 0.048233430832624435, 0.03624233230948448, -0.005817797500640154, -0.07087048143148422, 0.017813701182603836, 0.06110849231481552, 0.01886100135743618, -0.0024861355777829885, 0.004251652397215366, -0.03526229038834572, -0.025750119239091873, -0.0254810880869627, -0.017909783869981766, 0.01686248555779457, -0.007071674335747957, 0.005053941160440445, 0.0070332414470613, -0.02154170349240303, 0.0071437363512814045, 0.016036175191402435, 0.013730194419622421, 0.011875801719725132, 0.01425864826887846, -0.01178932748734951, -0.06245364621281624, 0.022195065394043922, -0.03595408424735069, -0.008801160380244255, -0.09454521536827087, -0.037030208855867386, -0.054305847734212875, 0.013297823257744312, 0.01983143575489521, 0.06844919919967651, -0.04596588388085365, 0.0040018376894295216, -0.03355202078819275, 0.013384297490119934, 0.06026296690106392, -0.0259038507938385, 0.03726080805063248, -0.0419304184615612, -0.026211315765976906, -0.029977750033140182, 0.042737510055303574, 0.005025116726756096, 0.029016925022006035, 0.04223788157105446, -0.00838320143520832, -0.04512035846710205, 0.010309656150639057, 0.05526667460799217, -0.0031707235611975193, 0.022195065394043922, -0.01715073175728321, -0.0698712170124054, -0.06007080152630806, 0.04827186465263367, 0.047195740044116974, 0.07367608696222305, 0.024328097701072693, -0.016170689836144447, 0.017967434599995613, -0.041738253086805344, 0.0033821051474660635, -0.0410848930478096, 0.015123390592634678, -0.03474344313144684, -0.045197226107120514, 0.011539512313902378, -0.011270481161773205, 0.013557245954871178, 0.03382105380296707, 0.014700627885758877, 0.024539479985833168, 0.013096049427986145, 0.023732386529445648, -0.01940867118537426, -0.06572045385837555, 0.020753826946020126, -0.04043152928352356, 0.06802643835544586, 0.026134449988603592, -0.03320612385869026, -0.0024981459137052298, 0.02609601616859436, 0.028171399608254433, -0.02680702693760395, -0.01527712307870388, 0.05926370620727539, 0.04834873229265213, 0.007696210872381926, 0.012846235185861588, -0.02632661536335945, 0.02257939614355564, 0.007196581922471523, 0.1099952831864357, 0.047042008489370346, 0.02965107001364231, 0.04658081382513046, 0.02031184732913971, -0.036991775035858154, 0.0052316938526928425, 0.027133706957101822, 0.03910559043288231, 0.0028320327401161194, 0.07509811222553253, -0.032956309616565704, -0.07333019375801086, -0.009420892223715782, -0.024462614208459854, -0.024923808872699738, 0.04269907996058464, -0.01345155481249094, 0.0027167336083948612, 0.03291787579655647, -0.010232790373265743, 0.00621654000133276, -0.02774863690137863, -0.036184683442115784, 0.009574624709784985, 0.04569685459136963, 0.01112635713070631, 0.04070056229829788, -0.037183940410614014, 0.029785586521029472, -0.012567595578730106, 0.027940800413489342, -0.02140718884766102, -0.03445519879460335, 0.011145574040710926, 0.00439337408170104, 0.01447002962231636, -0.018591970205307007, -0.0645674616098404, 0.08009440451860428, 0.002248331205919385, 0.0456584207713604, 0.03272571042180061, -0.0634913370013237, 0.015594195574522018, -0.04127705842256546, -0.0367419607937336, 0.03084249421954155, 0.01575753651559353, 0.005519941449165344, -0.013086440972983837, -0.03931697458028793, -0.00202614045701921, -0.03966287150979042, -0.018937867134809494, -0.03443598002195358, -0.03820241615176201, 0.061800286173820496, 0.02040793001651764, -0.036088600754737854, -0.0013259389670565724, 0.025039108470082283, 0.013528420589864254, 0.07840334624052048, -0.014441205188632011, 0.01672796905040741, 0.04223788157105446, -0.0036991776432842016, -0.019370239228010178, -0.023790035396814346, -0.0374721884727478, 0.009137448854744434, -0.01824607327580452, -0.047618504613637924, 0.042737510055303574, -0.03816398233175278, -0.006274189334362745, 0.04608118534088135, 0.053883086889982224, 0.007475221063941717, 0.02774863690137863, -0.009127840399742126, 0.02719135768711567, 0.030592679977416992, 0.05407525226473808, 0.012557987123727798, -0.008493696339428425, 0.027863934636116028, 0.05549727380275726, -0.06303014606237411, 0.030592679977416992, 0.0024861355777829885, 0.02444339729845524, -0.06026296690106392, 0.005236498080193996, -0.08639741688966751, 0.017352506518363953, -0.030150700360536575, -0.04043152928352356, 0.027364306151866913, 0.02722978964447975, -0.007859551347792149, 0.03664587810635567, -0.03966287150979042, -0.029055358842015266, 0.05861034616827965, 0.0438520684838295, 0.0046744151040911674, -0.011308914050459862, -0.034705013036727905, -0.0048329513520002365, 0.06706561148166656, 0.017544670030474663, 0.022906076163053513, 0.0010809284867718816, -0.00014464925334323198, 0.020100466907024384, 0.02267547883093357, -0.02196446806192398, -0.041392356157302856, -0.009079799987375736, 0.05499764159321785, 0.019658487290143967, 0.025019891560077667, 0.012260131537914276, -0.016776010394096375, -0.048233430832624435, 0.045812152326107025, 0.040124066174030304, -0.007624149322509766, 0.05534353852272034, -0.010963017120957375, 0.031111525371670723, 0.0027863935101777315, 0.00712932413443923, 0.021503271535038948, 0.024943025782704353, -0.07037084549665451, -0.012654069811105728, 0.005332580767571926, -0.0019240527180954814, -0.05561257153749466, -0.039355404675006866, -0.06779583543539047, 0.060570430010557175, 0.01335547212511301, -0.015363597311079502, -0.0437367707490921, -0.008839593268930912, 0.057764820754528046, -0.03372497111558914, -0.03364810347557068, -0.07617423683404922, -0.0020297435112297535, -0.022329581901431084, -0.015911268070340157, -0.06425999850034714, 0.008743510581552982, -0.027345089241862297, 0.006701756734400988, 0.029785586521029472, -0.019005125388503075, -0.05403681844472885, -0.023213541135191917, -0.03549288958311081, 0.00038913427852094173, 0.09416088461875916, 0.07413728535175323, -0.03116917423903942, -0.06791113317012787, -0.008450458757579327, -0.034666579216718674, 0.011453038081526756, -0.006879509426653385, 0.027114491909742355, 0.020388713106513023, 0.030342863872647285, -0.03164958581328392, -0.07163913547992706, -0.009973366744816303, 0.015267514623701572, 0.011395388282835484, 0.01586322672665119, 0.019206898286938667, 0.03107309155166149, -0.07298429310321808, -0.052499495446681976, -0.0034013218246400356, 0.04596588388085365, 0.09339222311973572, 0.047426339238882065, -0.017900176346302032, 0.029362821951508522, 0.0017198773566633463, 0.03359045460820198, -0.009468933567404747, 0.044812895357608795, 0.0032571980264037848, -0.0544595792889595, -0.06979435682296753, -0.0037856518756598234, -0.03658822923898697, -0.004823343362659216, 0.0383753627538681, -0.02167621999979019, -0.09093251079320908, 0.00046840234426781535, -0.030496597290039062, 0.012490729801356792, -0.01091497577726841, 0.026768594980239868, -0.020004384219646454, -0.0039009510073810816, 0.05718832463026047, 0.03804868459701538, -0.00459514744579792, 0.02477007731795311, -0.002920909086242318, 0.04166138544678688, 0.013211348094046116, -0.005270127207040787, 0.06525925546884537, 0.021983683109283447, -0.02945890463888645, 0.09954150766134262, -0.051653970032930374, 0.06356820464134216, -0.03180331736803055, 0.012557987123727798, 0.021176591515541077, -0.006802643649280071, 0.009017345495522022, 0.0010863331845030189, -0.012827018275856972, 0.030727194622159004, -0.00912303663790226, 0.029113007709383965, 0.06425999850034714, -0.006567241158336401, 0.030957791954278946, 0.03207235038280487, -0.01057868730276823, -0.003014589427039027, 0.004016249906271696, 0.012778976932168007, -0.05100060999393463, 0.07094734162092209, 0.009632274508476257, 0.01637246459722519, 0.07183130085468292, -0.012048750184476376, -0.05861034616827965, -0.049463290721178055, -0.050846878439188004, -0.006240560673177242, 0.03977816924452782, 0.02011968195438385, 0.012846235185861588, -0.06191558390855789, -0.01857275329530239, -0.011885409243404865, -0.01675679348409176, -0.014412379823625088, -0.012567595578730106, -0.034897178411483765, -0.023309623822569847, 0.03274492919445038, -0.03947070613503456, 0.01692013442516327, 0.013710977509617805, 0.02576933614909649, -0.09854225069284439, -0.029170658439397812, -0.026134449988603592, 0.050039783120155334, -0.0009452119120396674, -0.02509675733745098, 0.028786327689886093, 0.05549727380275726, 0.027364306151866913, 0.03268727660179138, -0.006264581345021725, 0.057303622364997864, 0.029958534985780716, 0.02557717077434063, -0.009574624709784985, -0.04727260768413544, 0.07863394916057587, -0.012375430203974247, -0.04834873229265213, -0.023232756182551384, -0.012730935588479042, -0.016872093081474304, 0.004057085141539574, -0.0250583253800869, -0.005640044808387756, -0.05303755775094032, 0.0149984834715724, -0.006033983081579208, 0.02874789386987686, -0.0031923421192914248, -0.008263098075985909, 0.013461163267493248, 0.02932438999414444, 0.016776010394096375, -0.032956309616565704, -0.038413796573877335, -0.013912751339375973, 0.01928376406431198, -0.03051581233739853, 0.012019924819469452, -0.008974108844995499, -0.06787270307540894, 0.0021714651957154274, 0.10430719703435898, 0.013096049427986145, -0.0140664828941226, 0.0013859905302524567, -0.0037880539894104004, 0.02819061651825905, 0.018140383064746857, -0.035665836185216904, -0.01558458711951971, 0.036184683442115784, 0.0304197296500206, -0.012692502699792385, 0.02186838537454605, 0.025557953864336014, -0.045197226107120514, 0.009108624421060085, -0.04873306304216385, -0.06948688626289368, 0.050885312259197235, -0.004559116438031197, -0.02874789386987686, -0.011501079425215721, -0.06802643835544586, -0.0057937768287956715, -0.02657642960548401, -0.007696210872381926, -0.010290439240634441, 0.006903530098497868, -0.016257164999842644, 0.05791855230927467, -0.0039754146710038185, -0.009262355975806713, 0.03772200271487236, -0.047618504613637924, 0.040393099188804626, -0.0025365790352225304, -0.014056874439120293, -0.03820241615176201, -0.00042786754784174263, -0.02703762613236904, -0.028075316920876503, 0.016929741948843002, 0.016285989433526993, -0.009488150477409363, -0.0322260819375515, 0.0527685284614563, 0.006423117592930794, 0.007590520195662975, -0.03545445576310158, -0.01712190732359886, -0.0030914556700736284, 0.007191777694970369, -0.08332277089357376, -0.024923808872699738, 0.022656261920928955, -0.07886454463005066, 0.10884229838848114, 0.005140415392816067, -0.013538029044866562, -0.03624233230948448, -0.05599690228700638, -0.04046996310353279, -0.033667318522930145, 0.05319129303097725, 0.04046996310353279, -0.0446975938975811, 0.016026567667722702, 0.03320612385869026, -0.003021795768290758, -0.0002438094379613176, 0.03341750428080559, -0.004129147157073021, -0.011308914050459862, 0.08739667385816574, -0.020753826946020126, 0.04492819309234619, 0.013941575773060322, 0.003110672114416957, 0.018428629264235497, 0.017996259033679962, -0.014287472702562809, 0.0651823952794075, -0.0051356116309762, 0.024366531521081924, -0.015536545775830746, 0.03910559043288231, -0.03658822923898697, 0.04162295535206795, -0.07582833617925644, 0.021003643050789833, 0.006442334037274122, -0.007710623554885387, -0.002005722839385271, -0.04365990310907364, -0.04731104150414467, -0.010530645959079266, 0.041161756962537766, -0.05142337083816528, 0.09600567072629929, -0.025750119239091873, 0.0015685473335906863, -0.0005113392253406346, 0.023021375760436058, 0.007528066635131836, 0.09439148008823395, -0.008046912029385567, -0.02177230268716812, -0.02467399463057518, -0.019139640033245087, -0.05034724995493889, -0.008085344918072224, 0.020388713106513023, 0.0704861506819725, -0.03595408424735069, -0.030880926176905632, 0.041392356157302856, 0.013538029044866562, -0.013528420589864254, -0.033475156873464584, -0.05599690228700638, -0.008296727202832699, 0.018467063084244728, 0.024116715416312218, -0.0519230030477047, 0.013461163267493248, 0.034147731959819794, -0.028440430760383606, 0.06045513227581978, -0.07033241540193558, -0.04169981926679611, -0.07375295460224152, 0.033052392303943634, -0.01017514057457447, 0.025634819641709328, -0.060570430010557175, 0.01324017345905304, -0.024789294227957726, 0.011433822102844715, 0.007014025002717972, 0.05949430540204048, 0.0001779028243618086, -0.05557413771748543, -0.03435911610722542, 0.039028726518154144, -0.002908898750320077, 0.03633841499686241, -0.04684984311461449, 0.0012646863469853997, -0.019514363259077072, -0.03787573426961899, -0.014844751916825771, 0.01604578271508217, -0.03362888842821121, 0.013211348094046116, 0.015709495171904564, 0.010847718454897404, -0.0830153077840805, 0.085782490670681, 0.025980716571211815, 0.01020396500825882, -0.08370710164308548, 0.0661432147026062, -0.004414992406964302, 0.03453206270933151, 0.023732386529445648, -0.0025822180323302746, -0.01969691924750805, -0.045543123036623, 0.03664587810635567, -0.04181512072682381, -0.042583778500556946, 0.027018409222364426, 0.018678445369005203, 0.0357234850525856, -0.0011163589078933, -0.013605287298560143, -0.03706864267587662, 0.015132999047636986, -0.0054286629892885685, -0.009757181629538536, -0.022041333839297295, -0.024135932326316833, 0.05299912765622139, -0.04773380234837532, 0.055689435452222824, -0.034416764974594116, -0.038740478456020355, -0.03624233230948448, -0.009022150188684464, -0.034186165779829025, -0.007528066635131836, -0.01243308000266552, 0.02444339729845524, 0.008018087595701218, -0.028305914252996445, -0.04020093381404877, -0.050885312259197235, 0.02092677541077137, 0.04335243999958038, -0.06837233155965805, -0.01314409077167511, -0.03862518072128296, 0.031534288078546524, -0.044005800038576126, 0.04877149313688278, 0.05822601541876793, -0.030381297692656517, 0.015296339988708496, -0.04423639923334122, 0.0303620807826519, 0.0012154440628364682, -0.007374334614723921, 0.0005710905534215271, 0.0045374976471066475, -0.02192603424191475, 0.009127840399742126, 0.01425864826887846, -0.00980041828006506, 0.04070056229829788, 0.03401321917772293, -0.005332580767571926, 0.04731104150414467, 0.020753826946020126, 0.023232756182551384, 0.04354460537433624, -0.041738253086805344, 0.0026783007197082043, -0.08309217542409897, -0.04665767773985863, -0.06671971082687378, -0.010790068656206131, 0.03958600386977196, -0.015315555967390537, 0.007566499523818493, -0.031342122703790665, 0.022617828100919724, 0.0156326275318861, -0.03924010694026947, -0.00933441799134016, -0.07755782455205917, 0.028363564983010292, -0.019139640033245087, -0.0006020171567797661, 0.04512035846710205, -0.06883352994918823, 0.00043567424290813506, 0.0035934867337346077, -0.013749410398304462, 0.00432851817458868, 0.06303014606237411, -0.04427483305335045, 0.05764951929450035, 0.01928376406431198, 0.046427082270383835, 0.036991775035858154, 0.08524442464113235, 0.006903530098497868, 0.014200998470187187, 0.0016970577416941524, -0.03209156543016434, -0.003970610909163952, 0.03230294957756996, -0.06971748918294907, 0.015776751562952995, 0.06475962698459625, 0.01490240078419447, 0.04350617155432701, 0.029977750033140182, 0.00456151831895113, 0.0050347247160971165, 0.007355118170380592, 0.012971142306923866, 0.016228340566158295, -0.028786327689886093, -0.0312652550637722, -0.05100060999393463, -0.0034950021654367447, -0.010780460201203823, 0.03370575234293938, -0.004806528799235821, 0.010655553080141544, 0.026115233078598976, 0.043967366218566895, -0.002860857406631112, 0.011424213647842407, -0.053075991570949554, 0.013124873861670494, -0.03647293150424957, -0.005121198948472738, 0.01416256558150053, -0.020427146926522255, -0.03791416808962822, 0.0047392710112035275, -0.06149282306432724, -0.005937900859862566, -0.06376037001609802, 0.025135191157460213, 0.04089272767305374, -0.039931900799274445, 0.014988875016570091, 0.009276769123971462, 0.0015361194964498281, 0.008215056732296944, 0.0054334672167897224, -0.0070332414470613, 0.008407222107052803, -0.010386521928012371, -0.011212831363081932, 0.06925629079341888, -0.04093116149306297, -0.022464096546173096, 0.045543123036623, 0.03714550659060478, -0.03877891227602959, 0.013970400206744671, -0.009171077981591225, 0.01128969807177782, 0.013374689035117626 ]
39,388
pyspark.sql.dataframe
head
Returns the first ``n`` rows. .. versionadded:: 1.3.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Notes ----- This method should only be used if the resulting array is expected to be small, as all the data is loaded into the driver's memory. Parameters ---------- n : int, optional default 1. Number of rows to return. Returns ------- If n is greater than 1, return a list of :class:`Row`. If n is 1, return a single Row. Examples -------- >>> df = spark.createDataFrame([ ... (2, "Alice"), (5, "Bob")], schema=["age", "name"]) >>> df.head() Row(age=2, name='Alice') >>> df.head(1) [Row(age=2, name='Alice')]
def head(self, n: Optional[int] = None) -> Union[Optional[Row], List[Row]]: """Returns the first ``n`` rows. .. versionadded:: 1.3.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Notes ----- This method should only be used if the resulting array is expected to be small, as all the data is loaded into the driver's memory. Parameters ---------- n : int, optional default 1. Number of rows to return. Returns ------- If n is greater than 1, return a list of :class:`Row`. If n is 1, return a single Row. Examples -------- >>> df = spark.createDataFrame([ ... (2, "Alice"), (5, "Bob")], schema=["age", "name"]) >>> df.head() Row(age=2, name='Alice') >>> df.head(1) [Row(age=2, name='Alice')] """ if n is None: rs = self.head(1) return rs[0] if rs else None return self.take(n)
(self, n: Optional[int] = None) -> Union[pyspark.sql.types.Row, NoneType, List[pyspark.sql.types.Row]]
[ -0.03778419271111488, -0.034889861941337585, 0.0018451368669047952, -0.03325850889086723, 0.020891817286610603, 0.05914963036775589, 0.015848662704229355, 0.00009798521205084398, 0.016488924622535706, -0.041643302887678146, 0.00549923162907362, 0.03673170879483223, -0.03918750584125519, 0.017874695360660553, -0.0010491955326870084, -0.044590260833501816, 0.008564592339098454, 0.012077259831130505, -0.04722147062420845, 0.05693941190838814, 0.01168257836252451, 0.02148822508752346, 0.023768609389662743, 0.016225803643465042, -0.04613390564918518, 0.049993015825748444, 0.04809854179620743, -0.02550520747900009, 0.030206305906176567, 0.036977287381887436, -0.0045783077366650105, 0.011638724245131016, -0.0505894236266613, 0.012936788611114025, -0.02666294015944004, 0.02903103083372116, 0.009051366709172726, -0.05009826272726059, 0.01638367585837841, 0.06251758337020874, -0.03392508253455162, -0.020453281700611115, 0.06535928696393967, -0.03060975857079029, -0.06963939219713211, -0.022014467045664787, 0.0522032305598259, -0.045677829533815384, -0.025627998635172844, 0.003170609474182129, 0.05002809688448906, 0.07227060198783875, -0.040204908698797226, -0.05578167736530304, -0.061991337686777115, -0.03757369518280029, -0.047046057879924774, -0.04097672924399376, -0.03545118495821953, 0.03125879168510437, 0.004644087981432676, -0.02566308155655861, 0.011954469606280327, 0.027487387880682945, 0.05560626462101936, -0.04055573791265488, 0.015699559822678566, -0.01933063194155693, -0.0232072826474905, -0.03257439658045769, 0.029206445440649986, 0.06721867620944977, 0.022523168474435806, 0.04220462962985039, -0.08651422709226608, -0.024207143113017082, 0.018085192888975143, 0.03285505995154381, -0.00019473704742267728, -0.025908660143613815, 0.023908939212560654, 0.02545258402824402, -0.01990949921309948, -0.011717661283910275, -0.008902264758944511, -0.00008592549420427531, 0.04220462962985039, 0.017067790031433105, -0.04620407149195671, -0.003332867519930005, -0.040134742856025696, 0.026645399630069733, -0.021190021187067032, 0.02190922014415264, 0.04795821011066437, -0.016997624188661575, -0.005762352608144283, -0.0213478934019804, -0.04630931839346886, -0.010691488161683083, -0.0652189552783966, -0.0023176586255431175, -0.01117387693375349, 0.02192676067352295, -0.007288455031812191, -0.018628975376486778, -0.02090935967862606, 0.042309876531362534, -0.03067992441356182, 0.07612971216440201, -0.022540710866451263, 0.009595150128006935, 0.0007921042270027101, -0.017585262656211853, 0.03139911964535713, 0.004181433469057083, -0.011200189590454102, 0.01610301248729229, -0.028838075697422028, 0.00913030281662941, 0.02450534701347351, 0.024189602583646774, 0.0054948460310697556, -0.0584830567240715, -0.008678612299263477, 0.031241249293088913, 0.03613530099391937, -0.07177944481372833, -0.008077818900346756, -0.005946537479758263, 0.041538055986166, -0.018137816339731216, 0.02148822508752346, 0.0505894236266613, -0.056167591363191605, -0.009998602792620659, 0.019804250448942184, 0.0320306122303009, -0.0082970866933465, -0.02715410105884075, 0.019155217334628105, -0.020242786034941673, 0.04469550773501396, 0.04630931839346886, -0.05700957775115967, -0.0686921551823616, 0.05181732028722763, -0.0343460775911808, 0.038556016981601715, 0.03824026882648468, 0.002074271673336625, -0.01776067540049553, 0.003775788238272071, -0.05550101771950722, -0.046168986707925797, 0.011033546179533005, 0.0007202940760180354, -0.09402194619178772, -0.03399524837732315, -0.026469985023140907, -0.015550458803772926, -0.00427791103720665, 0.019786708056926727, -0.021014606580138206, -0.08602306991815567, 0.04441484808921814, -0.059184711426496506, -0.012147425673902035, 0.001428528456017375, -0.008169910870492458, 0.05700957775115967, 0.03911733999848366, 0.05943029373884201, -0.0150242168456316, -0.04806346073746681, 0.10174016654491425, 0.02148822508752346, -0.008235691115260124, 0.010893214493989944, -0.0010311058722436428, 0.019313091412186623, -0.05585184320807457, -0.037257950752973557, -0.049887765198946, 0.028206584975123405, -0.0025325408205389977, 0.004788804333657026, -0.044099099934101105, 0.034258369356393814, 0.05395737290382385, 0.028013629838824272, 0.018488643690943718, -0.020944442600011826, 0.053781960159540176, -0.026505067944526672, -0.031136000528931618, 0.029066113755106926, 0.053150467574596405, -0.034381162375211716, 0.004880896769464016, 0.024908799678087234, 0.0403803214430809, 0.04125739261507988, -0.0018517149146646261, 0.016804669052362442, 0.005087008699774742, -0.05269439145922661, -0.008639143779873848, -0.036696627736091614, 0.022435462102293968, 0.006621881853789091, -0.027417222037911415, -0.02176888845860958, -0.006161419674754143, -0.018944721668958664, 0.002596128499135375, -0.027487387880682945, -0.036907125264406204, 0.007713834289461374, -0.05269439145922661, 0.07739269733428955, -0.04778279736638069, -0.027364596724510193, 0.02659277617931366, 0.01875176653265953, -0.00945481937378645, -0.001630254671908915, -0.026434902101755142, 0.005442222114652395, -0.011436997912824154, -0.007148123811930418, -0.01796240173280239, 0.05132616311311722, -0.012015865184366703, 0.003534593852236867, 0.054588861763477325, 0.02443518117070198, -0.012989412993192673, 0.010787966661155224, -0.018558809533715248, -0.07072696089744568, 0.04283611848950386, 0.004920365288853645, 0.011472080834209919, -0.05483444407582283, 0.04374827444553375, -0.054518695920705795, 0.03760877996683121, -0.03617038577795029, -0.025645539164543152, -0.015182089060544968, 0.00984073057770729, 0.08665455877780914, 0.016085471957921982, 0.01081427838653326, 0.001964637776836753, 0.019207842648029327, -0.06469271332025528, -0.025627998635172844, 0.013138514943420887, 0.018558809533715248, -0.06279823929071426, -0.016208261251449585, -0.02169872261583805, -0.010042455978691578, -0.020435741171240807, -0.07069187611341476, 0.04066098481416702, -0.009542526677250862, 0.05234356224536896, 0.011743973009288311, 0.08637389540672302, -0.011621182784438133, -0.03332867473363876, 0.048273954540491104, -0.06037752702832222, -0.011559788137674332, -0.008590904995799065, -0.026645399630069733, 0.000011211769560759421, -0.055746596306562424, -0.021505767479538918, -0.028925782069563866, 0.005266807973384857, -0.011279125697910786, -0.0350477360188961, 0.0042691403068602085, -0.03838060051202774, -0.016769586130976677, 0.0019229769241064787, 0.031171083450317383, 0.051291078329086304, -0.03634579852223396, -0.06500846147537231, -0.00397093640640378, -0.0076831369660794735, -0.0559220090508461, 0.016866063699126244, 0.018874555826187134, -0.019155217334628105, 0.04360794275999069, -0.08405842632055283, 0.028873158618807793, 0.025627998635172844, -0.022032009437680244, -0.05900929868221283, -0.0028395154513418674, -0.004573922138661146, 0.000771273800637573, 0.0016280619893223047, -0.016646796837449074, -0.01990949921309948, 0.0042647551745176315, -0.00274961581453681, -0.06592061370611191, -0.0786556750535965, -0.06606094539165497, 0.04974743351340294, -0.004687941633164883, 0.0003763180284295231, -0.016638025641441345, -0.010209099389612675, -0.014033126644790173, -0.027276890352368355, -0.03624055162072182, 0.03648613020777702, -0.034310996532440186, 0.004023560788482428, -0.07605955004692078, 0.04371318966150284, 0.045888323336839676, -0.0035104744601994753, -0.013313928619027138, 0.05199273303151131, -0.08265511691570282, 0.02608407475054264, 0.030872879549860954, 0.029294151812791824, -0.005757967475801706, 0.024891259148716927, 0.0011840451043099165, -0.06146509572863579, 0.04936152324080467, -0.017059020698070526, 0.06230708211660385, 0.020312951877713203, 0.10061752051115036, -0.03420574590563774, 0.012164967134594917, -0.005586938466876745, 0.050203509628772736, -0.00030231522396206856, 0.0037538614124059677, -0.014173458330333233, 0.03269718587398529, 0.034889861941337585, -0.054588861763477325, 0.03167978301644325, -0.00030423380667343736, 0.012463171035051346, 0.03246914595365524, -0.02480355091392994, -0.028504788875579834, -0.004889667499810457, 0.01594514027237892, 0.02989055961370468, -0.014647075906395912, 0.05083500221371651, -0.07697170227766037, 0.049887765198946, -0.008380407467484474, 0.006928856484591961, -0.024891259148716927, -0.0029162592254579067, 0.031592078506946564, -0.050484172999858856, -0.003905156161636114, 0.014068209566175938, 0.002045766683295369, -0.004880896769464016, 0.02401418797671795, -0.04336236044764519, 0.0005517321405932307, -0.0033789137378335, -0.08532141149044037, 0.03183765709400177, -0.057535819709300995, -0.02083919383585453, -0.04669522866606712, -0.035959888249635696, -0.005915840156376362, -0.001884605037048459, -0.025908660143613815, -0.05181732028722763, 0.010595010593533516, -0.010068768635392189, 0.04585324227809906, 0.03185519948601723, 0.005367671139538288, -0.04364302381873131, -0.010770425200462341, 0.00805589184165001, 0.0145593686029315, 0.016260886564850807, -0.03918750584125519, -0.011331750079989433, 0.011743973009288311, -0.05792172998189926, -0.024207143113017082, -0.03134649619460106, 0.012691209092736244, 0.004512527491897345, -0.005582553334534168, 0.00193174765445292, 0.06455238163471222, 0.06665734946727753, 0.03138158097863197, 0.08868936449289322, 0.0035258231218904257, 0.038626182824373245, -0.0012925824848935008, -0.04406401887536049, -0.08370760083198547, 0.12342134863138199, 0.028013629838824272, -0.027364596724510193, 0.021453142166137695, 0.024382557719945908, 0.02543504163622856, -0.019804250448942184, 0.01661171391606331, -0.008687382563948631, -0.06714851409196854, 0.011524705216288567, 0.004981759935617447, -0.010542386211454868, 0.012129884213209152, -0.04234496131539345, -0.06606094539165497, 0.01580480858683586, 0.05399245396256447, 0.019506046548485756, -0.006314907222986221, -0.00564394798129797, 0.05044909194111824, -0.00952498521655798, 0.010077538900077343, -0.00506946723908186, -0.041222311556339264, -0.034328535199165344, -0.00782785378396511, -0.030101057142019272, 0.06325431913137436, -0.007012178190052509, 0.014813719317317009, -0.011340520344674587, -0.06378056108951569, -0.022453002631664276, -0.02559291571378708, -0.005700957961380482, 0.053641628473997116, 0.03764386102557182, 0.026206864044070244, -0.041152145713567734, 0.044169265776872635, -0.008174296468496323, -0.03185519948601723, -0.01048976182937622, -0.06834132969379425, 0.0034490793477743864, 0.017480013892054558, 0.00244264118373394, -0.019067510962486267, -0.05988636985421181, 0.09795122593641281, -0.004378774203360081, -0.005323817487806082, -0.019804250448942184, 0.04585324227809906, -0.0268032718449831, -0.047116223722696304, 0.028592495247721672, 0.019453421235084534, 0.0007213904173113406, -0.03301293030381203, 0.014778636395931244, -0.02069886215031147, 0.011103712022304535, 0.00938465353101492, 0.007376162335276604, 0.048273954540491104, 0.03387245908379555, -0.019225383177399635, 0.031364038586616516, 0.0037385127507150173, 0.025487666949629784, 0.047186389565467834, 0.037257950752973557, 0.03097812831401825, 0.0891103520989418, 0.016997624188661575, -0.026698023080825806, 0.018207982182502747, 0.01904997043311596, -0.02624194696545601, 0.02687343768775463, 0.005889527965337038, 0.018646517768502235, -0.004231864586472511, -0.017567720264196396, 0.04830903932452202, 0.08293578028678894, -0.01555922906845808, 0.008424261584877968, -0.004054258111864328, 0.02673310600221157, 0.04097672924399376, 0.041292477399110794, 0.06065819039940834, 0.009261863306164742, 0.049993015825748444, 0.01308589056134224, -0.0027978545986115932, 0.031293872743844986, -0.01587497442960739, 0.00264217471703887, 0.01653277687728405, -0.034749530255794525, 0.032802432775497437, 0.04830903932452202, -0.032890141010284424, 0.004530068952590227, -0.0505894236266613, -0.03322342783212662, -0.0468706451356411, -0.04178363457322121, -0.0452568344771862, 0.07135844975709915, 0.10300315171480179, -0.015094381757080555, -0.02227758802473545, -0.022838914766907692, -0.011270355433225632, 0.04936152324080467, -0.032100778073072433, -0.028645120561122894, -0.027768049389123917, 0.03887176141142845, -0.011208959855139256, -0.004109074827283621, 0.03046942688524723, -0.04823887348175049, 0.09661807864904404, -0.041643302887678146, -0.022821372374892235, -0.023049410432577133, 0.011708890087902546, -0.0313289538025856, -0.020874276757240295, -0.024978965520858765, 0.006902544293552637, -0.04651981592178345, -0.019172759726643562, 0.0017190580256283283, 0.02350548654794693, 0.03167978301644325, 0.07002530246973038, 0.02989055961370468, 0.004203360062092543, -0.028417082503437996, -0.0002891591575462371, 0.10461696237325668, -0.0396786667406559, 0.019997205585241318, 0.02097952365875244, -0.008989972062408924, 0.010235412046313286, 0.03369704633951187, -0.07374408096075058, 0.0010568698635324836, 0.033188346773386, -0.0004741662123706192, 0.0522032305598259, -0.0043371133506298065, -0.02775050885975361, 0.03160961717367172, -0.07346341758966446, -0.004832657985389233, -0.0378192774951458, 0.005889527965337038, 0.0329427644610405, -0.04504633694887161, -0.00812605768442154, 0.010831819847226143, 0.05146649107336998, 0.03894192725419998, -0.015524146147072315, -0.04694081097841263, -0.011717661283910275, 0.05160682275891304, -0.04694081097841263, 0.0403803214430809, -0.0023373926524072886, -0.008954889141023159, -0.0010475509334355593, -0.007323537953197956, -0.03329359367489815, 0.04066098481416702, 0.03795960918068886, -0.011796597391366959, -0.01081427838653326, 0.01817289926111698, -0.027347056195139885, -0.07886617630720139, -0.027119018137454987, 0.02047082409262657, 0.020944442600011826, 0.018348313868045807, 0.03164470195770264, -0.018523726612329483, -0.014471662230789661, 0.053290799260139465, 0.027276890352368355, 0.014620764181017876, -0.007218289654701948, -0.025891119614243507, -0.008437417447566986, -0.024277308955788612, 0.01526979636400938, 0.029697604477405548, 0.0536065436899662, -0.06785016506910324, 0.04392368718981743, 0.012191278859972954, -0.007455098442733288, -0.017865924164652824, -0.0209970660507679, -0.018558809533715248, 0.01458568125963211, 0.02931169420480728, -0.01595391146838665, 0.06420155614614487, 0.0029601126443594694, -0.0174010768532753, 0.07325292378664017, -0.019997205585241318, -0.04097672924399376, 0.01088444422930479, 0.06395597755908966, -0.01983933337032795, -0.015541687607765198, 0.009998602792620659, 0.006279824301600456, 0.038556016981601715, 0.002074271673336625, 0.00706480210646987, 0.005648333579301834, -0.006582413334399462, 0.002070982474833727, 0.0005339166382327676, 0.009902125224471092, -0.02559291571378708, 0.04543224722146988, -0.014182228595018387, 0.04048557206988335, -0.0025785870384424925, -0.033398840576410294, -0.03569676727056503, -0.03204815462231636, 0.05855322256684303, -0.0050387694500386715, 0.04185380041599274, 0.024610595777630806, -0.0017826455878093839, 0.06286840885877609, 0.0211198553442955, -0.020611155778169632, -0.055009856820106506, -0.050063181668519974, 0.0011182647431269288, 0.04346761107444763, -0.05665874853730202, -0.01469970028847456, -0.0035499425139278173, -0.08069048076868057, -0.05213306471705437, -0.022909078747034073, -0.0016532777808606625, -0.018804389983415604, 0.017137955874204636, 0.013357782736420631, -0.04076623171567917, 0.023382697254419327, 0.045607663691043854, -0.013717381283640862, -0.03239898011088371, -0.019856873899698257, -0.0020775606390088797, 0.0037034298293292522, 0.04767754673957825, 0.0348021537065506, 0.011743973009288311, -0.02818904258310795, 0.018278148025274277, -0.002473338507115841, 0.03624055162072182, -0.01954112946987152, -0.012173737399280071, 0.0008792630978859961, 0.005740426015108824, -0.049045778810977936, 0.03387245908379555, 0.010007373988628387, 0.009226781316101551, -0.03457411751151085, 0.0631139874458313, 0.00015759859525132924, 0.029294151812791824, -0.04504633694887161, 0.055080022662878036, -0.02271612361073494, -0.06893773376941681, 0.006499091628938913, 0.0944429412484169, 0.012559648603200912, 0.09640758484601974, 0.011507163755595684, -0.0013452067505568266, -0.05413278564810753, 0.04490600526332855, 0.015568000264465809, -0.012603501789271832, 0.05079991742968559, -0.008805787190794945, 0.06072835624217987, -0.025908660143613815, 0.050133343786001205, -0.02313711866736412, 0.05202781781554222, -0.037187784910202026, -0.02573324553668499, -0.020155077800154686, 0.017839612439274788, -0.07458607107400894, 0.026820814236998558, -0.03406541422009468, 0.025996366515755653, -0.03243406489491463, 0.015085611492395401, 0.027417222037911415, -0.010972150601446629, -0.017304599285125732, 0.010209099389612675, 0.024522889405488968, -0.06111426651477814, 0.00003823478982667439, -0.013419177383184433, 0.01469970028847456, -0.03401279076933861, -0.023330073803663254, -0.0061921169981360435, 0.05051925778388977, -0.021891677752137184, 0.06956922262907028, -0.0510454997420311, -0.029943184927105904, 0.07381425052881241, -0.004179240670055151 ]
39,389
pyspark.sql.dataframe
hint
Specifies some hint on the current :class:`DataFrame`. .. versionadded:: 2.2.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Parameters ---------- name : str A name of the hint. parameters : str, list, float or int Optional parameters. Returns ------- :class:`DataFrame` Hinted DataFrame Examples -------- >>> df = spark.createDataFrame([(2, "Alice"), (5, "Bob")], schema=["age", "name"]) >>> df2 = spark.createDataFrame([Row(height=80, name="Tom"), Row(height=85, name="Bob")]) >>> df.join(df2, "name").explain() # doctest: +SKIP == Physical Plan == ... ... +- SortMergeJoin ... ... Explicitly trigger the broadcast hashjoin by providing the hint in ``df2``. >>> df.join(df2.hint("broadcast"), "name").explain() == Physical Plan == ... ... +- BroadcastHashJoin ... ...
def hint( self, name: str, *parameters: Union["PrimitiveType", List["PrimitiveType"]] ) -> "DataFrame": """Specifies some hint on the current :class:`DataFrame`. .. versionadded:: 2.2.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Parameters ---------- name : str A name of the hint. parameters : str, list, float or int Optional parameters. Returns ------- :class:`DataFrame` Hinted DataFrame Examples -------- >>> df = spark.createDataFrame([(2, "Alice"), (5, "Bob")], schema=["age", "name"]) >>> df2 = spark.createDataFrame([Row(height=80, name="Tom"), Row(height=85, name="Bob")]) >>> df.join(df2, "name").explain() # doctest: +SKIP == Physical Plan == ... ... +- SortMergeJoin ... ... Explicitly trigger the broadcast hashjoin by providing the hint in ``df2``. >>> df.join(df2.hint("broadcast"), "name").explain() == Physical Plan == ... ... +- BroadcastHashJoin ... ... """ if len(parameters) == 1 and isinstance(parameters[0], list): parameters = parameters[0] # type: ignore[assignment] if not isinstance(name, str): raise PySparkTypeError( error_class="NOT_STR", message_parameters={"arg_name": "name", "arg_type": type(name).__name__}, ) allowed_types = (str, list, float, int) for p in parameters: if not isinstance(p, allowed_types): raise PySparkTypeError( error_class="DISALLOWED_TYPE_FOR_CONTAINER", message_parameters={ "arg_name": "parameters", "arg_type": type(parameters).__name__, "allowed_types": ", ".join(map(lambda x: x.__name__, allowed_types)), "return_type": type(p).__name__, }, ) jdf = self._jdf.hint(name, self._jseq(parameters)) return DataFrame(jdf, self.sparkSession)
(self, name: str, *parameters: Union[ForwardRef('PrimitiveType'), List[ForwardRef('PrimitiveType')]]) -> 'DataFrame'
[ 0.024820005521178246, -0.06836159527301788, 0.06346803158521652, 0.006580359768122435, -0.02795262634754181, 0.000978944357484579, -0.0010490344138816, 0.028953583911061287, -0.02520926482975483, -0.02724825032055378, -0.0349963940680027, -0.014282161369919777, -0.009611032903194427, 0.015014342032372952, -0.045821547508239746, -0.0043838173151016235, 0.009462743066251278, 0.03358763828873634, 0.014754834584891796, 0.02409709244966507, -0.002868480747565627, -0.002998234238475561, 0.03686854988336563, 0.07540535926818848, -0.033291060477495193, 0.0030306726694107056, 0.008610076270997524, -0.020445456728339195, 0.00584817910566926, 0.03507053852081299, -0.03557101637125015, -0.03557101637125015, -0.024300990626215935, 0.022595657035708427, -0.0210015419870615, 0.00231239409185946, 0.00783618912100792, 0.01635821908712387, 0.077036552131176, -0.04274453595280647, -0.005750863812863827, -0.009666641242802143, 0.010167119093239307, -0.061169542372226715, -0.01017638761550188, 0.01597822643816471, 0.010510039515793324, -0.03610856458544731, -0.00920786987990141, 0.01393924094736576, 0.024523425847291946, -0.040927983820438385, -0.041632361710071564, -0.019574252888560295, -0.08756512403488159, 0.0011700991308316588, -0.028490178287029266, 0.01316071953624487, 0.015412870794534683, 0.02241029590368271, 0.046229343861341476, -0.0061262222006917, 0.012734386138617992, 0.037776827812194824, -0.026988742873072624, 0.007168884854763746, 0.021131295710802078, -0.03697976842522621, -0.0367387980222702, -0.011121734976768494, 0.00113070965744555, -0.003429201664403081, -0.01994497701525688, 0.07047472894191742, -0.03612710162997246, 0.0002460394171066582, -0.0031905476935207844, -0.01834159530699253, -0.03290179744362831, -0.03015843778848648, 0.0740707516670227, -0.022892236709594727, -0.02385612204670906, -0.07725898176431656, -0.010593452490866184, 0.030529161915183067, -0.002592754550278187, 0.03829583898186684, 0.007599852047860622, -0.07599852234125137, -0.0066359685733914375, 0.014272892847657204, -0.011501727625727654, 0.05757351219654083, 0.032753508538007736, -0.0682874545454979, 0.010908568277955055, -0.031048176810145378, -0.003334203502163291, 0.03896314278244972, 0.023151744157075882, 0.011455386877059937, 0.013596320524811745, 0.017998674884438515, 0.03254961222410202, -0.06313437968492508, -0.005361603107303381, -0.0061401245184242725, -0.03405104577541351, -0.01522750873118639, -0.0323827862739563, 0.0018304522382095456, -0.015533355996012688, -0.03829583898186684, -0.008818608708679676, 0.07889017462730408, -0.0025116584729403257, -0.008758366107940674, -0.03716513141989708, 0.04730444401502609, 0.037721216678619385, 0.04715615510940552, -0.007066935766488314, -0.1236736923456192, 0.019407426938414574, 0.01912938430905342, 0.0034616398625075817, -0.016200659796595573, 0.003653953317552805, 0.008369105868041515, 0.05864861607551575, -0.015347993932664394, -0.013383153825998306, 0.09245868772268295, 0.046414706856012344, 0.022391758859157562, -0.0037767558824270964, 0.051901429891586304, -0.00443479185923934, 0.02274394780397415, -0.006895475555211306, -0.020204484462738037, 0.057202789932489395, -0.0038416325114667416, -0.0016613091574981809, -0.021094223484396935, 0.03401397168636322, -0.05052974820137024, -0.028749683871865273, 0.028397496789693832, 0.012882675975561142, -0.018156232312321663, -0.011019785888493061, 0.019407426938414574, -0.04070555046200752, -0.029657959938049316, 0.026117540895938873, -0.04281868040561676, 0.005736961495131254, -0.026933135464787483, 0.030436480417847633, -0.056275978684425354, -0.025190729647874832, 0.03844413161277771, -0.07318101823329926, 0.0013821072643622756, -0.021372267976403236, 0.009648105129599571, -0.024764396250247955, -0.02706288732588291, 0.03056623414158821, -0.002437513554468751, 0.07162397354841232, 0.024189773947000504, -0.01887914538383484, 0.06150319427251816, -0.012030010111629963, 0.0022706876043230295, 0.022132253274321556, -0.07681411504745483, 0.026451192796230316, -0.0019995952025055885, -0.041558217257261276, -0.009648105129599571, -0.005764765664935112, 0.038369983434677124, -0.038369983434677124, -0.01635821908712387, 0.051604848355054855, 0.025060975924134254, -0.04274453595280647, -0.03634953498840332, 0.016960645094513893, 0.030176972970366478, -0.02613607607781887, -0.03347642347216606, 0.016997717320919037, 0.04381963610649109, -0.08993776142597198, 0.03520029038190842, 0.054348211735486984, 0.028137989342212677, 0.02952820621430874, 0.01828598603606224, 0.031993523240089417, -0.011501727625727654, 0.004687347915023565, 0.0396675206720829, 0.02502390369772911, -0.0665079727768898, 0.020853253081440926, -0.059427134692668915, -0.014356305822730064, 0.033291060477495193, 0.01874939166009426, 0.0014261307660490274, -0.06002029404044151, -0.013438763096928596, 0.01567237824201584, 0.006469142623245716, 0.06272658705711365, -0.0317896269261837, -0.033976901322603226, 0.05397748574614525, 0.0335320308804512, -0.0472673736512661, 0.06439484655857086, -0.052012648433446884, 0.051901429891586304, -0.06925133615732193, -0.011047589592635632, -0.0711420327425003, 0.021798599511384964, -0.0460810549557209, -0.05998322367668152, 0.05523794889450073, -0.013929973356425762, -0.008948362432420254, -0.017377709969878197, -0.03803633153438568, -0.015802131965756416, 0.06569238007068634, 0.04289282485842705, 0.039593376219272614, 0.011056858114898205, -0.060947105288505554, 0.021372267976403236, 0.03714659437537193, 0.01817476749420166, -0.01793379709124565, -0.01771136187016964, -0.01920352876186371, 0.011510995216667652, 0.013920704834163189, 0.015987493097782135, -0.02241029590368271, 0.021316658705472946, -0.002963478909805417, -0.015663109719753265, 0.017053326591849327, -0.08207840472459793, -0.027081424370408058, -0.028434569016098976, 0.037832435220479965, -0.00936079304665327, -0.029379915446043015, -0.06521043926477432, 0.02439367212355137, -0.04393085092306137, -0.029213089495897293, 0.015533355996012688, 0.01920352876186371, 0.02654387429356575, 0.009675909765064716, 0.01988936960697174, -0.024022947996854782, -0.009050311520695686, 0.026766307651996613, 0.0017713679699227214, -0.026877526193857193, 0.04118749126791954, -0.03173401579260826, -0.020278630778193474, -0.00014807257684879005, -0.01972254365682602, 0.021075688302516937, 0.01154806837439537, -0.006214269436895847, -0.0274150762706995, -0.024226846173405647, -0.00994468480348587, 0.026451192796230316, 0.04304111376404762, 0.01294755283743143, -0.014115335419774055, 0.07629510015249252, 0.04074262082576752, 0.03097403235733509, 0.009777858853340149, -0.032531075179576874, 0.010908568277955055, -0.020908862352371216, 0.05390334129333496, 0.059019338339567184, -0.010834423825144768, -0.12397027015686035, -0.020148877054452896, -0.0723654180765152, -0.004768443759530783, 0.011066126637160778, 0.025042438879609108, 0.0066359685733914375, 0.01880500093102455, -0.03358763828873634, -0.006552555598318577, -0.012057813815772533, -0.024634642526507378, 0.013105111196637154, 0.004121993202716112, 0.05705450102686882, -0.008739829994738102, -0.032938871532678604, -0.019388891756534576, -0.011418314650654793, -0.014161676168441772, 0.015765059739351273, 0.027081424370408058, -0.032475464046001434, -0.009421036578714848, -0.024060020223259926, 0.02363368682563305, -0.0006163294892758131, 0.07240249216556549, -0.03110378421843052, -0.10298726707696915, 0.017748435959219933, 0.019110847264528275, 0.020093267783522606, -0.002432879526168108, 0.020686427131295204, 0.07911260426044464, -0.05642426759004593, 0.01294755283743143, 0.003213718067854643, 0.010426626540720463, 0.016701137647032738, 0.004682713653892279, 0.021279586479067802, 0.024931222200393677, 0.02608046866953373, -0.008494225330650806, -0.007256932090967894, -0.023466860875487328, -0.009546156041324139, 0.07166104763746262, -0.016015298664569855, -0.0250795129686594, 0.03723927587270737, -0.03156718984246254, -0.026562409475445747, 0.04574740305542946, -0.06113246828317642, 0.02748922072350979, -0.013753878884017467, 0.007187420967966318, 0.048416618257761, -0.019963514059782028, 0.029379915446043015, -0.039111435413360596, -0.020908862352371216, -0.015904080122709274, -0.08215254545211792, -0.006580359768122435, 0.03594173863530159, 0.0033805440180003643, -0.023707831278443336, -0.03814755007624626, 0.019982051104307175, -0.04352305456995964, 0.018591834232211113, -0.00768789928406477, -0.07622095942497253, 0.07440440356731415, -0.00012497470015659928, -0.043967925012111664, 0.0022034936118870974, -0.06584066897630692, -0.051197052001953125, 0.019110847264528275, -0.001786428620107472, 0.004641007166355848, -0.0018455128883942962, 0.0034407866187393665, 0.01012077834457159, -0.05523794889450073, 0.031530119478702545, 0.007558145560324192, 0.03286472707986832, -0.035737842321395874, -0.026302902027964592, -0.03306862339377403, -0.07303272187709808, -0.025005366653203964, -0.020723499357700348, 0.007891797460615635, 0.04311525821685791, 0.06836159527301788, -0.019444499164819717, -0.010825155302882195, -0.023763440549373627, -0.004008458461612463, -0.03675733506679535, -0.060539308935403824, 0.05705450102686882, 0.0080261854454875, 0.04252209886908531, 0.03034380078315735, -0.015190436504781246, 0.03494078293442726, 0.04545082151889801, 0.03303155303001404, -0.02632143907248974, 0.024708786979317665, 0.05034438520669937, -0.0008040087413974106, 0.011687089689075947, -0.02887943759560585, 0.0000025523513613734394, -0.019685471430420876, -0.007766677998006344, -0.032586682587862015, -0.018628906458616257, 0.016608458012342453, -0.0021305072586983442, -0.011103198863565922, 0.010760278441011906, 0.020519601181149483, -0.03167840838432312, 0.007057667709887028, -0.02124251425266266, 0.08875144273042679, -0.021316658705472946, 0.018999630585312843, -0.01651577651500702, -0.05494137108325958, -0.04170650616288185, -0.01700698584318161, -0.008443250320851803, -0.07243956625461578, -0.0367758683860302, 0.10157851129770279, 0.019982051104307175, 0.05056682229042053, 0.03551540523767471, -0.059538353234529495, -0.012919748201966286, -0.05041852965950966, -0.04267038777470589, -0.0013751562219113111, 0.0618368461728096, 0.028045307844877243, -0.0027549464721232653, -0.04267038777470589, -0.005102095659822226, -0.0012002205476164818, 0.029898930341005325, 0.011807574890553951, -0.09030848741531372, -0.02550584450364113, 0.0031025006901472807, 0.07733312994241714, -0.022299079224467278, 0.0058342767879366875, -0.030232582241296768, 0.02596925012767315, 0.03799926117062569, -0.06914012134075165, 0.026506802067160606, 0.014671421609818935, 0.06139197573065758, -0.0501590259373188, -0.05546038597822189, 0.03160426393151283, 0.01493092905730009, 0.04274453595280647, -0.060168586671352386, -0.018591834232211113, 0.0050696576945483685, -0.032049134373664856, 0.0027897018007934093, -0.02363368682563305, 0.05538623780012131, 0.044190358370542526, 0.02613607607781887, 0.00593622587621212, 0.03303155303001404, 0.03616417571902275, 0.007910333573818207, -0.026284366846084595, 0.010565647855401039, 0.0003846266772598028, -0.038481201976537704, -0.027378004044294357, 0.001005010912194848, 0.05794423818588257, -0.05338432639837265, 0.07206884026527405, 0.021835673600435257, -0.0595012828707695, 0.009777858853340149, -0.07555365562438965, 0.027618974447250366, 0.06843574345111847, 0.05145655944943428, 0.009490546770393848, -0.0016103344969451427, 0.008837144821882248, 0.02765604667365551, 0.01717381179332733, -0.046006910502910614, 0.00986127182841301, 0.032697901129722595, 0.02787848189473152, -0.04619227349758148, 0.0032948139123618603, -0.05442235618829727, 0.061577338725328445, -0.03634953498840332, 0.020093267783522606, 0.07955747842788696, -0.04037189856171608, 0.029880395159125328, -0.0017516732914373279, -0.03738756477832794, 0.026469729840755463, 0.029769176617264748, -0.03833291307091713, 0.019648397341370583, -0.00500478083267808, -0.02823067083954811, -0.00020360884082037956, 0.030492089688777924, -0.01154806837439537, -0.03985288366675377, 0.0033666419330984354, 0.0024143431801348925, -0.023819047957658768, 0.0215947013348341, 0.04585862159729004, -0.025635598227381706, 0.007669363170862198, -0.014180212281644344, 0.020389847457408905, 0.0524945892393589, -0.035144682973623276, -0.037721216678619385, 0.029769176617264748, -0.006821330636739731, 0.010380285792052746, 0.009054945781826973, -0.006469142623245716, 0.008915924467146397, 0.09438645839691162, -0.0277116559445858, 0.0052828239277005196, 0.02444927953183651, 0.05723986029624939, 0.0018663661321625113, -0.014402646571397781, -0.045895691961050034, 0.013920704834163189, 0.024986831471323967, 0.023615149781107903, -0.024115627631545067, 0.004462596029043198, -0.00994468480348587, 0.0329759456217289, 0.03216034919023514, -0.09386744350194931, -0.020260093733668327, -0.05538623780012131, 0.06369046866893768, -0.03657197207212448, 0.04556204006075859, 0.00848959106951952, 0.06339389085769653, -0.07132739573717117, -0.017368443310260773, 0.007340345066040754, 0.02561706304550171, -0.03925972431898117, -0.05961249768733978, 0.003359690774232149, -0.023615149781107903, 0.034736886620521545, 0.07414489984512329, -0.08385787904262543, -0.02899065613746643, 0.06057638302445412, -0.007479366846382618, -0.028675539419054985, -0.01686796359717846, -0.051197052001953125, -0.04278160631656647, 0.0010554062901064754, 0.0077296057716012, -0.05034438520669937, 0.04485766217112541, -0.026933135464787483, 0.00943957269191742, 0.0212981216609478, 0.05301360413432121, 0.006802794523537159, -0.004939903970807791, -0.01408753078430891, -0.025098048150539398, -0.03599734976887703, 0.004550643265247345, 0.0618368461728096, -0.013800219632685184, -0.054756008088588715, 0.04274453595280647, 0.06324560195207596, 0.00965737272053957, -0.013651929795742035, 0.025283411145210266, -0.04211430251598358, -0.045821547508239746, -0.017637217417359352, 0.009833467192947865, 0.031066711992025375, -0.008230083622038364, 0.04115041717886925, -0.0011011676397174597, 0.05360676348209381, -0.055163804441690445, 0.0022104447707533836, -0.06561823189258575, -0.021891281008720398, 0.07488634437322617, -0.02426391839981079, 0.026877526193857193, 0.03488517552614212, -0.035682231187820435, 0.013790951110422611, -0.010954909026622772, 0.012929016724228859, -0.03431055322289467, 0.01825818046927452, 0.012586096301674843, -0.01755380444228649, 0.02969503216445446, 0.01994497701525688, 0.022132253274321556, 0.12515659630298615, 0.08697196841239929, -0.05675791949033737, -0.01423582062125206, 0.01885133981704712, 0.0006725174025632441, 0.010510039515793324, -0.027044352144002914, -0.013290473259985447, -0.0041173589415848255, -0.025116585195064545, 0.04704493656754494, -0.028137989342212677, -0.0212981216609478, 0.06617432087659836, 0.04797174781560898, -0.028267743065953255, 0.008906655944883823, -0.016775283962488174, -0.01484751608222723, 0.043485984206199646, -0.04856490716338158, -0.037776827812194824, -0.07210591435432434, -0.040927983820438385, -0.0764433890581131, 0.027581902220845222, -0.029435524716973305, 0.009638836607336998, 0.009226405993103981, -0.005370871163904667, 0.05279116705060005, 0.009458108805119991, -0.029064800590276718, 0.0071318126283586025, -0.023781975731253624, 0.010917836800217628, -0.025987787172198296, -0.006385729648172855, 0.055794037878513336, -0.003248473396524787, -0.03892607241868973, -0.028675539419054985, -0.08445104211568832, 0.009416402317583561, 0.020667890086770058, 0.012150495313107967, 0.06224464252591133, 0.0012430856004357338, 0.038369983434677124, 0.02322589047253132, 0.08408031612634659, -0.0012604632647708058, 0.010306141339242458, 0.0431523323059082, -0.039704594761133194, -0.021335193887352943, -0.017488928511738777, 0.04567325860261917, 0.025172192603349686, 0.01301242969930172, -0.014189479872584343, -0.031585726886987686, -0.006640602368861437, 0.02257712185382843, 0.04596983641386032, 0.023374179378151894, 0.0010942164808511734, 0.048416618257761, 0.015412870794534683, -0.013151451013982296, 0.026933135464787483, 0.003788340836763382, -0.021946890279650688, 0.003123353933915496, 0.017025522887706757, 0.026803381741046906, 0.0431523323059082, -0.007168884854763746, 0.028657004237174988, 0.04893563315272331, -0.022076644003391266, 0.04545082151889801, 0.0009314452763646841, 0.00007385526987491176, 0.00390650937333703, -0.0065015810541808605, 0.032642289996147156, -0.04504302516579628, -0.019796688109636307, 0.019907904788851738, -0.00971298199146986, -0.01362412516027689, 0.00608451571315527, 0.04263331741094589, -0.0031905476935207844, 0.030936958268284798, -0.006677675060927868, -0.04029775410890579, 0.0003272802277933806, 0.05034438520669937, -0.0077620442025363445, 0.024523425847291946, 0.00654792133718729, -0.023244425654411316, -0.06383875757455826, -0.035793449729681015, 0.0688064694404602, 0.04800882190465927, -0.016728943213820457, -0.05727693438529968, -0.03156718984246254, -0.014606544747948647, 0.04882441461086273 ]
39,390
pyspark.sql.dataframe
inputFiles
Returns a best-effort snapshot of the files that compose this :class:`DataFrame`. This method simply asks each constituent BaseRelation for its respective files and takes the union of all results. Depending on the source relations, this may not find all input files. Duplicates are removed. .. versionadded:: 3.1.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Returns ------- list List of file paths. Examples -------- >>> import tempfile >>> with tempfile.TemporaryDirectory() as d: ... # Write a single-row DataFrame into a JSON file ... spark.createDataFrame( ... [{"age": 100, "name": "Hyukjin Kwon"}] ... ).repartition(1).write.json(d, mode="overwrite") ... ... # Read the JSON file as a DataFrame. ... df = spark.read.format("json").load(d) ... ... # Returns the number of input files. ... len(df.inputFiles()) 1
def inputFiles(self) -> List[str]: """ Returns a best-effort snapshot of the files that compose this :class:`DataFrame`. This method simply asks each constituent BaseRelation for its respective files and takes the union of all results. Depending on the source relations, this may not find all input files. Duplicates are removed. .. versionadded:: 3.1.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Returns ------- list List of file paths. Examples -------- >>> import tempfile >>> with tempfile.TemporaryDirectory() as d: ... # Write a single-row DataFrame into a JSON file ... spark.createDataFrame( ... [{"age": 100, "name": "Hyukjin Kwon"}] ... ).repartition(1).write.json(d, mode="overwrite") ... ... # Read the JSON file as a DataFrame. ... df = spark.read.format("json").load(d) ... ... # Returns the number of input files. ... len(df.inputFiles()) 1 """ return list(self._jdf.inputFiles())
(self) -> List[str]
[ -0.03277825191617012, -0.04434919357299805, -0.014226417988538742, -0.0020611879881471395, -0.02138981595635414, 0.041465580463409424, -0.013624144718050957, 0.029766885563731194, 0.06165085360407829, -0.0036227633245289326, 0.024127420037984848, -0.014153415337204933, -0.029000356793403625, 0.014418049715459347, 0.010503276251256466, -0.02390841208398342, 0.032522741705179214, 0.015777727589011192, 0.05442357808351517, 0.02770455740392208, -0.04358266294002533, -0.01098691951483488, 0.02836158312857151, 0.056577157229185104, -0.03288775309920311, 0.014919944107532501, -0.005137571133673191, -0.023652901872992516, 0.05106544867157936, 0.02560572698712349, -0.039531007409095764, 0.017465917393565178, -0.005315515212714672, -0.02204684168100357, -0.02836158312857151, -0.00019590981537476182, 0.03571661189198494, 0.043363653123378754, -0.005799158941954374, -0.001879821764305234, 0.005110194906592369, -0.023926662281155586, 0.009029531851410866, -0.004795370623469353, -0.002185520948842168, 0.04861985519528389, -0.07117771357297897, -0.04807233437895775, 0.041356079280376434, -0.010302518494427204, 0.043911173939704895, 0.018086440861225128, -0.06668804585933685, 0.032559242099523544, -0.04730580374598503, 0.00923941470682621, -0.04617426171898842, -0.023178383708000183, 0.0016995960613712668, 0.005260763224214315, 0.011616568081080914, -0.025094708427786827, 0.05982578173279762, 0.0035771364346146584, 0.0485103502869606, 0.0015068231150507927, -0.014956445433199406, -0.011598317883908749, -0.02370765432715416, -0.0004961907980032265, -0.08716532588005066, -0.014171665534377098, -0.0019870444666594267, 0.07446283847093582, -0.026938028633594513, 0.005005253478884697, 0.05102894827723503, 0.017192155122756958, -0.06486297398805618, -0.0534745417535305, 0.045152224600315094, -0.04055304825305939, -0.04095456376671791, -0.03181096538901329, 0.043363653123378754, 0.03401929885149002, 0.03905649110674858, 0.0175845455378294, -0.027668055146932602, 0.004635676741600037, -0.02201033942401409, 0.025423219427466393, -0.014618807472288609, 0.039385002106428146, 0.028233828023076057, -0.05117495357990265, -0.10490500181913376, -0.057015176862478256, -0.045115720480680466, -0.0044189500622451305, -0.041356079280376434, 0.025696979835629463, 0.03967701271176338, 0.04183059558272362, 0.04559024050831795, -0.03551585599780083, -0.03894698619842529, -0.04369216784834862, 0.03270524740219116, -0.015941983088850975, -0.0491308756172657, 0.04486021026968956, 0.07176173478364944, -0.023525146767497063, 0.028726596385240555, -0.00925766583532095, -0.015102451667189598, -0.015704724937677383, 0.004268381744623184, 0.012218841351568699, 0.05004340782761574, 0.059022750705480576, 0.02936537005007267, -0.035899121314287186, 0.04854685068130493, -0.03197522088885307, 0.033380523324012756, -0.02305063046514988, -0.0010277422843500972, 0.020203521475195885, 0.041940100491046906, -0.0007015111623331904, -0.016781514510512352, 0.038216959685087204, 0.009499487467110157, 0.03533334657549858, 0.028799599036574364, 0.007537537720054388, 0.024419432505965233, 0.013688022270798683, 0.036318887025117874, -0.011251553893089294, 0.04555373638868332, 0.027339544147253036, -0.003725423477590084, 0.01564997248351574, 0.06000829115509987, 0.01431767176836729, 0.00906603317707777, 0.026134997606277466, -0.010010506957769394, -0.00484099704772234, -0.07526586949825287, -0.07114121317863464, -0.02991289086639881, -0.021298563107848167, -0.05051792785525322, -0.00566684128716588, -0.00439841765910387, -0.06891462951898575, -0.0028288578614592552, -0.04723280295729637, -0.0064607467502355576, 0.028343331068754196, -0.030624669045209885, 0.030241403728723526, -0.004587769042700529, 0.027248289436101913, -0.050189416855573654, -0.011069047264754772, 0.057708702981472015, 0.03803445026278496, 0.02153582125902176, 0.0005840222584083676, -0.00829037930816412, 0.03803445026278496, 0.012237091548740864, 0.033179767429828644, 0.05416806787252426, 0.03551585599780083, -0.02297762595117092, -0.024820948019623756, 0.007423470728099346, 0.018743464723229408, 0.041283074766397476, 0.006830323021858931, -0.06552000343799591, -0.007647041697055101, 0.112643301486969, 0.015129826962947845, -0.009910128079354763, -0.019893258810043335, -0.0006570250843651593, 0.004375604446977377, -0.031099187210202217, -0.07055719196796417, -0.02974863536655903, 0.020331276580691338, -0.05767219886183739, 0.007250089198350906, -0.011598317883908749, -0.00576265761628747, 0.0559566356241703, -0.012811988592147827, -0.014071286655962467, -0.01887121982872486, -0.08774934709072113, -0.017967810854315758, 0.00018507346976548433, -0.010457648895680904, 0.03723141923546791, -0.048364344984292984, -0.01059452909976244, -0.038107454776763916, 0.028544088825583458, 0.024857448413968086, -0.03799794986844063, 0.00043773153447546065, -0.017694050446152687, -0.02452893555164337, 0.051539964973926544, 0.015604345127940178, -0.03960401192307472, 0.003177902428433299, 0.01385227870196104, -0.03586261719465256, 0.045809246599674225, 0.008148935623466969, -0.01592373289167881, -0.053292032331228256, -0.03996902331709862, -0.07289328426122665, 0.048364344984292984, -0.05157646909356117, -0.018725214526057243, 0.07760196179151535, 0.030861927196383476, -0.03872797638177872, 0.04730580374598503, -0.023196635767817497, -0.06676104664802551, 0.038800980895757675, 0.04055304825305939, -0.05957027152180672, -0.005192323122173548, -0.026518261060118675, 0.015595220029354095, 0.028544088825583458, -0.008842462673783302, -0.0024364679120481014, 0.061504848301410675, 0.0000509736237290781, -0.036592647433280945, -0.0030045208986848593, 0.027686307206749916, -0.027412546798586845, -0.026627765968441963, 0.0036182005424052477, 0.007975554093718529, 0.021444568410515785, 0.028598841279745102, -0.038107454776763916, 0.03056991659104824, 0.034931834787130356, -0.08015705645084381, -0.05635815113782883, -0.023342641070485115, -0.009444735012948513, -0.0759228989481926, 0.018743464723229408, 0.04245112091302872, 0.014801315031945705, -0.01751154288649559, -0.004266100469976664, -0.008938279002904892, -0.020787542685866356, -0.07391531765460968, 0.035972122102975845, -0.03272349759936333, -0.018615709617733955, -0.01564997248351574, -0.022557860240340233, -0.005826534703373909, 0.00728202797472477, -0.007747420575469732, -0.041684590280056, -0.026901526376605034, -0.08023006469011307, -0.03613637760281563, -0.02025827392935753, 0.03305201232433319, 0.027138786390423775, -0.03502308577299118, -0.03555235639214516, -0.04562674090266228, -0.0005358290509320796, 0.0364101380109787, -0.055774129927158356, 0.048948366194963455, 0.03343527764081955, -0.02819732576608658, 0.04924038052558899, 0.06296490132808685, 0.030077148228883743, -0.07106821238994598, -0.065264493227005, -0.022028591483831406, -0.05763569846749306, -0.02629925310611725, -0.006396869197487831, -0.020550284534692764, 0.0021969275549054146, 0.026335755363106728, -0.019163230434060097, -0.05245250090956688, -0.024127420037984848, -0.016142740845680237, 0.058949749916791916, -0.029766885563731194, 0.01987500861287117, -0.03619113191962242, 0.07154273241758347, -0.027576802298426628, -0.009992255829274654, -0.016215743497014046, 0.057124678045511246, 0.02994939312338829, 0.02056853473186493, -0.02104305289685726, -0.01813206635415554, 0.035661861300468445, -0.022886373102664948, 0.030807174742221832, 0.013596768490970135, -0.010603654198348522, 0.0024912201333791018, 0.03692115843296051, -0.022211097180843353, 0.07745595276355743, 0.02723003923892975, 0.033763788640499115, -0.043801672756671906, 0.03173796087503433, -0.021298563107848167, -0.01945524290204048, -0.014053036458790302, 0.06771008670330048, 0.04084505885839462, 0.030423911288380623, 0.005826534703373909, -0.0001460055646020919, 0.06340292096138, -0.060373302549123764, 0.013049247674643993, 0.003214403986930847, 0.0067116934806108475, -0.06435195356607437, 0.0441666841506958, 0.00332162668928504, 0.023269638419151306, 0.06398694217205048, -0.0494958870112896, 0.002024686662480235, -0.03502308577299118, 0.046502772718667984, 0.032285481691360474, 0.0323767364025116, 0.0035611670464277267, -0.04062604904174805, -0.022521359845995903, -0.026098495349287987, 0.0012296406785026193, 0.022411854937672615, -0.051466964185237885, -0.005999916233122349, 0.005739843938499689, 0.0036775153130292892, -0.0025893175043165684, -0.02805132046341896, 0.07274727523326874, -0.03036915883421898, -0.03803445026278496, 0.011808200739324093, -0.007240963634103537, -0.03996902331709862, 0.0309531819075346, -0.04774382337927818, -0.055847130715847015, -0.002049781382083893, 0.008427259512245655, 0.03684815764427185, -0.0043117268942296505, -0.015421838499605656, 0.011242428794503212, -0.007031080778688192, -0.0821281373500824, 0.01987500861287117, 0.013003621250391006, 0.02232060208916664, 0.004042529035359621, 0.01650775410234928, -0.017329035326838493, -0.06332992017269135, 0.03363603353500366, -0.019656000658869743, -0.005771782714873552, 0.05489809438586235, -0.013934406451880932, -0.030186651274561882, -0.06800209730863571, 0.04423968866467476, -0.040151532739400864, -0.014126039110124111, 0.10439398139715195, -0.022284099832177162, 0.07687193155288696, -0.0360998772084713, -0.008235626854002476, 0.03684815764427185, 0.10118185728788376, 0.01596023328602314, 0.03648314252495766, -0.00332162668928504, 0.06427895277738571, 0.025660479441285133, 0.04427618905901909, -0.025769982486963272, 0.01994801126420498, -0.008596077561378479, 0.06230787932872772, -0.0029885515104979277, 0.05551861971616745, -0.042633626610040665, -0.046502772718667984, -0.00346306967549026, -0.018387576565146446, 0.04617426171898842, -0.04303514212369919, -0.03622763231396675, 0.0627823993563652, 0.02432817779481411, -0.0196012482047081, 0.04548073559999466, 0.006761882919818163, -0.015403587371110916, -0.006401431746780872, -0.04653927683830261, 0.03436606004834175, -0.07460884749889374, 0.02153582125902176, 0.028215575963258743, -0.009043220430612564, 0.03405579924583435, -0.0696081593632698, -0.03956751152873039, 0.033033762127161026, 0.029766885563731194, -0.02149932086467743, -0.09337056428194046, 0.010448523797094822, 0.05500759929418564, 0.013067498803138733, 0.10395596921443939, -0.035388100892305374, 0.03370903804898262, -0.09052345156669617, -0.012711609713733196, -0.01863396167755127, -0.036245882511138916, 0.025550974532961845, 0.025769982486963272, -0.0017589108319953084, -0.06938914954662323, -0.07333129644393921, 0.04361916333436966, 0.014299420639872551, -0.0013494108570739627, 0.0024273425806313753, 0.03374553844332695, -0.040042027831077576, -0.05690567195415497, -0.07665292173624039, -0.01385227870196104, 0.03292425721883774, 0.0423051156103611, -0.03854547068476677, -0.018223321065306664, -0.03839946538209915, 0.014436300843954086, -0.08592427521944046, 0.01936398819088936, 0.04413018375635147, -0.023963164538145065, -0.011123799718916416, 0.03549760580062866, 0.0247479435056448, 0.026134997606277466, 0.038764480501413345, -0.011005169712007046, 0.05763569846749306, 0.04409368336200714, 0.012583855539560318, -0.03568011149764061, 0.04927688091993332, -0.03367253392934799, 0.007295716088265181, 0.059095755219459534, -0.033526528626680374, -0.07318529486656189, -0.04785332456231117, -0.02901860699057579, 0.03989602252840996, -0.0019528245320543647, 0.039458006620407104, -0.01689101941883564, 0.0007790765957906842, 0.0196012482047081, 0.07709094136953354, 0.04971489682793617, 0.0743168368935585, -0.050736937671899796, -0.07073970139026642, -0.0392024964094162, -0.03292425721883774, -0.027795810252428055, 0.0005711897392757237, 0.01596936024725437, -0.021371565759181976, -0.00854588858783245, 0.051393959671258926, -0.037523433566093445, 0.012894117273390293, 0.0024889386259019375, -0.01168044563382864, -0.02553272433578968, 0.008783147670328617, 0.022338852286338806, 0.01836932636797428, 0.026865025982260704, -0.02056853473186493, -0.03157370537519455, 0.08169011771678925, 0.005046317353844643, 0.0379614494740963, 0.007044768892228603, -0.002252820413559675, -0.031281694769859314, 0.02808782085776329, 0.08840637654066086, -0.0007106364937499166, 0.026317503303289413, -0.02898210659623146, 0.02812432311475277, 0.05544561520218849, 0.052196990698575974, -0.043108146637678146, 0.06716256588697433, -0.005712468177080154, -0.049532391130924225, -0.027941815555095673, -0.0012957993894815445, -0.02359815128147602, 0.02115255780518055, -0.062052369117736816, -0.002103392733260989, 0.02781406044960022, 0.004649364855140448, 0.01883471943438053, -0.014253794215619564, -0.026956278830766678, 0.039385002106428146, 0.03336227312684059, 0.015987610444426537, -0.07052069157361984, 0.020440779626369476, -0.028106072917580605, -0.01751154288649559, 0.055847130715847015, -0.04683128744363785, -0.029584378004074097, 0.02045902982354164, 0.021937336772680283, 0.03861847519874573, 0.03850897029042244, 0.0026760082691907883, 0.016909269616007805, -0.028179075568914413, 0.02901860699057579, 0.01863396167755127, 0.009581615217030048, -0.03898348659276962, -0.020897047594189644, 0.033490028232336044, 0.014856066554784775, 0.02881784923374653, 0.03239498659968376, -0.04843734949827194, -0.04376516863703728, 0.021754829213023186, -0.04942288622260094, 0.001032305066473782, 0.02502170391380787, -0.03365428373217583, -0.005534523632377386, -0.02847108617424965, -0.0522334948182106, -0.010037883184850216, 0.024072669446468353, -0.03651964291930199, 0.07296628504991531, -0.0021649887785315514, 0.033563029021024704, 0.02452893555164337, -0.05427757278084755, -0.0051740724593400955, 0.04756131395697594, -0.04588225111365318, 0.007911676540970802, 0.06442496180534363, -0.002180958166718483, -0.04376516863703728, 0.01731078512966633, 0.0196012482047081, 0.0068394485861063, -0.028544088825583458, 0.029566127806901932, -0.05639465153217316, 0.025970740243792534, -0.03526034578680992, 0.012109337374567986, 0.05679616704583168, -0.0908154621720314, 0.06690705567598343, 0.02378065697848797, 0.04861985519528389, -0.009029531851410866, -0.058402229100465775, -0.07409782707691193, -0.043290652334690094, -0.007090395782142878, -0.03440256416797638, -0.03491358086466789, -0.01363326981663704, -0.06858611851930618, -0.003488164395093918, -0.029493125155568123, -0.016106240451335907, -0.0360998772084713, 0.008897214196622372, -0.016106240451335907, -0.015914607793092728, 0.006606752052903175, -0.04372866824269295, 0.0034037549048662186, 0.029821638017892838, 0.031865715980529785, -0.03215772658586502, -0.004546704702079296, 0.02277686819434166, -0.011005169712007046, 0.0071360222063958645, -0.017274284735322, -0.0002942924911621958, 0.002591598778963089, -0.029529627412557602, -0.014463677071034908, 0.011087298393249512, -0.03872797638177872, -0.018387576565146446, 0.054569583386182785, 0.003985495772212744, 0.007879737764596939, 0.021791331470012665, -0.0065200612880289555, 0.03412880375981331, -0.016416501253843307, 0.00576265761628747, 0.00558015052229166, 0.028799599036574364, -0.05661366134881973, -0.005589275620877743, 0.033727288246154785, 0.026719018816947937, 0.04208610579371452, 0.006675192154943943, -0.02797831781208515, 0.05004340782761574, -0.0053793927654623985, 0.03458506986498833, -0.004466857761144638, -0.040151532739400864, 0.03432955965399742, 0.02677377127110958, 0.019856758415699005, -0.005671403836458921, 0.006606752052903175, 0.03515084087848663, -0.007222712971270084, -0.03613637760281563, 0.03799794986844063, 0.041976600885391235, 0.04489671438932419, 0.002443311968818307, 0.00449423398822546, 0.027759309858083725, 0.03422005474567413, 0.003068398218601942, 0.03622763231396675, -0.023835409432649612, -0.011899454519152641, 0.0012410474009811878, 0.0010174763156101108, -0.000360736419679597, 0.009700245223939419, 0.004767994396388531, 0.0186704620718956, 0.000533262558747083, 0.011716946959495544, 0.05110194906592369, -0.027321292087435722, 0.013596768490970135, -0.031044434756040573, 0.024236924946308136, 0.04792632907629013, -0.0404435433447361, 0.014865192584693432, -0.003545197891071439, -0.008956529200077057, 0.02471144311130047, 0.0503719225525856, -0.015430963598191738, 0.03522384539246559, -0.02487569861114025, -0.0018741183448582888, 0.05993528664112091, -0.04467770457267761, 0.0163434986025095, -0.0379614494740963, -0.03401929885149002, 0.010010506957769394, -0.004457732662558556, -0.020678039640188217, -0.014116914011538029, 0.031026184558868408, 0.04022453352808952, -0.024766195565462112, 0.06920664012432098, -0.009212039411067963, -0.035899121314287186, -0.011744323186576366, 0.0057535320520401, -0.006830323021858931, -0.029274117201566696, -0.022995878010988235, -0.018925972282886505, 0.053438037633895874, 0.014226417988538742, 0.0010117730125784874, -0.02432817779481411, -0.018460579216480255, -0.03398279845714569, 0.019692501053214073, 0.005990791134536266, 0.00503719225525856, 0.050116412341594696, 0.02929236739873886, 0.002815169980749488, -0.006948952563107014 ]
39,391
pyspark.sql.dataframe
intersect
Return a new :class:`DataFrame` containing rows only in both this :class:`DataFrame` and another :class:`DataFrame`. Note that any duplicates are removed. To preserve duplicates use :func:`intersectAll`. .. versionadded:: 1.3.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Parameters ---------- other : :class:`DataFrame` Another :class:`DataFrame` that needs to be combined. Returns ------- :class:`DataFrame` Combined DataFrame. Notes ----- This is equivalent to `INTERSECT` in SQL. Examples -------- >>> df1 = spark.createDataFrame([("a", 1), ("a", 1), ("b", 3), ("c", 4)], ["C1", "C2"]) >>> df2 = spark.createDataFrame([("a", 1), ("a", 1), ("b", 3)], ["C1", "C2"]) >>> df1.intersect(df2).sort(df1.C1.desc()).show() +---+---+ | C1| C2| +---+---+ | b| 3| | a| 1| +---+---+
def intersect(self, other: "DataFrame") -> "DataFrame": """Return a new :class:`DataFrame` containing rows only in both this :class:`DataFrame` and another :class:`DataFrame`. Note that any duplicates are removed. To preserve duplicates use :func:`intersectAll`. .. versionadded:: 1.3.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Parameters ---------- other : :class:`DataFrame` Another :class:`DataFrame` that needs to be combined. Returns ------- :class:`DataFrame` Combined DataFrame. Notes ----- This is equivalent to `INTERSECT` in SQL. Examples -------- >>> df1 = spark.createDataFrame([("a", 1), ("a", 1), ("b", 3), ("c", 4)], ["C1", "C2"]) >>> df2 = spark.createDataFrame([("a", 1), ("a", 1), ("b", 3)], ["C1", "C2"]) >>> df1.intersect(df2).sort(df1.C1.desc()).show() +---+---+ | C1| C2| +---+---+ | b| 3| | a| 1| +---+---+ """ return DataFrame(self._jdf.intersect(other._jdf), self.sparkSession)
(self, other: pyspark.sql.dataframe.DataFrame) -> pyspark.sql.dataframe.DataFrame
[ 0.004461356904357672, -0.0685635432600975, 0.023686883971095085, 0.05825404077768326, -0.023009097203612328, -0.005221638362854719, -0.022402655333280563, 0.035227105021476746, -0.005939557682722807, -0.01093378011137247, -0.0006972960545681417, -0.059930671006441116, -0.0018293570028617978, 0.05946692079305649, -0.016766319051384926, -0.05661308020353317, -0.00916796550154686, -0.012369619682431221, 0.06403306871652603, -0.018567806109786034, -0.0400964729487896, -0.02825303003191948, 0.014652692712843418, 0.036475662142038345, -0.04066724330186844, 0.01653444394469261, -0.07391449809074402, 0.00798183772712946, 0.007816850207746029, 0.05154751241207123, -0.017096294090151787, -0.054472699761390686, 0.0039686234667897224, -0.03133874759078026, -0.03770638257265091, -0.017381679266691208, 0.03319374471902847, -0.01372519414871931, 0.027717934921383858, -0.006777873728424311, -0.0418444499373436, -0.04944280534982681, 0.028859471902251244, -0.06695825606584549, 0.012485556304454803, 0.02903783693909645, -0.015178869478404522, -0.020904388278722763, 0.025862937793135643, 0.005975230596959591, 0.04441290721297264, 0.014661611057817936, -0.05386625975370407, 0.0032529335003346205, -0.07776717841625214, 0.015321562066674232, -0.011691831983625889, -0.030678795650601387, -0.008374241180717945, 0.01368952076882124, -0.018781844526529312, -0.054187316447496414, -0.008686380460858345, 0.05547154322266579, -0.033479128032922745, 0.04416319727897644, -0.018175402656197548, -0.015606945380568504, -0.04691002145409584, -0.015134278684854507, -0.06385470181703568, 0.032480284571647644, -0.018389441072940826, 0.07698237150907516, -0.05111943557858467, -0.0058057839050889015, -0.0006549343233928084, 0.02099357172846794, -0.035013068467378616, -0.014197861775755882, 0.05136914551258087, -0.061143554747104645, -0.013225771486759186, -0.03208788111805916, 0.030268557369709015, 0.026843946427106857, 0.0034268393646925688, 0.03802743926644325, -0.03046475723385811, -0.046767327934503555, 0.029091347008943558, 0.0598236508667469, -0.052938759326934814, -0.02654072642326355, 0.04266493022441864, -0.05215395241975784, -0.02382957749068737, 0.022777222096920013, 0.004949631169438362, -0.013707357458770275, 0.025060296058654785, 0.08240467309951782, 0.04812290146946907, -0.0001588564191479236, 0.025862937793135643, -0.02061900496482849, -0.008414373733103275, -0.018389441072940826, -0.028360050171613693, 0.004269614350050688, -0.014492164365947247, -0.014447572641074657, 0.04245089367032051, -0.02504245936870575, 0.016935765743255615, -0.01721223071217537, -0.007023125421255827, 0.03913330286741257, -0.052974432706832886, 0.011468875221908092, 0.024257652461528778, 0.06924133002758026, 0.049228765070438385, -0.05828971415758133, 0.007308509666472673, -0.019602322950959206, 0.0014001659583300352, 0.007040962111204863, -0.011165655218064785, 0.033603984862565994, 0.043307043612003326, -0.01704278402030468, 0.004753429908305407, 0.02978697046637535, 0.032266244292259216, -0.009185802191495895, 0.032141391187906265, 0.014563510194420815, 0.022259963676333427, 0.055400196462869644, 0.007174735888838768, -0.05090539902448654, 0.05935990437865257, -0.004111315589398146, -0.0951756164431572, -0.013377382420003414, 0.01356466580182314, -0.0475878082215786, -0.009141211397945881, 0.02953726053237915, -0.0071123079396784306, 0.00630074692890048, -0.009979527443647385, -0.04491233080625534, -0.028021156787872314, -0.03399638831615448, 0.04951414838433266, -0.010318420827388763, 0.05240366607904434, -0.040524549782276154, -0.006001985631883144, 0.05661308020353317, -0.0007190342876128852, 0.0443415641784668, -0.037099938839673996, 0.02953726053237915, -0.014866730198264122, 0.001132061006501317, -0.0458398275077343, -0.01653444394469261, 0.055150486528873444, 0.036564845591783524, 0.07170277088880539, -0.03913330286741257, -0.060144711285829544, 0.04423454403877258, 0.003756814869120717, -0.005854834336787462, 0.021510830149054527, -0.020351456478238106, 0.025969957932829857, -0.01303848810493946, -0.027575243264436722, 0.009676306508481503, 0.02416847087442875, -0.014982667751610279, 0.01072866003960371, -0.03374667465686798, 0.085187166929245, -0.010175728239119053, 0.01562478207051754, -0.03349696472287178, -0.011558057740330696, 0.03838416934013367, -0.033728837966918945, -0.042557910084724426, 0.004459127318114042, 0.029269712045788765, -0.07327237725257874, 0.0685635432600975, -0.023490682244300842, 0.01790785603225231, 0.014527836814522743, -0.011504548601806164, 0.032605137676000595, -0.0033889368642121553, -0.025113806128501892, -0.01724790409207344, -0.029519423842430115, -0.04780184477567673, -0.011192409321665764, -0.06324826180934906, 0.009194720536470413, -0.021403811872005463, 0.06178566813468933, 0.041273683309555054, -0.07869467884302139, -0.03121389076113701, 0.003085716161876917, -0.003946327604353428, 0.0028850554954260588, -0.013716275803744793, -0.033693164587020874, 0.040524549782276154, -0.01005979161709547, -0.04944280534982681, 0.06153595820069313, 0.008552606217563152, 0.01924559287726879, -0.08326082676649094, -0.04073858633637428, -0.035940565168857574, 0.03267648443579674, -0.03720695897936821, -0.08012159913778305, 0.051262129098176956, -0.002115855924785137, 0.007602812256664038, 0.00030266327667050064, -0.030072355642914772, 0.004316435195505619, 0.017096294090151787, 0.08704216778278351, -0.013243608176708221, -0.0021192003041505814, -0.036101095378398895, 0.016864418983459473, 0.03544114530086517, 0.03462066501379013, 0.024685729295015335, 0.0010740923462435603, -0.0620710514485836, 0.004068953916430473, -0.0131455073133111, -0.005457971710711718, -0.037099938839673996, -0.037563689053058624, -0.02083304338157177, -0.03025072067975998, 0.05960961431264877, -0.011879115365445614, -0.008030888624489307, -0.005966312251985073, 0.029180528596043587, -0.08326082676649094, 0.0035851383581757545, -0.02825303003191948, 0.02662990801036358, 0.0003834849630948156, -0.015936920419335365, 0.03205220773816109, -0.02117193676531315, 0.03949003294110298, 0.018764007836580276, 0.023258809000253677, -0.019691506400704384, -0.04462694749236107, -0.01409976091235876, -0.03945435956120491, -0.046553291380405426, 0.048265594989061356, -0.0115223852917552, -0.02595212124288082, -0.024400344118475914, -0.02470356598496437, -0.046339251101017, -0.0082895178347826, -0.09110888838768005, 0.0022407115902751684, -0.06610210239887238, -0.0450906977057457, 0.014991586096584797, 0.03133874759078026, 0.017782999202609062, -0.0498352088034153, 0.033015377819538116, 0.024721402674913406, -0.04940713196992874, 0.010050873272120953, 0.018692661076784134, 0.0062561556696891785, -0.03652917221188545, 0.038598205894231796, 0.059859324246644974, -0.023562029004096985, -0.0791940987110138, 0.03495955839753151, 0.020155254751443863, -0.013867885805666447, 0.01937044970691204, -0.03563734516501427, 0.009569287300109863, 0.004053346812725067, -0.019013719633221626, -0.09103754162788391, 0.0007998559740372002, -0.0020846419502049685, 0.023686883971095085, -0.02341933734714985, -0.001124257454648614, 0.010363011620938778, -0.014081924222409725, -0.010817842558026314, 0.020779533311724663, 0.008329649455845356, 0.0023900922387838364, 0.044555600732564926, 0.010701905936002731, 0.028342213481664658, 0.008485719561576843, 0.018942372873425484, -0.009801161475479603, 0.055186159908771515, -0.01871049776673317, 0.011861278675496578, -0.03529845178127289, 0.006969616282731295, 0.022937750443816185, 0.04416319727897644, 0.04312868043780327, 0.055221833288669586, -0.05037030205130577, 0.035227105021476746, -0.04437723383307457, -0.03688590228557587, -0.02070818655192852, -0.01545533537864685, 0.053438182920217514, -0.034406628459692, -0.025631064549088478, -0.03041124902665615, 0.0535808727145195, 0.0016521066427230835, 0.006059953942894936, -0.006608426570892334, 0.03121389076113701, -0.08133448660373688, 0.024810584262013435, -0.006233860272914171, -0.00030851588235236704, 0.0583253875374794, 0.0032306378707289696, -0.0017446335405111313, -0.01335062738507986, -0.011058636009693146, 0.06670854240655899, -0.0024012401700019836, -0.01535723451524973, -0.08889716118574142, -0.0605727843940258, -0.03517359495162964, -0.005257311277091503, 0.010550295002758503, 0.015598027966916561, 0.030215047299861908, -0.0032997543457895517, -0.07009748369455338, 0.008945009671151638, 0.008686380460858345, 0.0182021576911211, -0.002588523318991065, -0.01189695205539465, -0.015642618760466576, -0.07391449809074402, -0.02254534885287285, -0.031106872484087944, -0.05557856336236, -0.054222989827394485, 0.028591925278306007, 0.010300584137439728, -0.011888033710420132, -0.01514319609850645, -0.01749761588871479, 0.02595212124288082, -0.051476165652275085, -0.03281917795538902, -0.012806613929569721, -0.010309502482414246, 0.060144711285829544, 0.006389929447323084, 0.04369944706559181, -0.004655329044908285, 0.022152945399284363, -0.07491333782672882, -0.00770983099937439, 0.02470356598496437, 0.04048887640237808, -0.07555545121431351, -0.0045661465264856815, -0.0012418669648468494, -0.015633700415492058, -0.03870522603392601, -0.06242778152227402, 0.07398584485054016, -0.00737539678812027, 0.01277094054967165, 0.0465889610350132, 0.0000011452641501819016, 0.03242677450180054, 0.0866854339838028, 0.030571777373552322, 0.00979224406182766, 0.007634025998413563, 0.038063112646341324, -0.03601191192865372, -0.011968297883868217, -0.0045460802502930164, 0.01412651501595974, 0.006117922719568014, -0.04063156992197037, -0.02420414239168167, -0.03429960831999779, -0.03752801567316055, 0.024400344118475914, -0.029840480536222458, 0.02978697046637535, 0.03663618862628937, -0.014340553432703018, 0.018425114452838898, 0.07962217926979065, 0.05340250954031944, -0.0430930070579052, 0.0010651740012690425, -0.019673669710755348, -0.06010903790593147, -0.07084661722183228, -0.015214542858302593, -0.008432209491729736, -0.02645154297351837, -0.009774407371878624, 0.09760137647390366, 0.021403811872005463, -0.04045320302248001, 0.015214542858302593, -0.03774205222725868, 0.03099985420703888, 0.008748807944357395, -0.03137442097067833, -0.05971663445234299, 0.04512636736035347, 0.0051725879311561584, 0.021278955042362213, -0.026933129876852036, 0.016596872359514236, -0.0026286556385457516, -0.008476801216602325, -0.041345030069351196, -0.037777725607156754, -0.03124956414103508, 0.015464253723621368, 0.0005543252918869257, -0.059859324246644974, -0.04765915498137474, -0.051440492272377014, 0.05425866320729256, 0.020280111581087112, -0.05525750666856766, 0.011486711911857128, -0.011504548601806164, 0.04138070344924927, -0.10273829102516174, -0.016926847398281097, -0.054686736315488815, -0.03895493596792221, 0.0613219179213047, -0.062392111867666245, 0.003901736345142126, 0.04212983697652817, 0.04366377368569374, -0.02475707419216633, 0.020315784960985184, 0.045768484473228455, -0.03319374471902847, -0.014295962639153004, 0.024560874328017235, 0.05076270550489426, -0.003792487783357501, 0.019887708127498627, 0.01055921334773302, 0.024774910882115364, -0.0032440151553601027, -0.022224290296435356, -0.0341569148004055, 0.014242452569305897, -0.0018538822187110782, -0.06196403503417969, 0.024739239364862442, -0.023686883971095085, -0.005007599946111441, -0.016445262357592583, -0.03157062083482742, -0.0036185819189995527, 0.059181537479162216, 0.007567139342427254, 0.051476165652275085, 0.0034758897963911295, -0.003901736345142126, 0.05229664593935013, 0.0415947400033474, -0.009185802191495895, -0.01678415574133396, -0.0011593730887398124, 0.046339251101017, -0.0518328957259655, -0.03920464590191841, 0.00651924405246973, 0.022884242236614227, 0.009890344925224781, -0.036350805312395096, -0.01320793479681015, -0.12542633712291718, 0.001474856398999691, 0.00019327530753798783, -0.04323570057749748, -0.06342662870883942, 0.03453148156404495, -0.02033362165093422, 0.04940713196992874, 0.022812895476818085, -0.0034669714514166117, 0.01578531041741371, 0.027575243264436722, 0.02775360830128193, 0.005163669586181641, -0.03529845178127289, 0.0127085130661726, -0.06392604857683182, 0.004044428467750549, 0.02208159863948822, 0.046731654554605484, 0.029073510318994522, -0.014661611057817936, 0.08097775280475616, 0.020779533311724663, 0.03412124142050743, -0.022884242236614227, -0.013109834864735603, -0.013546829111874104, -0.009159047156572342, 0.03895493596792221, 0.04987088218331337, -0.01653444394469261, 0.08932524174451828, -0.008267221972346306, -0.006224941927939653, -0.009141211397945881, 0.04555444419384003, 0.00543567631393671, -0.010006281547248363, 0.0029363352805376053, 0.028074664995074272, 0.048229921609163284, 0.023722557350993156, -0.036315131932497025, 0.022402655333280563, 0.06235643848776817, 0.009159047156572342, 0.06952671706676483, -0.059680961072444916, -0.015678292140364647, -0.04637492448091507, 0.03208788111805916, 0.008677462115883827, 0.004376633558422327, 0.0017290266696363688, 0.04145204648375511, -0.0478375181555748, -0.006550458259880543, 0.05479375645518303, 0.0150807686150074, -0.013091998174786568, -0.018157565966248512, -0.017551125958561897, -0.01012221910059452, -0.0003717797517310828, 0.08161986619234085, -0.03328292816877365, -0.010648395866155624, 0.03841984272003174, -0.025185151025652885, 0.05379491299390793, 0.013867885805666447, -0.036600518971681595, -0.04398483410477638, 0.017693817615509033, -0.016177713871002197, -0.025060296058654785, -0.000048040128604043275, -0.016070695593953133, 0.020815206691622734, 0.020226601511240005, 0.02482842095196247, 0.014697283506393433, -0.07134603708982468, 0.05786163732409477, 0.005185964982956648, -0.010550295002758503, -0.04287897050380707, 0.013065243139863014, 0.00581024307757616, 0.014411899261176586, 0.04416319727897644, 0.039061956107616425, 0.010416521690785885, 0.021350301802158356, 0.02787846513092518, 0.01110322680324316, 0.035227105021476746, -0.0216713584959507, 0.04769482463598251, 0.045233387500047684, -0.032854851335287094, 0.03153494745492935, 0.005573909264057875, 0.05946692079305649, -0.0470883846282959, -0.008762185461819172, -0.058682117611169815, -0.015936920419335365, 0.054686736315488815, -0.017845427617430687, -0.018728334456682205, -0.010077627375721931, -0.005631878040730953, -0.03157062083482742, -0.03412124142050743, -0.022099435329437256, -0.01704278402030468, 0.019352613016963005, -0.013493319042026997, 0.0020367063116282225, -0.0022730401251465082, 0.029965335503220558, -0.01325252652168274, -0.032729994505643845, 0.02657639980316162, -0.026487216353416443, 0.010514622554183006, 0.09189369529485703, 0.03938301280140877, 0.035102251917123795, 0.02575591951608658, 0.0104611124843359, 0.014777547679841518, 0.043307043612003326, 0.03246244788169861, 0.04680300131440163, -0.028520578518509865, 0.06535296887159348, 0.08504447340965271, 0.01162048615515232, 0.045804157853126526, -0.03688590228557587, 0.02666558139026165, -0.009301739744842052, -0.07384315133094788, -0.030571777373552322, -0.0485866516828537, 0.009774407371878624, -0.0498352088034153, 0.0026197372935712337, 0.0450906977057457, -0.011192409321665764, -0.011406447738409042, -0.004068953916430473, -0.0030968638602644205, 0.02211727201938629, -0.02778928168118, 0.04113098978996277, -0.07541276514530182, 0.012485556304454803, -0.02579159289598465, 0.007691994775086641, 0.0339072048664093, 0.022598857060074806, 0.03508441522717476, -0.02045847661793232, -0.08754158765077591, -0.03133874759078026, 0.05215395241975784, -0.016570117324590683, 0.040025126188993454, 0.023365827277302742, 0.05315279960632324, 0.039561379700899124, 0.06817113608121872, 0.020601168274879456, 0.004073412623256445, 0.06317691504955292, -0.04369944706559181, -0.03542330861091614, 0.0023767149541527033, 0.08154851943254471, 0.05775461718440056, 0.013573584146797657, 0.02953726053237915, -0.008900417946279049, -0.003076797816902399, 0.05279606953263283, 0.013555747456848621, -0.029697788879275322, -0.02682610973715782, 0.04270060360431671, 0.033853694796562195, -0.0044702752493321896, 0.04730242118239403, 0.07009748369455338, -0.03699292242527008, -0.008432209491729736, 0.029608605429530144, 0.0035115627106279135, 0.051262129098176956, 0.018425114452838898, 0.03913330286741257, 0.016935765743255615, -0.04141637310385704, -0.022652367129921913, -0.06424710899591446, 0.009087701328098774, 0.0017089605098590255, 0.018978046253323555, -0.0005741126369684935, -0.013368464075028896, -0.03924031928181648, 0.045304734259843826, -0.006568294484168291, -0.016739564016461372, 0.015606945380568504, 0.007277295924723148, 0.04666030779480934, -0.006171432323753834, 0.025845102965831757, -0.022777222096920013, -0.020012563094496727, 0.0425935834646225, 0.06974074989557266, -0.010363011620938778, -0.013965986669063568, -0.009524695575237274, -0.0478375181555748, -0.0470883846282959, 0.05390193313360214, -0.012726349756121635, 0.038063112646341324, 0.0023365826345980167, 0.043021660298109055, 0.015196706168353558, 0.053937602788209915 ]
39,392
pyspark.sql.dataframe
intersectAll
Return a new :class:`DataFrame` containing rows in both this :class:`DataFrame` and another :class:`DataFrame` while preserving duplicates. This is equivalent to `INTERSECT ALL` in SQL. As standard in SQL, this function resolves columns by position (not by name). .. versionadded:: 2.4.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Parameters ---------- other : :class:`DataFrame` Another :class:`DataFrame` that needs to be combined. Returns ------- :class:`DataFrame` Combined DataFrame. Examples -------- >>> df1 = spark.createDataFrame([("a", 1), ("a", 1), ("b", 3), ("c", 4)], ["C1", "C2"]) >>> df2 = spark.createDataFrame([("a", 1), ("a", 1), ("b", 3)], ["C1", "C2"]) >>> df1.intersectAll(df2).sort("C1", "C2").show() +---+---+ | C1| C2| +---+---+ | a| 1| | a| 1| | b| 3| +---+---+
def intersectAll(self, other: "DataFrame") -> "DataFrame": """Return a new :class:`DataFrame` containing rows in both this :class:`DataFrame` and another :class:`DataFrame` while preserving duplicates. This is equivalent to `INTERSECT ALL` in SQL. As standard in SQL, this function resolves columns by position (not by name). .. versionadded:: 2.4.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Parameters ---------- other : :class:`DataFrame` Another :class:`DataFrame` that needs to be combined. Returns ------- :class:`DataFrame` Combined DataFrame. Examples -------- >>> df1 = spark.createDataFrame([("a", 1), ("a", 1), ("b", 3), ("c", 4)], ["C1", "C2"]) >>> df2 = spark.createDataFrame([("a", 1), ("a", 1), ("b", 3)], ["C1", "C2"]) >>> df1.intersectAll(df2).sort("C1", "C2").show() +---+---+ | C1| C2| +---+---+ | a| 1| | a| 1| | b| 3| +---+---+ """ return DataFrame(self._jdf.intersectAll(other._jdf), self.sparkSession)
(self, other: pyspark.sql.dataframe.DataFrame) -> pyspark.sql.dataframe.DataFrame
[ -0.010647737421095371, -0.07657838612794876, 0.008439087308943272, 0.05300760269165039, -0.032352056354284286, -0.007914699614048004, 0.002375298645347357, 0.0014120695414021611, 0.01342965941876173, 0.0019975618924945593, -0.006305984687060118, -0.07167225331068039, -0.015411666594445705, 0.04849253594875336, -0.0024086283519864082, -0.07156559824943542, -0.00016039932961575687, 0.01074550487101078, 0.05862477049231529, -0.018860183656215668, -0.025774991139769554, -0.020619992166757584, -0.0021353247575461864, 0.022113164886832237, -0.023926300927996635, 0.008834600448608398, -0.05247432738542557, 0.012007590383291245, 0.005772709380835295, 0.05375418812036514, -0.01862909644842148, -0.045861706137657166, -0.008136898279190063, -0.02517061121761799, -0.07220552861690521, -0.037435952574014664, 0.04817257076501846, -0.005381640512496233, 0.057309359312057495, 0.0035351733677089214, -0.0331164188683033, -0.04408412054181099, 0.021419906988739967, -0.07288100570440292, 0.022308699786663055, 0.009483419358730316, 0.008527967147529125, -0.01614047773182392, 0.026983749121427536, 0.010514418594539165, 0.028903542086482048, 0.0012798616662621498, -0.056100599467754364, 0.0233752503991127, -0.07124563306570053, 0.02685931883752346, -0.013163020834326744, -0.015233908779919147, -0.0034951777197420597, 0.005879364442080259, -0.043088674545288086, -0.043301984667778015, -0.01004335843026638, 0.05770042911171913, -0.030876660719513893, 0.01086993608623743, -0.021366579458117485, -0.011216565035283566, -0.05791373923420906, -0.02314416505396366, -0.07494300603866577, 0.04977239668369293, -0.009305660612881184, 0.06658835709095001, -0.05091005191206932, 0.0019242364214733243, 0.00022636441281065345, 0.01638045161962509, -0.03857360780239105, -0.007443639449775219, 0.026983749121427536, -0.06833039224147797, -0.021633217111229897, -0.012754176743328571, 0.02657490409910679, 0.028565799817442894, 0.004446186125278473, 0.05275873839855194, 0.006248213350772858, -0.05410970374941826, 0.028565799817442894, 0.06146891042590141, -0.05514070391654968, -0.04291091486811638, 0.03359636664390564, -0.03811143338680267, -0.0346095897257328, 0.0268415417522192, 0.004803924821317196, -0.007968027144670486, 0.006670389790087938, 0.058909185230731964, 0.035800572484731674, 0.0036462724674493074, 0.03635162487626076, -0.021882077679038048, -0.011065470054745674, -0.04219987988471985, -0.016469329595565796, 0.011918711476027966, -0.033507488667964935, -0.008714613504707813, 0.0326186940073967, -0.01982007920742035, 0.01250531431287527, -0.039782363921403885, 0.0006360423285514116, 0.03228095546364784, -0.07700500637292862, 0.016975942999124527, 0.03647605702280998, 0.07821376621723175, 0.06566400825977325, -0.06356646120548248, -0.0033885224256664515, -0.012105357833206654, 0.011145461350679398, 0.013198573142290115, -0.025348370894789696, 0.03293865919113159, 0.04291091486811638, -0.005470519419759512, 0.005057231057435274, 0.03059224784374237, 0.03336527943611145, -0.02010449208319187, 0.04966574162244797, -0.004390636458992958, 0.019002389162778854, 0.026326041668653488, 0.004581726621836424, -0.052829843014478683, 0.0667305588722229, 0.007856927812099457, -0.08098679780960083, -0.007928031496703625, 0.017811408266425133, -0.04433298483490944, -0.02447735331952572, 0.0291524026542902, 0.00804801844060421, 0.0027108180802315474, -0.01870020106434822, -0.04429743438959122, -0.03821808844804764, -0.031872108578681946, 0.05524735897779465, -0.011296556331217289, 0.027623679488897324, -0.03359636664390564, -0.01614047773182392, 0.028850214555859566, 0.0006677056080661714, 0.046786051243543625, -0.06715718656778336, -0.0066037303768098354, -0.010176677256822586, -0.033951885998249054, -0.044226329773664474, -0.02685931883752346, 0.044226329773664474, 0.03357859328389168, 0.06566400825977325, -0.05972687527537346, -0.06964579969644547, 0.04333753511309624, -0.016051597893238068, -0.010612186044454575, 0.03459181636571884, -0.012558641843497753, 0.026326041668653488, -0.04522177577018738, -0.01424734853208065, -0.003457403974607587, 0.036973778158426285, 0.00017428671708330512, -0.006288208998739719, -0.03226317837834358, 0.07707610726356506, -0.019926734268665314, 0.0013987376587465405, -0.04465295001864433, -0.031623248010873795, 0.06665945798158646, -0.037009332329034805, -0.0411333292722702, -0.005274984985589981, 0.02053111419081688, -0.05464297905564308, 0.06452635675668716, -0.036102764308452606, 0.033276401460170746, 0.02495730109512806, -0.008132454007863998, 0.026486024260520935, -0.0043306429870426655, -0.029934540390968323, -0.027854766696691513, -0.016042709350585938, -0.04614612087607384, 0.022717542946338654, -0.060580115765333176, -0.010967702604830265, -0.021046612411737442, 0.037435952574014664, 0.04017343372106552, -0.07167225331068039, -0.024850646033883095, 0.017900286242365837, -0.005448299925774336, 0.01653154566884041, -0.025295043364167213, -0.04205767437815666, 0.014354003593325615, -0.016664864495396614, -0.028316937386989594, 0.062428805977106094, 0.019553441554307938, 0.005510515067726374, -0.08290658891201019, -0.033009763807058334, -0.05720270425081253, 0.010558858513832092, -0.04152439907193184, -0.08169783651828766, 0.04291091486811638, 0.016247132793068886, 0.0038951344322413206, -0.0010332216043025255, -0.019926734268665314, -0.019553441554307938, -0.001923125353641808, 0.07192111015319824, -0.006070454604923725, -0.012043142691254616, -0.03588945418596268, -0.0005199437728151679, 0.04714157059788704, 0.024175163358449936, 0.027232611551880836, -0.01608715020120144, -0.06779711693525314, 0.01702038198709488, -0.025615008547902107, 0.005421636160463095, -0.0447596050798893, -0.04223543405532837, 0.006390420254319906, -0.02844136953353882, 0.05069674178957939, 0.002379742683842778, -0.004643942229449749, -0.0009121235925704241, 0.02517061121761799, -0.06527294218540192, 0.005937135778367519, -0.03293865919113159, 0.031392160803079605, 0.004763929173350334, -0.03078778274357319, -0.005590506829321384, -0.030858885496854782, 0.035836126655340195, 0.029099075123667717, 0.03949795290827751, 0.012656409293413162, -0.040031228214502335, 0.0010604409035295248, -0.0360138826072216, -0.05759377405047417, 0.06086453050374985, -0.01918014883995056, -0.01062107365578413, -0.02006894163787365, -0.03800477832555771, -0.024797318503260612, -0.031089970842003822, -0.09406983107328415, -0.01530501153320074, -0.07856928557157516, -0.02847692184150219, 0.015207245014607906, 0.030698902904987335, 0.017811408266425133, -0.05976242572069168, 0.028779109939932823, 0.023179715499281883, -0.06587731838226318, 0.006225993391126394, 0.02332192286849022, 0.003641828428953886, -0.0233752503991127, 0.039569053798913956, 0.04742598161101341, -0.014407331123948097, -0.07160114496946335, 0.018806856125593185, 0.0313032828271389, -0.007648061960935593, 0.009643401950597763, -0.024104060605168343, 0.021402129903435707, -0.0016098259948194027, -0.02661045640707016, -0.0736631453037262, -0.00815911777317524, 0.007981359027326107, 0.004335086792707443, -0.009034578688442707, -0.008741277270019054, 0.004532843362540007, -0.011980926617980003, -0.029756782576441765, 0.021331027150154114, 0.009972254745662212, 0.014833951368927956, 0.06164666637778282, 0.0008682394400238991, 0.02145545743405819, -0.005199437960982323, 0.021810974925756454, -0.018131373450160027, 0.046359430998563766, -0.01631823554635048, 0.0057060495018959045, -0.037435952574014664, 0.019997837021946907, 0.022984180599451065, 0.053078703582286835, 0.029721230268478394, 0.052616532891988754, -0.03222762793302536, 0.01793583855032921, -0.04411967471241951, -0.03292088583111763, -0.006679277867078781, -0.023855198174715042, 0.04390636458992958, -0.038893572986125946, -0.04038674384355545, -0.032796453684568405, 0.018344683572649956, 0.0013165243435651064, 0.0022086501121520996, 0.01202536653727293, 0.05041232705116272, -0.08191114664077759, 0.004286203067749739, -0.02054888941347599, 0.009607849642634392, 0.07330762594938278, -0.012496426701545715, 0.003886246355250478, -0.01725146733224392, 0.01567830517888069, 0.06676611304283142, 0.005817148834466934, -0.004608390387147665, -0.08283548802137375, -0.057309359312057495, -0.03807588294148445, -0.012194236740469933, 0.027659231796860695, 0.00315077044069767, 0.022717542946338654, 0.006901476066559553, -0.07551183551549911, 0.024601783603429794, -0.007505855057388544, 0.00959007441997528, 0.0048528085462749004, -0.025561681017279625, 0.00758140254765749, -0.059620220214128494, -0.013260788284242153, -0.028850214555859566, -0.029579024761915207, -0.06189553067088127, 0.021153267472982407, 0.036102764308452606, -0.002370854839682579, 0.0006760380347259343, -0.005750489421188831, 0.027925869449973106, -0.043550845235586166, -0.01889573410153389, -0.019748976454138756, -0.0004480071074794978, 0.03896467760205269, 0.000290801894152537, 0.05386084318161011, -0.01551832165569067, 0.028085852041840553, -0.05841146036982536, -0.00804357510060072, 0.025063956156373024, 0.03988901898264885, -0.10011362284421921, -0.0073636481538414955, 0.01563386432826519, -0.011518754996359348, -0.003886246355250478, -0.04358639940619469, 0.07142338901758194, -0.0025375033728778362, 0.01891351118683815, 0.055673979222774506, 0.022362027317285538, 0.05297204852104187, 0.08454196900129318, 0.04667939618229866, -0.005452743731439114, 0.00479503720998764, 0.040706709027290344, -0.021064389497041702, -0.01001669466495514, -0.029081299901008606, 0.019446786493062973, -0.00367738027125597, -0.04092001914978027, -0.015713855624198914, -0.01862909644842148, -0.03921353816986084, 0.0256861113011837, -0.029703455045819283, 0.020140044391155243, 0.04045784845948219, -0.011678737588226795, 0.014789512380957603, 0.08098679780960083, 0.04763929173350334, -0.027161506935954094, -0.00035385062801651657, -0.024690663442015648, -0.039782363921403885, -0.04600391536951065, -0.01637156307697296, 0.008452419191598892, -0.043301984667778015, -0.011678737588226795, 0.09456755220890045, 0.00875016488134861, -0.01729590818285942, -0.016931502148509026, -0.04060005396604538, 0.023001957684755325, 0.01379406452178955, -0.033720798790454865, -0.06374421715736389, 0.04874139651656151, 0.022717542946338654, 0.014558426104485989, -0.012931935489177704, 0.029294610023498535, 0.0005882697296328843, -0.031001092866063118, -0.05489184334874153, -0.0467505007982254, -0.02801474928855896, 0.015393891371786594, 0.016184916719794273, -0.07238328456878662, -0.03517841920256615, -0.05158553272485733, 0.03704488277435303, 0.011527642607688904, -0.0467505007982254, 0.008367984555661678, -0.020015614107251167, 0.049096912145614624, -0.0858929380774498, -0.00297523383051157, -0.04123998433351517, -0.056491669267416, 0.05883808434009552, -0.037933677434921265, 0.015607201494276524, 0.047497086226940155, 0.02547280117869377, -0.018949061632156372, 0.002686376217752695, 0.04020898416638374, -0.03775591775774956, -0.009070130065083504, 0.04731932654976845, 0.04148884862661362, -0.0015909391222521663, 0.03032561019062996, -0.0015787181910127401, 0.0294012650847435, -0.007532518822699785, -0.031605470925569534, -0.028761334717273712, 0.03478734940290451, 0.015171692706644535, -0.05734490975737572, 0.030023420229554176, -0.022362027317285538, -0.006630394142121077, -0.01446065865457058, -0.034876227378845215, -0.016993718221783638, 0.04838588088750839, 0.017429227009415627, 0.056598324328660965, -0.009367875754833221, -0.008772384375333786, 0.049132466316223145, 0.057984840124845505, 0.0053905281238257885, -0.024424025788903236, 0.015091701410710812, 0.030236730352044106, -0.028601352125406265, -0.04838588088750839, 0.014202908612787724, 0.03446738421916962, 0.01098547875881195, -0.021899854764342308, -0.02682376652956009, -0.11277002841234207, -0.0032929773442447186, 0.010665513575077057, -0.03574724495410919, -0.05581618845462799, 0.03204986825585365, -0.01684262417256832, 0.05112336203455925, 0.028316937386989594, -0.0025819430593401194, 0.019464561715722084, 0.0298989899456501, 0.008123566396534443, -0.0006310428725555539, -0.028139179572463036, 0.022077612578868866, -0.061113391071558, -0.01025666855275631, 0.01935790665447712, 0.05059008672833443, 0.0205666646361351, -0.015802735462784767, 0.06235770136117935, 0.021153267472982407, 0.01587384007871151, -0.028885765001177788, -0.019482338801026344, -0.014078477397561073, -0.00419732416048646, 0.04077781364321709, 0.06164666637778282, -0.01144765131175518, 0.103739894926548, -0.02166876755654812, -0.0073058768175542355, -0.0018242471851408482, 0.031836558133363724, 0.017144812270998955, -0.022344250231981277, 0.0014998378464952111, 0.022113164886832237, 0.05396749824285507, 0.006332648452371359, -0.05759377405047417, 0.04269760474562645, 0.050305671989917755, 0.007892480120062828, 0.060117945075035095, -0.06004684045910835, -0.01613158918917179, -0.047994811087846756, 0.0296501275151968, 0.023961853235960007, -0.0029863438103348017, 0.019464561715722084, 0.05560287833213806, -0.02963235229253769, 0.0024286264088004827, 0.07856928557157516, 0.009536746889352798, -0.03875136375427246, -0.026290491223335266, 0.0014665081398561597, -0.0076213981956243515, -0.01775808073580265, 0.07750272750854492, -0.040991123765707016, -0.019535666331648827, 0.03900022804737091, -0.04628833010792732, 0.04411967471241951, 0.022770870476961136, -0.03786257281899452, -0.041453294456005096, 0.023730767890810966, -0.015980495139956474, -0.011287668719887733, 0.014282899908721447, -0.008967919275164604, 0.04184436425566673, 0.029010197147727013, 0.02310861274600029, 0.014745072461664677, -0.08546631783246994, 0.04849253594875336, 0.02031780406832695, -0.015322787687182426, -0.035391729325056076, 0.007576958741992712, 0.011163237504661083, -0.007772492710500956, 0.03226317837834358, 0.027499249204993248, 0.0009293439798057079, 0.0007254771189764142, 0.037222642451524734, -0.0018375790677964687, 0.05396749824285507, -0.014176244847476482, 0.05812704935669899, 0.036760468035936356, -0.03553393483161926, 0.031605470925569534, 0.006585954688489437, 0.05258098244667053, -0.05606504902243614, -0.006679277867078781, -0.04255539923906326, -0.031001092866063118, 0.06733494251966476, -0.010478867217898369, -0.013287452049553394, -0.011456538923084736, -0.011678737588226795, -0.025774991139769554, -0.02195318229496479, -0.028103627264499664, -0.030556695535779, 0.021046612411737442, -0.020140044391155243, 0.008088014088571072, 0.01778474450111389, 0.014780623838305473, 0.006310428958386183, -0.03786257281899452, 0.03236983343958855, -0.03521396964788437, 0.00818578153848648, 0.0792803168296814, 0.03315196931362152, 0.05489184334874153, 0.018398011103272438, 0.022450905293226242, -0.001999783795326948, 0.051869947463274, 0.035622816532850266, 0.04536398500204086, -0.024441801011562347, 0.047710396349430084, 0.096131831407547, 0.0037218197248876095, 0.03825364261865616, -0.03437850624322891, 0.0231263879686594, -0.01776696741580963, -0.05958466976881027, -0.05094560235738754, -0.04550619050860405, 0.004428409971296787, -0.04060005396604538, -0.009518970735371113, 0.03853805363178253, -0.004626166541129351, -0.007728053256869316, -0.021117717027664185, -0.013438547030091286, 0.03686712309718132, -0.01166096143424511, 0.046537190675735474, -0.08269327878952026, 0.010416651144623756, -0.019517889246344566, 0.021117717027664185, 0.03416519612073898, 0.019482338801026344, 0.057984840124845505, -0.010452203452587128, -0.09008803963661194, -0.02657490409910679, 0.057984840124845505, -0.02008671686053276, 0.022913077846169472, 0.029952317476272583, 0.053825292736291885, 0.047994811087846756, 0.0766494870185852, 0.027161506935954094, 0.014300676062703133, 0.04689270630478859, -0.04689270630478859, -0.02895686961710453, 0.002326415153220296, 0.06534404307603836, 0.08041796833276749, 0.01235421933233738, 0.02127769961953163, 0.011394323781132698, -0.010443314909934998, 0.04643053561449051, 0.012931935489177704, -0.016487106680870056, -0.007310320623219013, 0.04390636458992958, 0.0318010076880455, 0.00239085266366601, 0.05254542827606201, 0.07195666432380676, -0.022504232823848724, -0.00421065604314208, 0.01567830517888069, 0.006168222054839134, 0.05851811543107033, 0.026521576568484306, 0.04596836119890213, 0.018095821142196655, -0.030503368005156517, -0.011909822933375835, -0.05933580547571182, -0.011954262852668762, 0.0030996648129075766, 0.024655111134052277, -0.02726816199719906, -0.005657166242599487, -0.024797318503260612, 0.05506959930062294, 0.0016664864961057901, -0.0027863653376698494, 0.023215267807245255, -0.012763064354658127, 0.049345776438713074, -0.017678089439868927, 0.0383247435092926, -0.013909607194364071, -0.02383742295205593, 0.03009452298283577, 0.08283548802137375, 0.005150554236024618, -0.020211147144436836, 0.0007382535259239376, -0.054287463426589966, -0.036724917590618134, 0.03704488277435303, -0.04276870936155319, 0.05226101726293564, 0.01889573410153389, 0.053114257752895355, 0.02406850829720497, 0.05222546309232712 ]
39,393
pyspark.sql.dataframe
isEmpty
Checks if the :class:`DataFrame` is empty and returns a boolean value. .. versionadded:: 3.3.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Returns ------- bool Returns ``True`` if the DataFrame is empty, ``False`` otherwise. See Also -------- DataFrame.count : Counts the number of rows in DataFrame. Notes ----- - Unlike `count()`, this method does not trigger any computation. - An empty DataFrame has no rows. It may have columns, but no data. Examples -------- Example 1: Checking if an empty DataFrame is empty >>> df_empty = spark.createDataFrame([], 'a STRING') >>> df_empty.isEmpty() True Example 2: Checking if a non-empty DataFrame is empty >>> df_non_empty = spark.createDataFrame(["a"], 'STRING') >>> df_non_empty.isEmpty() False Example 3: Checking if a DataFrame with null values is empty >>> df_nulls = spark.createDataFrame([(None, None)], 'a STRING, b INT') >>> df_nulls.isEmpty() False Example 4: Checking if a DataFrame with no rows but with columns is empty >>> df_no_rows = spark.createDataFrame([], 'id INT, value STRING') >>> df_no_rows.isEmpty() True
def isEmpty(self) -> bool: """ Checks if the :class:`DataFrame` is empty and returns a boolean value. .. versionadded:: 3.3.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Returns ------- bool Returns ``True`` if the DataFrame is empty, ``False`` otherwise. See Also -------- DataFrame.count : Counts the number of rows in DataFrame. Notes ----- - Unlike `count()`, this method does not trigger any computation. - An empty DataFrame has no rows. It may have columns, but no data. Examples -------- Example 1: Checking if an empty DataFrame is empty >>> df_empty = spark.createDataFrame([], 'a STRING') >>> df_empty.isEmpty() True Example 2: Checking if a non-empty DataFrame is empty >>> df_non_empty = spark.createDataFrame(["a"], 'STRING') >>> df_non_empty.isEmpty() False Example 3: Checking if a DataFrame with null values is empty >>> df_nulls = spark.createDataFrame([(None, None)], 'a STRING, b INT') >>> df_nulls.isEmpty() False Example 4: Checking if a DataFrame with no rows but with columns is empty >>> df_no_rows = spark.createDataFrame([], 'id INT, value STRING') >>> df_no_rows.isEmpty() True """ return self._jdf.isEmpty()
(self) -> bool
[ 0.023714199662208557, -0.0489283949136734, 0.011178530752658844, -0.025464193895459175, 0.029374893754720688, 0.027410615235567093, -0.023196345195174217, -0.0016897260211408138, -0.002812489867210388, -0.010598176158964634, -0.010955316945910454, -0.005808014422655106, 0.05374980345368385, 0.005665157921612263, -0.004915160592645407, -0.0063972980715334415, 0.00324329175055027, -0.0030580246821045876, 0.08799967914819717, 0.01458923239260912, -0.02357134222984314, 0.015241015702486038, 0.022321347147226334, 0.024767767637968063, -0.030999887734651566, 0.015232088044285774, 0.001608253107406199, 0.0007695284439250827, 0.0330534502863884, 0.08714254200458527, -0.008589254692196846, -0.006928546354174614, -0.03710700944066048, 0.010267820209264755, -0.009214252233505249, 0.046321261674165726, 0.04746411368250847, 0.000874438788741827, 0.020589211955666542, -0.03158917278051376, -0.01697315275669098, 0.006464262492954731, 0.010133891366422176, -0.028946323320269585, -0.019035644829273224, -0.026642760261893272, 0.020178498700261116, -0.001501110615208745, -0.000398994074203074, -0.022767774760723114, 0.06449976563453674, 0.07428544759750366, -0.05478551611304283, 0.05196409672498703, -0.06649976223707199, -0.00798211432993412, 0.00688836770132184, 0.0007901756907813251, -0.00227677752263844, -0.009116038680076599, -0.008571397513151169, 0.007267830893397331, 0.03571415692567825, -0.01384816411882639, 0.03721415251493454, 0.040535565465688705, -0.00420757383108139, -0.00912943109869957, -0.005093731451779604, -0.016696367412805557, -0.05964263901114464, 0.0045580193400382996, -0.02967846393585205, 0.10928531736135483, -0.07089260220527649, -0.045999832451343536, -0.0046874829567968845, 0.01648208312690258, -0.0593569278717041, -0.06667833030223846, 0.05035696178674698, -0.04710697382688522, -0.04435698315501213, -0.02362491376698017, 0.041428420692682266, 0.01591065712273121, 0.0067767612636089325, 0.09049966931343079, -0.0017778953770175576, 0.00745532987639308, 0.024232054129242897, 0.051356956362724304, 0.042464133352041245, -0.019267788156867027, 0.05149981379508972, -0.05221409723162651, -0.015116016380488873, -0.027732042595744133, -0.02614276297390461, -0.051535528153181076, -0.04457126557826996, 0.015428515151143074, 0.06667833030223846, 0.03592843934893608, -0.018044577911496162, 0.005165159702301025, 0.007749971933662891, -0.03549987077713013, -0.00022977037588134408, -0.008290148340165615, -0.010473175905644894, 0.008008899167180061, 0.035642728209495544, -0.017178509384393692, 0.02653561718761921, -0.022446347400546074, 0.005013374611735344, 0.015080302022397518, -0.07478544116020203, -0.011026745662093163, 0.024499911814928055, 0.07464258372783661, 0.041749849915504456, -0.10235676914453506, 0.09214252233505249, -0.008321397937834263, -0.005504444241523743, -0.012999952770769596, -0.0006517833680845797, 0.019107073545455933, 0.06646404415369034, 0.05092838779091835, 0.02839275449514389, 0.0384998619556427, -0.03785700723528862, 0.005812478717416525, 0.07067831605672836, 0.030857030302286148, -0.047678399831056595, 0.04785696789622307, -0.0006517833680845797, -0.06517833471298218, 0.011214245110750198, 0.0453212633728981, 0.02374991402029991, 0.0035825762897729874, 0.023785628378391266, -0.0432855561375618, -0.004301323555409908, 0.030535602942109108, -0.010473175905644894, 0.0008203095057979226, -0.008758896961808205, -0.034035589545965195, -0.04403555393218994, -0.017651721835136414, 0.04399983957409859, -0.008111577481031418, 0.013964234851300716, -0.05878550186753273, 0.007866042666137218, 0.05114267021417618, 0.0038370396941900253, 0.032303452491760254, -0.042464133352041245, 0.05428551882505417, -0.045356977730989456, -0.010928532108664513, -0.048892680555582047, 0.02601776272058487, 0.08649968355894089, 0.0356784425675869, 0.012535668909549713, 0.010374962352216244, -0.02473205327987671, 0.07649972289800644, -0.01593744195997715, 0.049356963485479355, 0.004441948141902685, -0.0561426542699337, -0.005419623106718063, -0.05789264664053917, -0.07007117569446564, 0.005790157709270716, 0.03516058623790741, 0.013732093386352062, -0.03942842781543732, -0.0722140222787857, 0.04442841187119484, 0.01982135698199272, -0.05042838677763939, -0.032303452491760254, -0.013857092708349228, 0.07478544116020203, 0.018232077360153198, -0.05342837795615196, 0.049678392708301544, 0.028428468853235245, -0.034553445875644684, 0.012866024859249592, 0.043249841779470444, -0.022910630330443382, 0.03253559768199921, -0.027660613879561424, -0.00007889201515354216, -0.0037700755055993795, -0.05439265817403793, 0.01001782063394785, -0.03076774626970291, -0.02562490664422512, -0.039892710745334625, -0.0661783292889595, -0.022910630330443382, 0.01491065975278616, 0.03978557139635086, -0.003015614114701748, 0.003825878957286477, -0.031464170664548874, 0.011937457136809826, -0.01598208397626877, 0.027910612523555756, -0.02498205192387104, 0.0005516163073480129, 0.030892744660377502, 0.01699993759393692, -0.008741039782762527, 0.056106939911842346, 0.012624953873455524, -0.009651750326156616, -0.07599972188472748, -0.005053553264588118, 0.014883874915540218, 0.001206468790769577, -0.015723157674074173, -0.04232127591967583, 0.01606244221329689, 0.061071205884218216, 0.015285658650100231, 0.02441062591969967, -0.06478548049926758, -0.045428406447172165, -0.0026584723964333534, -0.01001782063394785, -0.00014564678713213652, 0.023874914273619652, -0.022642774507403374, -0.011410673148930073, 0.08828539401292801, -0.0011160674039274454, -0.016714224591851234, -0.009866035543382168, -0.021714206784963608, 0.010749961249530315, -0.03721415251493454, -0.01146424375474453, -0.041499849408864975, -0.05021410435438156, 0.03753557801246643, -0.02942846529185772, 0.023035630583763123, 0.047999825328588486, -0.049999818205833435, 0.007852650247514248, 0.10392819344997406, -0.024874908849596977, -0.010866031982004642, 0.011374958790838718, 0.0050714099779725075, -0.024249911308288574, 0.00247766962274909, 0.07628543674945831, -0.0008325862581841648, 0.04849982261657715, -0.048892680555582047, 0.037499863654375076, 0.0007349303923547268, -0.04128556326031685, -0.018080292269587517, 0.0099196070805192, -0.022035634145140648, 0.023714199662208557, -0.047749828547239304, -0.001829234417527914, 0.006473190616816282, -0.030053462833166122, 0.01944635808467865, -0.008607111871242523, -0.05435694754123688, -0.007968720979988575, -0.030946316197514534, -0.024107055738568306, 0.037249863147735596, -0.02214277721941471, 0.03971414268016815, -0.03398201987147331, 0.03308916464447975, 0.0396784283220768, -0.03510701656341553, -0.011705314740538597, 0.02176777832210064, -0.011482100933790207, -0.026678474619984627, -0.020642781630158424, 0.01249102596193552, -0.01458923239260912, -0.02292848750948906, -0.020946351811289787, 0.019553501158952713, 0.03637486696243286, -0.009839249774813652, -0.02176777832210064, -0.004154002759605646, 0.018499933183193207, -0.023928483948111534, 0.03158917278051376, 0.004013378173112869, 0.006321405526250601, -0.028357040137052536, 0.002065840642899275, 0.014223163016140461, -0.043821267783641815, -0.0009112689876928926, -0.022124920040369034, -0.018053505569696426, -0.09478536993265152, 0.013312451541423798, 0.040392711758613586, 0.019678499549627304, -0.03507130220532417, 0.039499856531620026, 0.046714115887880325, -0.018008863553404808, 0.0693926066160202, -0.030803460627794266, -0.014482090249657631, -0.07671400904655457, -0.027392758056521416, 0.008566932752728462, 0.028178468346595764, 0.07528544217348099, 0.029446322470903397, -0.022571345791220665, 0.049035537987947464, -0.02396419830620289, 0.013392808847129345, -0.015124944970011711, 0.01937492936849594, -0.01184817124158144, 0.05389266088604927, -0.006700868718326092, -0.0177410077303648, 0.028428468853235245, -0.03742843493819237, -0.017160652205348015, 0.041749849915504456, -0.01110710296779871, -0.008450862020254135, 0.09757107496261597, 0.008214255794882774, 0.027910612523555756, 0.07328544557094574, -0.029196321964263916, -0.04449983686208725, -0.012482097372412682, -0.006638368591666222, 0.012285669334232807, 0.010267820209264755, 0.02312491647899151, -0.07464258372783661, -0.04042842611670494, -0.015232088044285774, -0.04953553527593613, 0.00019391671230550855, -0.047428399324417114, 0.01078567560762167, 0.03753557801246643, -0.018660645931959152, -0.012535668909549713, 0.006196406204253435, -0.011598172597587109, 0.04449983686208725, -0.0637497678399086, 0.009232109412550926, -0.058749787509441376, -0.005330337677150965, -0.01751779392361641, -0.07749971747398376, -0.023874914273619652, -0.060499779880046844, -0.04789268225431442, -0.017062438651919365, 0.002935257274657488, -0.07089260220527649, -0.005955335684120655, -0.028803467750549316, 0.020642781630158424, 0.002593740588054061, 0.014303519390523434, 0.01853564754128456, 0.012607096694409847, 0.038535576313734055, -0.010508890263736248, 0.06085692346096039, -0.00023925694404169917, 0.013821378350257874, 0.0018002167344093323, 0.010062463581562042, -0.031839169561862946, -0.014473161660134792, -0.014089234173297882, 0.10114248842000961, -0.0533212348818779, -0.07571401447057724, 0.07385687530040741, -0.04592840373516083, 0.054499801248311996, 0.05414266139268875, 0.0022901701740920544, 0.04560697823762894, 0.07835686206817627, -0.022624917328357697, 0.04514269158244133, 0.003861593082547188, 0.05807121843099594, -0.018624931573867798, 0.017205294221639633, -0.022678488865494728, -0.03258916735649109, 0.026803474873304367, 0.014401733875274658, -0.03346416354179382, -0.0244641974568367, -0.05432123318314552, 0.0320713110268116, -0.04939267784357071, 0.03792843222618103, -0.00007652037311345339, -0.047428399324417114, -0.03046417608857155, 0.06874974817037582, 0.01818743348121643, -0.014955302700400352, 0.005031231790781021, -0.0006021183799020946, 0.01162495743483305, 0.006124977953732014, -0.0013270041672512889, -0.009946392849087715, -0.02048206888139248, 0.0262677613645792, 0.015214230865240097, 0.03903557360172272, 0.003187488531693816, -0.017955292016267776, -0.07692829519510269, 0.01017853431403637, -0.03605344146490097, -0.013669593259692192, -0.028607038781046867, -0.00866068247705698, -0.003531237132847309, 0.05396408960223198, -0.05314266309142113, -0.020267782732844353, -0.001467628637328744, -0.0034932908602058887, -0.0244641974568367, 0.0022622686810791492, -0.0003138939500786364, 0.02839275449514389, -0.00874550361186266, -0.027142759412527084, -0.033249881118535995, -0.03935699909925461, 0.06149977818131447, -0.014821374788880348, -0.03417844697833061, 0.011169602163136005, 0.00512051722034812, 0.0035468621645122766, -0.08249969780445099, 0.0525355227291584, 0.004069181624799967, -0.0007734347018413246, 0.02703561633825302, -0.024642767384648323, -0.03739272058010101, -0.004946410655975342, 0.047035545110702515, -0.0533212348818779, -0.0022555722389370203, 0.0047812326811254025, -0.007580329664051533, -0.029517749324440956, 0.0039374856278300285, -0.016339225694537163, 0.03921414166688919, 0.024803481996059418, -0.025553477928042412, 0.04410698264837265, 0.04128556326031685, 0.044714123010635376, -0.026232047006487846, 0.07685686647891998, -0.03735700622200966, -0.1154281497001648, 0.027785614132881165, -0.026357047259807587, -0.055928368121385574, -0.04939267784357071, -0.024249911308288574, 0.042856987565755844, -0.041178423911333084, 0.03328559175133705, 0.018080292269587517, 0.012437454424798489, -0.0034531124401837587, -0.03721415251493454, 0.03233916684985161, 0.0008822512463666499, -0.0322677418589592, -0.009232109412550926, -0.01481244619935751, 0.051356956362724304, -0.09107109904289246, 0.043106988072395325, 0.015160659328103065, 0.008580326102674007, 0.025874905288219452, 0.023839199915528297, -0.031321313232183456, 0.02853561006486416, 0.01818743348121643, 0.0034151661675423384, -0.01016960572451353, 0.01631244085729122, 0.017330294474959373, -0.004857125226408243, -0.07124973833560944, 0.012517811730504036, 0.022374918684363365, -0.0045758760534226894, 0.011598172597587109, -0.04828554019331932, -0.06317834556102753, -0.0006450869259424508, 0.042535558342933655, 0.021982062608003616, 0.08528540283441544, -0.009004431776702404, 0.016857082024216652, 0.0190535020083189, 0.061392635107040405, -0.03330345079302788, 0.052321240305900574, 0.021678492426872253, 0.031892742961645126, 0.027767756953835487, 0.02266063168644905, -0.03262488171458244, -0.018044577911496162, -0.07835686206817627, 0.043428413569927216, -0.009004431776702404, -0.011999956332147121, 0.007316937670111656, 0.025535620748996735, -0.017017794772982597, 0.031642742455005646, 0.0070669385604560375, 0.0017868238501250744, 0.013071381486952305, 0.0029374894220381975, -0.07657115161418915, 0.01932135783135891, -0.05639265105128288, -0.04921410605311394, 0.06253548711538315, -0.062428344041109085, -0.0396784283220768, 0.0034084697254002094, -0.018964216113090515, -0.017857078462839127, 0.005620515439659357, -0.03939271345734596, 0.001661824295297265, -0.05607122555375099, 0.0013314683455973864, -0.01088388916105032, -0.01848207600414753, 0.0094285374507308, -0.009058003313839436, 0.02582133561372757, -0.06564261764287949, 0.0481426827609539, 0.08635682612657547, 0.01088388916105032, -0.053285520523786545, 0.05285695195198059, -0.02332134358584881, -0.017999934032559395, 0.06974975019693375, -0.035392727702856064, -0.05235695466399193, -0.007772293407469988, 0.001930796541273594, -0.03348202258348465, 0.10957103222608566, -0.01937492936849594, -0.013401737436652184, 0.0322677418589592, 0.004314716439694166, 0.005388373509049416, 0.002620526123791933, 0.026124905794858932, -0.0057633719407022, -0.014223163016140461, -0.011374958790838718, -0.0035602550487965345, 0.008776754140853882, -0.014839231967926025, 0.009955321438610554, -0.00360489753074944, 0.024517768993973732, -0.002979899989441037, 0.012571383267641068, -0.004758911207318306, 0.0037031115498393774, -0.060499779880046844, -0.005986585281789303, 0.05099981650710106, -0.05210695415735245, -0.0029843642842024565, -0.006205334793776274, 0.038464147597551346, -0.03785700723528862, -0.051356956362724304, -0.0027633828576654196, 0.02735704369843006, 0.045821260660886765, -0.04146413505077362, 0.003249988192692399, -0.0008638361468911171, 0.014794589020311832, 0.012383883818984032, -0.04857125133275986, 0.01191067136824131, 0.004178556147962809, 0.01049996167421341, -0.038678430020809174, -0.026499904692173004, -0.004401769954711199, 0.05267838016152382, -0.021357065066695213, 0.055214084684848785, 0.03753557801246643, -0.029714178293943405, -0.05314266309142113, 0.0015658425400033593, -0.03501772880554199, -0.005870514549314976, -0.07110688835382462, -0.010419605299830437, 0.021589206531643867, 0.07835686206817627, -0.00033788938890211284, -0.015258872881531715, -0.0041093602776527405, 0.024678481742739677, 0.05117838457226753, -0.015267801471054554, 0.09607107937335968, -0.018642788752913475, -0.013008881360292435, -0.0005164601607248187, -0.007772293407469988, -0.05053552985191345, -0.05442837253212929, -0.003618290415033698, -0.017044581472873688, 0.008133899420499802, 0.006102656479924917, -0.0489283949136734, -0.004691947251558304, -0.009321394376456738, -0.047749828547239304, -0.0038169503677636385, -0.05846407264471054, 0.04564269259572029, -0.07357116043567657, -0.031464170664548874, -0.051106955856084824, 0.035767726600170135, 0.09857106953859329, -0.009062467142939568, -0.0022678489331156015, -0.027214186266064644, 0.02169634960591793, -0.01410709135234356, 0.003752218559384346, -0.0017845917027443647, 0.08314255625009537, -0.009312465786933899, 0.04146413505077362, 0.06064263731241226, 0.0661783292889595, -0.03239274024963379, 0.04435698315501213, 0.02080349624156952, 0.012267813086509705, -0.03437487408518791, 0.05924978479743004, -0.007665150798857212, -0.001426334143616259, -0.034410588443279266, 0.0029977569356560707, 0.003968735691159964, 0.007540151011198759, 0.017553508281707764, 0.01951778680086136, 0.027910612523555756, -0.03639272600412369, -0.01168745756149292, 0.027982041239738464, -0.008767825551331043, 0.030089177191257477, -0.02858918160200119, -0.05903549864888191, 0.0312856025993824, 0.0029330251272767782, -0.010973174124956131, 0.026571331545710564, 0.022035634145140648, 0.017794577404856682, 0.05146409943699837, -0.04528554901480675, -0.0049598035402596, -0.010999959893524647, -0.050571244210004807, -0.01441959012299776, 0.03535701334476471, -0.024053484201431274, 0.05149981379508972, -0.04564269259572029, 0.04424984008073807, -0.01399994920939207, 0.00046902731992304325, 0.01336602307856083, 0.006866046693176031, 0.0286606103181839, 0.02021421305835247, -0.005799086298793554, -0.0020334748551249504, -0.02221420593559742, 0.024696338921785355, 0.04874982312321663, -0.05492837354540825, 0.04271413013339043, -0.0032410596031695604, -0.036928437650203705, -0.035642728209495544, 0.028821324929594994, 0.019749928265810013, 0.024767767637968063, -0.03942842781543732, 0.028053469955921173, 0.00252008019015193, 0.045178405940532684 ]
39,394
pyspark.sql.dataframe
isLocal
Returns ``True`` if the :func:`collect` and :func:`take` methods can be run locally (without any Spark executors). .. versionadded:: 1.3.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Returns ------- bool Examples -------- >>> df = spark.sql("SHOW TABLES") >>> df.isLocal() True
def isLocal(self) -> bool: """Returns ``True`` if the :func:`collect` and :func:`take` methods can be run locally (without any Spark executors). .. versionadded:: 1.3.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Returns ------- bool Examples -------- >>> df = spark.sql("SHOW TABLES") >>> df.isLocal() True """ return self._jdf.isLocal()
(self) -> bool
[ 0.06495580822229385, -0.007012275047600269, -0.014453697949647903, 0.013123339973390102, 0.08376964926719666, 0.011260838247835636, 0.03318170830607414, 0.002566303825005889, -0.010316712781786919, 0.011544075794517994, -0.05228736624121666, -0.05170372501015663, -0.005720539949834347, -0.042262475937604904, 0.0035018459893763065, 0.030435161665081978, -0.03223758190870285, -0.014616774395108223, 0.04267445579171181, 0.002875290345400572, -0.03158527985215187, -0.008883359842002392, 0.06495580822229385, 0.007707494311034679, -0.0035168661270290613, 0.031156130135059357, 0.03064115345478058, -0.06626041978597641, 0.017002835869789124, 0.04521501064300537, -0.03132778778672218, 0.040614549070596695, 0.00745000597089529, -0.039412934333086014, 0.023551631718873978, 0.05276801437139511, 0.02224702201783657, 0.004866536241024733, 0.037181366235017776, -0.08479960262775421, -0.018058540299534798, 0.014393617399036884, -0.006857781670987606, 0.010179385542869568, 0.010986183770000935, -0.019345982000231743, 0.0003173011646140367, -0.07566733658313751, 0.04188482463359833, -0.010625699535012245, 0.046622615307569504, 0.05091409385204315, -0.005943696945905685, 0.053523313254117966, -0.04899151250720024, -0.01786971464753151, 0.04428805410861969, -0.01208480168133974, -0.09091067314147949, -0.06759936362504959, -0.0513947419822216, 0.03443481773138046, 0.043052107095718384, 0.039687588810920715, 0.028014767915010452, -0.011106344871222973, -0.0254913792014122, 0.010230883955955505, -0.018556350842118263, 0.03198009356856346, -0.06505880504846573, -0.009132265113294125, -0.04191915690898895, 0.06591710448265076, -0.03532744571566582, -0.0558922104537487, 0.001212342525832355, -0.05475926026701927, -0.04744658246636391, -0.05712815374135971, 0.011973223648965359, -0.027637118473649025, -0.018882503733038902, -0.026229513809084892, 0.02284782938659191, -0.024255434051156044, 0.014822765253484249, 0.0414385125041008, 0.027654284611344337, 0.020015453919768333, 0.020547596737742424, 0.07223416119813919, 0.004454554058611393, 0.0374903529882431, -0.00016991570009849966, -0.013552487827837467, -0.02456442080438137, -0.06464682519435883, -0.03865763545036316, -0.05321432650089264, 0.008694534189999104, 0.026967648416757584, 0.03361085429787636, 0.0007858768803998828, 0.042193811386823654, 0.04799589142203331, 0.003924556542187929, -0.024667415767908096, -0.01664235256612301, -0.004806455224752426, -0.005621836055070162, 0.030675483867526054, -0.026658661663532257, 0.00018292425374966115, -0.0008904816932044923, -0.001233799965120852, -0.019689301028847694, -0.01072011236101389, -0.03913827985525131, 0.022144027054309845, -0.02509656362235546, 0.03979058563709259, 0.04020256549119949, -0.10704662650823593, 0.01499442383646965, 0.017852548509836197, 0.05990903452038765, -0.028186427429318428, -0.0038558929227292538, 0.013912972062826157, 0.06948760896921158, -0.015071670524775982, -0.04202215373516083, 0.1011415496468544, -0.007171059492975473, 0.020547596737742424, 0.05846709758043289, 0.055651888251304626, -0.019208654761314392, 0.0512574128806591, -0.00005900782343815081, 0.010076390579342842, -0.029611198231577873, 0.037902332842350006, 0.005085401237010956, 0.05362631008028984, -0.018247364088892937, -0.04542100429534912, 0.009870399720966816, -0.020478932186961174, 0.044974688440561295, -0.054038289934396744, -0.05633852258324623, -0.0024740369990468025, -0.045043352991342545, 0.007291221059858799, 0.010119304992258549, -0.0372156985104084, 0.052596352994441986, -0.04373874515295029, -0.037181366235017776, 0.00554458936676383, -0.03972192108631134, -0.002671445021405816, -0.03858897089958191, 0.005291392561048269, -0.013286415487527847, -0.006879239343106747, -0.06468115746974945, 0.03810832276940346, 0.04847653582692146, 0.03349069505929947, 0.04857953265309334, 0.0505707748234272, 0.005621836055070162, 0.03098447062075138, 0.007248306181281805, 0.020341604948043823, 0.013655482791364193, -0.01091752015054226, -0.009775986894965172, -0.0205132644623518, -0.07491204142570496, -0.0026156557723879814, 0.01874517649412155, 0.02919921651482582, -0.04837353900074959, -0.0747060477733612, 0.08994937688112259, 0.05671617388725281, -0.025251056998968124, 0.012179214507341385, -0.004342975560575724, -0.018916834145784378, -0.016041545197367668, -0.05355764552950859, 0.02428976632654667, 0.01874517649412155, -0.06725604087114334, -0.004441679921001196, 0.034383323043584824, 0.012204963713884354, -0.007196808699518442, 0.014745518565177917, -0.0006737620569765568, 0.06004635989665985, -0.07381342351436615, 0.004634796176105738, 0.04672561213374138, 0.03297571837902069, -0.006986526306718588, -0.06763369590044022, -0.023088151589035988, 0.06117931008338928, 0.035911086946725845, 0.03906961530447006, -0.04600464552640915, 0.026384007185697556, 0.05863875523209572, 0.004853661637753248, 0.052390363067388535, -0.02236718311905861, 0.021096905693411827, 0.03223758190870285, -0.008891941979527473, -0.023311307653784752, 0.02456442080438137, 0.003958888351917267, -0.010617116466164589, -0.07923784852027893, -0.02384345233440399, -0.01549223531037569, -0.022144027054309845, -0.005784912500530481, 0.00172517413739115, 0.047034598886966705, 0.03232341259717941, 0.06021801754832268, 0.030881475657224655, -0.04229680821299553, -0.04978114366531372, 0.01532057672739029, 0.030229171738028526, -0.05860442295670509, -0.01344090886414051, -0.03930993750691414, -0.02032444067299366, 0.06464682519435883, 0.024392761290073395, 0.0032679603900760412, -0.0005804224056191742, -0.03779933974146843, -0.0320315919816494, -0.046244967728853226, 0.0028817274142056704, -0.05826110392808914, -0.031087467446923256, 0.018813839182257652, -0.003188568167388439, 0.0250107329338789, -0.04957515373826027, -0.017886880785226822, 0.004411639180034399, 0.04428805410861969, -0.014290621504187584, -0.02734529785811901, -0.020478932186961174, -0.015638146549463272, -0.02011844888329506, -0.0014043861301615834, 0.01953480765223503, 0.03337053209543228, -0.007540126796811819, -0.016693849116563797, 0.0002912840573117137, -0.07161618769168854, -0.0650244727730751, 0.016736764460802078, -0.05860442295670509, -0.009312507696449757, 0.029405206441879272, 0.008604413829743862, -0.0651618018746376, -0.0207879189401865, -0.018384691327810287, -0.06804567575454712, -0.01847052201628685, -0.0826023668050766, -0.01991245709359646, -0.05503391474485397, -0.016281867399811745, 0.04878552258014679, 0.05747147276997566, -0.03649472817778587, 0.013355079106986523, 0.02324264496564865, 0.030795646831393242, -0.02377478778362274, -0.019500475376844406, 0.047755565494298935, -0.023139650002121925, -0.045180682092905045, -0.004887993447482586, 0.046691279858350754, 0.021543219685554504, 0.02574886754155159, -0.03314737603068352, -0.011895976960659027, 0.013337913900613785, 0.013775643892586231, -0.011870227754116058, -0.011561241932213306, 0.02065059170126915, 0.006085315719246864, 0.0160157959908247, -0.00842417124658823, -0.003098447108641267, 0.000032621937862131745, -0.022006699815392494, 0.01991245709359646, -0.007617373485118151, 0.04706893116235733, -0.009175179526209831, 0.018384691327810287, -0.08507426083087921, 0.016796844080090523, 0.05218437314033508, -0.01879667304456234, 0.0006313836784102023, 0.048167549073696136, 0.02058192901313305, 0.006141105201095343, 0.035705097019672394, 0.001784181920811534, -0.006278432440012693, 0.00015127459482755512, -0.03455498069524765, -0.027190804481506348, 0.032409243285655975, -0.019620636478066444, 0.03450348228216171, -0.023877782747149467, 0.018916834145784378, 0.0023774788714945316, -0.02660716325044632, 0.059016406536102295, -0.010290964506566525, 0.04095786437392235, 0.08438762277364731, -0.016899840906262398, -0.05122308060526848, 0.016075877472758293, -0.07875720411539078, 0.058879077434539795, -0.015500818379223347, 0.013089007697999477, -0.02362029440701008, 0.03264956548810005, 0.02554287761449814, 0.01399880088865757, 0.03218608349561691, -0.04377307370305061, 0.021062573418021202, -0.04150717332959175, -0.017766719684004784, -0.04353275150060654, 0.059085067361593246, -0.027448292821645737, -0.011132094077765942, -0.03834864869713783, -0.039344269782304764, -0.04871685802936554, 0.030212005600333214, -0.057746127247810364, -0.04394473508000374, 0.006407176610082388, 0.013595402240753174, 0.005274226423352957, -0.022590341046452522, 0.07422540336847305, 0.014591025188565254, 0.002506223041564226, 0.002840958535671234, -0.004415930714458227, -0.004561841022223234, 0.05606386810541153, -0.06680972874164581, -0.037559013813734055, -0.0601150244474411, -0.04370441287755966, 0.01951764151453972, -0.02595485933125019, -0.015578065067529678, 0.025800365954637527, 0.04892284795641899, -0.0041241105645895, -0.03532744571566582, 0.0081452252343297, 0.05867308750748634, 0.02878723479807377, -0.0036885254085063934, -0.015749724581837654, -0.003347352845594287, 0.020736422389745712, -0.0019429667154327035, -0.007587333209812641, 0.020204277709126472, 0.009089350700378418, -0.022075362503528595, 0.00615397933870554, 0.03098447062075138, -0.05362631008028984, -0.06849198788404465, 0.0016897694440558553, -0.05826110392808914, 0.055651888251304626, 0.022590341046452522, -0.027551287785172462, 0.10890054702758789, 0.0749807059764862, 0.006565961521118879, -0.021337227895855904, 0.03924127295613289, -0.0046176305040717125, -0.024873405694961548, -0.026263846084475517, -0.0024375594221055508, -0.0006968287634663284, 0.010660030879080296, 0.0054115536622703075, -0.021405892446637154, -0.029885852709412575, 0.05499958246946335, -0.035842422395944595, 0.0035490524023771286, 0.045386672019958496, 0.01675393059849739, -0.007668870966881514, -0.05287100747227669, 0.04600464552640915, 0.050467781722545624, -0.04229680821299553, -0.03137928619980812, -0.009707323275506496, -0.010170802474021912, 0.015003006905317307, -0.026040688157081604, 0.018316028639674187, -0.06227792799472809, 0.028237925842404366, -0.012934514321386814, 0.033267538994550705, -0.027911772951483727, -0.029748525470495224, -0.049884140491485596, 0.016161706298589706, 0.0014633940299972892, -0.014213374815881252, -0.02416960336267948, 0.04847653582692146, 0.0023903532419353724, 0.03553343936800957, -0.0028473956044763327, -0.010471206158399582, 0.06917862594127655, -0.041678834706544876, -0.048682525753974915, 0.00283881276845932, -0.021405892446637154, -0.0005367029807530344, 0.0006356751546263695, 0.024873405694961548, -0.010848856531083584, -0.05091409385204315, 0.05705949291586876, -0.00830830167979002, -0.05626985803246498, 0.0411638580262661, -0.0006109991809353232, 0.017303239554166794, -0.10656598210334778, -0.012513949535787106, 0.00868165958672762, 0.008055103942751884, 0.04078620672225952, -0.08212172240018845, -0.027894606813788414, -0.005999486427754164, 0.0254913792014122, -0.018247364088892937, 0.02104540728032589, 0.03865763545036316, 0.034245993942022324, -0.051463402807712555, -0.02561154030263424, 0.018024208024144173, 0.0362544059753418, 0.03228908032178879, 0.02025577612221241, 0.04181616008281708, 0.04463136941194534, 0.05496525019407272, -0.034709472209215164, 0.10011159628629684, -0.0038151240441948175, -0.045970313251018524, 0.04758390784263611, -0.0035275949630886316, -0.05036478489637375, -0.011157842352986336, -0.006063858512789011, 0.014488029293715954, 0.016676682978868484, 0.006518755108118057, 0.016333365812897682, 0.028564076870679855, -0.03211742267012596, -0.03129345923662186, 0.03900095075368881, -0.0019494039006531239, -0.044906023889780045, -0.06155696138739586, 0.039618924260139465, -0.005059652496129274, -0.04720625653862953, 0.0045275092124938965, -0.0015095273265615106, 0.019225820899009705, -0.03268389776349068, 0.04294911026954651, 0.0063213468529284, 0.02933654375374317, 0.014007383957505226, 0.0076989117078483105, 0.057093821465969086, 0.08170974254608154, -0.015526567585766315, -0.027431126683950424, -0.06347954273223877, -0.020444601774215698, 0.02734529785811901, -0.032735392451286316, 0.03330186754465103, 0.0038558929227292538, 0.01726890727877617, -0.028564076870679855, 0.0002517219982109964, 0.008273969404399395, 0.0696592703461647, -0.037112701684236526, 0.016238952055573463, 0.02197236754000187, 0.05235603079199791, -0.0500214658677578, 0.05832976847887039, 0.04470003396272659, 0.030692650005221367, 0.032460737973451614, -0.020942412316799164, 0.016487859189510345, -0.001211269642226398, -0.04449404403567314, 0.0026135100051760674, 0.04308643937110901, -0.03522445261478424, -0.03024633601307869, 0.024341262876987457, 0.003572655376046896, 0.046828608959913254, -0.05860442295670509, 0.04727492108941078, -0.044906023889780045, 0.0509827584028244, -0.052596352994441986, 0.013775643892586231, -0.012831519357860088, 0.017698055133223534, 0.048819854855537415, -0.028941728174686432, -0.018230197951197624, -0.01773238740861416, -0.03146511688828468, -0.029885852709412575, 0.0502961203455925, -0.06193460896611214, 0.019380314275622368, -0.025405550375580788, -0.007385633420199156, 0.002834521234035492, -0.011990389786660671, 0.031602442264556885, -0.002574886893853545, 0.04978114366531372, -0.012814353220164776, 0.04288044944405556, -0.025233890861272812, -0.01731182262301445, 0.003907390870153904, 0.07353876531124115, -0.011346668004989624, -0.025302553549408913, -0.012677025981247425, -0.02574886754155159, -0.08589822053909302, 0.01175006665289402, -0.038554638624191284, -0.09516781568527222, 0.020702090114355087, -0.017225991934537888, 0.031739771366119385, -0.022418681532144547, 0.004014677833765745, -0.009243843145668507, -0.029628364369273186, 0.09097933024168015, 0.00045623775804415345, -0.007737534586340189, -0.036838047206401825, 0.05836410075426102, -0.026178015395998955, -0.006806284189224243, 0.034915465861558914, 0.05572054907679558, -0.012797187082469463, 0.0002702290075831115, 0.038623303174972534, 0.021268565207719803, -0.04727492108941078, -0.0027444001752883196, 0.021697713062167168, -0.017045751214027405, -0.023946447297930717, 0.025766033679246902, 0.02514806017279625, 0.02985152043402195, -0.06626041978597641, -0.019448978826403618, -0.012273627333343029, 0.009578579105436802, 0.011878810822963715, -0.07027724385261536, 0.01819586753845215, 0.047961559146642685, -0.012625528499484062, -0.0012187797110527754, -0.05386663228273392, 0.03728435933589935, -0.02834092080593109, 0.06296456605195999, -0.0362544059753418, -0.07621664553880692, 0.025989191606640816, 0.036906711757183075, 0.028375253081321716, 0.005222728941589594, 0.03567076474428177, -0.07923784852027893, -0.02085658349096775, 0.03153378143906593, -0.06945327669382095, -0.016264701262116432, -0.04449404403567314, -0.01254828181117773, 0.033336199820041656, 0.04665694758296013, 0.01965496875345707, 0.004044718109071255, 0.0038322899490594864, -0.016067294403910637, 0.007900610566139221, 0.004836495500057936, 0.04854520037770271, 0.03821131959557533, -0.03288988769054413, 0.007471463177353144, 0.017646556720137596, -0.026916150003671646, -0.02176637575030327, -0.024272600188851357, -0.053969625383615494, -0.005857867654412985, 0.008055103942751884, 0.003225045744329691, 0.03210025653243065, 0.020152781158685684, 0.011441079899668694, -0.0006313836784102023, -0.049025844782590866, 0.048682525753974915, -0.027310965582728386, -0.037250030785799026, 0.0032808349933475256, 0.053969625383615494, 0.10320146381855011, -0.0019011247204616666, -0.024186769500374794, 0.02013561502099037, 0.0007837311713956296, -0.030726982280611992, 0.03314737603068352, 0.026916150003671646, 0.0410265289247036, 0.003572655376046896, 0.0073083871975541115, -0.018024208024144173, 0.06523046642541885, -0.02933654375374317, 0.007003691978752613, 0.0175178125500679, 0.003598404349759221, -0.0015749724116176367, 0.0012026866897940636, 0.01743198372423649, -0.055377233773469925, 0.006853490136563778, 0.04106086120009422, -0.012402371503412724, -0.04202215373516083, 0.0737447589635849, 0.04085487127304077, 0.03646039590239525, -0.024942070245742798, -0.03328470513224602, 0.014058881439268589, -0.0019869543612003326, 0.021543219685554504, -0.05215004086494446, -0.03388550877571106, 0.005029612220823765, 0.03283838927745819, -0.0363917350769043, -0.006115355994552374, -0.024976402521133423, 0.08074844628572464, 0.01689125783741474, -0.00878465548157692, 0.013020344078540802, 0.05335165560245514, -0.05393529683351517, -0.014367868192493916, 0.021680546924471855, -0.0365290604531765, 0.0276027861982584, -0.01191314309835434, -0.02720797061920166, -0.007522961124777794, 0.012239295057952404, -0.010445457883179188, -0.00695219449698925, 0.03450348228216171, 0.06904129683971405, -0.0250107329338789, -0.013183420524001122, -0.040614549070596695, -0.020736422389745712, 0.029679860919713974, -0.028684237971901894, 0.03731869161128998, -0.01761222630739212, -0.0301948394626379, -0.042537130415439606, 0.04840787127614021, -0.013715563341975212, 0.03292421996593475, -0.001541713485494256, -0.035190120339393616, 0.009321089833974838, 0.0256973709911108 ]
39,395
pyspark.sql.dataframe
join
Joins with another :class:`DataFrame`, using the given join expression. .. versionadded:: 1.3.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Parameters ---------- other : :class:`DataFrame` Right side of the join on : str, list or :class:`Column`, optional a string for the join column name, a list of column names, a join expression (Column), or a list of Columns. If `on` is a string or a list of strings indicating the name of the join column(s), the column(s) must exist on both sides, and this performs an equi-join. how : str, optional default ``inner``. Must be one of: ``inner``, ``cross``, ``outer``, ``full``, ``fullouter``, ``full_outer``, ``left``, ``leftouter``, ``left_outer``, ``right``, ``rightouter``, ``right_outer``, ``semi``, ``leftsemi``, ``left_semi``, ``anti``, ``leftanti`` and ``left_anti``. Returns ------- :class:`DataFrame` Joined DataFrame. Examples -------- The following performs a full outer join between ``df1`` and ``df2``. >>> from pyspark.sql import Row >>> from pyspark.sql.functions import desc >>> df = spark.createDataFrame([(2, "Alice"), (5, "Bob")]).toDF("age", "name") >>> df2 = spark.createDataFrame([Row(height=80, name="Tom"), Row(height=85, name="Bob")]) >>> df3 = spark.createDataFrame([Row(age=2, name="Alice"), Row(age=5, name="Bob")]) >>> df4 = spark.createDataFrame([ ... Row(age=10, height=80, name="Alice"), ... Row(age=5, height=None, name="Bob"), ... Row(age=None, height=None, name="Tom"), ... Row(age=None, height=None, name=None), ... ]) Inner join on columns (default) >>> df.join(df2, 'name').select(df.name, df2.height).show() +----+------+ |name|height| +----+------+ | Bob| 85| +----+------+ >>> df.join(df4, ['name', 'age']).select(df.name, df.age).show() +----+---+ |name|age| +----+---+ | Bob| 5| +----+---+ Outer join for both DataFrames on the 'name' column. >>> df.join(df2, df.name == df2.name, 'outer').select( ... df.name, df2.height).sort(desc("name")).show() +-----+------+ | name|height| +-----+------+ | Bob| 85| |Alice| NULL| | NULL| 80| +-----+------+ >>> df.join(df2, 'name', 'outer').select('name', 'height').sort(desc("name")).show() +-----+------+ | name|height| +-----+------+ | Tom| 80| | Bob| 85| |Alice| NULL| +-----+------+ Outer join for both DataFrams with multiple columns. >>> df.join( ... df3, ... [df.name == df3.name, df.age == df3.age], ... 'outer' ... ).select(df.name, df3.age).show() +-----+---+ | name|age| +-----+---+ |Alice| 2| | Bob| 5| +-----+---+
def join( self, other: "DataFrame", on: Optional[Union[str, List[str], Column, List[Column]]] = None, how: Optional[str] = None, ) -> "DataFrame": """Joins with another :class:`DataFrame`, using the given join expression. .. versionadded:: 1.3.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Parameters ---------- other : :class:`DataFrame` Right side of the join on : str, list or :class:`Column`, optional a string for the join column name, a list of column names, a join expression (Column), or a list of Columns. If `on` is a string or a list of strings indicating the name of the join column(s), the column(s) must exist on both sides, and this performs an equi-join. how : str, optional default ``inner``. Must be one of: ``inner``, ``cross``, ``outer``, ``full``, ``fullouter``, ``full_outer``, ``left``, ``leftouter``, ``left_outer``, ``right``, ``rightouter``, ``right_outer``, ``semi``, ``leftsemi``, ``left_semi``, ``anti``, ``leftanti`` and ``left_anti``. Returns ------- :class:`DataFrame` Joined DataFrame. Examples -------- The following performs a full outer join between ``df1`` and ``df2``. >>> from pyspark.sql import Row >>> from pyspark.sql.functions import desc >>> df = spark.createDataFrame([(2, "Alice"), (5, "Bob")]).toDF("age", "name") >>> df2 = spark.createDataFrame([Row(height=80, name="Tom"), Row(height=85, name="Bob")]) >>> df3 = spark.createDataFrame([Row(age=2, name="Alice"), Row(age=5, name="Bob")]) >>> df4 = spark.createDataFrame([ ... Row(age=10, height=80, name="Alice"), ... Row(age=5, height=None, name="Bob"), ... Row(age=None, height=None, name="Tom"), ... Row(age=None, height=None, name=None), ... ]) Inner join on columns (default) >>> df.join(df2, 'name').select(df.name, df2.height).show() +----+------+ |name|height| +----+------+ | Bob| 85| +----+------+ >>> df.join(df4, ['name', 'age']).select(df.name, df.age).show() +----+---+ |name|age| +----+---+ | Bob| 5| +----+---+ Outer join for both DataFrames on the 'name' column. >>> df.join(df2, df.name == df2.name, 'outer').select( ... df.name, df2.height).sort(desc("name")).show() +-----+------+ | name|height| +-----+------+ | Bob| 85| |Alice| NULL| | NULL| 80| +-----+------+ >>> df.join(df2, 'name', 'outer').select('name', 'height').sort(desc("name")).show() +-----+------+ | name|height| +-----+------+ | Tom| 80| | Bob| 85| |Alice| NULL| +-----+------+ Outer join for both DataFrams with multiple columns. >>> df.join( ... df3, ... [df.name == df3.name, df.age == df3.age], ... 'outer' ... ).select(df.name, df3.age).show() +-----+---+ | name|age| +-----+---+ |Alice| 2| | Bob| 5| +-----+---+ """ if on is not None and not isinstance(on, list): on = [on] # type: ignore[assignment] if on is not None: if isinstance(on[0], str): on = self._jseq(cast(List[str], on)) else: assert isinstance(on[0], Column), "on should be Column or list of Column" on = reduce(lambda x, y: x.__and__(y), cast(List[Column], on)) on = on._jc if on is None and how is None: jdf = self._jdf.join(other._jdf) else: if how is None: how = "inner" if on is None: on = self._jseq([]) assert isinstance(how, str), "how should be a string" jdf = self._jdf.join(other._jdf, on, how) return DataFrame(jdf, self.sparkSession)
(self, other: pyspark.sql.dataframe.DataFrame, on: Union[str, List[str], pyspark.sql.column.Column, List[pyspark.sql.column.Column], NoneType] = None, how: Optional[str] = None) -> pyspark.sql.dataframe.DataFrame
[ 0.0014157905243337154, -0.041669685393571854, 0.06560079008340836, 0.051497820764780045, -0.043707225471735, -0.0305031705647707, -0.019846037030220032, 0.018737375736236572, -0.036236248910427094, 0.020305482670664787, -0.005448421463370323, -0.05181743577122688, 0.029044929891824722, 0.09204886108636856, -0.018457714468240738, 0.02201342023909092, 0.054134637117385864, 0.0007447258103638887, 0.10507313162088394, 0.02704734168946743, -0.02860546112060547, -0.06444218754768372, -0.01934663951396942, 0.013054237700998783, -0.03108246996998787, 0.007755635771900415, -0.04386703297495842, 0.015131729654967785, 0.004035127814859152, 0.008539688773453236, -0.003293523332104087, -0.043587371706962585, 0.042428769171237946, 0.01489201933145523, -0.0012884442694485188, 0.01929670013487339, 0.0036256222520023584, -0.038553450256586075, 0.0519372895359993, 0.0009488543146289885, 0.018777327612042427, 0.027806425467133522, 0.029744086787104607, -0.06160561740398407, -0.04254862666130066, 0.05844942852854729, -0.01398311648517847, -0.007071461994200945, 0.01958635076880455, -0.018068183213472366, -0.007081449497491121, 0.020575156435370445, -0.02788632921874523, 0.008055273443460464, -0.06124604865908623, 0.010976746678352356, -0.015341476537287235, -0.04170963913202286, -0.0036106405314058065, -0.014532453380525112, 0.0391727015376091, -0.007670738268643618, -0.026747703552246094, 0.04254862666130066, -0.051178205758333206, 0.05053897947072983, 0.023651443421840668, 0.002041285391896963, -0.046144284307956696, -0.01605062000453472, -0.044586166739463806, 0.02796623297035694, -0.011865673586726189, 0.06955602020025253, -0.04139002412557602, 0.02235301025211811, 0.0035082639660686255, -0.0201956145465374, -0.004224898759275675, -0.04634404182434082, 0.033359721302986145, -0.00019008299568668008, -0.05069878697395325, -0.06887684017419815, 0.032860323786735535, 0.00411253422498703, -0.025249512866139412, 0.06160561740398407, -0.042189061641693115, -0.09013117104768753, -0.0117558054625988, 0.04846148565411568, -0.056371934711933136, -0.013473731465637684, -0.006911654490977526, -0.07063471525907516, 0.001665489049628377, -0.028325797989964485, 0.0076108104549348354, 0.01584087312221527, 0.03539726138114929, -0.01642017439007759, -0.007106419652700424, 0.005383499898016453, -0.01307421363890171, -0.06556084007024765, -0.044586166739463806, -0.012964346446096897, -0.024790067225694656, -0.08741445094347, -0.05073873698711395, -0.06620007008314133, -0.011885648593306541, -0.04065091535449028, 0.040770772844552994, 0.006602028384804726, -0.011056649498641491, 0.009997928515076637, -0.012524876743555069, 0.02209332399070263, 0.03495779260993004, 0.04246872290968895, -0.0006798041868023574, -0.13535656034946442, 0.02293231151998043, -0.023651443421840668, -0.0420692041516304, -0.05437434837222099, -0.004634404089301825, -0.008764417842030525, 0.055532947182655334, 0.017568787559866905, -0.03333974629640579, 0.0519372895359993, 0.03907282277941704, -0.01101669855415821, -0.06723881512880325, 0.04322780668735504, 0.00178284733556211, 0.025269489735364914, 0.013343888334929943, -0.07359114289283752, 0.04017149657011032, -0.03411880508065224, -0.05872908979654312, 0.011126565746963024, 0.011905624531209469, -0.07355119287967682, -0.03511759638786316, -0.002866538939997554, 0.03290027379989624, -0.009758217260241508, 0.009094019420444965, -0.018387798219919205, -0.016599956899881363, -0.057610440999269485, 0.02349163591861725, -0.018327871337532997, 0.013513683341443539, -0.012524876743555069, 0.01431271806359291, -0.026847584173083305, 0.0045869615860283375, 0.04542515426874161, -0.013413803651928902, 0.036835525184869766, 0.014722224324941635, -0.018018243834376335, 0.003952727187424898, -0.024190790951251984, 0.06472185254096985, -0.01918683387339115, 0.11090608686208725, -0.0014607362681999803, -0.044905778020620346, 0.04898085817694664, -0.025529175996780396, -0.0013758387649431825, -0.011056649498641491, -0.05061888322234154, -0.011486131697893143, -0.017389005050063133, -0.003473306307569146, -0.0052586505189538, -0.019756145775318146, 0.00041325102210976183, -0.01934663951396942, -0.03605646640062332, 0.05121815949678421, -0.012524876743555069, 0.008954188786447048, -0.060566868633031845, 0.007176334969699383, 0.04378712922334671, 0.00332848122343421, -0.05429444462060928, 0.052656423300504684, 0.022213179618120193, -0.05477386340498924, 0.06052691861987114, -0.019576363265514374, 0.027107270434498787, -0.010087819769978523, -0.012474937364459038, 0.004389699548482895, -0.013953153043985367, -0.014402610249817371, -0.008509725332260132, 0.031142398715019226, -0.03240088000893593, 0.014402610249817371, -0.03635610267519951, -0.050339218229055405, 0.04154983162879944, 0.003213619813323021, 0.022452889010310173, -0.05737072974443436, 0.011695878580212593, 0.03513757511973381, 0.050499025732278824, -0.04590457305312157, -0.004864126909524202, -0.042428769171237946, 0.04542515426874161, -0.008260026574134827, -0.032360926270484924, 0.053894925862550735, 0.045225393027067184, 0.08781397342681885, -0.06492161005735397, -0.007026515901088715, -0.039951760321855545, 0.025589102879166603, 0.0026892528403550386, -0.04222901165485382, 0.022213179618120193, -0.04678351432085037, -0.0105173010379076, -0.018887195736169815, -0.05409468337893486, 0.013543646782636642, 0.015201644971966743, 0.03399894759058952, -0.047622498124837875, 0.038553450256586075, -0.0494602806866169, -0.009952982887625694, 0.02325192466378212, 0.002241044072434306, -0.03851349651813507, 0.002350911498069763, -0.012285166420042515, 0.008794381283223629, -0.009029097855091095, -0.02465023659169674, -0.023152045905590057, 0.016649896278977394, -0.03829376399517059, -0.040870651602745056, -0.0018827267922461033, -0.0007877987809479237, -0.06236470118165016, -0.005947818513959646, -0.0017653685063123703, -0.057610440999269485, 0.005243668798357248, -0.025868766009807587, -0.031941432505846024, -0.017049415037035942, -0.03671566769480705, 0.09868085384368896, -0.037055257707834244, 0.037894245237112045, -0.0028165990952402353, 0.028086088597774506, 0.034678127616643906, -0.019756145775318146, -0.013323912397027016, 0.010916818864643574, -0.04586462303996086, 0.04626413807272911, -0.028325797989964485, -0.0569312609732151, -0.025868766009807587, 0.008999134413897991, 0.00564818037673831, 0.003330978099256754, -0.011665914207696915, 0.03771446272730827, -0.023871177807450294, -0.016180463135242462, 0.007426033727824688, 0.05101839825510979, 0.031941432505846024, -0.02008574828505516, 0.02167383022606373, 0.056611645966768265, 0.015601162798702717, -0.01905699074268341, -0.024969851598143578, -0.007615804672241211, -0.047702401876449585, 0.05621212720870972, 0.050019606947898865, -0.035417236387729645, -0.07782603055238724, 0.05872908979654312, -0.039392437785863876, 0.05876903980970383, -0.043667275458574295, 0.013174093328416348, 0.009398652240633965, -0.022992238402366638, 0.019646279513835907, -0.020754940807819366, -0.011116577312350273, -0.015101766213774681, -0.008819350972771645, 0.01676975190639496, -0.01261476892977953, -0.010876866988837719, 0.04734283685684204, 0.01108661387115717, 0.006701908074319363, 0.0350576713681221, -0.019686229526996613, 0.035417236387729645, 0.021953493356704712, 0.03116237372159958, -0.04083070158958435, 0.05181743577122688, -0.001893963199108839, 0.06963592022657394, -0.04774235561490059, -0.07287201285362244, 0.016929559409618378, -0.025429295375943184, -0.02433062344789505, 0.008080244064331055, 0.01863749697804451, 0.04182949289679527, -0.05888889729976654, 0.0011773285223171115, -0.01204545609652996, -0.017708618193864822, -0.0025793856475502253, 0.01655001752078533, 0.03639605641365051, -0.012874455191195011, -0.0067168897949159145, -0.030782831832766533, 0.05393487960100174, 0.022073348984122276, -0.03034336306154728, -0.03152193874120712, 0.0042798323556780815, -0.07319162786006927, 0.014582392759621143, 0.009967964142560959, 0.006232474930584431, 0.0635232999920845, -0.03981193155050278, 0.03437849134206772, 0.002242292510345578, 0.031781625002622604, 0.034678127616643906, 0.044905778020620346, 0.008324948139488697, -0.04410674422979355, -0.03769448772072792, -0.0022110803984105587, -0.04710312560200691, 0.030203532427549362, 0.03276044502854347, 0.0007035255548544228, 0.022972263395786285, -0.04678351432085037, -0.006177541334182024, -0.01776854507625103, -0.017488883808255196, -0.02473014034330845, -0.029504375532269478, -0.004487082362174988, 0.00015216003521345556, -0.040031664073467255, -0.015191657468676567, 0.00605768570676446, -0.05549299716949463, 0.034418441355228424, 0.026927487924695015, -0.021893564611673355, 0.033779215067625046, 0.014872043393552303, 0.06092643737792969, -0.02728705294430256, 0.044825877994298935, -0.03687547519803047, 0.00935870036482811, 0.010687096044421196, -0.03325984254479408, -0.009034091606736183, -0.028565509244799614, 0.023451684042811394, -0.05177748203277588, -0.023191997781395912, 0.05185738578438759, 0.03655586019158363, -0.07494950294494629, -0.02670775167644024, -0.03068295307457447, -0.021953493356704712, -0.04154983162879944, -0.10611187666654587, 0.04115031287074089, 0.04107040911912918, 0.04402684047818184, 0.09708277881145477, -0.03693540394306183, 0.034678127616643906, 0.06879693269729614, 0.018078172579407692, 0.015201644971966743, 0.034758031368255615, 0.04542515426874161, -0.018527628853917122, -0.02349163591861725, -0.02399103343486786, 0.015830885618925095, 0.0011873163748532534, -0.008834333159029484, 0.0029614244122058153, -0.027506787329912186, 0.01982606202363968, 0.019017038866877556, -0.014492501504719257, 0.05848937854170799, 0.05797000601887703, -0.029983796179294586, 0.03339967131614685, 0.007655756082385778, 0.036915428936481476, -0.008260026574134827, -0.04682346433401108, 0.013343888334929943, -0.045984476804733276, -0.022372987121343613, 0.007026515901088715, -0.008439810015261173, -0.0799834281206131, -0.012085407972335815, 0.04658375307917595, 0.036895450204610825, -0.044905778020620346, 0.09500528872013092, -0.07359114289283752, 0.01030755415558815, 0.02016565203666687, 0.021394168958067894, -0.0461842343211174, 0.06671944260597229, 0.012714647687971592, -0.015810908749699593, -0.03176164999604225, 0.00788048468530178, -0.028765268623828888, 0.07235264033079147, -0.009178916923701763, -0.06132595241069794, -0.0374947264790535, -0.005076370667666197, 0.06484171003103256, -0.017418967559933662, 0.030463218688964844, -0.002739192685112357, 0.04694331809878349, 0.05065883323550224, -0.034178730100393295, 0.01191561296582222, 0.01315411739051342, 0.014862054958939552, -0.07650762051343918, -0.018038220703601837, -0.011615974828600883, -0.03292025253176689, 0.0527762770652771, -0.05996759235858917, -0.021633878350257874, 0.019935928285121918, 0.05137796327471733, 0.029484400525689125, 0.012055443599820137, 0.03859340026974678, 0.01918683387339115, -0.027686569839715958, 0.009638362564146519, 0.06651968508958817, -0.034338537603616714, -0.0005630701198242605, -0.03260063752532005, -0.044586166739463806, 0.015820898115634918, -0.03116237372159958, -0.0478222593665123, 0.022213179618120193, -0.004983982071280479, -0.036995332688093185, 0.011096601374447346, -0.016849655658006668, -0.008559664711356163, -0.007820556871592999, -0.027107270434498787, -0.0039702062495052814, 0.04190939664840698, 0.0035007731057703495, 0.04330771043896675, 0.001736653153784573, 0.042268961668014526, 0.07630786299705505, 0.04402684047818184, -0.025049753487110138, -0.03431856259703636, 0.008929219096899033, 0.015970716252923012, -0.041669685393571854, -0.07039500027894974, -0.017069390043616295, 0.03256068378686905, 0.06875698268413544, -0.0004360360326245427, 0.014502489008009434, -0.06556084007024765, 0.03290027379989624, 0.00935870036482811, -0.025708958506584167, -0.013483719900250435, 0.05665159597992897, -0.04690336808562279, 0.01072704792022705, 0.004901581909507513, -0.0010331275407224894, -0.02225313149392605, 0.003935248591005802, -0.0651213675737381, -0.10211670398712158, -0.04922056943178177, -0.008854309096932411, -0.006327360402792692, 0.00439469376578927, 0.05369516834616661, -0.04254862666130066, -0.013873249292373657, 0.0019651271868497133, 0.08014323562383652, 0.04013154283165932, 0.04594452679157257, -0.036236248910427094, 0.014712235890328884, -0.03497776761651039, 0.002467021346092224, 0.027327004820108414, 0.0005480882246047258, 0.027646617963910103, 0.08709484338760376, -0.022233154624700546, 0.020734963938593864, 0.0037604596000164747, 0.05393487960100174, 0.027766473591327667, 0.015830885618925095, -0.027926281094551086, -0.02978403866291046, 0.03413878008723259, -0.005423451773822308, -0.06731871515512466, 0.022952286526560783, 0.021633878350257874, -0.0048241750337183475, 0.060726676136255264, -0.03190148249268532, -0.014512477442622185, -0.026767680421471596, 0.030203532427549362, -0.013343888334929943, 0.04526534676551819, 0.0088593028485775, 0.01003288570791483, -0.00825003907084465, 0.022472865879535675, 0.05189733952283859, -0.00967331975698471, -0.041669685393571854, -0.032700516283512115, -0.00633235415443778, -0.0038778178859502077, -0.004137504380196333, 0.03361940756440163, -0.03743480145931244, -0.02219320274889469, 0.058848943561315536, 0.010207675397396088, 0.056531742215156555, -0.017179258167743683, -0.033859118819236755, -0.01016272883862257, -0.020345434546470642, 0.012934383004903793, -0.02161390334367752, 0.006222486961632967, -0.0021911044605076313, 0.02598862163722515, 0.016300318762660027, 0.0519772432744503, 0.004649386275559664, -0.07359114289283752, 0.01584087312221527, -0.037055257707834244, -0.03613636642694473, -0.050339218229055405, 0.03661578893661499, -0.007246250752359629, -0.008619592525064945, 0.021414143964648247, 0.01916685700416565, 0.023191997781395912, -0.0050588916055858135, 0.0428682416677475, -0.025948669761419296, -0.0014370149001479149, -0.023851200938224792, 0.03306008130311966, 0.04142997786402702, -0.015281548723578453, 0.0486612468957901, 0.03375924006104469, 0.022372987121343613, -0.03907282277941704, 0.006402269937098026, -0.07682723551988602, 0.011945576407015324, 0.019556386396288872, 0.014872043393552303, -0.008275008760392666, 0.03593660891056061, 0.018657471984624863, 0.0009950485546141863, -0.007690714206546545, -0.01768864318728447, 0.0006829253979958594, -0.02910485863685608, -0.014991898089647293, 0.005643186159431934, -0.01995590515434742, 0.0470232218503952, 0.005188735201954842, 0.02008574828505516, 0.06887684017419815, -0.03891301527619362, -0.009493537247180939, 0.0519372895359993, 0.0725523978471756, 0.00032273531542159617, 0.0031137403566390276, 0.06248455494642258, 0.04055103659629822, -0.017648691311478615, 0.02417081594467163, 0.04814187064766884, 0.0039727031253278255, 0.08254034072160721, 0.06220489367842674, -0.026927487924695015, -0.007251244504004717, 0.01600068062543869, 0.020635085180401802, 0.03811398148536682, -0.05377507209777832, 0.011326324194669724, -0.036895450204610825, 0.01752883568406105, -0.06564074754714966, 0.026028571650385857, 0.012874455191195011, 0.00857964064925909, -0.01747889630496502, 0.03511759638786316, 0.024190790951251984, 0.0511382557451725, 0.011715853586792946, 0.048940908163785934, -0.045385200530290604, 0.0000026042773697554367, -0.025109682232141495, -0.010447385720908642, 0.06887684017419815, 0.010707071982324123, -0.06288406997919083, -0.028225919231772423, -0.08509725332260132, -0.004174958914518356, 0.019556386396288872, 0.01405303180217743, 0.025708958506584167, 0.02127431333065033, -0.024370575323700905, 0.0470232218503952, 0.057850152254104614, 0.013973128981888294, 0.03539726138114929, 0.06472185254096985, -0.04230891540646553, -0.03841361775994301, -0.0036680710036307573, 0.017019450664520264, 0.01141621544957161, 0.03461820259690285, 0.018597545102238655, -0.028485605493187904, 0.02762664295732975, -0.018487676978111267, 0.024390550330281258, -0.010577228851616383, -0.0009557210141792893, 0.07247249782085419, -0.033859118819236755, -0.019606327638030052, -0.00453951908275485, -0.01683966815471649, 0.015221620909869671, 0.014902006834745407, 0.02077491581439972, -0.0058179753832519054, 0.04162973538041115, 0.05948817357420921, 0.013293948955833912, -0.02580883726477623, -0.0700354352593422, 0.0022922323551028967, -0.034997742623090744, -0.015701042488217354, 0.005837951321154833, -0.007176334969699383, -0.04262853041291237, -0.03519750013947487, -0.01934663951396942, 0.039112772792577744, -0.015231609344482422, -0.027446860447525978, -0.01863749697804451, -0.000734113622456789, 0.05153777077794075, 0.013893225230276585, -0.0018365324940532446, -0.026288259774446487, -0.03208126500248909, 0.051258109509944916, 0.05477386340498924, -0.0038778178859502077, 0.011406227946281433, 0.015551223419606686, -0.0659603551030159, -0.045305296778678894, 0.07063471525907516, 0.005573270842432976, 0.034098830074071884, -0.003066297620534897, 0.000154188834130764, -0.01088685542345047, 0.03735489770770073 ]
39,396
pyspark.sql.dataframe
limit
Limits the result count to the number specified. .. versionadded:: 1.3.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Parameters ---------- num : int Number of records to return. Will return this number of records or all records if the DataFrame contains less than this number of records. Returns ------- :class:`DataFrame` Subset of the records Examples -------- >>> df = spark.createDataFrame( ... [(14, "Tom"), (23, "Alice"), (16, "Bob")], ["age", "name"]) >>> df.limit(1).show() +---+----+ |age|name| +---+----+ | 14| Tom| +---+----+ >>> df.limit(0).show() +---+----+ |age|name| +---+----+ +---+----+
def limit(self, num: int) -> "DataFrame": """Limits the result count to the number specified. .. versionadded:: 1.3.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Parameters ---------- num : int Number of records to return. Will return this number of records or all records if the DataFrame contains less than this number of records. Returns ------- :class:`DataFrame` Subset of the records Examples -------- >>> df = spark.createDataFrame( ... [(14, "Tom"), (23, "Alice"), (16, "Bob")], ["age", "name"]) >>> df.limit(1).show() +---+----+ |age|name| +---+----+ | 14| Tom| +---+----+ >>> df.limit(0).show() +---+----+ |age|name| +---+----+ +---+----+ """ jdf = self._jdf.limit(num) return DataFrame(jdf, self.sparkSession)
(self, num: int) -> pyspark.sql.dataframe.DataFrame
[ 0.014950343407690525, 0.003535786410793662, -0.025881869718432426, 0.04753883183002472, -0.029488500207662582, 0.07439964264631271, -0.010373357683420181, -0.005178091581910849, -0.03117159567773342, -0.03857377544045448, -0.019201016053557396, -0.025315113365650177, -0.019355585798621178, -0.007642622571438551, 0.019802121445536613, -0.0023507503792643547, 0.04455047845840454, -0.022343937307596207, 0.05911439657211304, 0.07446833699941635, -0.010785543359816074, 0.028286291286349297, 0.05313769355416298, 0.028543908149003983, -0.04619922488927841, 0.07433094829320908, -0.0509050190448761, 0.03515606373548508, 0.02861260436475277, 0.032803166657686234, -0.06048835068941116, 0.002155391266569495, 0.002279906067997217, 0.006642211694270372, -0.03637544810771942, 0.020351702347397804, -0.016341472044587135, -0.04272998869419098, -0.0024580906610935926, -0.0019299768609926105, -0.020763888955116272, -0.026586022228002548, 0.03733721747994423, -0.016135379672050476, -0.04602748155593872, -0.0036023373249918222, 0.0872461199760437, -0.018668608739972115, 0.024988800287246704, -0.0006885874317958951, 0.03170400112867355, 0.07185782492160797, -0.06550328433513641, -0.016264187172055244, -0.03513889014720917, -0.014469459652900696, -0.024937275797128677, -0.015663081780076027, 0.02744474448263645, -0.035551074892282486, -0.01402292400598526, -0.016573328524827957, -0.028509559109807014, 0.006719497032463551, -0.007178912870585918, 0.01512208767235279, 0.011515457183122635, 0.02045474946498871, -0.05200418084859848, -0.018273595720529556, 0.026963859796524048, 0.02373506687581539, 0.008381123654544353, 0.09864994138479233, -0.07062126696109772, -0.03082810714840889, -0.024937275797128677, -0.008106332272291183, -0.032923389226198196, -0.02617383562028408, 0.10325268656015396, -0.018273595720529556, -0.010871415957808495, -0.0030956915579736233, 0.012537335976958275, 0.03956989198923111, 0.03599761053919792, 0.005495818331837654, 0.010347595438361168, -0.003617364913225174, -0.04358870908617973, 0.0520385317504406, -0.013799657113850117, -0.026070788502693176, -0.0003976954612880945, -0.031068548560142517, -0.010991636663675308, 0.01190188154578209, -0.0245079156011343, 0.012236783280968666, -0.025504032149910927, 0.020471923053264618, 0.017964456230401993, -0.028286291286349297, -0.02674059197306633, -0.027152778580784798, 0.007135977037250996, -0.010278898291289806, -0.041321683675050735, 0.03527628630399704, -0.03494996950030327, 0.0877956971526146, 0.0025783118326216936, 0.022927867248654366, -0.003254554932937026, 0.06512545049190521, -0.012837888672947884, -0.04922192543745041, -0.0011302923085168004, 0.014684139750897884, 0.005500112194567919, 0.019784945994615555, 0.005560222547501326, -0.0834677442908287, -0.05454599857330322, 0.0724761039018631, 0.04664576053619385, -0.08442950993776321, 0.07130824774503708, 0.023254182189702988, 0.03843637928366661, -0.0016938283806666732, 0.024215949699282646, 0.059148747473955154, 0.036306750029325485, 0.001392202451825142, -0.006534871645271778, 0.01587776280939579, -0.050595879554748535, 0.002780111273750663, -0.0193040631711483, -0.00013752964150626212, 0.05248506739735603, 0.06804510205984116, -0.03877986967563629, -0.06890382617712021, 0.0463709682226181, -0.010416293516755104, -0.03081093169748783, 0.000518989865668118, -0.01820489950478077, 0.010630973614752293, 0.024009857326745987, -0.04568399116396904, -0.0015456989640370011, 0.04063470661640167, 0.06515979766845703, -0.023065263405442238, 0.018273595720529556, -0.04643966630101204, 0.01964755170047283, 0.025160543620586395, -0.03802419453859329, 0.018909050151705742, -0.05437425523996353, 0.01040770672261715, -0.009686379693448544, -0.010278898291289806, -0.04619922488927841, 0.00756533769890666, 0.08669653534889221, 0.06515979766845703, 0.0955585464835167, 0.0065477523021399975, -0.05379032343626022, 0.10606929659843445, 0.02655167318880558, 0.001380395027808845, 0.021863052621483803, -0.02373506687581539, -0.006393182557076216, -0.022515680640935898, -0.002344310050830245, -0.036684587597846985, 0.027736708521842957, -0.06852598488330841, -0.020763888955116272, -0.008329600095748901, 0.029076315462589264, 0.03513889014720917, -0.014048686251044273, -0.05554211512207985, 0.057465653866529465, 0.016204077750444412, -0.030484618619084358, -0.04382915422320366, 0.025881869718432426, 0.026877988129854202, -0.03261424973607063, 0.06072879582643509, -0.02320265956223011, 0.05348118394613266, 0.026809290051460266, -0.09961170703172684, 0.0412529893219471, 0.018617084249854088, -0.026431452482938766, -0.0034026845823973417, -0.02504032291471958, -0.023632019758224487, 0.02230958826839924, -0.036650240421295166, 0.010742607526481152, 0.02284199558198452, 0.03737156465649605, -0.008591510355472565, 0.00862156506627798, -0.05255376547574997, 0.04070340469479561, -0.03488127142190933, 0.04719534143805504, -0.004394507966935635, -0.044310037046670914, 0.004503995180130005, 0.012511574663221836, 0.0016669933684170246, 0.03395385295152664, -0.03678763657808304, 0.04747013375163078, -0.045787036418914795, -0.012417115271091461, -0.009712141938507557, 0.014383587054908276, -0.038539428263902664, -0.04180257022380829, -0.008213672786951065, 0.017930107191205025, 0.009488874115049839, 0.03144638612866402, -0.044481780380010605, 0.01354204025119543, 0.02193175069987774, 0.02191457711160183, 0.025675777345895767, -0.07350657135248184, 0.025297939777374268, -0.07536140829324722, 0.05835872143507004, 0.0386081263422966, 0.040359918028116226, -0.010570863261818886, -0.05502688139677048, -0.02467966079711914, -0.001066424883902073, 0.004594160709530115, -0.025160543620586395, -0.04846625030040741, -0.022189367562532425, -0.021863052621483803, 0.015534274280071259, 0.01217667292803526, -0.02912783809006214, -0.05348118394613266, -0.02880152314901352, -0.040600359439849854, -0.012185259722173214, -0.07412485033273697, -0.02655167318880558, 0.040394265204668045, 0.05179809033870697, -0.010794131085276604, 0.049702808260917664, 0.01801598072052002, -0.07433094829320908, -0.02823476679623127, -0.05787783861160278, -0.022532856091856956, -0.02990068681538105, -0.037955496460199356, -0.06790770590305328, -0.03479539975523949, -0.051145460456609726, -0.016951166093349457, 0.0027328815776854753, -0.00022192587493918836, -0.017775537446141243, 0.019235365092754364, 0.04266129061579704, -0.020351702347397804, -0.03477822616696358, -0.03675328567624092, 0.02859543077647686, -0.025315113365650177, -0.006406063213944435, -0.08154420554637909, -0.034245818853378296, 0.013284423388540745, -0.04719534143805504, -0.05475209280848503, 0.03419429436326027, -0.0026062200777232647, -0.10091696679592133, 0.04685185104608536, 0.08985663205385208, 0.025212068110704422, -0.02507467195391655, 0.004740143660455942, -0.05499253422021866, -0.000428555766120553, 0.018891876563429832, -0.018651433289051056, 0.05461469665169716, 0.001804388826712966, -0.004456765484064817, -0.009248431771993637, -0.01911514438688755, -0.0004940332728438079, 0.019767772406339645, -0.045787036418914795, 0.009153972379863262, -0.004254965577274561, -0.02893891930580139, -0.035344984382390976, -0.04843189939856529, 0.005573103670030832, 0.05664128065109253, 0.004456765484064817, 0.021605435758829117, 0.00009526443318463862, -0.028750000521540642, -0.034984320402145386, 0.044310037046670914, 0.002352897310629487, -0.007299134042114019, -0.0408751517534256, -0.026671893894672394, -0.006212851032614708, 0.042043011635541916, -0.014417936094105244, 0.047264039516448975, 0.02304808795452118, -0.0639575868844986, 0.016040919348597527, -0.029935035854578018, -0.0312231183052063, -0.006187089253216982, 0.06066009774804115, -0.036100659519433975, 0.04784797132015228, 0.036135006695985794, -0.019613202661275864, 0.014555332250893116, 0.011850358918309212, 0.044310037046670914, -0.005461469758301973, 0.03153225779533386, 0.005543048027902842, 0.049668461084365845, -0.016135379672050476, -0.008870594203472137, 0.035757169127464294, 0.004868951626121998, -0.011197729967534542, 0.014718488790094852, -0.0001537648495286703, 0.05238201841711998, -0.016453105956315994, -0.016478868201375008, -0.04942801594734192, 0.027049731463193893, 0.0057834903709590435, -0.0359632633626461, 0.018651433289051056, 0.03644414618611336, 0.028732826933264732, 0.03977598622441292, -0.09109319001436234, 0.02770235948264599, -0.006715203169733286, 0.0548894889652729, 0.014915995299816132, -0.05794653668999672, 0.020300179719924927, -0.0438978485763073, 0.009737903252243996, 0.022034797817468643, -0.08807048946619034, -0.04822580888867378, -0.022687425836920738, -0.043932199478149414, 0.002674917923286557, 0.011541218496859074, -0.019750596955418587, -0.010253136046230793, -0.013559214770793915, -0.002932534320279956, -0.022687425836920738, -0.028200417757034302, 0.0749492272734642, -0.007634035311639309, -0.021296296268701553, 0.040394265204668045, 0.023872461169958115, -0.009025164879858494, -0.026877988129854202, -0.00594235397875309, 0.02876717410981655, -0.07790322601795197, -0.045752689242362976, -0.04959976300597191, 0.06481631100177765, -0.041115593165159225, -0.0420086644589901, 0.05117981135845184, 0.04733273759484291, 0.034245818853378296, 0.04290173202753067, 0.008389710448682308, 0.039466846734285355, 0.01674507185816765, 0.04582138732075691, -0.030175479128956795, 0.00964344386011362, 0.06423237919807434, -0.033679064363241196, -0.0009161486523225904, -0.013670848682522774, -0.03287186473608017, 0.0008726758533157408, 0.003638833062723279, -0.057465653866529465, -0.0598013736307621, -0.02974611707031727, 0.015362530015408993, 0.009858124889433384, 0.0008807263802736998, -0.023494623601436615, -0.027599314227700233, -0.053584229201078415, 0.0009258092613890767, 0.05379032343626022, -0.017603794112801552, 0.01391987781971693, -0.01058803778141737, 0.035018667578697205, -0.04832885414361954, 0.028904570266604424, 0.004147625528275967, -0.0902688205242157, -0.016195490956306458, 0.04805406183004379, -0.008372535929083824, 0.041699521243572235, 0.001503836247138679, 0.000922589038964361, 0.01058803778141737, -0.0382302887737751, -0.03551672771573067, 0.05756869912147522, 0.05117981135845184, 0.051729392260313034, 0.022945042699575424, -0.02560707926750183, 0.01029607281088829, -0.026860812678933144, 0.020849760621786118, -0.044275686144828796, -0.054339904338121414, -0.006272961385548115, -0.03877986967563629, 0.02318548411130905, 0.005500112194567919, -0.039466846734285355, -0.04582138732075691, 0.07543011009693146, 0.0142891276627779, -0.010794131085276604, -0.035928912460803986, 0.0598013736307621, 0.03397102653980255, -0.013859767466783524, 0.03987903147935867, 0.04568399116396904, -0.014143145643174648, -0.02399268187582493, -0.019973864778876305, -0.03960424289107323, -0.004295755177736282, 0.019973864778876305, 0.0128207141533494, 0.033335573971271515, 0.02285916917026043, -0.0019997479394078255, 0.03599761053919792, -0.02433617040514946, 0.020901285111904144, 0.05296595022082329, 0.02991786226630211, -0.00797752384096384, 0.03223641216754913, 0.01550851296633482, -0.011257840320467949, -0.05609169602394104, 0.0002718390605878085, -0.019767772406339645, 0.02584752067923546, 0.016118206083774567, 0.02634558081626892, 0.0011710816761478782, -0.04832885414361954, 0.0018237100448459387, 0.06361410021781921, -0.04527180641889572, 0.0637858435511589, -0.002528935205191374, -0.004916181322187185, 0.003164389170706272, 0.026689069345593452, 0.057293906807899475, -0.02560707926750183, 0.0029110664036124945, 0.0007905606180429459, -0.016968339681625366, 0.03623805195093155, -0.009694967418909073, -0.0015800477704033256, -0.004048872739076614, 0.018840352073311806, 0.032957736402750015, 0.10861111432313919, -0.08662784099578857, 0.03857377544045448, 0.02789127826690674, 0.007539575919508934, 0.05629779025912285, -0.034228645265102386, -0.03589456528425217, 0.025160543620586395, 0.053172044456005096, 0.018840352073311806, -0.04235215112566948, -0.0028101664502173662, 0.00218329974450171, -0.005319780670106411, -0.06814815104007721, -0.02119324915111065, -0.037405915558338165, 0.006740964949131012, 0.0902688205242157, -0.0471266433596611, 0.02340875193476677, 0.0061656213365495205, 0.05849611759185791, -0.03101702593266964, 0.011970579624176025, 0.017741188406944275, 0.028372162953019142, -0.0041068363934755325, 0.004289314616471529, -0.058770909905433655, -0.040737755596637726, -0.044069595634937286, 0.06581242382526398, -0.009171146899461746, -0.004405241925269365, 0.030879629775881767, 0.03970728814601898, 0.0036774754989892244, 0.00964344386011362, -0.03768070414662361, 0.03433169052004814, 0.026276882737874985, 0.006650798954069614, 0.002797285793349147, 0.012348417192697525, 0.003473529126495123, 0.01707138679921627, 0.02694668434560299, -0.02634558081626892, 0.03366188704967499, -0.01780988648533821, 0.06069444492459297, 0.0010825259378179908, 0.024078555405139923, -0.05626344308257103, 0.02711842954158783, -0.07302568852901459, -0.04678315669298172, 0.04606182873249054, 0.03381645679473877, 0.014993280172348022, -0.011549806222319603, -0.0412529893219471, -0.026671893894672394, 0.024198776111006737, 0.09322281926870346, -0.08229988068342209, -0.037405915558338165, 0.043176524341106415, 0.04307347908616066, -0.004551224876195192, 0.05976702645421028, -0.03192726895213127, 0.015912111848592758, -0.011738725006580353, 0.009437350556254387, -0.051145460456609726, 0.07048387080430984, -0.01152404397726059, 0.0233744028955698, 0.0177927128970623, 0.00017912396288011223, -0.012331242673099041, -0.03477822616696358, -0.03477822616696358, -0.0022133549209684134, -0.02545250952243805, -0.04128733649849892, -0.0006075455457903445, -0.053927719593048096, -0.03932945057749748, 0.023099612444639206, 0.021605435758829117, 0.0196819007396698, -0.029608722776174545, -0.001932123675942421, 0.023305704817175865, 0.009952583350241184, -0.051901135593652725, 0.042455196380615234, 0.02674059197306633, -0.04678315669298172, 0.038161590695381165, -0.012786365114152431, -0.0355854257941246, -0.04331392049789429, -0.0019385641207918525, -0.0031622424721717834, 0.04551224783062935, 0.01029607281088829, 0.00937724020332098, 0.04922192543745041, -0.013043981976807117, -0.02394115924835205, 0.0047315564006567, -0.0556451641023159, 0.00892211776226759, 0.03137768805027008, -0.012803539633750916, 0.014950343407690525, -0.022893518209457397, -0.045203108340501785, 0.02917936071753502, 0.005440001375973225, 0.022927867248654366, 0.02045474946498871, -0.019784945994615555, 0.033885154873132706, 0.02584752067923546, -0.005212440155446529, -0.007857303135097027, -0.039054661989212036, 0.03024417534470558, -0.024370519444346428, 0.025143370032310486, 0.025761649012565613, -0.0025697245728224516, -0.06265232712030411, -0.013473342172801495, 0.02431899681687355, 0.06594981998205185, 0.014014337211847305, -0.03620370477437973, 0.008436939679086208, 0.0416308268904686, 0.012992458418011665, -0.08367383480072021, -0.047264039516448975, -0.02212066948413849, -0.030347222462296486, -0.006981406826525927, 0.005448588635772467, -0.03118876926600933, 0.0090852752327919, 0.008398297242820263, 0.015912111848592758, -0.02583034709095955, -0.01142099779099226, 0.002999085234478116, 0.003993055783212185, 0.01292376033961773, -0.012691905722022057, -0.018531212583184242, 0.04534050077199936, -0.07714755088090897, 0.03062201291322708, -0.053034648299217224, -0.008668795228004456, 0.004757317714393139, 0.04805406183004379, -0.022962216287851334, 0.060041818767786026, 0.01040770672261715, 0.0022262358106672764, 0.00889635644853115, -0.003522905521094799, -0.008664500899612904, -0.015637321397662163, 0.035551074892282486, -0.0193040631711483, -0.02248133160173893, 0.06072879582643509, 0.004003789741545916, 0.009677792899310589, -0.07068996876478195, 0.0880017951130867, 0.021966099739074707, 0.01835946924984455, -0.0032330870162695646, 0.053034648299217224, 0.029488500207662582, -0.02416442707180977, 0.030570490285754204, 0.03232228383421898, -0.017895758152008057, 0.05811828002333641, 0.01086282916367054, 0.02747909165918827, 0.007329189218580723, -0.037577658891677856, -0.010562276467680931, -0.009617682546377182, 0.003911477047950029, -0.04564964398741722, 0.0586678609251976, -0.020557796582579613, 0.02133064530789852, 0.006766726728528738, 0.043004781007766724, -0.022000448778271675, -0.02615666203200817, 0.010785543359816074, -0.027994325384497643, -0.030948327854275703, -0.020008213818073273, -0.029625896364450455, 0.02373506687581539, 0.015740368515253067, 0.0017067092703655362, 0.008939292281866074, -0.018462514504790306, -0.009806601330637932, -0.002966883359476924, -0.02991786226630211, -0.030896805226802826, 0.04829450324177742, 0.003544373670592904, 0.01627277582883835, 0.006771020125597715, -0.009901060722768307, 0.0189262256026268, 0.10071087628602982, -0.001071255188435316, 0.03792114928364754, -0.05482079088687897, 0.013035394251346588, 0.07783453166484833, -0.007797192316502333 ]
39,397
pyspark.sql.dataframe
localCheckpoint
Returns a locally checkpointed version of this :class:`DataFrame`. Checkpointing can be used to truncate the logical plan of this :class:`DataFrame`, which is especially useful in iterative algorithms where the plan may grow exponentially. Local checkpoints are stored in the executors using the caching subsystem and therefore they are not reliable. .. versionadded:: 2.3.0 Parameters ---------- eager : bool, optional, default True Whether to checkpoint this :class:`DataFrame` immediately. Returns ------- :class:`DataFrame` Checkpointed DataFrame. Notes ----- This API is experimental. Examples -------- >>> df = spark.createDataFrame([ ... (14, "Tom"), (23, "Alice"), (16, "Bob")], ["age", "name"]) >>> df.localCheckpoint(False) DataFrame[age: bigint, name: string]
def localCheckpoint(self, eager: bool = True) -> "DataFrame": """Returns a locally checkpointed version of this :class:`DataFrame`. Checkpointing can be used to truncate the logical plan of this :class:`DataFrame`, which is especially useful in iterative algorithms where the plan may grow exponentially. Local checkpoints are stored in the executors using the caching subsystem and therefore they are not reliable. .. versionadded:: 2.3.0 Parameters ---------- eager : bool, optional, default True Whether to checkpoint this :class:`DataFrame` immediately. Returns ------- :class:`DataFrame` Checkpointed DataFrame. Notes ----- This API is experimental. Examples -------- >>> df = spark.createDataFrame([ ... (14, "Tom"), (23, "Alice"), (16, "Bob")], ["age", "name"]) >>> df.localCheckpoint(False) DataFrame[age: bigint, name: string] """ jdf = self._jdf.localCheckpoint(eager) return DataFrame(jdf, self.sparkSession)
(self, eager: bool = True) -> pyspark.sql.dataframe.DataFrame
[ 0.04369338974356651, -0.02772246114909649, 0.019335981458425522, 0.04048525542020798, 0.025525586679577827, -0.019632384181022644, -0.0009333446505479515, 0.04829636216163635, -0.004524515010416508, -0.038811445236206055, -0.05328292027115822, -0.06698723137378693, 0.008129307068884373, 0.021149273961782455, -0.010496176779270172, 0.0135909803211689, -0.012553567066788673, -0.03509768098592758, 0.014698134735226631, 0.056770022958517075, 0.01890009269118309, -0.05073733627796173, 0.02121901512145996, 0.01903957687318325, -0.03548126295208931, -0.003835812211036682, -0.025787118822336197, 0.009083900600671768, 0.01230947021394968, 0.008098794147372246, 0.008351609110832214, -0.0025019957683980465, -0.03769557178020477, -0.003916451707482338, -0.024793295189738274, 0.011394105851650238, -0.0078285438939929, -0.025891732424497604, 0.02610095962882042, -0.0801336020231247, -0.00808571744710207, 0.010504894889891148, -0.03619612008333206, -0.00031956020393408835, -0.02203848585486412, 0.0007104970281943679, 0.020992353558540344, -0.047773297876119614, 0.05809511989355087, -0.010443870909512043, 0.018568817526102066, 0.050109654664993286, -0.005949867889285088, 0.02704247646033764, -0.01592733897268772, -0.016650911420583725, 0.026031216606497765, -0.016642194241285324, -0.03835812211036682, -0.04024115577340126, -0.008238278329372406, -0.00796366948634386, 0.04609948769211769, 0.06573187559843063, -0.0013970202999189496, -0.017906269058585167, -0.026066087186336517, -0.01862112432718277, -0.047529201954603195, -0.03115725703537464, -0.016668347641825676, -0.029256785288453102, -0.018795480951666832, 0.07713469862937927, -0.0789479911327362, -0.03452230989933014, -0.029605496674776077, -0.03005881980061531, -0.05007478594779968, 0.013721746392548084, -0.010374128818511963, -0.04840097576379776, -0.025229183956980705, -0.012466389685869217, -0.02528149075806141, -0.006978563033044338, 0.01987648196518421, 0.055793631821870804, 0.007244454696774483, 0.05216704681515694, 0.034051552414894104, 0.08850265294313431, -0.039613477885723114, 0.006507804151624441, 0.041008319705724716, -0.058408960700035095, 0.0039426046423614025, 0.014183787629008293, -0.019475465640425682, 0.00822084303945303, -0.025944039225578308, 0.03929964080452919, -0.05122552812099457, -0.009554659947752953, -0.009336715564131737, -0.00547475041821599, 0.0025259696412831545, -0.01752268709242344, 0.03874170407652855, -0.06105915829539299, -0.030564449727535248, -0.004995273891836405, -0.048610202968120575, 0.0047250231727957726, 0.009223384782671928, 0.044146712869405746, -0.0018241902580484748, -0.016345791518688202, -0.04735484719276428, 0.03591715171933174, 0.028053736314177513, -0.0139396907761693, -0.0024671247228980064, -0.08362070471048355, -0.04027602821588516, 0.0032495432533323765, 0.08766574412584305, -0.03713763505220413, 0.04714561998844147, 0.006895744241774082, 0.1020326092839241, -0.008517246693372726, -0.034470003098249435, 0.05889715254306793, 0.01794113963842392, -0.0010466754902154207, 0.06817284226417542, 0.06332577019929886, -0.04962146282196045, 0.015317095443606377, 0.01291099563241005, -0.0059455088339746, 0.0019407902145758271, 0.05262036994099617, 0.034208472818136215, -0.005779871717095375, -0.04543694108724594, -0.02733887918293476, -0.026955299079418182, 0.038148894906044006, 0.07246197760105133, -0.06203554570674896, -0.01657245308160782, -0.015308378264307976, -0.008303661830723286, -0.017775502055883408, -0.016363225877285004, -0.016668347641825676, 0.056351568549871445, -0.03766070306301117, -0.041391901671886444, 0.02174208126962185, 0.00605012197047472, 0.03342387452721596, -0.04372825846076012, 0.038148894906044006, -0.005941150244325399, -0.01602323353290558, -0.08920007199048996, 0.014794030226767063, 0.08654987066984177, 0.048749685287475586, 0.0380791537463665, 0.028454752638936043, -0.04508822783827782, 0.04432106763124466, 0.022753341123461723, -0.004136574920266867, 0.0019375210395082831, -0.01890009269118309, 0.001921175280585885, 0.0326392762362957, -0.03194185346364975, -0.014820183627307415, 0.03237774223089218, 0.010592072270810604, -0.044530294835567474, -0.010182337835431099, 0.09436098486185074, 0.04174061119556427, -0.025264054536819458, 0.0037006870843470097, 0.07734392583370209, 0.02664146013557911, -0.015421709045767784, -0.05739770084619522, 0.025752248242497444, 0.018655996769666672, -0.05830434709787369, 0.03197672590613365, 0.014846337027847767, 0.029971642419695854, 0.05931560695171356, -0.03218595311045647, -0.0016770781949162483, 0.04857533052563667, -0.07950592786073685, -0.005051939282566309, 0.005365778226405382, 0.01780165545642376, -0.006433703470975161, -0.013338165357708931, -0.0543639212846756, 0.04337954893708229, 0.02350306697189808, -0.00808135885745287, -0.012806382030248642, 0.028507059440016747, 0.04128728806972504, 0.01741807535290718, 0.04285648465156555, -0.04449542239308357, -0.017888832837343216, 0.03919502720236778, 0.005099886562675238, -0.05750231444835663, 0.019492899999022484, -0.043553903698921204, 0.003393386257812381, -0.0774834081530571, -0.0008537951507605612, -0.03957860916852951, -0.031628016382455826, -0.07002101093530655, 0.0489240400493145, 0.05534030869603157, -0.01851651258766651, 0.015273506753146648, 0.007601882331073284, -0.03699815273284912, -0.0007851428235881031, 0.01725243777036667, 0.04990043118596077, -0.005557568743824959, 0.0407990925014019, 0.0046422043815255165, 0.0244794562458992, 0.03422590717673302, 0.026850685477256775, 0.014209941029548645, -0.036370474845170975, -0.020765691995620728, 0.0036941487342119217, -0.006241912487894297, 0.04529745504260063, -0.042228806763887405, -0.0007137662032619119, 0.041008319705724716, -0.011585896834731102, 0.0543987937271595, -0.021916436031460762, -0.015718111768364906, 0.014680699445307255, 0.020504159852862358, -0.05516595393419266, -0.011254621669650078, -0.06890513747930527, -0.04543694108724594, -0.002926986198872328, 0.01305047981441021, -0.00971157941967249, 0.03738173469901085, 0.024409715086221695, -0.006991639733314514, -0.012727922759950161, -0.09463994950056076, -0.06991639733314514, -0.0043370830826461315, -0.016685783863067627, -0.05544492229819298, -0.032569531351327896, -0.027094783261418343, -0.027827074751257896, 0.025054827332496643, -0.07120662182569504, -0.046029746532440186, -0.05408495292067528, -0.05666540935635567, 0.045611295849084854, -0.06363961100578308, -0.03157570958137512, 0.01032182201743126, 0.06231451407074928, -0.01795857585966587, 0.014305836521089077, 0.035428956151008606, 0.018725737929344177, -0.025787118822336197, -0.04432106763124466, 0.03426077589392662, 0.034871019423007965, -0.0571187324821949, -0.0031580068171024323, 0.06719645857810974, 0.061512481421232224, -0.0028790386859327555, -0.04972607642412186, -0.017583712935447693, 0.003016343340277672, -0.0015702856471762061, -0.009371587075293064, -0.008007258176803589, 0.0073621440678834915, 0.01203050184994936, -0.022073356434702873, -0.06754516810178757, -0.01619758829474449, -0.02336358278989792, 0.050632722675800323, 0.0003767704765778035, 0.0016302202129736543, 0.02896038256585598, -0.019335981458425522, 0.05631669983267784, -0.05631669983267784, 0.01197819598019123, 0.06848668307065964, -0.002221937756985426, 0.004877584055066109, 0.017304744571447372, 0.02254411391913891, -0.011638202704489231, 0.03004138357937336, 0.007562652695924044, -0.046169232577085495, 0.03553356975317001, -0.01550888642668724, -0.005893202498555183, 0.029832158237695694, -0.019771868363022804, 0.1127728819847107, -0.023555373772978783, 0.0036113299429416656, -0.02503739297389984, -0.03173262998461723, 0.02705991268157959, 0.00035770039539784193, 0.012483824975788593, 0.06433703005313873, 0.05370137095451355, -0.050528109073638916, -0.004751176573336124, -0.06880052387714386, 0.05600285902619362, 0.0007982194656506181, 0.008094435557723045, 0.00006589396798517555, 0.020347241312265396, 0.004572462756186724, -0.03150596842169762, 0.008098794147372246, -0.0489937849342823, -0.007776237558573484, -0.021149273961782455, 0.010313103906810284, -0.005387572571635246, 0.001136577338911593, -0.026589153334498405, -0.026292748749256134, -0.018812915310263634, -0.03448743745684624, -0.04473951831459999, 0.009798756800591946, -0.0024082798045128584, 0.009049030020833015, 0.02353793941438198, -0.03929964080452919, 0.03839299455285072, 0.02012057788670063, 0.09763886034488678, 0.028507059440016747, -0.04463490471243858, 0.00479912431910634, -0.0003933887055609375, 0.027216831222176552, 0.03061675652861595, -0.03790479898452759, -0.03551613539457321, 0.0016672706697136164, -0.023747164756059647, -0.0018710482399910688, -0.00775444321334362, -0.0009289857698604465, 0.0074929106049239635, 0.04498361796140671, 0.00869160145521164, 0.021393371745944023, 0.012178704142570496, 0.0017675248673185706, -0.02310205064713955, 0.04292622581124306, -0.013503802940249443, -0.02121901512145996, -0.06737080961465836, -0.029431141912937164, 0.01713038794696331, 0.0004342531901784241, -0.04421645402908325, -0.027513235807418823, 0.02664146013557911, 0.07322914153337479, -0.0024845602456480265, -0.020626207813620567, 0.053771112114191055, -0.013512520119547844, 0.0462041012942791, -0.011263339780271053, -0.02460150420665741, 0.06594110280275345, 0.027112217620015144, 0.025734813883900642, -0.010644379071891308, -0.010766427963972092, -0.005274241790175438, -0.05073733627796173, -0.006948051042854786, -0.03249979019165039, -0.005788589362055063, 0.002680709585547447, 0.020504159852862358, 0.0024104593321681023, -0.07629778981208801, 0.02639736235141754, 0.01454993337392807, -0.01903957687318325, 0.05073733627796173, 0.06025712192058563, -0.004441696219146252, -0.03926476836204529, 0.04651794210076332, 0.06444164365530014, -0.06133812665939331, 0.026606587693095207, 0.014916079118847847, -0.023032309487462044, -0.023346148431301117, -0.05262036994099617, -0.006359602324664593, -0.08403915911912918, 0.03492332622408867, 0.10719351470470428, -0.00387722160667181, 0.007109329104423523, 0.020765691995620728, -0.11493488401174545, 0.04118267446756363, -0.030965466052293777, -0.0258219912648201, -0.020015966147184372, 0.08243509382009506, 0.0031645451672375202, -0.008347250521183014, -0.01216998603194952, -0.0032408253755420446, 0.004206317011266947, -0.04498361796140671, -0.04529745504260063, 0.013146374374628067, -0.0421590656042099, -0.06102428585290909, 0.04041551426053047, -0.05178346484899521, -0.0489240400493145, -0.06894000619649887, 0.04446054995059967, 0.03286593779921532, -0.08487606048583984, 0.004182342905551195, 0.061930932104587555, 0.014236094430088997, -0.09122259169816971, -0.022369759157299995, 0.029867028817534447, -0.006908820942044258, 0.03171519190073013, -0.060047898441553116, -0.029413705691695213, -0.011402823962271214, 0.001535414601676166, 0.02420048788189888, -0.023171793669462204, 0.0638837069272995, 0.026676330715417862, -0.020974919199943542, -0.020870305597782135, 0.05370137095451355, 0.011228468269109726, 0.03926476836204529, 0.026711201295256615, -0.01713910698890686, 0.04854046180844307, 0.02812347747385502, -0.04365851730108261, 0.04634358733892441, -0.04376313090324402, -0.043972358107566833, 0.03661457076668739, 0.0029771134722977877, -0.0612335130572319, 0.006712671369314194, -0.004317468032240868, 0.018847785890102386, -0.0039360662922263145, 0.05788589268922806, -0.04840097576379776, 0.021515419706702232, 0.015203764662146568, 0.01182127557694912, 0.046238973736763, -0.0476338155567646, -0.010295668616890907, 0.024008696898818016, 0.06294219195842743, -0.007200865540653467, -0.07078817486763, 0.007915721274912357, 0.020713387057185173, 0.012928430922329426, -0.011899735778570175, 0.05408495292067528, -0.019632384181022644, 0.0421590656042099, 0.043972358107566833, 0.017217567190527916, 0.02542097307741642, 0.008129307068884373, -0.01592733897268772, -0.020626207813620567, -0.014401731081306934, -0.05600285902619362, 0.017104236409068108, -0.003476204816251993, 0.023346148431301117, 0.020748257637023926, -0.025508152320981026, -0.040973447263240814, 0.015744265168905258, 0.034347955137491226, 0.0022121304646134377, -0.030669063329696655, -0.0028964742086827755, -0.04927275329828262, 0.05139988288283348, -0.01781037449836731, 0.027147090062499046, -0.008652372285723686, 0.052132174372673035, 0.028437316417694092, 0.01032182201743126, -0.02707734704017639, -0.033650536090135574, -0.011254621669650078, 0.08536425977945328, -0.027652719989418983, 0.006115505006164312, -0.018690867349505424, 0.028454752638936043, 0.0381140261888504, 0.006416267715394497, -0.05370137095451355, 0.07092765718698502, -0.007122405804693699, 0.036370474845170975, -0.0407990925014019, 0.0038990159519016743, 0.011394105851650238, -0.0071180472150444984, 0.045192841440439224, -0.019126754254102707, 0.02310205064713955, -0.006616776343435049, -0.012065373361110687, -0.03380745276808739, 0.012727922759950161, -0.07385682314634323, 0.06416267901659012, -0.02500252239406109, 0.020190320909023285, -0.014733006246387959, 0.0033236441668123007, -0.012544849887490273, -0.01930110901594162, 0.02678094431757927, -0.009467481635510921, 0.06991639733314514, -0.029535753652453423, -0.024828165769577026, 0.023729728534817696, 0.07643727958202362, -0.015979645773768425, -0.03783505782485008, 0.024026133120059967, -0.02840244583785534, -0.06953281164169312, -0.03874170407652855, -0.01959751360118389, -0.06472061574459076, 0.039927318692207336, 0.0006026148330420256, 0.0088310856372118, -0.031087514013051987, 0.019353415817022324, -0.012832535430788994, -0.020992353558540344, 0.006956768687814474, 0.01958007737994194, -0.06210528686642647, -0.028995253145694733, -0.045192841440439224, 0.02134106494486332, -0.007584447041153908, -0.0010619316017255187, 0.03478384390473366, 0.007414450868964195, -0.004524515010416508, -0.017017057165503502, 0.03752121701836586, -0.06974203884601593, -0.01135051716119051, 0.015116587281227112, 0.008748266845941544, 0.03232543542981148, 0.0013185604475438595, 0.008159819059073925, 0.05234140157699585, -0.04460003599524498, -0.0071049705147743225, -0.027356315404176712, 0.03352848440408707, 0.009441329166293144, -0.07315940409898758, 0.030512142926454544, 0.034452568739652634, -0.04390261322259903, -0.004607333801686764, -0.04540206864476204, 0.0031100590713322163, -0.02704247646033764, 0.07455424219369888, -0.005919355899095535, -0.02420048788189888, -0.0008843072573654354, 0.004228111356496811, 0.03005881980061531, 0.0278793815523386, 0.1196075975894928, -0.045192841440439224, -0.03178493678569794, 0.02421792410314083, -0.0231194868683815, -0.02163746766746044, -0.01496838591992855, -0.0530039519071579, 0.03244748339056969, 0.04149651527404785, 0.09268717467784882, -0.04651794210076332, 0.018568817526102066, 0.017078083008527756, -0.019928788766264915, -0.030093690380454063, 0.03164545074105263, -0.015142740681767464, -0.01672937162220478, 0.035812538117170334, -0.04878455772995949, -0.03467923030257225, 0.0031972366850823164, -0.021044660359621048, -0.0013632389018312097, 0.026310184970498085, 0.03797454014420509, 0.034208472818136215, 0.023625116795301437, -0.003916451707482338, 0.009885934181511402, 0.029588060453534126, -0.018934963271021843, 0.013791488483548164, -0.049412235617637634, -0.00043806718895211816, 0.020451853051781654, 0.039927318692207336, 0.06231451407074928, -0.004947326146066189, -0.034871019423007965, -0.01837702840566635, -0.00002114736707881093, -0.04257751628756523, 0.007052663713693619, -0.001889573410153389, 0.061512481421232224, 0.008146742358803749, -0.008556476794183254, 0.01169922761619091, 0.04093857854604721, 0.0032756964210420847, 0.02772246114909649, -0.042368289083242416, -0.02488047257065773, -0.0028245525900274515, 0.04407697170972824, -0.0007126764976419508, -0.02855936624109745, 0.016956033185124397, 0.03427821397781372, -0.022927695885300636, -0.07978489249944687, -0.0010276053799316287, 0.05596798658370972, 0.020486723631620407, -0.03173262998461723, 0.0004914634628221393, 0.022387195378541946, -0.007928797975182533, 0.02461894042789936, 0.0176621712744236, -0.016415532678365707, -0.041670870035886765, -0.012492543086409569, 0.023415889590978622, 0.02162003330886364, 0.007859055884182453, 0.02637992613017559, 0.07176455855369568, -0.005165270064026117, 0.014837618917226791, 0.04749432951211929, -0.01604066975414753, 0.004550667945295572, -0.020887741819024086, 0.0031819806899875402, -0.051748596131801605, 0.0011976015521213412, 0.015142740681767464, -0.011184879578649998, 0.012684334069490433, -0.0016868856037035584, 0.006346525624394417, 0.04927275329828262, 0.0066690826788544655, 0.02597890980541706, 0.013582262210547924, 0.0028158349450677633, 0.032273128628730774, 0.03452230989933014, -0.04107806086540222, 0.028175784274935722, -0.0004149106680415571, -0.05275985226035118, -0.03863709047436714, 0.005200141109526157, -0.013242269866168499, 0.0476338155567646, -0.040868837386369705, -0.020225191488862038, 0.05066759139299393, 0.09094361960887909 ]
39,398
pyspark.sql.pandas.map_ops
mapInArrow
Maps an iterator of batches in the current :class:`DataFrame` using a Python native function that takes and outputs a PyArrow's `RecordBatch`, and returns the result as a :class:`DataFrame`. The function should take an iterator of `pyarrow.RecordBatch`\s and return another iterator of `pyarrow.RecordBatch`\s. All columns are passed together as an iterator of `pyarrow.RecordBatch`\s to the function and the returned iterator of `pyarrow.RecordBatch`\s are combined as a :class:`DataFrame`. Each `pyarrow.RecordBatch` size can be controlled by `spark.sql.execution.arrow.maxRecordsPerBatch`. The size of the function's input and output can be different. .. versionadded:: 3.3.0 Parameters ---------- func : function a Python native function that takes an iterator of `pyarrow.RecordBatch`\s, and outputs an iterator of `pyarrow.RecordBatch`\s. schema : :class:`pyspark.sql.types.DataType` or str the return type of the `func` in PySpark. The value can be either a :class:`pyspark.sql.types.DataType` object or a DDL-formatted type string. barrier : bool, optional, default False Use barrier mode execution. .. versionadded: 3.5.0 Examples -------- >>> import pyarrow # doctest: +SKIP >>> df = spark.createDataFrame([(1, 21), (2, 30)], ("id", "age")) >>> def filter_func(iterator): ... for batch in iterator: ... pdf = batch.to_pandas() ... yield pyarrow.RecordBatch.from_pandas(pdf[pdf.id == 1]) >>> df.mapInArrow(filter_func, df.schema).show() # doctest: +SKIP +---+---+ | id|age| +---+---+ | 1| 21| +---+---+ Set ``barrier`` to ``True`` to force the ``mapInArrow`` stage running in the barrier mode, it ensures all Python workers in the stage will be launched concurrently. >>> df.mapInArrow(filter_func, df.schema, barrier=True).show() # doctest: +SKIP +---+---+ | id|age| +---+---+ | 1| 21| +---+---+ Notes ----- This API is unstable, and for developers. See Also -------- pyspark.sql.functions.pandas_udf pyspark.sql.DataFrame.mapInPandas
def mapInArrow( self, func: "ArrowMapIterFunction", schema: Union[StructType, str], barrier: bool = False ) -> "DataFrame": """ Maps an iterator of batches in the current :class:`DataFrame` using a Python native function that takes and outputs a PyArrow's `RecordBatch`, and returns the result as a :class:`DataFrame`. The function should take an iterator of `pyarrow.RecordBatch`\\s and return another iterator of `pyarrow.RecordBatch`\\s. All columns are passed together as an iterator of `pyarrow.RecordBatch`\\s to the function and the returned iterator of `pyarrow.RecordBatch`\\s are combined as a :class:`DataFrame`. Each `pyarrow.RecordBatch` size can be controlled by `spark.sql.execution.arrow.maxRecordsPerBatch`. The size of the function's input and output can be different. .. versionadded:: 3.3.0 Parameters ---------- func : function a Python native function that takes an iterator of `pyarrow.RecordBatch`\\s, and outputs an iterator of `pyarrow.RecordBatch`\\s. schema : :class:`pyspark.sql.types.DataType` or str the return type of the `func` in PySpark. The value can be either a :class:`pyspark.sql.types.DataType` object or a DDL-formatted type string. barrier : bool, optional, default False Use barrier mode execution. .. versionadded: 3.5.0 Examples -------- >>> import pyarrow # doctest: +SKIP >>> df = spark.createDataFrame([(1, 21), (2, 30)], ("id", "age")) >>> def filter_func(iterator): ... for batch in iterator: ... pdf = batch.to_pandas() ... yield pyarrow.RecordBatch.from_pandas(pdf[pdf.id == 1]) >>> df.mapInArrow(filter_func, df.schema).show() # doctest: +SKIP +---+---+ | id|age| +---+---+ | 1| 21| +---+---+ Set ``barrier`` to ``True`` to force the ``mapInArrow`` stage running in the barrier mode, it ensures all Python workers in the stage will be launched concurrently. >>> df.mapInArrow(filter_func, df.schema, barrier=True).show() # doctest: +SKIP +---+---+ | id|age| +---+---+ | 1| 21| +---+---+ Notes ----- This API is unstable, and for developers. See Also -------- pyspark.sql.functions.pandas_udf pyspark.sql.DataFrame.mapInPandas """ from pyspark.sql import DataFrame from pyspark.sql.pandas.functions import pandas_udf assert isinstance(self, DataFrame) # The usage of the pandas_udf is internal so type checking is disabled. udf = pandas_udf( func, returnType=schema, functionType=PythonEvalType.SQL_MAP_ARROW_ITER_UDF ) # type: ignore[call-overload] udf_column = udf(*[self[col] for col in self.columns]) jdf = self._jdf.pythonMapInArrow(udf_column._jc.expr(), barrier) return DataFrame(jdf, self.sparkSession)
(self, func: 'ArrowMapIterFunction', schema: Union[pyspark.sql.types.StructType, str], barrier: bool = False) -> 'DataFrame'
[ 0.038015216588974, -0.0483933724462986, -0.03436575457453728, 0.018171273171901703, -0.06093839183449745, 0.004597465042024851, 0.006856994703412056, 0.035468198359012604, 0.0008862297399900854, -0.01128101535141468, -0.03181873634457588, 0.011271512135863304, -0.015852345153689384, 0.033491406589746475, -0.024158669635653496, -0.01961585134267807, 0.00320990988984704, 0.02668668143451214, 0.01932123303413391, 0.06553823500871658, -0.013428875245153904, -0.04854543134570122, 0.017563030123710632, 0.04675871506333351, -0.021668672561645508, 0.05953183025121689, -0.013428875245153904, -0.010815328918397427, 0.04003002494573593, 0.02273309975862503, 0.059569843113422394, -0.015681276097893715, -0.038015216588974, -0.042462997138500214, 0.01244047936052084, 0.005621500313282013, -0.01986294984817505, -0.013637959025800228, 0.02385454811155796, -0.04512406140565872, 0.01910264603793621, -0.007104093674570322, -0.003514031646773219, 0.0002196269779233262, -0.04094238951802254, 0.03472689911723137, -0.010881856083869934, -0.06941578537225723, 0.053525425493717194, 0.005825832020491362, 0.05565427616238594, 0.0028844045009464025, 0.019454287365078926, 0.04185475409030914, 0.007973691448569298, 0.02904362604022026, -0.06401762366294861, -0.07584035396575928, 0.014968491159379482, -0.01861795224249363, -0.016165971755981445, -0.03275010734796524, -0.031077438965439796, 0.006367548834532499, 0.037368956953287125, -0.008515408262610435, -0.00667642243206501, -0.04596039652824402, -0.07785516232252121, 0.014274713583290577, -0.059835951775312424, 0.011081435717642307, 0.004756654147058725, 0.03333934396505356, -0.08538217842578888, 0.01308673806488514, 0.00589711032807827, -0.01681222952902317, 0.010919870808720589, -0.021288521587848663, 0.03160965442657471, -0.024956990033388138, -0.04615047201514244, -0.03605743125081062, -0.014749904163181782, 0.00398922199383378, 0.06340938061475754, 0.024329738691449165, -0.04622650519013405, -0.02653462067246437, -0.005806824192404747, 0.010853344574570656, -0.0006634843302890658, -0.0016857372829690576, -0.017173374071717262, -0.04485795646905899, -0.015320132486522198, -0.014787918888032436, -0.019007608294487, 0.051548633724451065, 0.0007401087204925716, 0.007123101036995649, 0.016527116298675537, 0.0066574146039783955, 0.0690736472606659, -0.06230694055557251, 0.006818979512900114, -0.0501420721411705, 0.01688826084136963, -0.039877962321043015, -0.05238496884703636, 0.018342342227697372, -0.025888362899422646, -0.019748905673623085, -0.0006195292226038873, 0.0751180648803711, 0.03303522244095802, -0.04694879427552223, -0.04105643555521965, -0.019672874361276627, 0.020889362320303917, 0.027427978813648224, 0.020414171740412712, -0.10157665610313416, 0.00641981977969408, -0.04337536171078682, 0.07211486250162125, 0.01118597760796547, 0.0065766326151788235, 0.06154663488268852, 0.08180874586105347, -0.031324539333581924, -0.009712887927889824, 0.05633855238556862, 0.014417271129786968, 0.031685683876276016, 0.03485995531082153, 0.03476491570472717, -0.06473991274833679, -0.0029034120962023735, 0.013172272592782974, -0.06679273396730423, 0.04569429159164429, 0.022619053721427917, -0.011566129513084888, -0.03837636113166809, 0.01971088908612728, 0.011423572897911072, 0.03489796817302704, 0.017677076160907745, 0.01971088908612728, -0.019900966435670853, -0.04789917171001434, 0.03212285786867142, -0.0570608414709568, -0.013694982044398785, 0.029005609452724457, 0.0440596379339695, 0.03843338415026665, -0.017648564651608467, -0.011223992332816124, 0.05523610860109329, -0.04193078354001045, 0.031001409515738487, -0.057250916957855225, 0.04025811329483986, 0.012820632196962833, 0.02470989152789116, -0.00596363702788949, -0.0406002514064312, 0.06679273396730423, 0.012516509741544724, 0.036855753511190414, -0.03041217289865017, -0.053525425493717194, 0.10096841305494308, 0.031248508021235466, 0.03826231509447098, 0.028929580003023148, -0.024747906252741814, 0.029537823051214218, 0.029575837776064873, -0.07165868580341339, 0.039535824209451675, 0.024215692654252052, 0.029252709820866585, -0.020794322714209557, -0.05021810159087181, 0.06367548555135727, 0.0007098153582774103, -0.051814738661050797, 0.0028844045009464025, 0.017753105610609055, 0.061926789581775665, -0.031400568783283234, -0.019036119803786278, 0.009446781128644943, 0.018988600000739098, -0.042919181287288666, 0.04554222896695137, 0.019558828324079514, -0.010834336280822754, 0.02393057942390442, 0.02073730155825615, -0.03818628564476967, -0.00674294913187623, -0.0003056066925637424, 0.009033366106450558, 0.024253707379102707, -0.018437379971146584, -0.04052422195672989, -0.07724691927433014, -0.015453185886144638, 0.009998002089560032, 0.03212285786867142, 0.058543432503938675, -0.04915367439389229, 0.029271716251969337, 0.051472604274749756, 0.02134554460644722, 0.054817941039800644, 0.004286215640604496, -0.05166267976164818, -0.05937976762652397, 0.07211486250162125, -0.01980592869222164, 0.04873550683259964, 0.01050170324742794, 0.009874452836811543, -0.02790316939353943, -0.01617547497153282, -0.050522223114967346, -0.013704485259950161, -0.06185075640678406, -0.001161246094852686, -0.027199886739253998, -0.027618054300546646, -0.03518308326601982, 0.02645859122276306, -0.018903067335486412, 0.014037118293344975, 0.036684684455394745, 0.034251708537340164, -0.007907165214419365, -0.03769208863377571, -0.0017605797620490193, -0.020984400063753128, 0.044097650796175, 0.019216692075133324, -0.004416892770677805, 0.023645464330911636, -0.02385454811155796, -0.008529664017260075, -0.0031909022945910692, -0.0010935314930975437, 0.00041727640200406313, 0.06492999196052551, -0.025166073814034462, -0.0341566726565361, 0.06470189988613129, -0.008330084383487701, -0.039953991770744324, -0.03930773213505745, -0.022067833691835403, 0.03592437878251076, -0.008339588530361652, -0.008905064314603806, -0.0016940530622377992, 0.02317027375102043, 0.04649261012673378, 0.028036221861839294, 0.03432774171233177, -0.002587410621345043, 0.010169070214033127, 0.028492404147982597, -0.02092737704515457, -0.03734995052218437, -0.027199886739253998, 0.008824282325804234, -0.07352142781019211, -0.01589035987854004, -0.023132259026169777, -0.04520009085536003, -0.03854743018746376, -0.05314527451992035, -0.033491406589746475, -0.006871250458061695, 0.019938981160521507, 0.018703486770391464, -0.06014007329940796, -0.017429977655410767, 0.006068178918212652, -0.022276917472481728, -0.011594641022384167, -0.031495608389377594, 0.020794322714209557, 0.03592437878251076, -0.053107257932424545, -0.04778512567281723, -0.02410164661705494, 0.0009414706146344543, -0.07698081433773041, 0.03060225024819374, 0.08568629622459412, -0.032274920493364334, -0.013989599421620369, -0.0009188990807160735, -0.003853792557492852, -0.008477393537759781, 0.008016458712518215, 0.010948382318019867, 0.007831134833395481, -0.04569429159164429, -0.025888362899422646, -0.019387761130928993, -0.0414746031165123, -0.02298019826412201, 0.07367348670959473, 0.024842943996191025, 0.00808773748576641, -0.013894561678171158, 0.027960192412137985, 0.01581433042883873, 0.059493813663721085, -0.002644433407112956, 0.05812526494264603, 0.04622650519013405, -0.023645464330911636, 0.026249507442116737, 0.009213938377797604, 0.03493598476052284, 0.024063631892204285, 0.0466826856136322, -0.012278915382921696, 0.002646809443831444, 0.032369956374168396, -0.001176689751446247, 0.0011030352907255292, 0.010596741922199726, 0.041968800127506256, 0.013267310336232185, -0.011955785565078259, 0.0699860155582428, -0.03983994573354721, -0.017534518614411354, 0.01802871562540531, -0.0011553062358871102, 0.04090437293052673, -0.008957335725426674, 0.06264907866716385, 0.06169869750738144, 0.004766157828271389, -0.0054741911590099335, 0.047671083360910416, -0.031039424240589142, -0.001854429836384952, -0.03297819942235947, 0.01978692039847374, -0.035563234239816666, 0.052499014884233475, 0.04337536171078682, -0.09404964745044708, 0.024918975308537483, -0.023037221282720566, 0.06838937103748322, -0.0010976893827319145, -0.05420969799160957, -0.003247925080358982, -0.036000411957502365, 0.012649563141167164, 0.027427978813648224, 0.004697255324572325, 0.0013436003355309367, 0.0013364724582061172, 0.010226093232631683, -0.002109844470396638, -0.031400568783283234, 0.03147659823298454, -0.02005302719771862, 0.10119650512933731, 0.007441478781402111, -0.08492599427700043, 0.05390557646751404, 0.02220088616013527, 0.03700781241059303, 0.01939726434648037, 0.024044623598456383, -0.04520009085536003, 0.006301022134721279, -0.04949581250548363, -0.01893157698214054, 0.05230893939733505, -0.0033096997067332268, -0.0067619564943015575, -0.001412502839230001, -0.04478192701935768, -0.03683674335479736, 0.009304224513471127, 0.07637257128953934, -0.05363947153091431, -0.05592038482427597, -0.009289968758821487, -0.04820329323410988, 0.014768911525607109, 0.013314829207956791, 0.020072033628821373, 0.0015253606252372265, -0.022866152226924896, 0.008144760504364967, 0.015624254010617733, 0.005146309733390808, -0.012640059925615788, -0.004283839836716652, 0.01283963955938816, -0.008838538080453873, 0.10165268927812576, -0.013029715046286583, -0.000016353225873899646, 0.00564050767570734, 0.008619950152933598, 0.08500202745199203, 0.018751004710793495, -0.010919870808720589, -0.010235597379505634, -0.005165317561477423, -0.06671670824289322, 0.017971694469451904, -0.002675320953130722, 0.017772113904356956, 0.030906371772289276, -0.023189282044768333, -0.08226493000984192, -0.06401762366294861, -0.017220893874764442, -0.02826431393623352, 0.04166467860341072, 0.007427223026752472, 0.047823142260313034, 0.032179880887269974, 0.026667675003409386, 0.06196480244398117, 0.015804827213287354, -0.0017356321914121509, -0.06873150914907455, -0.006481594406068325, 0.03160965442657471, -0.03375751152634621, 0.033491406589746475, 0.011756205931305885, 0.04888756945729256, 0.06724891811609268, -0.007365448400378227, 0.02712385728955269, -0.0035781823098659515, -0.008814778178930283, 0.006438827142119408, 0.013010707683861256, -0.05071229860186577, -0.08424171805381775, 0.04052422195672989, 0.06880754232406616, -0.0021739951334893703, -0.04789917171001434, -0.04018208384513855, 0.008510656654834747, 0.029613854363560677, -0.05519809573888779, 0.0475570373237133, -0.008135256357491016, 0.0007935676258057356, 0.045922379940748215, -0.049381766468286514, -0.011813228949904442, -0.006453082896769047, 0.0777411162853241, 0.037292927503585815, -0.0656522810459137, 0.021991802379488945, 0.03620949387550354, 0.016745703294873238, -0.03067827969789505, -0.04736695811152458, 0.04174070805311203, -0.0151300560683012, 0.03421369567513466, -0.05979793518781662, 0.0062915184535086155, 0.007113597355782986, 0.002392582595348358, 0.019283218309283257, -0.01435074396431446, 0.07625852525234222, 0.05477992817759514, 0.007493749726563692, -0.0037421227898448706, -0.007070830091834068, 0.07580234110355377, 0.06610846519470215, 0.06401762366294861, -0.038851551711559296, 0.02151661179959774, -0.0003768852329812944, -0.060102056711912155, 0.0336814820766449, 0.006633655168116093, -0.015624254010617733, 0.0034261213149875402, -0.007317929062992334, -0.06492999196052551, -0.02144058234989643, -0.04805123433470726, -0.02126951329410076, -0.016821732744574547, 0.02955683134496212, -0.055350154638290405, -0.012022311799228191, 0.07222890853881836, 0.026667675003409386, -0.013067730702459812, -0.037121858447790146, 0.014873453415930271, -0.020946383476257324, -0.019387761130928993, -0.04158864542841911, -0.023474397137761116, -0.0034380012657493353, 0.05204283073544502, -0.03050721064209938, 0.045770321041345596, -0.02480492927134037, -0.08735896646976471, 0.04025811329483986, 0.027504010125994682, -0.04786115884780884, 0.016023414209485054, 0.001555059920065105, 0.04451581835746765, -0.0012960813473910093, 0.04276711866259575, 0.033928580582141876, 0.02081333100795746, 0.04949581250548363, -0.011993801221251488, -0.008772010914981365, 0.01530112512409687, -0.01634654402732849, -0.005773561075329781, 0.02436775341629982, 0.049457795917987823, -0.0003412459627725184, 0.023987602442502975, -0.04345139116048813, 0.05200481787323952, 0.01656513102352619, -0.046188488602638245, 0.005084535107016563, 0.011233496479690075, -0.008387107402086258, -0.025204088538885117, -0.02619248442351818, -0.04189276695251465, 0.03480293229222298, 0.04854543134570122, -0.051548633724451065, 0.032617054879665375, 0.019074134528636932, 0.04223490506410599, 0.030355149880051613, 0.01659364253282547, -0.058011218905448914, 0.04675871506333351, 0.014892460778355598, -0.037216898053884506, -0.09914368391036987, -0.002485244767740369, -0.013552424497902393, -0.006186976563185453, 0.0005051866173744202, -0.022771114483475685, -0.07067028433084488, -0.04976191744208336, 0.03704582899808884, 0.04960985854268074, 0.024519814178347588, -0.019074134528636932, -0.03387155756354332, -0.06531014293432236, 0.03050721064209938, 0.056832749396562576, 0.010178574360907078, -0.013495401479303837, -0.028815533965826035, -0.03911765664815903, -0.018751004710793495, 0.005887606646865606, -0.005488446913659573, -0.03077331744134426, -0.018579937517642975, -0.021022414788603783, -0.017382457852363586, -0.038148269057273865, 0.06211686506867409, -0.00411277124658227, -0.010701283812522888, -0.03387155756354332, -0.02317027375102043, -0.026629658415913582, -0.008287317119538784, 0.032464995980262756, 0.03440377116203308, -0.05341137945652008, 0.06177472695708275, 0.011908266693353653, -0.028644464910030365, 0.023265313357114792, -0.03242697939276695, -0.04253902658820152, -0.0324079729616642, 0.025166073814034462, -0.05219489336013794, -0.05333535000681877, -0.06082434579730034, 0.006372300907969475, -0.02375951036810875, 0.006937777157872915, 0.023474397137761116, 0.04185475409030914, -0.05477992817759514, 0.059075646102428436, 0.050864361226558685, 0.0006646722904406488, -0.01927371509373188, 0.07222890853881836, -0.010995901189744473, 0.09883956611156464, -0.08720690757036209, -0.009950483217835426, 0.0025992903392761946, -0.032636065036058426, -0.005711786448955536, -0.03647559881210327, -0.004438276402652264, -0.005977892782539129, -0.015016010962426662, 0.039003610610961914, -0.05341137945652008, 0.011946281418204308, 0.005973140709102154, 0.0466826856136322, 0.019007608294487, -0.0107963215559721, 0.005350641906261444, -0.028207290917634964, 0.05390557646751404, 0.035563234239816666, 0.059645876288414, -0.02921469323337078, 0.024918975308537483, 0.005203332751989365, 0.03533514216542244, -0.019767912104725838, -0.05668068677186966, -0.06458785384893417, -0.01952081359922886, -0.02109844610095024, -0.010216589085757732, -0.013248302973806858, 0.01308673806488514, 0.000982455792836845, 0.029176678508520126, -0.004478667862713337, 0.04649261012673378, -0.041968800127506256, -0.056908778846263885, 0.04542818292975426, -0.008135256357491016, -0.037730101495981216, -0.049457795917987823, -0.045770321041345596, -0.01610894873738289, -0.025698285549879074, 0.02377851866185665, -0.03457484021782875, 0.06724891811609268, -0.03786315396428108, -0.042462997138500214, 0.043527424335479736, -0.013637959025800228, 0.0026491854805499315, -0.010463688522577286, 0.06321930885314941, -0.007508005481213331, 0.034688886255025864, 0.026325536891818047, -0.04736695811152458, -0.023303328081965446, 0.00013342450256459415, -0.05550221726298332, 0.005094039253890514, 0.05253702774643898, -0.02358844131231308, 0.019245203584432602, 0.02100340649485588, -0.0027252158615738153, 0.06899762153625488, 0.029917975887656212, -0.05367748439311981, 0.008135256357491016, 0.0021526117343455553, -0.015453185886144638, 0.01637505367398262, 0.0010270047932863235, 0.0018282943638041615, 0.005478943232446909, 0.01659364253282547, 0.010577733628451824, -0.015111048705875874, 0.011395061388611794, -0.028910571709275246, 0.012126853689551353, -0.006695430260151625, -0.025033019483089447, 0.015633758157491684, 0.002656313357874751, -0.04417368024587631, 0.02254302427172661, -0.018950585275888443, 0.026857750490307808, -0.01744898408651352, 0.022257909178733826, 0.028625458478927612, 0.010083536617457867, -0.019634859636425972, 0.013495401479303837, 0.020547224208712578, -0.04417368024587631, -0.0027418474201112986, -0.03440377116203308, 0.005298370961099863, -0.04615047201514244, 0.017734099179506302, -0.03375751152634621, -0.027180880308151245, -0.00873399619013071, -0.033567436039447784, 0.017914671450853348, 0.006405564025044441, -0.01516807172447443, 0.029138663783669472, 0.005920869763940573, 0.015681276097893715, -0.007850142195820808, -0.039003610610961914, -0.027028819546103477, 0.04546619951725006, 0.04862146079540253, -0.03276911750435829, 0.0018615575972944498, -0.09222491830587387, -0.038072239607572556, -0.044895969331264496, 0.06420770287513733, 0.005844839382916689, -0.008049721829593182, 0.038414377719163895, -0.005916118156164885, -0.008786266669631004, 0.07158265262842178 ]
39,399
pyspark.sql.pandas.map_ops
mapInPandas
Maps an iterator of batches in the current :class:`DataFrame` using a Python native function that takes and outputs a pandas DataFrame, and returns the result as a :class:`DataFrame`. The function should take an iterator of `pandas.DataFrame`\s and return another iterator of `pandas.DataFrame`\s. All columns are passed together as an iterator of `pandas.DataFrame`\s to the function and the returned iterator of `pandas.DataFrame`\s are combined as a :class:`DataFrame`. Each `pandas.DataFrame` size can be controlled by `spark.sql.execution.arrow.maxRecordsPerBatch`. The size of the function's input and output can be different. .. versionadded:: 3.0.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Parameters ---------- func : function a Python native function that takes an iterator of `pandas.DataFrame`\s, and outputs an iterator of `pandas.DataFrame`\s. schema : :class:`pyspark.sql.types.DataType` or str the return type of the `func` in PySpark. The value can be either a :class:`pyspark.sql.types.DataType` object or a DDL-formatted type string. barrier : bool, optional, default False Use barrier mode execution. .. versionadded: 3.5.0 Examples -------- >>> from pyspark.sql.functions import pandas_udf >>> df = spark.createDataFrame([(1, 21), (2, 30)], ("id", "age")) >>> def filter_func(iterator): ... for pdf in iterator: ... yield pdf[pdf.id == 1] ... >>> df.mapInPandas(filter_func, df.schema).show() # doctest: +SKIP +---+---+ | id|age| +---+---+ | 1| 21| +---+---+ Set ``barrier`` to ``True`` to force the ``mapInPandas`` stage running in the barrier mode, it ensures all Python workers in the stage will be launched concurrently. >>> df.mapInPandas(filter_func, df.schema, barrier=True).show() # doctest: +SKIP +---+---+ | id|age| +---+---+ | 1| 21| +---+---+ Notes ----- This API is experimental See Also -------- pyspark.sql.functions.pandas_udf
def mapInPandas( self, func: "PandasMapIterFunction", schema: Union[StructType, str], barrier: bool = False ) -> "DataFrame": """ Maps an iterator of batches in the current :class:`DataFrame` using a Python native function that takes and outputs a pandas DataFrame, and returns the result as a :class:`DataFrame`. The function should take an iterator of `pandas.DataFrame`\\s and return another iterator of `pandas.DataFrame`\\s. All columns are passed together as an iterator of `pandas.DataFrame`\\s to the function and the returned iterator of `pandas.DataFrame`\\s are combined as a :class:`DataFrame`. Each `pandas.DataFrame` size can be controlled by `spark.sql.execution.arrow.maxRecordsPerBatch`. The size of the function's input and output can be different. .. versionadded:: 3.0.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Parameters ---------- func : function a Python native function that takes an iterator of `pandas.DataFrame`\\s, and outputs an iterator of `pandas.DataFrame`\\s. schema : :class:`pyspark.sql.types.DataType` or str the return type of the `func` in PySpark. The value can be either a :class:`pyspark.sql.types.DataType` object or a DDL-formatted type string. barrier : bool, optional, default False Use barrier mode execution. .. versionadded: 3.5.0 Examples -------- >>> from pyspark.sql.functions import pandas_udf >>> df = spark.createDataFrame([(1, 21), (2, 30)], ("id", "age")) >>> def filter_func(iterator): ... for pdf in iterator: ... yield pdf[pdf.id == 1] ... >>> df.mapInPandas(filter_func, df.schema).show() # doctest: +SKIP +---+---+ | id|age| +---+---+ | 1| 21| +---+---+ Set ``barrier`` to ``True`` to force the ``mapInPandas`` stage running in the barrier mode, it ensures all Python workers in the stage will be launched concurrently. >>> df.mapInPandas(filter_func, df.schema, barrier=True).show() # doctest: +SKIP +---+---+ | id|age| +---+---+ | 1| 21| +---+---+ Notes ----- This API is experimental See Also -------- pyspark.sql.functions.pandas_udf """ from pyspark.sql import DataFrame from pyspark.sql.pandas.functions import pandas_udf assert isinstance(self, DataFrame) # The usage of the pandas_udf is internal so type checking is disabled. udf = pandas_udf( func, returnType=schema, functionType=PythonEvalType.SQL_MAP_PANDAS_ITER_UDF ) # type: ignore[call-overload] udf_column = udf(*[self[col] for col in self.columns]) jdf = self._jdf.mapInPandas(udf_column._jc.expr(), barrier) return DataFrame(jdf, self.sparkSession)
(self, func: 'PandasMapIterFunction', schema: Union[pyspark.sql.types.StructType, str], barrier: bool = False) -> 'DataFrame'
[ 0.06524509936571121, -0.03676479309797287, -0.0206921249628067, 0.02926294133067131, -0.05115765333175659, 0.01994766667485237, 0.009095754474401474, 0.02580789104104042, 0.0031734926160424948, -0.014020632952451706, -0.02685776725411415, -0.009033716283738613, -0.020978456363081932, 0.03554311767220497, 0.0035409494303166866, -0.026056043803691864, -0.011806346476078033, 0.04126971960067749, 0.025292497128248215, 0.04772169142961502, -0.027716757729649544, -0.019394095987081528, 0.01373430248349905, 0.053830068558454514, -0.035218607634305954, 0.05318105220794678, -0.008203358389437199, -0.040277108550071716, 0.026227841153740883, 0.028003089129924774, 0.07066628336906433, -0.004027710761874914, -0.031725380569696426, -0.034779567271471024, -0.008823741227388382, -0.013113920576870441, -0.02613239921629429, -0.005048954859375954, 0.025578826665878296, -0.06654312461614609, 0.010661025531589985, -0.016091754660010338, 0.0008661486790515482, -0.02597968839108944, -0.04440026357769966, 0.04279681295156479, -0.01034606248140335, -0.04214779660105705, 0.03888363391160965, 0.012856223620474339, 0.059060364961624146, 0.011901790276169777, 0.0022047420497983694, 0.024681659415364265, 0.003569582477211952, 0.03892181068658829, -0.07780544459819794, -0.04955420643091202, 0.01005973294377327, -0.022925501689314842, -0.005993844475597143, -0.01815333217382431, -0.04814164340496063, 0.0109569001942873, 0.003536177333444357, -0.006623771041631699, -0.00022891498520039022, -0.0438276007771492, -0.07284238934516907, 0.0066858092322945595, -0.06742120534181595, 0.013820202089846134, 0.009224602952599525, 0.06589411199092865, -0.08925865590572357, 0.012588982470333576, -0.0069578224793076515, -0.03586762398481369, -0.003266549902036786, 0.0032307584770023823, 0.028022177517414093, -0.021264785900712013, -0.046767257153987885, -0.03468412533402443, -0.0029348840471357107, -0.0007641435950063169, 0.049477849155664444, 0.0372038297355175, -0.008532638661563396, -0.032927967607975006, 0.008799879811704159, 0.017895635217428207, 0.020310351625084877, -0.007606837898492813, 0.0006287333089858294, -0.01553818304091692, -0.014077899046242237, 0.012703514657914639, -0.017342062667012215, 0.01892642304301262, -0.009114842861890793, 0.02296367846429348, 0.015414106659591198, 0.029377473518252373, 0.04146060720086098, -0.032508015632629395, -0.0016177654033526778, -0.058602236211299896, 0.00439516780897975, -0.045698292553424835, -0.040735237300395966, 0.0056502483785152435, -0.009687503799796104, -0.01433559600263834, -0.022410105913877487, 0.05031775310635567, 0.0011972179636359215, -0.02985469065606594, -0.03178264573216438, -0.02777402475476265, 0.006523555144667625, 0.048714302480220795, 0.025120697915554047, -0.12300743162631989, 0.00876647513359785, -0.044820211827754974, 0.05970938131213188, 0.012789413332939148, -0.007850218564271927, 0.07097169756889343, 0.07620199769735336, -0.01289440132677555, -0.0009484686306677759, 0.07341504842042923, 0.03687932342290878, 0.007745230570435524, 0.010174265131354332, 0.03140087425708771, -0.06035839766263962, 0.015471372753381729, 0.00892872828990221, -0.054860856384038925, 0.037165652960538864, 0.026056043803691864, -0.004144628997892141, -0.026781413704156876, 0.0259415116161108, 0.002524477429687977, -0.0075352550484240055, 0.007010316476225853, 0.021073898300528526, -0.010097909718751907, -0.03392057865858078, 0.006704897619783878, -0.051119476556777954, -0.007053266279399395, 0.0657414048910141, 0.025483382865786552, 0.04317858815193176, -0.0423005074262619, -0.024815279990434647, 0.0432167649269104, -0.048256173729896545, 0.0282321535050869, -0.05405913293361664, 0.030274640768766403, -0.017924267798662186, -0.005468905903398991, -0.011978144757449627, -0.05466996878385544, 0.06211455538868904, 0.05089041218161583, 0.05299016833305359, -0.03768104687333107, -0.029950134456157684, 0.09483254700899124, 0.05283745750784874, 0.015156409703195095, 0.008079282008111477, -0.027544960379600525, 0.006972139235585928, 0.031458139419555664, -0.0879606232047081, 0.029072055593132973, 0.006132237613201141, 0.04367489367723465, -0.053219228982925415, -0.034760478883981705, 0.05257021635770798, -0.006132237613201141, -0.04241504147648811, 0.01433559600263834, 0.010470138862729073, 0.06108376383781433, -0.036249395459890366, -0.03403510898351669, 0.018229685723781586, 0.011930422857403755, -0.03140087425708771, 0.04852341488003731, 0.05333376303315163, 0.006380390375852585, 0.017647482454776764, 0.030236463993787766, -0.047187209129333496, -0.008838057518005371, -0.053486473858356476, 0.0019327285699546337, 0.009897478856146336, -0.039857156574726105, -0.031725380569696426, -0.08689165860414505, 0.011042799800634384, 0.01552863884717226, 0.041498783975839615, 0.06047292798757553, -0.019890401512384415, 0.0038296657148748636, 0.05027957633137703, 0.01623491942882538, 0.06138918548822403, -0.014068354852497578, -0.04993597790598869, -0.03151540458202362, 0.04650001600384712, -0.0217610914260149, 0.035943977534770966, 0.025769714266061783, 0.026934122666716576, -0.034302353858947754, -0.014831901527941227, -0.054135486483573914, 0.0038893178571015596, -0.06497785449028015, 0.0025984460953623056, -0.023765401914715767, -0.002173722954466939, -0.03378695622086525, 0.026915034279227257, -0.0324125736951828, -0.007043721619993448, 0.0447438582777977, 0.05134854093194008, 0.010155175812542439, -0.03544767200946808, -0.005425956565886736, -0.020329440012574196, 0.05978573486208916, 0.03644028306007385, -0.003051802283152938, 0.028556659817695618, -0.0282321535050869, -0.008694891817867756, 0.01216903142631054, 0.01087100151926279, -0.009768630377948284, 0.038501862436532974, 0.016254007816314697, -0.023440895602107048, 0.07700372487306595, -0.008007699623703957, -0.05478450283408165, -0.04356035962700844, -0.036249395459890366, 0.013161642476916313, -0.009358223527669907, -0.009291413240134716, -0.01073738094419241, 0.022581905126571655, 0.04306405410170555, 0.027659492567181587, 0.022161953151226044, 0.023650869727134705, 0.014726914465427399, 0.03397784382104874, -0.025006165727972984, -0.03016010858118534, -0.043445829302072525, 0.022009244188666344, -0.06173278018832207, -0.003560038283467293, -0.05589164420962334, -0.042224153876304626, -0.03787193447351456, -0.04798893257975578, -0.015337752178311348, -0.005263702478259802, 0.02970198169350624, 0.03493227809667587, -0.03365333750844002, -0.048714302480220795, -0.015175498090684414, -0.03157266974449158, -0.014077899046242237, -0.048828836530447006, 0.0330234095454216, 0.035657647997140884, -0.05955667048692703, -0.045240163803100586, -0.040926121175289154, -0.024509860202670097, -0.07433130592107773, 0.005998616572469473, 0.11575373262166977, -0.013381162658333778, -0.016702592372894287, 0.001766895642504096, -0.018391940742731094, -0.02118843048810959, 0.013982456177473068, 0.0076163820922374725, 0.01604403369128704, -0.040582526475191116, -0.029377473518252373, -0.042987700551748276, -0.058907657861709595, -0.02254372648894787, 0.06791751086711884, 0.019260475412011147, 0.021054809913039207, -0.022314663976430893, 0.009048032574355602, 0.020081287249922752, 0.02534976229071617, 0.021054809913039207, 0.09376358240842819, 0.0404679961502552, -0.024872545152902603, 0.03514225408434868, 0.017637936398386955, 0.020596683025360107, 0.006241997238248587, 0.05848770588636398, -0.014373773708939552, -0.02220013178884983, -0.004829435143619776, -0.013915644958615303, -0.03197353333234787, 0.002031750977039337, 0.02924385294318199, 0.01696028932929039, -0.015299574472010136, 0.06230543926358223, -0.06241997331380844, -0.017971988767385483, 0.006790796760469675, -0.013562505133450031, 0.03605851158499718, -0.010403328575193882, 0.05886947736144066, 0.07303328067064285, 0.0333288311958313, -0.006848062854260206, 0.05764780193567276, -0.022925501689314842, 0.014975067228078842, -0.006695353426039219, 0.056082531809806824, -0.026685969904065132, 0.025139788165688515, 0.04955420643091202, -0.09177836030721664, 0.04417119920253754, -0.05329558625817299, 0.07784362137317657, -0.0008965712622739375, -0.044629327952861786, -0.01215948723256588, 0.007974294945597649, -0.004383237566798925, 0.030942745506763458, -0.00506804371252656, -0.006895784288644791, -0.009267552755773067, -0.0013791569508612156, -0.009272324852645397, -0.04695814475417137, 0.03300432115793228, -0.047798044979572296, 0.06341258436441422, -0.00012280879309400916, -0.08834239840507507, 0.049897801131010056, 0.016158564016222954, 0.02777402475476265, 0.006222908850759268, 0.0228300578892231, -0.0570751428604126, 0.010937811806797981, -0.03749015927314758, -0.0333288311958313, 0.039971690624952316, 0.0102697080001235, -0.0013612612383440137, 0.0009693468455225229, -0.03708929941058159, -0.037471070885658264, 0.0017322973581030965, 0.06562686711549759, -0.048714302480220795, -0.03792919963598251, -0.03464594855904579, -0.0342450849711895, 0.02147476188838482, 0.01994766667485237, 0.013295263051986694, 0.0019506241660565138, -0.036115776747465134, -0.016721680760383606, 0.03243166208267212, 0.01081373542547226, -0.029644714668393135, 0.0004163717676419765, 0.012130853720009327, -0.011166876181960106, 0.09483254700899124, -0.013028021901845932, -0.018382396548986435, 0.034302353858947754, 0.005626387428492308, 0.07769091427326202, -0.025158876553177834, -0.02672414667904377, 0.01578633487224579, -0.028041265904903412, -0.06616135686635971, 0.02611330896615982, 0.0022763246670365334, -0.009706592187285423, 0.04562193900346756, -0.012254930101335049, -0.05272292345762253, -0.0737968236207962, 0.008160409517586231, -0.01494643371552229, 0.030560972169041634, -0.019441816955804825, 0.05360100418329239, 0.026781413704156876, 0.032794345170259476, 0.0701318010687828, 0.013018477708101273, 0.012856223620474339, -0.049745090305805206, 0.0008130583446472883, 0.021207520738244057, -0.03508498892188072, 0.04084976762533188, -0.026342373341321945, 0.034168731421232224, 0.06745938211679459, -0.025750624015927315, 0.015041877515614033, 0.016273096203804016, -0.017322974279522896, 0.01592950150370598, 0.01650216057896614, -0.03405420109629631, -0.0842955932021141, 0.037585604935884476, 0.049134254455566406, -0.01215948723256588, -0.048256173729896545, -0.0108041912317276, -0.000020747751477756537, 0.052913811057806015, -0.05589164420962334, 0.012531716376543045, -0.02733498439192772, -0.0038034189492464066, 0.0378146693110466, -0.04378942400217056, -0.013887012377381325, -0.04336947202682495, 0.056197065860033035, 0.05928942933678627, -0.09781038016080856, 0.016244463622570038, 0.024509860202670097, 0.038654569536447525, -0.056082531809806824, -0.031458139419555664, 0.07429312914609909, 0.016282640397548676, 0.03046552836894989, -0.08895323425531387, 0.028862079605460167, 0.0006567697855643928, 0.019623160362243652, 0.019460905343294144, -0.0067239864729344845, 0.04237686097621918, 0.06459607928991318, 0.0019911876879632473, -0.004743536002933979, -0.0005258333985693753, 0.051386717706918716, 0.06978820264339447, 0.05600617825984955, -0.04302587732672691, 0.010021555237472057, 0.004784099757671356, -0.05150124803185463, 0.02399446628987789, 0.019002778455615044, -0.030083755031228065, 0.010183809325098991, 0.002970675239339471, -0.06994090974330902, -0.025311585515737534, -0.04806528985500336, -0.023517249152064323, -0.008365612477064133, 0.035791270434856415, -0.02239101752638817, 0.021837446838617325, 0.056655190885066986, 0.003354834858328104, 0.013829746283590794, -0.03676479309797287, 0.0072966464795172215, -0.024719836190342903, 0.016731224954128265, -0.016091754660010338, -0.0025984460953623056, 0.0229827668517828, 0.037471070885658264, -0.003631620667874813, 0.0260942205786705, -0.001231219619512558, -0.08872416615486145, 0.030217375606298447, 0.019623160362243652, -0.08032514899969101, 0.024261707440018654, -0.0063422126695513725, 0.05864041671156883, -0.007396862376481295, 0.03693658858537674, 0.047645337879657745, 0.01966133713722229, 0.05447908490896225, 0.029988311231136322, -0.0015294802142307162, 0.02115025371313095, -0.023669959977269173, -0.013562505133450031, 0.005941350478678942, 0.0660468190908432, 0.0058459071442484856, 0.008561271242797375, -0.0345505066215992, 0.0345505066215992, 0.05451726168394089, -0.004564580041915178, -0.007778635714203119, -0.011930422857403755, 0.03525678440928459, -0.040162574499845505, -0.021207520738244057, -0.03344336152076721, 0.012350373901426792, 0.060854703187942505, -0.06688672304153442, 0.0031925812363624573, 0.01682666875422001, 0.045240163803100586, 0.008570815436542034, 0.010508316569030285, -0.05394459888339043, 0.04653819277882576, 0.016244463622570038, -0.02970198169350624, -0.10116998851299286, 0.0018217755714431405, -0.007520938757807016, -0.015576359815895557, -0.013257086277008057, -0.036383017897605896, -0.06009115278720856, -0.07078081369400024, 0.01785745657980442, 0.0827684998512268, 0.017609303817152977, -0.031324516981840134, -0.023230919614434242, -0.04172784835100174, 0.01417334284633398, 0.03932267427444458, -0.0086376266553998, -0.020539416000247, -0.04695814475417137, -0.03395875543355942, -0.023937201127409935, 0.01141502894461155, 0.009429805912077427, -0.05031775310635567, -0.039857156574726105, 0.013743847608566284, -0.010097909718751907, -0.026056043803691864, 0.04520198702812195, -0.014660104177892208, -0.012627159245312214, -0.014087443239986897, -0.009582515805959702, -0.012207209132611752, -0.005087132565677166, 0.028136709704995155, 0.013333440758287907, -0.04348400607705116, 0.053371939808130264, 0.03273708000779152, -0.032030798494815826, 0.050814058631658554, -0.019060043618083, -0.04638548567891121, -0.052608393132686615, 0.0202339980751276, -0.05550987273454666, -0.04577464610338211, -0.020940277725458145, 0.014488305896520615, -0.021379318088293076, 0.002486300189048052, 0.01966133713722229, 0.032641638070344925, -0.028785724192857742, 0.027354074642062187, 0.03470321372151375, 0.0038511406164616346, 0.01072783675044775, 0.07108623534440994, -0.005969983525574207, 0.08780791610479355, -0.08238673210144043, -0.00011878227087436244, -0.015881778672337532, -0.0459655337035656, 0.005717058666050434, -0.027659492567181587, -0.03586762398481369, 0.01592950150370598, -0.023307275027036667, 0.037738315761089325, -0.05115765333175659, 0.013085287995636463, 0.004447661805897951, 0.05386824533343315, 0.01618719846010208, -0.0007402827613987029, -0.00953479390591383, -0.011224142275750637, 0.024528950452804565, 0.05543351545929909, 0.04932514205574989, -0.022486461326479912, 0.025731535628437996, 0.01553818304091692, 0.04573646932840347, -0.01979495771229267, -0.05039410665631294, -0.027086831629276276, -0.006509238854050636, -0.00891918409615755, -0.006041566375643015, -0.010699203237891197, 0.0007044914527796209, 0.023937201127409935, 0.03958991542458534, -0.017351606860756874, 0.049134254455566406, -0.06860470771789551, -0.045698292553424835, 0.038654569536447525, -0.00892872828990221, -0.060587458312511444, -0.0413842499256134, -0.04550740495324135, -0.011128698475658894, -0.017370695248246193, 0.031458139419555664, -0.040009867399930954, 0.06261085718870163, -0.03554311767220497, -0.039857156574726105, 0.0734914019703865, -0.053486473858356476, 0.019060043618083, -0.011290952563285828, 0.07089534401893616, -0.028480306267738342, 0.0075782048515975475, 0.021112076938152313, -0.02912932075560093, 0.0075734322890639305, 0.009028944186866283, -0.03079003468155861, 0.020634859800338745, 0.05543351545929909, -0.03722291812300682, 0.012951667420566082, 0.03346244990825653, 0.02252463810145855, 0.07940889894962311, 0.03275616839528084, -0.04619459807872772, 0.01801971159875393, 0.016024943441152573, -0.041651491075754166, -0.00135052390396595, -0.012646248564124107, 0.029663803055882454, 0.017466139048337936, 0.00003659284266177565, 0.015213675796985626, -0.027125010266900063, 0.010231530293822289, 0.0053734625689685345, 0.009730452671647072, 0.025139788165688515, -0.02834668569266796, 0.025426117703318596, 0.018840523436665535, -0.027201363816857338, -0.011367307044565678, -0.014240153133869171, 0.049745090305805206, 0.010909179225564003, 0.013171186670660973, 0.03623030707240105, 0.017962444573640823, -0.0025507244281470776, -0.00506804371252656, 0.0162062868475914, -0.046309128403663635, -0.002240533474832773, -0.010641937144100666, -0.02628510817885399, -0.03962809219956398, 0.012503082863986492, -0.029530182480812073, -0.03649754822254181, -0.02130296267569065, -0.010766013525426388, 0.02372722513973713, 0.016149019822478294, -0.021245697513222694, 0.025597915053367615, 0.0027249085251241922, 0.025483382865786552, -0.026819590479135513, -0.05822046473622322, -0.011882700957357883, 0.024815279990434647, 0.057876866310834885, -0.033844225108623505, 0.013801113702356815, -0.06639041751623154, -0.02027217485010624, -0.046461839228868484, 0.04859977215528488, 0.023975377902388573, 0.005507083144038916, 0.04378942400217056, -0.0024457366671413183, -0.011806346476078033, 0.05944214016199112 ]
39,400
pyspark.sql.dataframe
melt
Unpivot a DataFrame from wide format to long format, optionally leaving identifier columns set. This is the reverse to `groupBy(...).pivot(...).agg(...)`, except for the aggregation, which cannot be reversed. :func:`melt` is an alias for :func:`unpivot`. .. versionadded:: 3.4.0 Parameters ---------- ids : str, Column, tuple, list, optional Column(s) to use as identifiers. Can be a single column or column name, or a list or tuple for multiple columns. values : str, Column, tuple, list, optional Column(s) to unpivot. Can be a single column or column name, or a list or tuple for multiple columns. If not specified or empty, use all columns that are not set as `ids`. variableColumnName : str Name of the variable column. valueColumnName : str Name of the value column. Returns ------- :class:`DataFrame` Unpivoted DataFrame. See Also -------- DataFrame.unpivot Notes ----- Supports Spark Connect.
def melt( self, ids: Union["ColumnOrName", List["ColumnOrName"], Tuple["ColumnOrName", ...]], values: Optional[Union["ColumnOrName", List["ColumnOrName"], Tuple["ColumnOrName", ...]]], variableColumnName: str, valueColumnName: str, ) -> "DataFrame": """ Unpivot a DataFrame from wide format to long format, optionally leaving identifier columns set. This is the reverse to `groupBy(...).pivot(...).agg(...)`, except for the aggregation, which cannot be reversed. :func:`melt` is an alias for :func:`unpivot`. .. versionadded:: 3.4.0 Parameters ---------- ids : str, Column, tuple, list, optional Column(s) to use as identifiers. Can be a single column or column name, or a list or tuple for multiple columns. values : str, Column, tuple, list, optional Column(s) to unpivot. Can be a single column or column name, or a list or tuple for multiple columns. If not specified or empty, use all columns that are not set as `ids`. variableColumnName : str Name of the variable column. valueColumnName : str Name of the value column. Returns ------- :class:`DataFrame` Unpivoted DataFrame. See Also -------- DataFrame.unpivot Notes ----- Supports Spark Connect. """ return self.unpivot(ids, values, variableColumnName, valueColumnName)
(self, ids: Union[ForwardRef('ColumnOrName'), List[ForwardRef('ColumnOrName')], Tuple[ForwardRef('ColumnOrName'), ...]], values: Union[ForwardRef('ColumnOrName'), List[ForwardRef('ColumnOrName')], Tuple[ForwardRef('ColumnOrName'), ...], NoneType], variableColumnName: str, valueColumnName: str) -> 'DataFrame'
[ 0.017592305317521095, -0.0037071125116199255, 0.018183261156082153, -0.056731779128313065, -0.013473797589540482, 0.015737613663077354, 0.015401222743093967, 0.015810346230864525, -0.07556963711977005, 0.003307080827653408, -0.020910751074552536, 0.029165951535105705, -0.025729315355420113, 0.06680530309677124, -0.006532337050884962, 0.029311418533325195, 0.004036684054881334, 0.053531523793935776, 0.0773879662156105, 0.009382563643157482, 0.027656741440296173, 0.024692870676517487, -0.015755796805024147, 0.018083253875374794, 0.00028255084180273116, -0.039784979075193405, 0.013737454079091549, -0.03731205314397812, 0.006064117886126041, 0.04022137448191643, -0.018110528588294983, 0.05164046585559845, 0.013701087795197964, -0.023056376725435257, -0.07986088842153549, -0.07462410628795624, 0.02976600080728531, -0.01339197251945734, 0.013328330591320992, -0.040839605033397675, 0.0700782909989357, -0.02776584029197693, 0.11019057035446167, -0.012155510485172272, -0.0434579961001873, -0.03091154620051384, -0.006136850919574499, -0.10735397785902023, 0.004945847205817699, 0.015473956242203712, 0.006886910647153854, 0.03091154620051384, -0.02414737269282341, 0.026438463479280472, 0.0023274575360119343, 0.11790026724338531, -0.009146180935204029, 0.00369574804790318, 0.022674527019262314, 0.00007862839993322268, -0.050040338188409805, 0.007650607265532017, -0.032802604138851166, 0.0075596910901367664, 0.00011904354323633015, -0.014637526124715805, 0.05895013362169266, 0.005227687768638134, -0.11520914733409882, 0.014710258692502975, -0.07869715988636017, 0.014910275116562843, 0.0048685683868825436, 0.07018738985061646, 0.027147609740495682, -0.013028306886553764, -0.0028161327354609966, -0.009782594628632069, -0.009146180935204029, -0.02371097356081009, -0.009391655214130878, -0.012373710051178932, -0.03534826263785362, 0.011810028925538063, 0.008200651034712791, 0.015083015896379948, 0.03278442099690437, 0.06702350080013275, 0.020474353805184364, -0.014473876915872097, -0.021256232634186745, 0.012628275901079178, -0.022110845893621445, -0.0033979970030486584, -0.009664404205977917, -0.02776584029197693, -0.0008046093280427158, 0.03538462892174721, -0.04527632147073746, 0.03438454866409302, 0.01623765379190445, -0.10386279225349426, -0.005877739284187555, -0.021056218072772026, 0.0056913611479103565, -0.038148485124111176, -0.0007324445177800953, 0.02763855829834938, -0.03574829176068306, -0.06309591978788376, 0.0336935855448246, -0.018783310428261757, 0.010319001041352749, 0.06415054947137833, -0.049313005059957504, -0.018055979162454605, -0.07876989245414734, -0.005186775699257851, -0.02763855829834938, 0.029602350667119026, -0.09593489021062851, 0.0030706983525305986, -0.01413748599588871, -0.08851611614227295, -0.03825758397579193, 0.0356573760509491, 0.0079960897564888, -0.05782277137041092, -0.018137803301215172, 0.027474908158183098, -0.07556963711977005, -0.020892567932605743, -0.006318683736026287, 0.036566540598869324, -0.02072891779243946, -0.022056296467781067, 0.05945926532149315, -0.0017024079570546746, 0.06825996190309525, 0.02292909286916256, -0.04585818573832512, 0.05084040015935898, 0.009909877553582191, 0.010555383749306202, -0.019783388823270798, -0.039203111082315445, 0.08218834549188614, 0.02372915670275688, -0.04294886440038681, 0.01392837893217802, -0.07578783482313156, -0.024383753538131714, 0.021419882774353027, 0.026092980057001114, 0.00860522873699665, -0.00932801328599453, 0.0019558370113372803, 0.015619422309100628, 0.019346991553902626, -0.014173852279782295, -0.008327933959662914, 0.0059050144627690315, -0.0021876737009733915, 0.013864737004041672, -0.022274496033787727, -0.00865523237735033, 0.05996839702129364, 0.007950630970299244, -0.005836827214807272, 0.03869398310780525, 0.010800858028233051, 0.014764809049665928, 0.04123963788151741, -0.04233063384890556, -0.02422010526061058, -0.046330951154232025, 0.03602104261517525, -0.04160330444574356, 0.010628116317093372, 0.05924106761813164, -0.04807654395699501, -0.024820152670145035, -0.044985391199588776, -0.034439098089933395, 0.00413214648142457, -0.021256232634186745, -0.004854931030422449, 0.005404974799603224, 0.03191162645816803, -0.008768877945840359, -0.05062220245599747, -0.08415213972330093, 0.029147768393158913, 0.0644778460264206, -0.051022231578826904, -0.023201841861009598, 0.05953200161457062, -0.045058123767375946, 0.02192901447415352, -0.04734921455383301, 0.036002859473228455, -0.007355129346251488, 0.04116690531373024, 0.0002670666726771742, 0.012973757460713387, 0.01741047389805317, -0.03069334663450718, -0.08066094666719437, -0.011919127777218819, -0.02449285425245762, 0.01921970769762993, -0.02940233424305916, 0.004882205743342638, 0.025438383221626282, -0.013555621728301048, 0.009573487564921379, -0.03196617588400841, -0.019601555541157722, 0.03869398310780525, 0.002904776018112898, 0.06116849184036255, 0.0006551656406372786, -0.02869318798184395, 0.037930283695459366, -0.005314058158546686, -0.04778561368584633, -0.0054277037270367146, 0.017037715762853622, 0.008955256082117558, -0.01231915969401598, 0.026511196047067642, -0.04851294308900833, 0.002704760292544961, -0.027165792882442474, -0.03098427876830101, 0.017719589173793793, 0.02905685268342495, -0.05622264742851257, 0.05356789007782936, 0.023310942575335503, -0.018783310428261757, -0.009746228344738483, 0.07193298637866974, -0.0019978859927505255, 0.002203583950176835, 0.0021138042211532593, -0.044403526932001114, 0.06680530309677124, -0.05382245406508446, -0.008618866093456745, 0.015292122960090637, -0.01719227433204651, 0.04087597131729126, 0.016364935785531998, 0.028474988415837288, -0.007005101535469294, -0.009309830144047737, -0.028875019401311874, -0.018255995586514473, -0.02300182729959488, 0.02514745108783245, -0.022674527019262314, -0.004932209849357605, 0.06822359561920166, -0.028038589283823967, -0.03967587649822235, -0.030584245920181274, -0.007164205424487591, -0.01606491208076477, 0.004259428940713406, 0.014955732971429825, 0.023801889270544052, 0.006818723399192095, 0.0280749574303627, 0.016055820509791374, 0.03982134535908699, 0.009591670706868172, -0.06465967744588852, -0.01310104038566351, -0.03483913093805313, 0.01741047389805317, -0.07527870684862137, -0.008837065659463406, 0.0017149088671430945, 0.018910592421889305, -0.007855169475078583, -0.0077733444049954414, -0.012282793410122395, -0.0038821264170110226, 0.003925311844795942, 0.011719112284481525, 0.002402463462203741, -0.02663847804069519, 0.02720215916633606, -0.06240495666861534, -0.002568385796621442, -0.04593091830611229, -0.0010569021105766296, -0.0297841839492321, -0.03136612847447395, -0.019928855821490288, -0.03582102432847023, -0.008973440155386925, 0.05564078316092491, -0.008277930319309235, -0.037712085992097855, 0.010837224312126637, 0.0009563259081915021, 0.035511910915374756, -0.019892489537596703, 0.07244211435317993, 0.04465809091925621, -0.028020406141877174, -0.05178593099117279, 0.028529537841677666, -0.0013637446099892259, 0.003598012961447239, -0.015573963522911072, 0.001454660901799798, 0.05749547481536865, 0.00916890986263752, -0.05735000967979431, 0.005673177540302277, -0.007091472391039133, 0.0059050144627690315, 0.0744786411523819, 0.021183500066399574, -0.03140249475836754, 0.014910275116562843, -0.05578624829649925, 0.010055343620479107, -0.0043367077596485615, 0.015119382180273533, -0.055604416877031326, 0.0522586964070797, -0.08967984467744827, -0.06527791172266006, 0.022383594885468483, 0.053095124661922455, 0.016519494354724884, 0.04429442808032036, -0.02947506681084633, -0.017255915328860283, -0.05662267655134201, 0.00042446551378816366, 0.05756820738315582, 0.007468774914741516, 0.0069732810370624065, 0.03945767879486084, 0.011810028925538063, -0.020747102797031403, 0.03894854709506035, -0.01880149357020855, -0.02556566707789898, 0.012601000256836414, -0.02251087874174118, -0.046621885150671005, 0.04065777361392975, -0.0056686317548155785, -0.011546371504664421, -0.019201524555683136, -0.003934403415769339, 0.011137248016893864, 0.013255598023533821, 0.014437509700655937, -0.0715329498052597, -0.011019056662917137, -0.04480355605483055, -0.019074242562055588, -0.020110687240958214, -0.008564316667616367, 0.02776584029197693, 0.04651278257369995, 0.026474829763174057, -0.04887660965323448, 0.048258379101753235, -0.03318445384502411, -0.017546847462654114, 0.021547164767980576, -0.009582579135894775, 0.09317103773355484, -0.06433238089084625, 0.05905923619866371, 0.006955097895115614, 0.017565030604600906, -0.03069334663450718, -0.02243814617395401, -0.03254804015159607, -0.05556804686784744, 0.03840304911136627, 0.039348579943180084, 0.01687406748533249, -0.028329521417617798, 0.0006227767444215715, 0.04742194712162018, -0.012237335555255413, 0.03069334663450718, -0.007605149410665035, 0.019837938249111176, -0.03865761682391167, 0.014828450046479702, 0.025311101227998734, -0.0012876022374257445, 0.04378529638051987, -0.005964110139757395, -0.00004488992635742761, 0.09186183661222458, -0.044330794364213943, -0.03569374233484268, -0.0048367478884756565, 0.09724408388137817, -0.0027206705417484045, -0.0332026369869709, -0.03673018887639046, 0.04465809091925621, 0.004791289567947388, -0.03027513064444065, -0.011628195643424988, 0.04793107882142067, -0.004304887261241674, 0.010791766457259655, 0.00701419310644269, 0.001034173066727817, -0.012328251264989376, -0.0732421800494194, -0.015755796805024147, -0.0644778460264206, -0.059022869914770126, -0.01146454643458128, -0.009141635149717331, -0.0016808152431622148, -0.01836509443819523, 0.02585659921169281, -0.013510163873434067, 0.04131237044930458, -0.006750536151230335, 0.007609695196151733, 0.004348072689026594, 0.0008989350171759725, 0.011582737788558006, 0.024656502529978752, -0.030584245920181274, 0.008746149018406868, -0.01936517469584942, -0.03642107546329498, -0.041203271597623825, 0.0021388062741607428, 0.02363824099302292, -0.06815086305141449, 0.004791289567947388, 0.07295124977827072, 0.030656980350613594, 0.023310942575335503, -0.00954621285200119, 0.011491821147501469, -0.024383753538131714, -0.07266031205654144, 0.04396712779998779, 0.008705236949026585, 0.015273939818143845, 0.02871137112379074, -0.09113451093435287, -0.013673813082277775, 0.007786981761455536, -0.016728600487113, 0.030329681932926178, -0.0034957320895045996, -0.07506050914525986, -0.006932368502020836, 0.012419167906045914, -0.0075324163772165775, -0.015010282397270203, 0.03569374233484268, 0.020983483642339706, -0.051604095846414566, -0.0018501469166949391, -0.028529537841677666, 0.0037980289198458195, -0.0598229318857193, 0.018910592421889305, -0.0010068981209769845, 0.0341845341026783, 0.004077596589922905, 0.005918651819229126, 0.015855804085731506, 0.00804609339684248, -0.01179184578359127, 0.003270714310929179, 0.04065777361392975, 0.036130141466856, -0.0007665381417609751, -0.022165397182106972, -0.007441500201821327, 0.005045855417847633, -0.006405054125934839, -0.01438296027481556, -0.03054787963628769, 0.010891773737967014, 0.004886751528829336, -0.029820550233125687, -0.012873749248683453, -0.04734921455383301, 0.019783388823270798, 0.009355287998914719, 0.008877977728843689, 0.007955176755785942, 0.09724408388137817, 0.01499209925532341, -0.05291329324245453, -0.0627322569489479, -0.04407622665166855, -0.07109655439853668, -0.06233222037553787, 0.03120247833430767, 0.035857394337654114, -0.018574202433228493, -0.014728441834449768, 0.033293552696704865, -0.011510005220770836, -0.03945767879486084, 0.005300420802086592, 0.013591988012194633, -0.017692314460873604, 0.05022216960787773, -0.03883944824337959, 0.02436557039618492, -0.0366210900247097, 0.030856994912028313, 0.0001865204976638779, 0.000564533460419625, -0.027584008872509003, -0.043276164680719376, 0.021238049492239952, -0.05233142897486687, 0.013764729723334312, -0.0808064192533493, -0.03360266983509064, -0.033366285264492035, -0.027602192014455795, 0.022619977593421936, -0.011028148233890533, 0.033802684396505356, -0.07069652527570724, -0.055240750312805176, -0.059422899037599564, -0.05156772956252098, -0.037930283695459366, 0.02712942659854889, 0.06095029413700104, -0.00032871929579414427, -0.006532337050884962, -0.021747181192040443, 0.021747181192040443, 0.028184056282043457, -0.0625140517950058, -0.04011227563023567, 0.008705236949026585, 0.007736978121101856, -0.051531363278627396, 0.014855724759399891, 0.027402175590395927, 0.011964586563408375, 0.09622582048177719, -0.003216164419427514, 0.002359278267249465, 0.049240272492170334, 0.03167524188756943, -0.023601874709129333, -0.026620294898748398, 0.01797415502369404, -0.014110211282968521, 0.018474193289875984, 0.02300182729959488, -0.003038877621293068, 0.023547323420643806, 0.03432999923825264, 0.04636731743812561, -0.004668552428483963, -0.01716499961912632, -0.0017478660447522998, -0.03323900327086449, 0.04062140733003616, -0.012028227560222149, -0.0001859522599261254, 0.020747102797031403, 0.06662347167730331, -0.007327854633331299, 0.028656821697950363, 0.10844497382640839, 0.03611195832490921, -0.016646776348352432, 0.013919287361204624, 0.005918651819229126, 0.0020626636687666178, -0.012946482747793198, 0.03252985700964928, -0.01726500689983368, -0.022419961169362068, 0.04382166266441345, 0.014219311065971851, -0.010391734540462494, 0.015828529372811317, -0.009050718508660793, 0.007700611371546984, 0.010173534974455833, -0.07051468640565872, 0.02278362773358822, 0.02707487717270851, -0.003468457143753767, 0.024183738976716995, 0.025892965495586395, -0.03840304911136627, 0.03880308195948601, 0.04629458487033844, 0.050876766443252563, 0.01994703896343708, 0.02251087874174118, -0.04051230847835541, -0.008891615085303783, -0.06295045465230942, -0.015901261940598488, -0.016855884343385696, -0.0011142930015921593, 0.027402175590395927, 0.05305875837802887, 0.05414975434541702, -0.0029502343386411667, -0.009982611052691936, -0.061204858124256134, 0.05749547481536865, 0.031093377619981766, 0.01774686388671398, 0.012191876769065857, 0.023547323420643806, -0.03513006120920181, 0.0434579961001873, -0.005277691874653101, -0.015010282397270203, -0.025529298931360245, -0.021201683208346367, 0.054949816316366196, -0.022965459153056145, 0.044403526932001114, 0.02336549200117588, -0.006405054125934839, -0.005377699621021748, -0.02456558682024479, -0.019274257123470306, -0.03494822978973389, 0.0013307874323800206, -0.004891297314316034, 0.01093723252415657, -0.014264768920838833, -0.021892648190259933, 0.07709702849388123, 0.05105859786272049, -0.026729395613074303, -0.012328251264989376, 0.02109258435666561, 0.03140249475836754, 0.05720454081892967, -0.0344209149479866, 0.06498698145151138, -0.00042815899359993637, 0.08698872476816177, 0.022747261449694633, 0.012137327343225479, 0.02771129086613655, 0.037639353424310684, 0.05527711659669876, 0.02614753134548664, 0.0024092821404337883, -0.007586966268718243, -0.003138885600492358, 0.019601555541157722, -0.05425885319709778, -0.03782118484377861, -0.06004112958908081, -0.004804926924407482, 0.021038034930825233, -0.02707487717270851, 0.012901023961603642, 0.023274574428796768, 0.004375347401946783, -0.026020247489213943, -0.051822297275066376, -0.004686735570430756, 0.008455216884613037, -0.03982134535908699, -0.06087756156921387, 0.06262315064668655, 0.013992019928991795, -0.041057806462049484, 0.05425885319709778, -0.05422248691320419, 0.03876671567559242, 0.029038669541478157, -0.07927902042865753, 0.036712005734443665, 0.053895190358161926, -0.05604081228375435, -0.029875099658966064, 0.024547403678297997, 0.0025592942256480455, 0.05284056067466736, 0.07233301550149918, 0.03818485140800476, 0.03405724838376045, 0.008859794586896896, -0.006473241373896599, -0.012137327343225479, 0.034511830657720566, 0.009127997793257236, 0.04349436238408089, 0.05676814541220665, -0.05251326039433479, -0.029729632660746574, 0.005523165687918663, 0.012228243984282017, 0.0410214401781559, 0.05214959383010864, 0.023947356268763542, 0.004643550608307123, -0.026456646621227264, 0.0332026369869709, -0.005895922891795635, 0.026329362764954567, 0.06575067341327667, 0.010173534974455833, -0.03703930601477623, 0.072260282933712, 0.06047752872109413, -0.0012739647645503283, 0.03091154620051384, 0.018928775563836098, -0.021692631766200066, 0.02812950685620308, 0.00739149609580636, 0.02065618522465229, 0.04323979839682579, -0.0042253355495631695, -0.056077178567647934, -0.0049185724928975105, 0.006455058231949806, -0.010837224312126637, -0.0030206944793462753, 0.021547164767980576, 0.003645743941888213, -0.03731205314397812, 0.04116690531373024, 0.01274646632373333, 0.03191162645816803, -0.09898968040943146, 0.0034866405185312033, 0.08415213972330093, -0.031857073307037354, 0.02705669403076172, -0.009518937207758427, -0.005182229448109865, -0.09418929368257523, -0.037930283695459366, 0.032293472439050674, 0.02712942659854889, -0.010428100824356079, -0.02507471852004528, 0.0485856756567955, 0.054658886045217514, 0.006045934744179249 ]
39,401
pyspark.sql.dataframe
observe
Define (named) metrics to observe on the DataFrame. This method returns an 'observed' DataFrame that returns the same result as the input, with the following guarantees: * It will compute the defined aggregates (metrics) on all the data that is flowing through the Dataset at that point. * It will report the value of the defined aggregate columns as soon as we reach a completion point. A completion point is either the end of a query (batch mode) or the end of a streaming epoch. The value of the aggregates only reflects the data processed since the previous completion point. The metrics columns must either contain a literal (e.g. lit(42)), or should contain one or more aggregate functions (e.g. sum(a) or sum(a + b) + avg(c) - lit(1)). Expressions that contain references to the input Dataset's columns must always be wrapped in an aggregate function. A user can observe these metrics by adding Python's :class:`~pyspark.sql.streaming.StreamingQueryListener`, Scala/Java's ``org.apache.spark.sql.streaming.StreamingQueryListener`` or Scala/Java's ``org.apache.spark.sql.util.QueryExecutionListener`` to the spark session. .. versionadded:: 3.3.0 .. versionchanged:: 3.5.0 Supports Spark Connect. Parameters ---------- observation : :class:`Observation` or str `str` to specify the name, or an :class:`Observation` instance to obtain the metric. .. versionchanged:: 3.4.0 Added support for `str` in this parameter. exprs : :class:`Column` column expressions (:class:`Column`). Returns ------- :class:`DataFrame` the observed :class:`DataFrame`. Notes ----- When ``observation`` is :class:`Observation`, this method only supports batch queries. When ``observation`` is a string, this method works for both batch and streaming queries. Continuous execution is currently not supported yet. Examples -------- When ``observation`` is :class:`Observation`, only batch queries work as below. >>> from pyspark.sql.functions import col, count, lit, max >>> from pyspark.sql import Observation >>> df = spark.createDataFrame([(2, "Alice"), (5, "Bob")], schema=["age", "name"]) >>> observation = Observation("my metrics") >>> observed_df = df.observe(observation, count(lit(1)).alias("count"), max(col("age"))) >>> observed_df.count() 2 >>> observation.get {'count': 2, 'max(age)': 5} When ``observation`` is a string, streaming queries also work as below. >>> from pyspark.sql.streaming import StreamingQueryListener >>> class MyErrorListener(StreamingQueryListener): ... def onQueryStarted(self, event): ... pass ... ... def onQueryProgress(self, event): ... row = event.progress.observedMetrics.get("my_event") ... # Trigger if the number of errors exceeds 5 percent ... num_rows = row.rc ... num_error_rows = row.erc ... ratio = num_error_rows / num_rows ... if ratio > 0.05: ... # Trigger alert ... pass ... ... def onQueryIdle(self, event): ... pass ... ... def onQueryTerminated(self, event): ... pass ... >>> spark.streams.addListener(MyErrorListener()) >>> # Observe row count (rc) and error row count (erc) in the streaming Dataset ... observed_ds = df.observe( ... "my_event", ... count(lit(1)).alias("rc"), ... count(col("error")).alias("erc")) # doctest: +SKIP >>> observed_ds.writeStream.format("console").start() # doctest: +SKIP
def observe( self, observation: Union["Observation", str], *exprs: Column, ) -> "DataFrame": """Define (named) metrics to observe on the DataFrame. This method returns an 'observed' DataFrame that returns the same result as the input, with the following guarantees: * It will compute the defined aggregates (metrics) on all the data that is flowing through the Dataset at that point. * It will report the value of the defined aggregate columns as soon as we reach a completion point. A completion point is either the end of a query (batch mode) or the end of a streaming epoch. The value of the aggregates only reflects the data processed since the previous completion point. The metrics columns must either contain a literal (e.g. lit(42)), or should contain one or more aggregate functions (e.g. sum(a) or sum(a + b) + avg(c) - lit(1)). Expressions that contain references to the input Dataset's columns must always be wrapped in an aggregate function. A user can observe these metrics by adding Python's :class:`~pyspark.sql.streaming.StreamingQueryListener`, Scala/Java's ``org.apache.spark.sql.streaming.StreamingQueryListener`` or Scala/Java's ``org.apache.spark.sql.util.QueryExecutionListener`` to the spark session. .. versionadded:: 3.3.0 .. versionchanged:: 3.5.0 Supports Spark Connect. Parameters ---------- observation : :class:`Observation` or str `str` to specify the name, or an :class:`Observation` instance to obtain the metric. .. versionchanged:: 3.4.0 Added support for `str` in this parameter. exprs : :class:`Column` column expressions (:class:`Column`). Returns ------- :class:`DataFrame` the observed :class:`DataFrame`. Notes ----- When ``observation`` is :class:`Observation`, this method only supports batch queries. When ``observation`` is a string, this method works for both batch and streaming queries. Continuous execution is currently not supported yet. Examples -------- When ``observation`` is :class:`Observation`, only batch queries work as below. >>> from pyspark.sql.functions import col, count, lit, max >>> from pyspark.sql import Observation >>> df = spark.createDataFrame([(2, "Alice"), (5, "Bob")], schema=["age", "name"]) >>> observation = Observation("my metrics") >>> observed_df = df.observe(observation, count(lit(1)).alias("count"), max(col("age"))) >>> observed_df.count() 2 >>> observation.get {'count': 2, 'max(age)': 5} When ``observation`` is a string, streaming queries also work as below. >>> from pyspark.sql.streaming import StreamingQueryListener >>> class MyErrorListener(StreamingQueryListener): ... def onQueryStarted(self, event): ... pass ... ... def onQueryProgress(self, event): ... row = event.progress.observedMetrics.get("my_event") ... # Trigger if the number of errors exceeds 5 percent ... num_rows = row.rc ... num_error_rows = row.erc ... ratio = num_error_rows / num_rows ... if ratio > 0.05: ... # Trigger alert ... pass ... ... def onQueryIdle(self, event): ... pass ... ... def onQueryTerminated(self, event): ... pass ... >>> spark.streams.addListener(MyErrorListener()) >>> # Observe row count (rc) and error row count (erc) in the streaming Dataset ... observed_ds = df.observe( ... "my_event", ... count(lit(1)).alias("rc"), ... count(col("error")).alias("erc")) # doctest: +SKIP >>> observed_ds.writeStream.format("console").start() # doctest: +SKIP """ from pyspark.sql import Observation if len(exprs) == 0: raise PySparkValueError( error_class="CANNOT_BE_EMPTY", message_parameters={"item": "exprs"}, ) if not all(isinstance(c, Column) for c in exprs): raise PySparkTypeError( error_class="NOT_LIST_OF_COLUMN", message_parameters={"arg_name": "exprs"}, ) if isinstance(observation, Observation): return observation._on(self, *exprs) elif isinstance(observation, str): return DataFrame( self._jdf.observe( observation, exprs[0]._jc, _to_seq(self._sc, [c._jc for c in exprs[1:]]) ), self.sparkSession, ) else: raise PySparkTypeError( error_class="NOT_LIST_OF_COLUMN", message_parameters={ "arg_name": "observation", "arg_type": type(observation).__name__, }, )
(self, observation: Union[ForwardRef('Observation'), str], *exprs: pyspark.sql.column.Column) -> 'DataFrame'
[ 0.03880450874567032, -0.03911951184272766, -0.011664978228509426, -0.011113721877336502, 0.04528177157044411, -0.02242431975901127, 0.013112026266753674, 0.028566891327500343, -0.052172474563121796, 0.034236956387758255, -0.008071968331933022, 0.03598916530609131, 0.03681604936718941, 0.010035818442702293, -0.009666673839092255, 0.0071318787522614, 0.016872381791472435, -0.020829614251852036, 0.061228830367326736, 0.03951326757669449, -0.04390363022685051, -0.07170269638299942, -0.040989845991134644, 0.042879868298769, -0.04449426010251045, -0.004744742065668106, 0.028625953942537308, -0.03937545418739319, 0.010257305577397346, 0.021105242893099785, -0.011576383374631405, -0.057251907885074615, -0.011920918710529804, -0.033114757388830185, -0.024038713425397873, 0.012836397625505924, -0.0011080498807132244, -0.0029876125045120716, 0.04358862712979317, -0.03852888196706772, -0.03925732523202896, -0.014185006730258465, 0.0247080959379673, -0.005876786541193724, -0.01622268743813038, 0.021558061242103577, -0.027740007266402245, -0.004540482070297003, 0.033370696008205414, -0.017266135662794113, 0.00035499432124197483, 0.00013512240548152477, -0.01816192828118801, 0.04165922850370407, -0.0035019542556256056, 0.021124931052327156, 0.008436190895736217, 0.003433047328144312, 0.043549250811338425, -0.013722345232963562, 0.00822454784065485, 0.010217930190265179, 0.004538021050393581, 0.021636812016367912, 0.008199937641620636, 0.0003159264742862433, 0.06815890967845917, -0.008071968331933022, -0.08158593624830246, -0.04291924461722374, -0.041737981140613556, -0.030437225475907326, 0.010139179416000843, 0.02894095703959465, -0.06969454884529114, -0.05402312055230141, -0.023054327815771103, -0.023940276354551315, -0.009710971266031265, -0.004262392874807119, 0.07477398216724396, -0.0163112822920084, -0.02386152371764183, -0.020868990570306778, 0.03118535876274109, -0.014312976971268654, 0.03362663835287094, 0.00885455496609211, -0.06563887745141983, 0.06961580365896225, -0.014647668227553368, -0.015484397299587727, 0.0051040430553257465, 0.04728991910815239, 0.009302450343966484, -0.031145982444286346, -0.057803165167570114, -0.00788001250475645, 0.03801700100302696, -0.0006380053819157183, 0.019933823496103287, 0.033528197556734085, -0.023546520620584488, 0.025771234184503555, -0.01291514839977026, 0.012304829433560371, -0.023192141205072403, -0.003248474793508649, 0.0007173715275712311, -0.027169061824679375, -0.009012056514620781, 0.09820237755775452, -0.04870743677020073, -0.02159743569791317, -0.0068907043896615505, 0.05551938712596893, 0.004577396437525749, -0.005340295843780041, -0.06788328289985657, 0.0006238548085093498, -0.01933334767818451, 0.031421612948179245, -0.0010280684800818563, -0.04461238905787468, -0.00010828249651240185, 0.032524123787879944, 0.03681604936718941, -0.019175846129655838, 0.023684335872530937, 0.007077737711369991, -0.0030343709513545036, -0.07103331387042999, 0.06985205411911011, 0.0691039189696312, -0.010011209174990654, 0.03402039036154747, 0.0559525191783905, 0.02120368182659149, -0.019894447177648544, 0.040438588708639145, 0.02736593969166279, 0.007451804354786873, 0.01341718528419733, -0.005305842496454716, 0.008647833950817585, -0.016645973548293114, 0.037209801375865936, 0.00935659185051918, -0.0046463035978376865, -0.002378523349761963, -0.05311748757958412, 0.0038686383049935102, -0.013367966748774052, -0.016626285389065742, -0.01672472432255745, 0.011231848038733006, 0.04311612248420715, 0.02118399366736412, 0.027070624753832817, -0.02303463965654373, 0.0036963706370443106, 0.006723358761519194, -0.02543654292821884, 0.03232724592089653, -0.041029222309589386, 0.05847254768013954, -0.03388257697224617, 0.006792265456169844, -0.05169996991753578, -0.05252685397863388, 0.04165922850370407, 0.05874817445874214, 0.06969454884529114, 0.004291924182325602, -0.0660720095038414, 0.10930626094341278, 0.02709031105041504, 0.05701565742492676, 0.03051597625017166, -0.06630825996398926, 0.007688057143241167, -0.05040058121085167, -0.07985341548919678, 0.03801700100302696, -0.03782012313604355, 0.017896143719553947, -0.03356757387518883, -0.02429465390741825, 0.04024171456694603, 0.017128322273492813, -0.01646878384053707, -0.01086762547492981, -0.005266466643661261, 0.025889361277222633, 0.0006472340319305658, -0.021794313564896584, 0.015907682478427887, 0.05536188557744026, -0.05496813356876373, 0.008761038072407246, 0.005507641471922398, 0.051188088953495026, 0.005246778950095177, -0.014844546094536781, -0.016055341809988022, -0.0027218281757086515, -0.049219317734241486, 0.024491531774401665, -0.02655874378979206, -0.07197833061218262, -0.021794313564896584, -0.003908013924956322, -0.02063273824751377, 0.0330360047519207, 0.023822149261832237, 0.043667376041412354, 0.02063273824751377, 0.007028518244624138, 0.05437749996781349, -0.0474867969751358, 0.09150855243206024, -0.021774625405669212, -0.03159880265593529, 0.05488938093185425, 0.02553498186171055, -0.03490633890032768, 0.07048206031322479, -0.005227091256529093, 0.052172474563121796, -0.028842519968748093, -0.00970112718641758, 0.001754668657667935, 0.04484863951802254, -0.06815890967845917, 0.012521393597126007, 0.08347596228122711, -0.003346913494169712, 0.02640124037861824, -0.0006189328851178288, -0.03742636740207672, -0.033646322786808014, -0.019225064665079117, 0.016586909070611, 0.012176859192550182, 0.030555350705981255, -0.07048206031322479, 0.02486559934914112, 0.07327771931886673, -0.03827293962240219, -0.010985751636326313, 0.018270209431648254, 0.01734488643705845, 0.02342839539051056, 0.012826553545892239, -0.004331300035119057, 0.021656498312950134, -0.01793551817536354, 0.05835442245006561, 0.034512583166360855, -0.025377480313181877, 0.012541081756353378, 0.028547203168272972, -0.046108655631542206, 0.05488938093185425, -0.037465743720531464, -0.018319429829716682, -0.0071318787522614, 0.00681687518954277, 0.04339174926280975, 0.012422955594956875, -0.05996881425380707, 0.085759736597538, -0.0031697240192443132, -0.044533636420965195, -0.019451472908258438, -0.024235591292381287, 0.012403267435729504, -0.03531978279352188, -0.02823220007121563, -0.01883131079375744, -0.0037529729306697845, -0.010966063477098942, -0.010818406008183956, 0.009036666713654995, 0.010168710723519325, -0.02695249766111374, 0.0012058732099831104, -0.00684640696272254, 0.0007376744761131704, -0.04051734134554863, -0.0008170406217686832, -0.004577396437525749, 0.028468452394008636, 0.04626615718007088, -0.010149022564291954, 0.02567279525101185, -0.030693165957927704, 0.02260150946676731, -0.024235591292381287, 0.0009585461812093854, -0.0008361131185665727, 0.02557435631752014, 0.07237208634614944, 0.015218612737953663, -0.017098790034651756, -0.054574377834796906, -0.003455196041613817, -0.05209372565150261, 0.0323469340801239, -0.00483825895935297, 0.06370948255062103, -0.0034355083480477333, -0.02205025404691696, -0.00018780244863592088, -0.04252548888325691, -0.00575373787432909, -0.058236293494701385, -0.021774625405669212, 0.013535312376916409, 0.025338103994727135, 0.05721253156661987, -0.04350987449288368, 0.012934836558997631, 0.0011683434713631868, -0.032799750566482544, 0.015927370637655258, 0.036501046270132065, -0.010985751636326313, -0.005852176807820797, -0.042879868298769, 0.03852888196706772, -0.040871720761060715, 0.03630416840314865, -0.004269775468856096, -0.014057036489248276, -0.06922204792499542, -0.03575291112065315, 0.0008957915706560016, 0.026046862825751305, 0.06540262699127197, -0.006378823425620794, -0.04106859862804413, 0.026027174666523933, 0.02655874378979206, 0.020691800862550735, -0.031992554664611816, -0.0017128322506323457, -0.012954523786902428, 0.0043239169754087925, 0.01688222587108612, -0.014135787263512611, 0.01665581576526165, -0.04161985218524933, 0.013623906299471855, 0.08615349233150482, 0.01700035110116005, -0.00861338060349226, 0.027582505717873573, -0.034945715218782425, -0.05689752846956253, 0.006880860310047865, 0.023329956457018852, 0.036934174597263336, -0.07221458107233047, 0.05311748757958412, 0.04110797122120857, 0.010710122995078564, 0.008431268855929375, -0.04575427621603012, -0.035103216767311096, -0.01482485793530941, -0.00800798274576664, 0.03130348399281502, 0.049219317734241486, 0.014765795320272446, 0.017128322273492813, 0.030299410223960876, -0.011271223425865173, -0.012176859192550182, 0.03092941828072071, 0.007368131540715694, -0.06213446334004402, -0.000011420419468777254, -0.05685815587639809, -0.012678896076977253, 0.053432490676641464, -0.0852084830403328, -0.021715562790632248, -0.03852888196706772, -0.019156157970428467, -0.0004435890878085047, 0.017768172547221184, -0.0070383623242378235, -0.008770882152020931, -0.02797625958919525, 0.026755619794130325, -0.027169061824679375, 0.0030466755852103233, 0.042131733149290085, -0.04181673005223274, -0.07867215573787689, 0.009760190732777119, -0.0313822366297245, -0.009435342624783516, 0.011349974200129509, 0.011290911585092545, 0.028704704716801643, -0.018408024683594704, -0.05087308585643768, -0.03049628809094429, 0.0403992161154747, -0.06158320978283882, -0.06300072371959686, 0.07449835538864136, -0.008834866806864738, 0.039158888161182404, 0.006984220817685127, -0.06508762389421463, 0.031992554664611816, 0.031716927886009216, -0.05662190169095993, -0.014893765561282635, 0.04154110327363014, 0.05839379504323006, -0.03553634509444237, -0.040989845991134644, -0.019717257469892502, -0.00423286110162735, 0.028153449296951294, 0.01608487218618393, -0.013899534940719604, -0.0244324691593647, -0.07733339071273804, -0.014500010758638382, -0.017817392945289612, 0.004857946652919054, 0.01122200395911932, -0.036363229155540466, 0.023507146164774895, 0.036225415766239166, -0.03305569291114807, 0.030122222378849983, 0.06945829838514328, 0.018663965165615082, -0.04902243986725807, 0.011271223425865173, -0.010513246059417725, 0.0020881295204162598, -0.07985341548919678, -0.00805228017270565, 0.04902243986725807, -0.03711136430501938, -0.026440616697072983, 0.05268435552716255, -0.012777334079146385, -0.019244752824306488, -0.04022202640771866, -0.04024171456694603, -0.0018149622483178973, 0.006201633717864752, -0.04784117639064789, -0.002709523309022188, -0.009469796903431416, -0.05339311435818672, -0.05662190169095993, 0.04311612248420715, -0.03033878654241562, -0.06402448564767838, -0.012954523786902428, 0.005763581953942776, 0.022975577041506767, 0.016252217814326286, 0.020022418349981308, -0.04492739215493202, 0.04079296812415123, -0.019579444080591202, -0.03799731284379959, -0.01954006776213646, 0.043549250811338425, 0.011970138177275658, -0.009233543649315834, 0.03374476358294487, 0.007023596204817295, -0.037071987986564636, 0.015641897916793823, -0.0008619533036835492, -0.017472857609391212, -0.06335510313510895, 0.03090973012149334, -0.01250170636922121, -0.029039395973086357, 0.06059882044792175, 0.04209236055612564, -0.07229333370923996, -0.04323424771428108, 0.0037332852371037006, 0.04457301273941994, 0.025771234184503555, 0.019067563116550446, -0.024511219933629036, 0.01332859043031931, -0.027464378625154495, -0.007353365886956453, 0.03640260547399521, -0.03969045728445053, -0.06213446334004402, 0.04650241136550903, 0.021243056282401085, -0.0345519594848156, -0.06953705102205276, -0.02978753112256527, 0.0029679248109459877, 0.038056373596191406, -0.008234391920268536, -0.020494922995567322, -0.060638196766376495, 0.032425686717033386, 0.019205376505851746, 0.013082494027912617, 0.0038292629178613424, -0.012531237676739693, -0.0409504696726799, 0.04022202640771866, 0.047093041241168976, -0.006560934707522392, -0.018447399139404297, -0.004961307160556316, 0.006280384957790375, -0.009725736454129219, -0.010729811154305935, -0.04847118258476257, 0.03512290492653847, 0.01926444098353386, 0.015405645594000816, -0.003908013924956322, 0.01567143015563488, 0.035792287439107895, -0.010119491256773472, -0.0559525191783905, 0.056267522275447845, -0.019717257469892502, 0.02655874378979206, -0.01256076991558075, -0.010257305577397346, -0.042289234697818756, -0.030594727024435997, 0.026794996112585068, -0.01772879809141159, 0.11891386657953262, -0.01510048657655716, -0.024196214973926544, 0.007811105344444513, 0.04303736984729767, 0.01933334767818451, -0.006767656188458204, -0.035792287439107895, 0.036934174597263336, 0.037071987986564636, -0.049494944512844086, -0.02626342698931694, -0.04280111566185951, -0.003703753463923931, 0.061346955597400665, 0.015120173804461956, 0.03356757387518883, 0.04965244606137276, 0.0423286110162735, -0.016596753150224686, 0.003524102969095111, -0.022503070533275604, 0.05303873494267464, 0.03405976668000221, 0.025200290605425835, -0.07414397597312927, -0.029137834906578064, -0.03037816286087036, 0.014283445663750172, 0.02896064519882202, -0.042564865201711655, 0.0169314444065094, -0.04973119869828224, 0.0215777475386858, -0.036225415766239166, 0.031145982444286346, -0.0162423737347126, 0.05563751608133316, -0.048353057354688644, 0.036087602376937866, 0.012688740156590939, 0.013377809897065163, 0.022640885785222054, -0.05890567600727081, -0.042564865201711655, 0.0142637575045228, 0.05551938712596893, 0.037780746817588806, -0.07733339071273804, -0.010916844010353088, -0.030968794599175453, -0.04894368723034859, -0.027425002306699753, 0.042564865201711655, -0.04276174306869507, -0.07457710802555084, 0.012984056025743484, -0.03618604317307472, -0.019776321947574615, 0.09702111780643463, 0.004208251368254423, 0.02358589693903923, -0.021341495215892792, 0.09867488592863083, 0.008071968331933022, 0.04035983979701996, 0.04161985218524933, 0.0016709958435967565, -0.018289897590875626, 0.0033223037607967854, -0.03051597625017166, -0.023389019072055817, 0.0003956002474296838, 0.041304849088191986, 0.013535312376916409, -0.008775804191827774, -0.009435342624783516, -0.005724206566810608, 0.027877820655703545, -0.06784390658140182, -0.029728466644883156, -0.04536052048206329, 0.014086568728089333, 0.028862206265330315, -0.004139344673603773, -0.02610592544078827, 0.07910528779029846, -0.03557572141289711, -0.013574687764048576, -0.05508625879883766, 0.00475212512537837, -0.011123565025627613, 0.00017011426098179072, 0.031854741275310516, 0.07843590527772903, 0.001525798812508583, 0.055401261895895004, 0.009710971266031265, -0.02783844619989395, 0.035221341997385025, 0.04642365872859955, -0.00617210241034627, 0.037642933428287506, -0.034512583166360855, 0.0315200500190258, 0.04799867793917656, 0.059496309608221054, 0.11166878789663315, -0.025594044476747513, -0.03884388506412506, 0.055991895496845245, 0.059653811156749725, -0.013535312376916409, -0.018467087298631668, -0.021223369985818863, 0.031677551567554474, 0.026007486507296562, 0.022916514426469803, -0.015307207591831684, -0.0026603040751069784, 0.019579444080591202, 0.03898169845342636, 0.0214399341493845, 0.04784117639064789, 0.0688282921910286, 0.010011209174990654, 0.03996608406305313, -0.05433812364935875, -0.004178720060735941, -0.05110933631658554, -0.028173137456178665, -0.06209509074687958, -0.009204012341797352, 0.0002982383011840284, 0.02214869298040867, -0.07922340929508209, -0.010070271790027618, -0.0734352171421051, 0.039040762931108475, -0.03476852551102638, 0.01243279967457056, -0.08260969817638397, -0.001303081400692463, -0.028547203168272972, -0.023074015974998474, 0.03681604936718941, -0.03512290492653847, -0.037642933428287506, -0.0324847474694252, 0.010444339364767075, 0.0022234825883060694, 0.011605914682149887, 0.011684665456414223, 0.09032729268074036, 0.023664647713303566, 0.022699948400259018, 0.04701429232954979, 0.08442097157239914, -0.032701313495635986, -0.04461238905787468, 0.04181673005223274, -0.020868990570306778, -0.022483384236693382, 0.01086762547492981, -0.04847118258476257, -0.009760190732777119, 0.025377480313181877, 0.02088867872953415, 0.025515293702483177, 0.027700630947947502, 0.007264771033078432, 0.043706752359867096, 0.030594727024435997, -0.07004892826080322, 0.02669655717909336, -0.004328839015215635, -0.038765132427215576, 0.050046201795339584, 0.029393775388598442, -0.0013326129410415888, 0.038627319037914276, -0.017463013529777527, 0.029000021517276764, 0.05169996991753578, -0.025790922343730927, -0.012452486902475357, 0.019116781651973724, -0.044966768473386765, -0.02285744994878769, -0.05193622410297394, 0.021774625405669212, -0.025180602446198463, 0.013367966748774052, -0.033114757388830185, 0.0485893078148365, -0.050203703343868256, -0.04669928550720215, -0.007235239259898663, -0.033685699105262756, -0.013121869415044785, 0.06575700640678406, 0.02738562785089016, 0.03459133580327034, -0.020928053185343742, -0.014135787263512611, -0.007195863872766495, 0.045124270021915436, 0.03742636740207672, -0.013879846781492233, 0.03512290492653847, -0.0038144970312714577, -0.040989845991134644, -0.015307207591831684, 0.09316232055425644, 0.05177872255444527, -0.007028518244624138, -0.03321319445967674, -0.005581470672041178, 0.003642229363322258, -0.0029162445571273565 ]
39,402
pyspark.sql.dataframe
offset
Returns a new :class: `DataFrame` by skipping the first `n` rows. .. versionadded:: 3.4.0 .. versionchanged:: 3.5.0 Supports vanilla PySpark. Parameters ---------- num : int Number of records to skip. Returns ------- :class:`DataFrame` Subset of the records Examples -------- >>> df = spark.createDataFrame( ... [(14, "Tom"), (23, "Alice"), (16, "Bob")], ["age", "name"]) >>> df.offset(1).show() +---+-----+ |age| name| +---+-----+ | 23|Alice| | 16| Bob| +---+-----+ >>> df.offset(10).show() +---+----+ |age|name| +---+----+ +---+----+
def offset(self, num: int) -> "DataFrame": """Returns a new :class: `DataFrame` by skipping the first `n` rows. .. versionadded:: 3.4.0 .. versionchanged:: 3.5.0 Supports vanilla PySpark. Parameters ---------- num : int Number of records to skip. Returns ------- :class:`DataFrame` Subset of the records Examples -------- >>> df = spark.createDataFrame( ... [(14, "Tom"), (23, "Alice"), (16, "Bob")], ["age", "name"]) >>> df.offset(1).show() +---+-----+ |age| name| +---+-----+ | 23|Alice| | 16| Bob| +---+-----+ >>> df.offset(10).show() +---+----+ |age|name| +---+----+ +---+----+ """ jdf = self._jdf.offset(num) return DataFrame(jdf, self.sparkSession)
(self, num: int) -> pyspark.sql.dataframe.DataFrame
[ 0.012468323111534119, 0.011719707399606705, -0.018224919214844704, 0.013380429707467556, -0.01254576537758112, 0.03916894644498825, -0.013595548458397388, 0.01646094024181366, -0.05827155336737633, -0.012640418484807014, -0.004844489973038435, -0.02106449566781521, 0.004603555891662836, 0.025384094566106796, 0.023336157202720642, -0.013105076737701893, 0.051043540239334106, 0.021804505959153175, 0.01608232967555523, 0.018534690141677856, 0.0073183635249733925, 0.017269788309931755, 0.04354017600417137, 0.052248209714889526, -0.06821867823600769, 0.043058305978775024, -0.07172942906618118, 0.024626873433589935, 0.025952009484171867, -0.00004009960684925318, -0.016546986997127533, -0.009396417066454887, -0.03333490714430809, -0.016254425048828125, -0.05128447338938713, 0.00005767889888375066, 0.0059459013864398, -0.03624332323670387, 0.07303735613822937, 0.008553149178624153, 0.014533469453454018, -0.004134595859795809, 0.02953159622848034, -0.06615353375673294, -0.04360901191830635, 0.0024996879510581493, 0.03596797212958336, -0.06260836124420166, -0.023731976747512817, 0.05975157767534256, 0.07069685310125351, 0.07179826498031616, -0.01209831703454256, -0.02787948027253151, -0.015204641968011856, -0.024213844910264015, -0.018156081438064575, -0.06284929811954498, 0.008398262783885002, -0.0003393509250599891, -0.021993812173604965, -0.0063245114870369434, -0.026726439595222473, 0.0418536402285099, -0.007107546553015709, -0.03438469022512436, 0.010463410057127476, -0.03285304084420204, -0.059166450053453445, -0.04285179451107979, 0.038928013294935226, 0.05131889507174492, -0.0006561143090948462, 0.07524017244577408, -0.10036612302064896, 0.00022439647000283003, -0.013552525080740452, -0.01516161859035492, 0.005016585346311331, 0.0057608988136053085, 0.0118918027728796, -0.03178604692220688, -0.02476455084979534, 0.040580131113529205, 0.02502269297838211, 0.060371119529008865, 0.053865909576416016, 0.004119537305086851, -0.00045470873010344803, 0.01081620529294014, -0.024024538695812225, 0.038101956248283386, -0.04267969727516174, -0.04199131578207016, 0.04064897075295448, -0.0234738327562809, 0.04405646026134491, 0.02942834049463272, -0.040201522409915924, 0.015428366139531136, -0.005984622985124588, 0.009921308606863022, 0.0021178508177399635, 0.003074056701734662, -0.04973561316728592, -0.022819871082901955, 0.006552538368850946, 0.027913898229599, -0.03149348497390747, 0.014249511994421482, -0.016701873391866684, 0.0364842563867569, -0.01782909967005253, -0.0002028845192398876, 0.0006060990272089839, 0.04395320266485214, -0.005636129528284073, -0.006574050057679415, -0.014129044488072395, 0.01173691637814045, 0.03913452848792076, -0.004861699417233467, -0.034522369503974915, -0.046224866062402725, -0.04970119521021843, 0.023078013211488724, 0.08728686720132828, -0.049907710403203964, 0.06340000033378601, -0.001118621090427041, 0.055518023669719696, -0.014309745281934738, -0.008720941841602325, 0.024024538695812225, -0.014593702740967274, 0.013363219797611237, 0.038549404591321945, 0.022664984688162804, -0.05445103347301483, 0.009921308606863022, 0.0023448020219802856, -0.029824160039424896, 0.05895993486046791, 0.07999001443386078, -0.05262681841850281, -0.021202171221375465, 0.011452958919107914, 0.007167779840528965, -0.008634894154965878, 0.030839523300528526, 0.0018661611247807741, 0.018792834132909775, 0.0008045466965995729, -0.049838870763778687, 0.010945277288556099, -0.017140716314315796, 0.04484809935092926, -0.017811888828873634, 0.022338002920150757, -0.04532996937632561, 0.013716015964746475, 0.035382844507694244, -0.00449599651619792, -0.012063898146152496, -0.08391378819942474, 0.03951313719153404, -0.05407242104411125, -0.0028266694862395525, -0.058374810963869095, -0.02381802536547184, 0.0951344221830368, 0.09375765919685364, 0.10311965644359589, -0.0080110477283597, -0.04887513816356659, 0.0951344221830368, 0.019291911274194717, 0.02238963171839714, -0.02543572336435318, -0.044572748243808746, 0.015910234302282333, 0.0374135747551918, -0.013578339479863644, -0.023921281099319458, 0.01911981590092182, -0.04082106426358223, -0.02550456114113331, -0.02242404967546463, 0.0862542912364006, 0.02445477806031704, 0.003672088962048292, -0.009611536748707294, 0.036621931940317154, 0.037723343819379807, -0.01279530394822359, -0.014989522285759449, 0.04687882959842682, 0.055104997009038925, -0.038101956248283386, 0.060749731957912445, 0.011255049146711826, 0.06615353375673294, 0.028430186212062836, -0.100228451192379, 0.006982777267694473, 0.006836495827883482, -0.062367428094148636, 0.009250136092305183, -0.041371770203113556, 0.004188375547528267, 0.04557090252637863, -0.04952910169959068, 0.042542021721601486, 0.04512345418334007, 0.033162813633680344, 0.0021070949733257294, -0.00535217160359025, -0.035795874893665314, 0.06398512423038483, -0.006733238697052002, 0.06601585447788239, -0.006767657585442066, -0.04033919796347618, 0.01689978316426277, 0.04247318208217621, -0.0033429560717195272, 0.013432057574391365, -0.07462063431739807, -0.0004571288009174168, -0.042163409292697906, -0.00043669246952049434, -0.048221174627542496, 0.011375515721738338, -0.06983637809753418, 0.010755972005426884, 0.03378235548734665, -0.019515635445713997, -0.04040803760290146, 0.0207719337195158, -0.03724147751927376, -0.025762705132365227, 0.029961835592985153, 0.06309022754430771, 0.02264777570962906, -0.020530998706817627, 0.058409228920936584, -0.06212649494409561, 0.05968273803591728, 0.011452958919107914, 0.04773930460214615, 0.003805462969467044, -0.008441287092864513, 0.022664984688162804, 0.029514387249946594, 0.010902252979576588, 0.0034634231124073267, -0.01386229693889618, -0.012864142656326294, -0.028877634555101395, 0.036174483597278595, -0.019997503608465195, -0.0720047801733017, -0.04477926343679428, -0.057961780577898026, -0.022561727091670036, 0.0031622557435184717, -0.04560532048344612, -0.012459717690944672, 0.04677557200193405, 0.05259240046143532, -0.005687757860869169, 0.07338154315948486, 0.028774376958608627, -0.041027579456567764, 0.02629620023071766, -0.05624082684516907, -0.01732141710817814, -0.0282236710190773, -0.02295754663646221, -0.04130293428897858, -0.004947747103869915, -0.04436623305082321, -0.052248209714889526, 0.02254451811313629, -0.01305344793945551, -0.018896091729402542, 0.02505711279809475, -0.0017758109606802464, 0.008514427579939365, -0.04691324755549431, -0.003829126013442874, 0.024816179648041725, 0.010755972005426884, -0.033162813633680344, -0.04051129147410393, -0.009981541894376278, 0.0028008550871163607, 0.010102009400725365, -0.07193594425916672, 0.016435125842690468, 0.025298045948147774, -0.07303735613822937, 0.041371770203113556, 0.0830877348780632, 0.010515037924051285, -0.007856162264943123, -0.008776873350143433, -0.011125977151095867, -0.01243390329182148, 0.006737540941685438, -0.022475678473711014, 0.03013393096625805, -0.011392725631594658, -0.02841297537088394, -0.02641666680574417, -0.07413876056671143, 0.002725563244894147, 0.03464283421635628, 0.015841396525502205, 0.03025439754128456, 0.005412405356764793, -0.04247318208217621, -0.05407242104411125, -0.02562502771615982, -0.024024538695812225, 0.07888860255479813, 0.012373670004308224, -0.0024545127525925636, -0.041819218546152115, 0.01016224268823862, -0.0047971634194254875, 0.004205584991723299, -0.024351520463824272, 0.01640070602297783, -0.02787948027253151, -0.037723343819379807, -0.02543572336435318, 0.0028761469293385744, -0.015419761650264263, 0.04832443222403526, 0.018465852364897728, -0.07434527575969696, 0.025900380685925484, -0.04894397407770157, 0.0020543907303363085, -0.024730131030082703, 0.04680998995900154, -0.03669077157974243, -0.009568512439727783, 0.08639197051525116, 0.04739511385560036, 0.03634658083319664, -0.018792834132909775, 0.003013823414221406, 0.03371351957321167, 0.027345983311533928, -0.011633659712970257, 0.03558935970067978, 0.001543481950648129, -0.031545113772153854, 0.01282972376793623, -0.026210153475403786, 0.01915423572063446, -0.013320195488631725, 0.0352107509970665, -0.015101384371519089, -0.02254451811313629, -0.01352671068161726, -0.08005885034799576, 0.04295504838228226, -0.022131487727165222, -0.04243876412510872, 0.02404174953699112, 0.03545168414711952, 0.015342318452894688, -0.03992616757750511, -0.06264278292655945, 0.033541422337293625, -0.02004913240671158, 0.029187405481934547, 0.007907791063189507, -0.06773681193590164, 0.019498426467180252, 0.029652064666152, 0.0024566641077399254, 0.021873345598578453, -0.06164462864398956, -0.03727589547634125, -0.02182171680033207, -0.049460262060165405, 0.01915423572063446, 0.005541476886719465, 0.011478773318231106, -0.01569511368870735, -0.003297781106084585, -0.008200353011488914, -0.017811888828873634, -0.014860451221466064, 0.04319598525762558, -0.016323262825608253, 0.02159799262881279, -0.01271786168217659, 0.005644734017550945, -0.004513205960392952, 0.0053865909576416016, -0.025384094566106796, -0.013354615308344364, -0.08597894012928009, -0.055518023669719696, -0.027139468118548393, 0.0031407438218593597, -0.04164712503552437, -0.01689978316426277, 0.04921932891011238, 0.0789574384689331, 0.027586916461586952, 0.02927345409989357, 0.049081653356552124, 0.007395806256681681, 0.03879033774137497, 0.02607247605919838, -0.06622236967086792, -0.02020401880145073, 0.03889359533786774, -0.00686661247164011, -0.025986429303884506, -0.009620141237974167, -0.03302513808012009, -0.00751627329736948, 0.06071531027555466, -0.045433226972818375, -0.07324386388063431, -0.06329674273729324, 0.04794581979513168, -0.006741843186318874, 0.014017182402312756, 0.0187067873775959, -0.04495135694742203, -0.052661240100860596, 0.03364467993378639, 0.04009826481342316, 0.003975407220423222, 0.022733822464942932, -0.006488002371042967, 0.02483338862657547, -0.0009126442018896341, 0.041337352246046066, -0.003999070264399052, -0.04956351965665817, -0.0036441234406083822, 0.08067839592695236, -0.0034999933559447527, -0.0006679458892904222, -0.013767643831670284, -0.024248262867331505, -0.021047286689281464, -0.01706327497959137, -0.020272856578230858, 0.021271010860800743, 0.0459839329123497, 0.02204544097185135, 0.02460966445505619, -0.03947871923446655, -0.008445588871836662, 0.028206462040543556, 0.02084077149629593, -0.039788492023944855, -0.02832692861557007, -0.07021498680114746, -0.044262975454330444, 0.019928665831685066, -0.034143757075071335, -0.04687882959842682, -0.06164462864398956, 0.08019652962684631, 0.029996255412697792, -0.03786102309823036, -0.056344084441661835, 0.05689479038119316, -0.005051004700362682, -0.08143561333417892, -0.01373322494328022, 0.012967400252819061, -0.019877037033438683, -0.03985733166337013, -0.00524891447275877, -0.04436623305082321, -0.01164226420223713, 0.0258487518876791, -0.026571553200483322, 0.027672965079545975, 0.027225516736507416, -0.014894870109856129, 0.013019029051065445, -0.0003299394447822124, 0.03348979353904724, 0.036897286772727966, 0.03527958691120148, 0.027638545259833336, 0.011650868691504002, 0.02517757937312126, 0.034264225512742996, 0.0016381345922127366, -0.013698806054890156, -0.03343816474080086, 0.0014283930649980903, 0.020186807960271835, 0.048290010541677475, -0.008467101491987705, -0.04319598525762558, 0.04354017600417137, 0.06759913265705109, -0.025676656514406204, 0.05242030695080757, -0.0031794654205441475, 0.037379153072834015, -0.013087866827845573, 0.03144185617566109, 0.08418914675712585, -0.00616102060303092, 0.027931109070777893, 0.0024588152300566435, 0.010842019692063332, 0.0355205237865448, -0.015591857023537159, 0.016090935096144676, -0.01832817681133747, 0.012270413339138031, 0.03466004505753517, 0.06549956649541855, -0.08893898129463196, 0.040201522409915924, 0.0358302928507328, -0.001843573641963303, 0.04068338871002197, -0.03665635362267494, 0.00763674033805728, 0.02648550644516945, 0.05183517932891846, -0.004775651730597019, 0.01406881120055914, 0.010084799490869045, 0.022303583100438118, -0.020272856578230858, -0.06398512423038483, 0.004792861174792051, -0.06959544122219086, 0.02166683040559292, 0.05131889507174492, -0.006036251317709684, -0.0018070032820105553, -0.014283930882811546, 0.0564473420381546, -0.017545141279697418, 0.0367940291762352, -0.0024437569081783295, 0.013346009887754917, 0.02648550644516945, -0.006664400454610586, -0.028464604169130325, -0.0302888173609972, -0.02340499497950077, 0.05372823029756546, -0.04206015169620514, -0.010033170692622662, 0.042645279318094254, 0.0371038019657135, -0.02479896880686283, 0.02065146714448929, -0.04529555141925812, 0.0058469465002417564, 0.044710423797369, 0.0034849350340664387, -0.002312534023076296, -0.026588762179017067, -0.016951411962509155, 0.013062052428722382, 0.025418512523174286, -0.04539880529046059, 0.007890581153333187, 0.009852470830082893, 0.011100162751972675, 0.026778068393468857, -0.003745229449123144, -0.052248209714889526, 0.029566016048192978, -0.06959544122219086, -0.025074321776628494, 0.05854690819978714, -0.017235370352864265, 0.01918865367770195, -0.07696112990379333, -0.01722676493227482, -0.0032676642294973135, -0.0010712947696447372, 0.0751713365316391, -0.05809945985674858, -0.032491639256477356, 0.029514387249946594, 0.031854886561632156, -0.005915784742683172, 0.08198632299900055, 0.0007179611129686236, 0.009508279152214527, 0.011074349284172058, 0.03021997958421707, -0.06171346455812454, 0.0735880583524704, -0.010747367516160011, 0.0032633619848638773, 0.0380675345659256, 0.008553149178624153, -0.026124104857444763, -0.05242030695080757, -0.01763979345560074, 0.004113083705306053, -0.00861338246613741, -0.04760162904858589, -0.019842617213726044, -0.043746691197156906, -0.04636254161596298, 0.031355809420347214, 0.0032870250288397074, 0.014800217933952808, -0.026881325989961624, -0.021580781787633896, 0.07035265862941742, 0.0072753396816551685, -0.013251357711851597, 0.016065120697021484, 0.0418536402285099, -0.021357057616114616, 0.017390254884958267, -0.030977198854088783, -0.03250885009765625, -0.03910011053085327, -0.03481493145227432, -0.03971965238451958, 0.004904723260551691, 0.022131487727165222, -0.012511346489191055, 0.024127796292304993, -0.01128946803510189, -0.0459839329123497, -0.007387201767414808, -0.0745517909526825, 0.0066428883001208305, -0.004192677792161703, 0.032302334904670715, 0.00003687281787279062, -0.008785477839410305, -0.039306625723838806, 0.0028739958070218563, 0.031286969780921936, 0.00978363212198019, 0.016349077224731445, -0.06140369176864624, 0.02810320444405079, 0.06071531027555466, -0.005859853699803352, 0.000387214997317642, -0.047911401838064194, 0.0005130598437972367, 0.009981541894376278, 0.04773930460214615, 0.031700000166893005, -0.018379805609583855, -0.06457024812698364, 0.028757166117429733, 0.030839523300528526, -0.007232315838336945, 0.04997655004262924, -0.015566042624413967, -0.026210153475403786, 0.06319348514080048, -0.01937795989215374, -0.05097470432519913, -0.06453583389520645, -0.012485532090067863, 0.014869055710732937, -0.03095998987555504, 0.04811791703104973, 0.011444354429841042, 0.005550081375986338, -0.04481368139386177, 0.013062052428722382, 0.024506406858563423, -0.011590635403990746, 0.03441911190748215, 0.0168137364089489, 0.03724147751927376, -0.01132388785481453, -0.0004614311910700053, 0.05734223872423172, -0.05720456317067146, -0.0244203582406044, -0.012081108056008816, -0.024781759828329086, 0.003672088962048292, 0.047876983880996704, 0.00011354273010510951, 0.044985778629779816, 0.007417318411171436, 0.013655781745910645, -0.012373670004308224, 0.026657601818442345, 0.0007066673715598881, -0.03419538587331772, -0.008716640062630177, -0.017811888828873634, -0.05056167393922806, 0.031286969780921936, -0.019360749050974846, 0.0028159134089946747, -0.04646579921245575, 0.08350076526403427, -0.014860451221466064, -0.006247068755328655, -0.027759011834859848, 0.06584376096725464, 0.021890554577112198, -0.053487297147512436, 0.0024674199521541595, 0.062023237347602844, -0.03758566826581955, 0.047016505151987076, -0.022819871082901955, -0.027414821088314056, -0.08047188073396683, 0.006526723969727755, 0.011091558262705803, 0.0020812805742025375, 0.05775526911020279, -0.02156357280910015, 0.08081607520580292, -0.012511346489191055, -0.020117970183491707, -0.011857383884489536, 0.04199131578207016, -0.026950163766741753, -0.0720047801733017, 0.015720928087830544, -0.03603680804371834, -0.030839523300528526, -0.03178604692220688, 0.005339264404028654, 0.05125005543231964, 0.0124511132016778, 0.011470168828964233, 0.04109641909599304, -0.0065396311692893505, -0.002278114901855588, -0.023938491940498352, -0.002691144123673439, -0.05524267256259918, 0.0348837673664093, 0.024058958515524864, 0.02245846949517727, -0.019773779436945915, -0.04116525501012802, -0.0193435400724411, 0.06488002091646194, -0.01979098841547966, 0.041406191885471344, -0.022251954302191734, 0.006896729115396738, 0.07207361608743668, 0.01386229693889618 ]
39,403
pyspark.sql.dataframe
sort
Returns a new :class:`DataFrame` sorted by the specified column(s). .. versionadded:: 1.3.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Parameters ---------- cols : str, list, or :class:`Column`, optional list of :class:`Column` or column names to sort by. Other Parameters ---------------- ascending : bool or list, optional, default True boolean or list of boolean. Sort ascending vs. descending. Specify list for multiple sort orders. If a list is specified, the length of the list must equal the length of the `cols`. Returns ------- :class:`DataFrame` Sorted DataFrame. Examples -------- >>> from pyspark.sql.functions import desc, asc >>> df = spark.createDataFrame([ ... (2, "Alice"), (5, "Bob")], schema=["age", "name"]) Sort the DataFrame in ascending order. >>> df.sort(asc("age")).show() +---+-----+ |age| name| +---+-----+ | 2|Alice| | 5| Bob| +---+-----+ Sort the DataFrame in descending order. >>> df.sort(df.age.desc()).show() +---+-----+ |age| name| +---+-----+ | 5| Bob| | 2|Alice| +---+-----+ >>> df.orderBy(df.age.desc()).show() +---+-----+ |age| name| +---+-----+ | 5| Bob| | 2|Alice| +---+-----+ >>> df.sort("age", ascending=False).show() +---+-----+ |age| name| +---+-----+ | 5| Bob| | 2|Alice| +---+-----+ Specify multiple columns >>> df = spark.createDataFrame([ ... (2, "Alice"), (2, "Bob"), (5, "Bob")], schema=["age", "name"]) >>> df.orderBy(desc("age"), "name").show() +---+-----+ |age| name| +---+-----+ | 5| Bob| | 2|Alice| | 2| Bob| +---+-----+ Specify multiple columns for sorting order at `ascending`. >>> df.orderBy(["age", "name"], ascending=[False, False]).show() +---+-----+ |age| name| +---+-----+ | 5| Bob| | 2| Bob| | 2|Alice| +---+-----+
def sort( self, *cols: Union[str, Column, List[Union[str, Column]]], **kwargs: Any ) -> "DataFrame": """Returns a new :class:`DataFrame` sorted by the specified column(s). .. versionadded:: 1.3.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Parameters ---------- cols : str, list, or :class:`Column`, optional list of :class:`Column` or column names to sort by. Other Parameters ---------------- ascending : bool or list, optional, default True boolean or list of boolean. Sort ascending vs. descending. Specify list for multiple sort orders. If a list is specified, the length of the list must equal the length of the `cols`. Returns ------- :class:`DataFrame` Sorted DataFrame. Examples -------- >>> from pyspark.sql.functions import desc, asc >>> df = spark.createDataFrame([ ... (2, "Alice"), (5, "Bob")], schema=["age", "name"]) Sort the DataFrame in ascending order. >>> df.sort(asc("age")).show() +---+-----+ |age| name| +---+-----+ | 2|Alice| | 5| Bob| +---+-----+ Sort the DataFrame in descending order. >>> df.sort(df.age.desc()).show() +---+-----+ |age| name| +---+-----+ | 5| Bob| | 2|Alice| +---+-----+ >>> df.orderBy(df.age.desc()).show() +---+-----+ |age| name| +---+-----+ | 5| Bob| | 2|Alice| +---+-----+ >>> df.sort("age", ascending=False).show() +---+-----+ |age| name| +---+-----+ | 5| Bob| | 2|Alice| +---+-----+ Specify multiple columns >>> df = spark.createDataFrame([ ... (2, "Alice"), (2, "Bob"), (5, "Bob")], schema=["age", "name"]) >>> df.orderBy(desc("age"), "name").show() +---+-----+ |age| name| +---+-----+ | 5| Bob| | 2|Alice| | 2| Bob| +---+-----+ Specify multiple columns for sorting order at `ascending`. >>> df.orderBy(["age", "name"], ascending=[False, False]).show() +---+-----+ |age| name| +---+-----+ | 5| Bob| | 2| Bob| | 2|Alice| +---+-----+ """ jdf = self._jdf.sort(self._sort_cols(cols, kwargs)) return DataFrame(jdf, self.sparkSession)
(self, *cols: Union[str, pyspark.sql.column.Column, List[Union[str, pyspark.sql.column.Column]]], **kwargs: Any) -> pyspark.sql.dataframe.DataFrame
[ -0.015830622985959053, -0.01593446172773838, 0.004457967821508646, 0.009081132709980011, -0.015755103901028633, -0.0010395630961284041, 0.018162265419960022, 0.054788872599601746, -0.01376329641789198, -0.024052729830145836, -0.018738096579909325, 0.022995466366410255, -0.005012558773159981, 0.05743202939629555, 0.012517237104475498, 0.028338421136140823, 0.02979215607047081, -0.004382448736578226, 0.018851373344659805, 0.01245115790516138, 0.001690912526100874, -0.01740707829594612, -0.03224651515483856, 0.016104379668831825, -0.0017593514639884233, 0.052825383841991425, 0.024581361562013626, -0.01837938092648983, -0.013527300208806992, 0.02467576041817665, 0.029962074011564255, -0.012696593999862671, -0.011063500307500362, 0.007835072465240955, -0.04742579162120819, -0.0037287394516170025, 0.05830049514770508, 0.004899280611425638, 0.0467083640396595, -0.02820626273751259, 0.010695346631109715, -0.022655632346868515, 0.02797970548272133, -0.11554372310638428, -0.053391773253679276, 0.023901691660284996, 0.009463446214795113, -0.01988031715154648, 0.030490705743432045, -0.0018443100852891803, 0.0357959009706974, 0.005446791648864746, -0.0012130202958360314, -0.008264586329460144, -0.035153988748788834, -0.030415186658501625, 0.018483219668269157, 0.02335418201982975, 0.031812284141778946, -0.019597122445702553, 0.002269103191792965, -0.04236603155732155, -0.026431571692228317, 0.027035720646381378, -0.032869547605514526, 0.008122988045215607, 0.009090572595596313, -0.008476982824504375, -0.09334120899438858, -0.030490705743432045, -0.0346631184220314, 0.030566224828362465, -0.0034313842188566923, 0.08654451370239258, -0.037910424172878265, 0.00041771322139538825, -0.06430424004793167, -0.01747315563261509, -0.04927600175142288, -0.027809789404273033, 0.050710856914520264, -0.030981577932834625, -0.0054939910769462585, -0.0289992094039917, 0.04055358096957207, -0.006353016942739487, 0.051994677633047104, 0.0342666432261467, 0.024505842477083206, 0.01014783512800932, -0.021447332575917244, 0.01770915277302265, -0.020125754177570343, 0.007735954597592354, 0.024694640189409256, -0.025204390287399292, 0.0003911636595148593, 0.013857695274055004, 0.00618781941011548, 0.027035720646381378, 0.016859566792845726, 0.016850126907229424, 0.027375556528568268, -0.013489541597664356, -0.001007703598588705, -0.02888593077659607, -0.009218010120093822, -0.018313303589820862, -0.052863143384456635, -0.036626607179641724, -0.017756352201104164, -0.0043446896597743034, 0.07125196605920792, -0.019748158752918243, 0.03660772740840912, 0.02320314384996891, 0.02478903718292713, -0.009062252938747406, -0.02456248179078102, -0.007414999883621931, -0.02990543469786644, 0.03660772740840912, 0.04289466515183449, -0.06570133566856384, -0.05954655259847641, 0.039873912930488586, 0.003556462237611413, -0.03264299035072327, -0.07313993573188782, 0.04750131070613861, 0.027734270319342613, -0.01739763841032982, 0.008779057301580906, 0.04814321920275688, 0.022127000615000725, -0.00849114265292883, 0.06188763678073883, 0.04168636351823807, 0.027111239731311798, 0.03471975773572922, 0.017048362642526627, -0.034965191036462784, 0.03524838760495186, -0.019002411514520645, 0.01668020896613598, 0.0041960119269788265, 0.03081165999174118, -0.03717411682009697, -0.03424776345491409, 0.06158556044101715, 0.00830234494060278, -0.012668274343013763, -0.026356052607297897, -0.009430406615138054, 0.018030107021331787, -0.04957807436585426, -0.013753856532275677, -0.03364361450076103, -0.04338553547859192, -0.0005094567313790321, 0.03371913358569145, 0.024958955124020576, -0.0013097787741571665, 0.03234091401100159, -0.038778889924287796, 0.020994219928979874, 0.019974716007709503, 0.005479831248521805, -0.06622996926307678, 0.01256443653255701, 0.026280533522367477, 0.07219594717025757, 0.05746978893876076, -0.040251508355140686, -0.04727475345134735, 0.03968511521816254, 0.012668274343013763, -0.002075586235150695, 0.01988031715154648, -0.054071441292762756, -0.027715390548110008, -0.011809248477220535, -0.006994926370680332, 0.027016840875148773, 0.019918076694011688, 0.0042691705748438835, -0.026374932378530502, -0.06860880553722382, 0.009949598461389542, -0.0436876118183136, -0.08156027644872665, 0.02191932499408722, 0.025714142248034477, 0.05746978893876076, -0.02290106937289238, 0.0005805505788885057, 0.011724289506673813, 0.021522851660847664, 0.022164760157465935, 0.03421000391244888, 0.05603493005037308, 0.054146960377693176, 0.06543701887130737, -0.054562315344810486, 0.032756268978118896, 0.006296377629041672, -0.02460024133324623, -0.04044030234217644, 0.01777523197233677, -0.05743202939629555, 0.06362456828355789, -0.029433442279696465, -0.02305210568010807, -0.06079261377453804, -0.017378758639097214, 0.013602819293737411, 0.01720884069800377, 0.009100012481212616, 0.06792914122343063, 0.002735195681452751, 0.051390524953603745, 0.029622239992022514, -0.04263034835457802, -0.017907390370965004, 0.05909344181418419, 0.0028720733243972063, 0.050559818744659424, -0.008538341149687767, -0.008226826786994934, -0.04825649783015251, -0.007174283731728792, -0.07310217618942261, 0.053165215998888016, -0.037721626460552216, -0.028074104338884354, 0.03415336459875107, -0.021824926137924194, 0.00366738042794168, -0.04712371528148651, -0.024921195581555367, -0.041271012276411057, 0.07653827965259552, 0.029735516756772995, 0.0023505219724029303, -0.002579438267275691, 0.001437216647900641, 0.02142845280468464, 0.008779057301580906, 0.015386950224637985, 0.02490231581032276, 0.006603172980248928, -0.005824385676532984, 0.001027173362672329, -0.007835072465240955, -0.027035720646381378, -0.0011852907482534647, 0.012753233313560486, -0.004719923250377178, -0.015132074244320393, 0.03081165999174118, -0.015698464587330818, -0.0485963299870491, -0.05679011717438698, 0.03235979378223419, 0.023901691660284996, -0.054524555802345276, -0.000026365196390543133, -0.025789661332964897, 0.010978542268276215, 0.039836153388023376, 0.010043997317552567, -0.00915193185210228, -0.018587058410048485, 0.003218987723812461, 0.08239098638296127, 0.0025227991864085197, 0.0009186150855384767, -0.04787890240550041, -0.053467292338609695, -0.04364985227584839, 0.06098141148686409, -0.03035854734480381, -0.013782176189124584, 0.06309593468904495, -0.03043406642973423, 0.015509668737649918, -0.03494631126523018, 0.007872832007706165, -0.032001081854104996, 0.0010377931175753474, 0.04319673776626587, 0.07808641344308853, 0.02327866293489933, 0.018086746335029602, 0.0036886201705783606, -0.004089813679456711, 0.009553125128149986, -0.016859566792845726, -0.001799470861442387, 0.03430440276861191, -0.04727475345134735, -0.02244795672595501, 0.10338520258665085, 0.04765234515070915, 0.0350218303501606, -0.037306275218725204, -0.08254202455282211, -0.07510342448949814, 0.0011876507196575403, -0.04414072260260582, 0.03249195218086243, 0.012838191352784634, -0.0549776665866375, -0.020635506138205528, -0.0613967627286911, -0.018926892429590225, -0.02873489446938038, -0.03481415659189224, 0.0005805505788885057, 0.01432968769222498, 0.013366823084652424, -0.04202619940042496, -0.03077390044927597, -0.026809165254235268, 0.021145256236195564, 0.06898640096187592, 0.04742579162120819, -0.007145964074879885, 0.006617332808673382, -0.0014313168358057737, 0.03194444254040718, 0.02907472848892212, 0.0900183767080307, -0.005243835039436817, -0.04263034835457802, -0.022919947281479836, -0.00747635867446661, 0.0003109249519184232, 0.018048986792564392, 0.053051941096782684, 0.003207187866792083, -0.07140300422906876, 0.04123325273394585, -0.03269962966442108, 0.022353557869791985, 0.008689379319548607, 0.04157308489084244, 0.019691521301865578, -0.008189067244529724, 0.03470087796449661, 0.05656356364488602, -0.01604774035513401, -0.019351685419678688, -0.010836943984031677, 0.02275003120303154, -0.000955194525886327, -0.011044620536267757, 0.04278138652443886, -0.002815434243530035, -0.03505958989262581, 0.08216442912817001, -0.04829425737261772, -0.02312762476503849, -0.026072857901453972, 0.054335758090019226, 0.008925375528633595, 0.017558114603161812, -0.024241527542471886, -0.025695262476801872, -0.024921195581555367, 0.019077930599451065, -0.008236266672611237, 0.05890464410185814, 0.040327027440071106, -0.04716147482395172, 0.023977210745215416, -0.032189879566431046, 0.010176154784858227, 0.019597122445702553, 0.02903696894645691, 0.004918160382658243, -0.06218970939517021, 0.06430424004793167, 0.007367800455540419, -0.0346631184220314, -0.00008451612666249275, -0.0178979504853487, -0.06128348410129547, -0.0083778640255332, -0.016076060011982918, -0.07623620331287384, 0.015651267021894455, -0.018011227250099182, 0.009340728633105755, -0.025940699502825737, 0.012658834457397461, -0.012913710437715054, 0.027960825711488724, 0.0369098000228405, -0.07094988971948624, -0.03445544093847275, -0.019899196922779083, 0.011639331467449665, 0.009369048289954662, 0.021220775321125984, 0.0312647745013237, 0.04780338332056999, 0.01425416860729456, -0.0335114561021328, 0.028942570090293884, 0.01154493261128664, -0.04153532534837723, -0.03186892345547676, 0.02112637646496296, 0.040175989270210266, 0.04289466515183449, 0.04319673776626587, 0.021447332575917244, 0.04372537136077881, 0.01466952171176672, 0.0021558250300586224, 0.009642803110182285, -0.021220775321125984, 0.08254202455282211, 0.026091735810041428, -0.00907641276717186, 0.00834010448306799, 0.0007699375273659825, -0.022768910974264145, 0.026091735810041428, 0.011148459278047085, 0.039987191557884216, -0.07249802350997925, 0.0610191710293293, 0.07461255043745041, 0.038250260055065155, 0.018587058410048485, -0.054562315344810486, -0.02022015117108822, 0.05033326521515846, 0.03485191613435745, 0.018709776923060417, -0.03409672528505325, 0.01133725605905056, -0.02790418639779091, 0.00698548648506403, 0.038741130381822586, -0.009340728633105755, -0.055430781096220016, -0.030755020678043365, 0.11493957787752151, 0.03706083819270134, 0.03972287476062775, -0.007056285627186298, -0.0444427989423275, -0.02550646662712097, -0.0212774146348238, 0.020239030942320824, -0.06562581658363342, 0.013753856532275677, 0.03354921564459801, -0.007259242236614227, -0.009255769662559032, -0.013942654244601727, -0.04474487528204918, 0.03326601907610893, -0.06830672919750214, -0.06709843128919601, -0.010336631909012794, 0.003096269676461816, 0.05947103351354599, -0.030301908031105995, -0.0068533290177583694, -0.018502099439501762, -0.0205222275108099, -0.00514943664893508, -0.03949631750583649, -0.04251706972718239, -0.020843181759119034, 0.02407160960137844, -0.07967230677604675, -0.028489457443356514, -0.009482325986027718, 0.005380712915211916, 0.05531750246882439, -0.025430947542190552, -0.006664531771093607, -0.014282488264143467, 0.054449036717414856, -0.07755777984857559, -0.015925021842122078, 0.027734270319342613, 0.03336041793227196, -0.004219611641019583, -0.008217386901378632, 0.04308346286416054, -0.022957706823945045, 0.030150871723890305, -0.0704212561249733, 0.01668020896613598, 0.01695396564900875, 0.007915311492979527, -0.024770157411694527, 0.03826913982629776, -0.019785918295383453, -0.0790681540966034, 0.0885080024600029, 0.010336631909012794, -0.027583232149481773, -0.0288104135543108, -0.013886014930903912, -0.012186842039227486, 0.02456248179078102, -0.000429218023782596, 0.03311498463153839, 0.012498357333242893, 0.027998585253953934, 0.0350218303501606, 0.06003742665052414, 0.009505925700068474, 0.027583232149481773, -0.01740707829594612, 0.02252347394824028, -0.0064332555048167706, 0.007778433617204428, 0.006338857114315033, 0.07310217618942261, 0.015245352871716022, 0.051579322665929794, 0.04202619940042496, -0.03264299035072327, 0.05584613233804703, 0.012639954686164856, -0.0064332555048167706, 0.009302969090640545, 0.02756435237824917, -0.04931376129388809, 0.07593412697315216, -0.03694755956530571, -0.017756352201104164, -0.009675842709839344, 0.054864391684532166, -0.017501475289463997, -0.05505318567156792, -0.04610421136021614, -0.04546230286359787, -0.013904894702136517, -0.04840753600001335, 0.053051941096782684, -0.020635506138205528, -0.004450887907296419, 0.004684524144977331, 0.013895454816520214, 0.03234091401100159, -0.013933214358985424, -0.04565110057592392, -0.03296394646167755, 0.008750737644731998, 0.008604420349001884, -0.016746288165450096, -0.00785395223647356, 0.033058345317840576, 0.07091213017702103, -0.03264299035072327, -0.03266187012195587, 0.034965191036462784, 0.04236603155732155, -0.0276776310056448, -0.007197883445769548, -0.07740674167871475, 0.036966439336538315, 0.008977293968200684, 0.03081165999174118, -0.04225275292992592, 0.028942570090293884, -0.02290106937289238, 0.04946479573845863, 0.08994285762310028, -0.09100012481212616, 0.014801680110394955, -0.02320314384996891, 0.013555619865655899, -0.039232004433870316, 0.005385432858020067, -0.08480758219957352, 0.0026691167149692774, 0.020144633948802948, 0.040138229727745056, 0.03470087796449661, -0.02029567025601864, -0.008986733853816986, -0.09334120899438858, 0.013055307790637016, -0.030641742050647736, -0.02180604636669159, 0.03394569084048271, -0.051654841750860214, -0.004677444230765104, -0.0010513629531487823, -0.01690676622092724, -0.030301908031105995, 0.01762419380247593, 0.01126173697412014, -0.05788514018058777, 0.0006985486834309995, -0.006914687808603048, -0.037268515676259995, 0.053618330508470535, -0.007348920684307814, 0.03375689312815666, 0.02301434613764286, 0.06222746893763542, 0.0006171299610286951, 0.012120763771235943, 0.0346631184220314, -0.00267855660058558, 0.013480101712048054, -0.07634948194026947, 0.020144633948802948, -0.054675593972206116, -0.08057853579521179, -0.004264450632035732, 0.06460630893707275, 0.0346631184220314, -0.02320314384996891, -0.03536166623234749, -0.018124505877494812, 0.031699005514383316, 0.004550006240606308, 0.004162972327321768, 0.03505958989262581, -0.04380089044570923, 0.06502166390419006, 0.004481567069888115, 0.011346695944666862, -0.10882255434989929, -0.03957183659076691, -0.10633043199777603, -0.017482595518231392, -0.054751113057136536, 0.013102507218718529, 0.02327866293489933, 0.052787624299526215, -0.010166714899241924, 0.0103555116802454, -0.0205222275108099, -0.04474487528204918, 0.014631763100624084, 0.021145256236195564, -0.0463307686150074, -0.004453247878700495, -0.0008153667440637946, 0.04591541364789009, 0.013942654244601727, 0.005508150439709425, 0.036400049924850464, -0.036324530839920044, 0.0295656006783247, 0.09394535422325134, -0.0008307064999826252, 0.014055931940674782, -0.0224101971834898, 0.0629071369767189, -0.027715390548110008, -0.0715918019413948, 0.03385129198431969, 0.009864640422165394, 0.004627884831279516, 0.005168315954506397, 0.052258990705013275, -0.007046845741569996, 0.039345283061265945, 0.04398968815803528, -0.014055931940674782, 0.04059134051203728, -0.0071601239033043385, -0.035946935415267944, -0.05879136547446251, -0.02055998705327511, -0.07034573704004288, -0.02998095378279686, 0.05637476593255997, -0.015906142070889473, -0.01095966249704361, -0.04908720403909683, 0.004639684688299894, 0.010062877088785172, 0.03436104208230972, -0.008255146443843842, -0.05916896089911461, -0.01442408561706543, -0.009713602252304554, -0.032794028520584106, 0.026129495352506638, -0.015292552299797535, -0.014093691483139992, 0.004271530546247959, -0.02497783489525318, 0.014763920567929745, 0.015292552299797535, 0.028338421136140823, 0.03360585495829582, 0.028413938358426094, 0.03285066783428192, 0.01822834461927414, 0.03471975773572922, 0.019955836236476898, 0.04534902423620224, 0.01928560622036457, -0.036362290382385254, -0.04750131070613861, -0.013734976761043072, -0.013281864114105701, -0.015830622985959053, 0.027224518358707428, 0.04599093273282051, 0.026771405711770058, -0.003202468156814575, 0.03281290829181671, 0.050522059202194214, -0.0009581444319337606, -0.01043103076517582, 0.009468166157603264, -0.06154780089855194, 0.04198843985795975, -0.0617743581533432, -0.018162265419960022, -0.010412150993943214, 0.024845676496624947, -0.08035197854042053, -0.018124505877494812, 0.003745259251445532, 0.04908720403909683, -0.021107496693730354, 0.0011976805981248617, -0.06192539632320404, -0.002418960677459836, 0.00040001352317631245, 0.0027965547051280737, 0.015906142070889473, -0.04134652763605118, 0.04274362698197365, 0.0046137250028550625, -0.04942703992128372, 0.013045867905020714, -0.018624817952513695, -0.007938911207020283, -0.029206886887550354, 0.02835729904472828, 0.025430947542190552, -0.018558738753199577, -0.06090589240193367, -0.03256747126579285, -0.012866511009633541, 0.017482595518231392, 0.032794028520584106, -0.04697267711162567, 0.06558805704116821, 0.003100989619269967, -0.07600964605808258, -0.0843544751405716, 0.0019729279447346926, -0.02475127764046192, -0.008613860234618187, 0.011072940193116665, -0.012904270552098751, 0.011101259849965572, 0.018256664276123047 ]
39,404
pyspark.sql.dataframe
pandas_api
Converts the existing DataFrame into a pandas-on-Spark DataFrame. .. versionadded:: 3.2.0 .. versionchanged:: 3.5.0 Supports Spark Connect. If a pandas-on-Spark DataFrame is converted to a Spark DataFrame and then back to pandas-on-Spark, it will lose the index information and the original index will be turned into a normal column. This is only available if Pandas is installed and available. Parameters ---------- index_col: str or list of str, optional, default: None Index column of table in Spark. Returns ------- :class:`PandasOnSparkDataFrame` See Also -------- pyspark.pandas.frame.DataFrame.to_spark Examples -------- >>> df = spark.createDataFrame( ... [(14, "Tom"), (23, "Alice"), (16, "Bob")], ["age", "name"]) >>> df.pandas_api() # doctest: +SKIP age name 0 14 Tom 1 23 Alice 2 16 Bob We can specify the index columns. >>> df.pandas_api(index_col="age") # doctest: +SKIP name age 14 Tom 23 Alice 16 Bob
def pandas_api( self, index_col: Optional[Union[str, List[str]]] = None ) -> "PandasOnSparkDataFrame": """ Converts the existing DataFrame into a pandas-on-Spark DataFrame. .. versionadded:: 3.2.0 .. versionchanged:: 3.5.0 Supports Spark Connect. If a pandas-on-Spark DataFrame is converted to a Spark DataFrame and then back to pandas-on-Spark, it will lose the index information and the original index will be turned into a normal column. This is only available if Pandas is installed and available. Parameters ---------- index_col: str or list of str, optional, default: None Index column of table in Spark. Returns ------- :class:`PandasOnSparkDataFrame` See Also -------- pyspark.pandas.frame.DataFrame.to_spark Examples -------- >>> df = spark.createDataFrame( ... [(14, "Tom"), (23, "Alice"), (16, "Bob")], ["age", "name"]) >>> df.pandas_api() # doctest: +SKIP age name 0 14 Tom 1 23 Alice 2 16 Bob We can specify the index columns. >>> df.pandas_api(index_col="age") # doctest: +SKIP name age 14 Tom 23 Alice 16 Bob """ from pyspark.pandas.namespace import _get_index_map from pyspark.pandas.frame import DataFrame as PandasOnSparkDataFrame from pyspark.pandas.internal import InternalFrame index_spark_columns, index_names = _get_index_map(self, index_col) internal = InternalFrame( spark_frame=self, index_spark_columns=index_spark_columns, index_names=index_names, # type: ignore[arg-type] ) return PandasOnSparkDataFrame(internal)
(self, index_col: Union[str, List[str], NoneType] = None) -> 'PandasOnSparkDataFrame'
[ -0.0005936636007390916, -0.02701612003147602, 0.008766076527535915, 0.04715611785650253, 0.023480387404561043, 0.01104672159999609, 0.0209213774651289, 0.023324111476540565, 0.0012447095941752195, 0.02951652742922306, -0.035415925085544586, -0.029750939458608627, -0.004405014216899872, -0.00682728411629796, 0.02217157930135727, 0.00527429673820734, 0.055790338665246964, 0.027895169332623482, 0.06860492378473282, 0.03625590726733208, 0.016438225284218788, -0.03301319107413292, -0.009137230925261974, 0.06833144277334213, -0.029243044555187225, 0.019241414964199066, -0.025746380910277367, -0.026039397343993187, -0.020823704078793526, -0.030317438766360283, 0.05172717571258545, -0.005020348820835352, -0.0033013189677149057, 0.04168647900223732, -0.009440014138817787, 0.005508709698915482, -0.016633568331599236, -0.02937978506088257, 0.060634877532720566, -0.06579196453094482, 0.040709756314754486, -0.02150741033256054, 0.01577405445277691, -0.0847012996673584, -0.0355917364358902, 0.04539801925420761, 0.004004558548331261, -0.03488849475979805, 0.022874819114804268, -0.009396061301231384, 0.05067231506109238, 0.020901842042803764, -0.039244674146175385, 0.023167835548520088, 0.005894514732062817, -0.016379620879888535, -0.04621846601366997, 0.01286342367529869, 0.03502523526549339, -0.0008399805519729853, 0.031626246869564056, -0.017629824578762054, -0.06551848351955414, 0.008648869581520557, 0.01892886497080326, 0.05176624283194542, 0.010958815924823284, -0.004011883866041899, -0.04617939889431, -0.04176461696624756, -0.0389711931347847, -0.04735146462917328, -0.009103044867515564, 0.06372131407260895, -0.06743285804986954, -0.04371805861592293, 0.016916818916797638, -0.0390297956764698, -0.026820775121450424, 0.014523849822580814, 0.006265669129788876, -0.02191763184964657, -0.06208042427897453, -0.005791958887130022, -0.007935862988233566, 0.006592870689928532, 0.008385155349969864, 0.01046068873256445, -0.03471268713474274, 0.002185414545238018, -0.0025297089014202356, 0.040905099362134933, 0.015637312084436417, 0.05668891966342926, -0.011427642777562141, -0.07661404460668564, 0.0023014002945274115, -0.01321504358202219, -0.020530687645077705, 0.04098323732614517, -0.07536383718252182, 0.03402898088097572, 0.005069185048341751, -0.0026981933042407036, -0.03426339477300644, -0.021976236253976822, -0.013097836636006832, -0.018587011843919754, 0.009933258406817913, -0.018547942861914635, -0.02396874874830246, 0.013146672397851944, -0.005005698185414076, -0.03481035679578781, -0.026996584609150887, 0.009386294521391392, -0.015813123434782028, -0.0015920562436804175, -0.05836888402700424, 0.0011085789883509278, 0.032876450568437576, 0.030376041308045387, 0.013517826795578003, -0.09837540239095688, -0.012814586982131004, 0.014807099476456642, 0.0040729292668402195, -0.02293342351913452, 0.00843887496739626, 0.10556407272815704, 0.010763471946120262, -0.002891095820814371, -0.008966304361820221, 0.04856259748339653, 0.0755201131105423, -0.005972652696073055, 0.037623316049575806, 0.050125353038311005, -0.08071627467870712, 0.03867817670106888, -0.007545174099504948, -0.041491132229566574, 0.06852678954601288, 0.007393782492727041, -0.008038418367505074, 0.0022159370128065348, 0.00404362753033638, -0.038287486881017685, -0.059423740953207016, -0.001483395928516984, 0.023089699447155, 0.019944654777646065, -0.011808563955128193, -0.03129415959119797, -0.044460367411375046, -0.06176787242293358, 0.045241743326187134, 0.01148624625056982, 0.04711705073714256, -0.04723425582051277, -0.0005930531187914312, 0.0018850726773962379, 0.017629824578762054, 0.013058767654001713, -0.040201861411333084, 0.028324926272034645, -0.008575615473091602, -0.0048103537410497665, -0.03043464571237564, -0.020374411717057228, 0.02221064828336239, 0.03606056049466133, -0.019505130127072334, -0.007681915536522865, -0.054501064121723175, 0.04047534242272377, 0.019495362415909767, 0.031528573483228683, 0.05278203636407852, -0.05067231506109238, 0.014240601100027561, 0.002976559102535248, -0.08704543113708496, 0.02613707073032856, -0.003677356755360961, 0.028910959139466286, -0.06497152149677277, 0.003052254905924201, 0.03854143247008324, 0.017414946109056473, -0.00004444846490514465, -0.009547453373670578, 0.02396874874830246, 0.05055510997772217, -0.013498292304575443, -0.06626079231500626, -0.002345352666452527, -0.018557710573077202, -0.03467361629009247, 0.0591893270611763, 0.10321994125843048, 0.05047697201371193, 0.03777959197759628, 0.020530687645077705, -0.027563083916902542, -0.010783006437122822, -0.03404851630330086, -0.02180042676627636, 0.0026933099143207073, -0.04367899149656296, 0.05770471319556236, -0.04492919519543648, 0.01694612018764019, 0.0004013715370092541, 0.016643336042761803, 0.021937167271971703, 0.027230998501181602, -0.022269252687692642, 0.06981606036424637, 0.001953443279489875, 0.04313202574849129, -0.003591893706470728, -0.04965652525424957, 0.03768191859126091, 0.017454015091061592, -0.0519225187599659, 0.04301482066512108, 0.012931793928146362, 0.010333714075386524, -0.05430572107434273, -0.030981609597802162, -0.06368225067853928, -0.0006046516937203705, -0.027270067483186722, -0.030161162838339806, 0.02830539271235466, -0.015266158618032932, -0.022523200139403343, 0.05657171458005905, -0.06344783306121826, 0.02109718695282936, 0.043952472507953644, 0.01505128014832735, 0.02842259779572487, -0.04160834103822708, 0.017454015091061592, -0.006490314844995737, 0.04750773683190346, 0.0006928618531674147, -0.04254599288105965, 0.04168647900223732, 0.001402816385962069, -0.023402249440550804, 0.045085467398166656, 0.03217320889234543, -0.011271366849541664, -0.040240928530693054, 0.02029627561569214, -0.04360085353255272, 0.014025721698999405, -0.09212438017129898, -0.006148462649434805, -0.030063491314649582, 0.01115416083484888, 0.015119650401175022, -0.04543709009885788, -0.003191437805071473, -0.0026298228185623884, 0.04973466321825981, 0.052938312292099, 0.12330133467912674, -0.00497151305899024, 0.023910144343972206, 0.0025297089014202356, 0.021683219820261, -0.043913401663303375, -0.04840632155537605, -0.01100765261799097, -0.039283741265535355, -0.032700639218091965, 0.0028398181311786175, -0.026703568175435066, -0.01384014543145895, 0.00530359847471118, -0.003838515840470791, 0.02885235659778118, 0.005503826308995485, 0.002961908234283328, -0.005323132500052452, 0.033618755638599396, -0.004363503772765398, 0.01258994173258543, 0.010968583635985851, 0.012531338259577751, -0.050828590989112854, 0.04039720445871353, 0.0096304751932621, -0.04918770119547844, -0.03633404150605202, -0.08165392279624939, -0.024398505687713623, -0.00528406398370862, -0.008189810439944267, 0.07766889780759811, 0.015793588012456894, -0.042038097977638245, -0.015061046928167343, -0.043327368795871735, 0.01907537318766117, -0.016447991132736206, -0.01350806001573801, 0.043327368795871735, 0.0002977474650833756, 0.019983723759651184, -0.08415433019399643, -0.08071627467870712, -0.021233927458524704, -0.01967117376625538, 0.01077323965728283, 0.044538505375385284, -0.05715774744749069, -0.011115091852843761, -0.018137719482183456, -0.02885235659778118, 0.043796196579933167, 0.08767052739858627, -0.02105811797082424, -0.02592219039797783, 0.015461502596735954, 0.021956700831651688, 0.008873515762388706, 0.01595963165163994, 0.034126654267311096, 0.0009962560143321753, -0.07903631031513214, -0.03606056049466133, -0.043210163712501526, -0.014055023901164532, 0.015090348199009895, 0.0635259747505188, 0.02180042676627636, -0.02529708854854107, 0.027914702892303467, -0.05176624283194542, -0.026293344795703888, -0.038014005869627, -0.013019698671996593, -0.012384830042719841, -0.019241414964199066, 0.018362365663051605, 0.03213414177298546, -0.038014005869627, -0.04352271556854248, 0.05524337291717529, 0.022249717265367508, 0.007276576012372971, -0.009889306500554085, 0.05176624283194542, -0.005186391528695822, -0.05590754374861717, 0.03172391653060913, -0.06770633906126022, 0.014924306422472, -0.047038912773132324, -0.011574150994420052, 0.02775842696428299, -0.014787564985454082, -0.027445876970887184, 0.0073595973663032055, -0.01956373266875744, 0.01012860331684351, -0.035161975771188736, 0.021526943892240524, -0.008326551876962185, -0.0018899563001468778, 0.006260785274207592, -0.04410874843597412, -0.0023612244985997677, -0.025023607537150383, -0.022269252687692642, 0.04039720445871353, -0.07532476633787155, 0.052039727568626404, 0.033989910036325455, 0.04211623594164848, -0.017444247379899025, 0.002966791857033968, -0.06360410898923874, -0.005059417802840471, 0.01823539286851883, -0.056415438652038574, 0.03018069639801979, -0.021019048988819122, 0.016662869602441788, -0.02283575013279915, -0.03576754406094551, -0.02734820544719696, 0.03811167553067207, 0.060752082616090775, -0.04227251186966896, -0.014719194732606411, -0.04727332666516304, 0.0024430248886346817, -0.03676380217075348, -0.0038800265174359083, 0.05067231506109238, 0.01764936000108719, -0.032446689903736115, -0.023519456386566162, -0.03748657554388046, 0.045202676206827164, -0.04836725443601608, -0.012990397401154041, 0.05340713635087013, 0.01519778836518526, 0.07649683207273483, 0.04129578918218613, 0.02404688484966755, 0.02801237627863884, 0.02209344319999218, 0.0248087290674448, -0.02771935798227787, -0.021233927458524704, 0.04281947389245033, 0.0023050629533827305, -0.00012170866830274463, 0.017991211265325546, -0.002164659323170781, 0.015012211166322231, 0.04297574982047081, 0.00810678955167532, -0.05489175394177437, -0.041373927146196365, 0.02525801956653595, 0.00804818607866764, 0.045241743326187134, 0.028403064236044884, 0.0028422598261386156, -0.013420154340565205, 0.03371642902493477, 0.06848771870136261, -0.04211623594164848, -0.009259320795536041, 0.030317438766360283, 0.0025223835837095976, -0.02805144339799881, -0.03320853412151337, 0.04688263684511185, -0.02572684735059738, -0.027250532060861588, 0.03797493502497673, 0.02062836103141308, -0.0052938312292099, 0.04993000626564026, -0.0730978474020958, 0.01816702075302601, 0.009996745735406876, -0.02447664365172386, 0.011701124720275402, 0.0668468251824379, 0.05848608911037445, -0.002588312141597271, -0.01886049471795559, -0.026039397343993187, 0.021605081856250763, 0.043366439640522, -0.05039883404970169, -0.07348853349685669, -0.03527918457984924, -0.014504315331578255, 0.07981768995523453, -0.018206089735031128, -0.012804820202291012, -0.06563568860292435, 0.02484779804944992, 0.02926257811486721, -0.05926746502518654, 0.00031346658943220973, 0.0035601502750068903, -0.004888491705060005, -0.06575290113687515, 0.01277551893144846, 0.01595963165163994, 0.00966954417526722, 0.04156927019357681, -0.04848445951938629, 0.0024662220384925604, -0.011388573795557022, 0.018137719482183456, -0.034829892218112946, -0.0202181376516819, 0.004307342227548361, 0.0267231035977602, 0.021976236253976822, -0.015637312084436417, 0.02389061078429222, 0.015188020654022694, 0.02510174550116062, -0.025375226512551308, -0.011886701919138432, 0.046374741941690445, -0.04543709009885788, -0.057079609483480453, -0.0024479085113853216, 0.00017840429791249335, -0.0650496557354927, 0.012013675644993782, 0.040787894278764725, -0.03592381998896599, -0.016477292403578758, -0.04027999937534332, 0.054383859038352966, -0.009879538789391518, 0.013879213482141495, 0.0534462071955204, 0.039869774132966995, -0.008062836714088917, -0.004243855364620686, 0.06227576732635498, 0.010802540928125381, -0.035376857966184616, 0.009313040412962437, 0.005972652696073055, 0.014221066609025002, -0.0068321675062179565, 0.0248087290674448, -0.024945469573140144, 0.020100930705666542, 0.012355527840554714, 0.041959960013628006, -0.04406967759132385, 0.04117858409881592, -0.0022220415994524956, -0.03580661490559578, 0.040905099362134933, 0.011095557361841202, 0.0009974769782274961, 0.03934234753251076, 0.05594661459326744, -0.030200231820344925, -0.0029521409887820482, 0.041452065110206604, 0.00037664826959371567, -0.05493082106113434, -0.019720008596777916, -0.04117858409881592, -0.05336806923151016, 0.0013893864816054702, 0.03830702230334282, -0.015666615217924118, -0.013429922051727772, 0.0243008341640234, 0.05278203636407852, 0.08009117096662521, 0.05532151088118553, -0.05684519559144974, -0.008531663566827774, 0.05114114284515381, -0.04973466321825981, -0.02176135778427124, -0.02330457791686058, -0.0611037015914917, 0.11431549489498138, -0.08149764686822891, -0.020100930705666542, 0.04055348038673401, 0.03772098943591118, -0.02451571263372898, 0.015686148777604103, -0.10908026993274689, 0.018958166241645813, -0.04660915583372116, 0.00047645700396969914, -0.0659482404589653, 0.022249717265367508, 0.02930164709687233, 0.012941560707986355, 0.04340550675988197, -0.04989093914628029, -0.0062900870107114315, -0.011622986756265163, 0.03818981349468231, 0.051336485892534256, 0.03117695264518261, -0.04219437390565872, -0.005362201482057571, 0.005557545926421881, -0.01519778836518526, 0.03502523526549339, -0.002810516394674778, 0.0034673616755753756, -0.0456715002655983, 0.040905099362134933, 0.0011598569108173251, 0.03768191859126091, 0.03154810890555382, -0.09017093479633331, -0.035611268132925034, 0.07649683207273483, -0.00294481567107141, -0.026195673272013664, 0.053172722458839417, -0.027328670024871826, -0.07173043489456177, -0.001175728626549244, 0.01904607191681862, -0.030610455200076103, 0.037955399602651596, 0.017707962542772293, 0.0022415760904550552, -0.01102718710899353, 0.03309132903814316, -0.02437897026538849, -0.002576103201135993, 0.061220910400152206, 0.02687937766313553, -0.05618102476000786, -0.03854143247008324, 0.00018893458764068782, -0.013771774247288704, -0.02900863066315651, 0.03080579824745655, 0.04281947389245033, 0.011163927614688873, -0.06321342289447784, 0.03318899869918823, 0.007467036601155996, -0.02437897026538849, -0.018079116940498352, 0.013664335012435913, 0.07583266496658325, -0.0301025602966547, 0.03842422738671303, 0.016633568331599236, 0.02463291771709919, -0.05723588541150093, 0.002353898948058486, -0.03473221883177757, 0.0036114281974732876, 0.045827776193618774, 0.004243855364620686, -0.012335993349552155, 0.05110207572579384, 0.00588963134214282, 0.031665313988924026, -0.0861077755689621, -0.031333230435848236, -0.03932281211018562, -0.025980794802308083, 0.003054696833714843, -0.06297900527715683, -0.05481361597776413, -0.03359922394156456, -0.020647894591093063, 0.03447827324271202, 0.06376038491725922, -0.05551685392856598, 0.025394761934876442, 0.02389061078429222, 0.06712030619382858, -0.010265343822538853, -0.028578873723745346, 0.02154647931456566, 0.02326550893485546, -0.01415269635617733, 0.05469641089439392, -0.039283741265535355, 0.008814912289381027, 0.03647078573703766, 0.050086282193660736, 0.024828262627124786, 0.052625760436058044, -0.03647078573703766, -0.006470780353993177, 0.06797982007265091, 0.040787894278764725, -0.022249717265367508, -0.07657497376203537, -0.021526943892240524, -0.06579196453094482, -0.03985024243593216, 0.03410711884498596, -0.02088230848312378, 0.01963210478425026, -0.053250860422849655, -0.022386459633708, 0.05289924144744873, -0.029536060988903046, 0.042038097977638245, -0.06946443766355515, 0.011124858632683754, -0.024437574669718742, -0.07438711822032928, 0.04281947389245033, 0.00263226474635303, -0.009606056846678257, 0.00511802127584815, -0.028871890157461166, 0.014318738132715225, 0.031743451952934265, -0.009039558470249176, 0.015031745657324791, 0.03504477068781853, 0.05618102476000786, 0.07020674645900726, 0.04031906649470329, 0.01354712899774313, 0.027777962386608124, -0.007569592446088791, -0.046491947025060654, -0.008468176238238811, 0.00944489799439907, -0.029418854042887688, 0.0038531667087227106, 0.030278369784355164, 0.0177958682179451, -0.0037359599955379963, 0.00453198840841651, -0.023480387404561043, 0.037740521132946014, 0.017297739163041115, -0.016194043681025505, 0.0195148978382349, 0.00977698341012001, 0.022816216573119164, -0.037154488265514374, 0.017766565084457397, 0.03596289083361626, 0.029282113537192345, 0.02267947606742382, 0.02730913646519184, -0.012785285711288452, 0.005347550846636295, -0.0288914255797863, 0.06508872658014297, -0.024574315175414085, 0.013595964759588242, 0.012482501566410065, -0.007110533304512501, -0.03623637184500694, -0.014807099476456642, 0.021331598982214928, -0.04625753313302994, -0.017551686614751816, -0.002744587603956461, -0.016594499349594116, 0.003513755975291133, -0.01227739080786705, -0.01577405445277691, 0.015314994379878044, 0.009703729301691055, -0.02517988346517086, -0.02797330729663372, -0.0011555837700143456, 0.043913401663303375, 0.03697868064045906, 0.0029887680429965258, 0.07891910523176193, -0.005152206402271986, -0.06508872658014297, 0.016340551897883415, 0.010597429238259792, 0.02267947606742382, -0.03504477068781853, 0.025707311928272247, -0.023167835548520088, 0.019651638343930244, 0.023089699447155 ]
39,405
pyspark.sql.dataframe
persist
Sets the storage level to persist the contents of the :class:`DataFrame` across operations after the first time it is computed. This can only be used to assign a new storage level if the :class:`DataFrame` does not have a storage level set yet. If no storage level is specified defaults to (`MEMORY_AND_DISK_DESER`) .. versionadded:: 1.3.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Notes ----- The default storage level has changed to `MEMORY_AND_DISK_DESER` to match Scala in 3.0. Parameters ---------- storageLevel : :class:`StorageLevel` Storage level to set for persistence. Default is MEMORY_AND_DISK_DESER. Returns ------- :class:`DataFrame` Persisted DataFrame. Examples -------- >>> df = spark.range(1) >>> df.persist() DataFrame[id: bigint] >>> df.explain() == Physical Plan == AdaptiveSparkPlan isFinalPlan=false +- InMemoryTableScan ... Persists the data in the disk by specifying the storage level. >>> from pyspark.storagelevel import StorageLevel >>> df.persist(StorageLevel.DISK_ONLY) DataFrame[id: bigint]
def persist( self, storageLevel: StorageLevel = (StorageLevel.MEMORY_AND_DISK_DESER), ) -> "DataFrame": """Sets the storage level to persist the contents of the :class:`DataFrame` across operations after the first time it is computed. This can only be used to assign a new storage level if the :class:`DataFrame` does not have a storage level set yet. If no storage level is specified defaults to (`MEMORY_AND_DISK_DESER`) .. versionadded:: 1.3.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Notes ----- The default storage level has changed to `MEMORY_AND_DISK_DESER` to match Scala in 3.0. Parameters ---------- storageLevel : :class:`StorageLevel` Storage level to set for persistence. Default is MEMORY_AND_DISK_DESER. Returns ------- :class:`DataFrame` Persisted DataFrame. Examples -------- >>> df = spark.range(1) >>> df.persist() DataFrame[id: bigint] >>> df.explain() == Physical Plan == AdaptiveSparkPlan isFinalPlan=false +- InMemoryTableScan ... Persists the data in the disk by specifying the storage level. >>> from pyspark.storagelevel import StorageLevel >>> df.persist(StorageLevel.DISK_ONLY) DataFrame[id: bigint] """ self.is_cached = True javaStorageLevel = self._sc._getJavaStorageLevel(storageLevel) self._jdf.persist(javaStorageLevel) return self
(self, storageLevel: pyspark.storagelevel.StorageLevel = StorageLevel(True, True, False, True, 1)) -> pyspark.sql.dataframe.DataFrame
[ 0.03254169225692749, -0.024999285116791725, -0.012406984344124794, 0.03000284917652607, 0.06775195151567459, -0.022034211084246635, -0.029113326221704483, 0.03789735957980156, -0.0661211609840393, -0.0073524583131074905, -0.011137561872601509, -0.01943976990878582, 0.0051193865947425365, -0.006801140028983355, -0.02603706158697605, -0.0394354909658432, 0.015270134434103966, -0.04833071678876877, 0.04744119197130203, 0.014528865925967693, 0.052778325974941254, -0.008969350717961788, -0.00704205222427845, -0.03322736546397209, -0.041214536875486374, 0.02564789541065693, -0.0017072343034669757, 0.00971061922609806, 0.03609978407621384, 0.050628647208213806, 0.0011449125595390797, 0.008487526327371597, -0.04833071678876877, 0.03552529960870743, -0.015751957893371582, 0.02197861485183239, -0.06441624462604523, 0.01174910832196474, 0.040065571665763855, -0.047107622027397156, -0.03787882626056671, 0.0379900187253952, 0.023201709613204002, -0.027019241824746132, -0.045588020235300064, 0.017299357801675797, 0.023980040103197098, -0.007639700081199408, 0.09806983917951584, -0.020106911659240723, 0.05763363838195801, 0.08798858523368835, -0.03354240581393242, -0.031911615282297134, -0.043734848499298096, -0.00971988495439291, 0.035729147493839264, -0.00570313585922122, -0.020162507891654968, -0.020218102261424065, 0.05563221126794815, -0.005035994108766317, -0.04762651026248932, 0.028390590101480484, -0.0007042051875032485, 0.036989305168390274, -0.02492515742778778, -0.004306307528167963, 0.01666927896440029, -0.0013342836173251271, -0.00980327744036913, -0.09206556528806686, -0.02142266370356083, 0.09265857934951782, -0.07657305151224136, 0.011424803175032139, -0.017985031008720398, -0.03704490140080452, -0.03215252608060837, 0.03328296169638634, 0.013509620912373066, -0.07446043938398361, -0.011776905506849289, -0.04151104390621185, 0.017271559685468674, 0.011007839813828468, 0.021478259935975075, 0.0365816093981266, -0.003243050305172801, 0.010961510241031647, 0.009905202314257622, 0.07953812927007675, 0.01666927896440029, -0.006157162599265575, 0.04277120158076286, -0.06493513286113739, -0.00479044858366251, -0.0008796774200163782, 0.022312186658382416, 0.019235922023653984, -0.06323021650314331, 0.09080541133880615, 0.03567355498671532, -0.01655808836221695, -0.042326439172029495, 0.007991802878677845, 0.015131146647036076, -0.030317887663841248, -0.0077833207324147224, -0.00585138937458396, -0.0047487523406744, 0.07390448451042175, -0.014464004896581173, -0.0075146108865737915, -0.02349821664392948, 0.02607412450015545, -0.04636635258793831, 0.0024670346174389124, -0.0365816093981266, -0.0006607715040445328, -0.02296079695224762, 0.031744830310344696, 0.015131146647036076, -0.05255594849586487, -0.02959515154361725, 0.05833784118294716, 0.018707767128944397, -0.057263001799583435, -0.006286884658038616, 0.06285957992076874, 0.025129007175564766, -0.013926584273576736, 0.019791873171925545, 0.07775907963514328, 0.017725586891174316, -0.01416749693453312, 0.008709906600415707, 0.023702064529061317, -0.05366785079240799, 0.025703489780426025, -0.01843905821442604, -0.06890092045068741, 0.033190302550792694, 0.0038476476911455393, 0.016743404790759087, 0.017660725861787796, -0.008737703785300255, -0.03913898393511772, -0.07231075316667557, -0.030503204092383385, 0.004431396722793579, 0.005503919906914234, -0.0038499641232192516, -0.004730220418423414, -0.018976477906107903, 0.005258374381810427, 0.01655808836221695, -0.0021369385067373514, 0.008603349328041077, -0.035562362521886826, -0.03509907051920891, 0.052185311913490295, 0.02603706158697605, 0.039954379200935364, -0.03973199799656868, 0.018911616876721382, 0.0011802386725321412, 0.0050498927012085915, -0.0662323534488678, 0.016020668670535088, 0.08013114333152771, 0.03582180663943291, 0.07783320546150208, 0.02157091721892357, -0.0661211609840393, 0.017864573746919632, 0.08761795610189438, 0.03552529960870743, 0.03689664602279663, -0.060376331210136414, 0.03495081514120102, -0.03621097281575203, -0.0450320690870285, 0.019828936085104942, 0.042474694550037384, -0.006833570543676615, -0.0022527617402374744, -0.036952242255210876, 0.027408408001065254, 0.05600284785032272, 0.005939415190368891, -0.02057020552456379, 0.011359942145645618, 0.00986813846975565, 0.0493314303457737, -0.02138560079038143, 0.021496791392564774, -0.06230362877249718, -0.05311189964413643, 0.04466143622994423, 0.07531289756298065, 0.004859942477196455, 0.03504347428679466, -0.06274838745594025, -0.0004876157909166068, 0.002557376865297556, -0.03876835107803345, 0.01942123845219612, -0.008455095812678337, -0.03096649795770645, -0.0408439040184021, -0.007088381331413984, -0.0014431574381887913, 0.006555594503879547, 0.07305202633142471, -0.03587740287184715, -0.012138274498283863, -0.0019388807704672217, 0.06434211879968643, 0.018086954951286316, 0.04136279225349426, -0.009766214527189732, -0.09732857346534729, 0.04518032446503639, -0.02238631248474121, -0.03193014860153198, 0.013194581493735313, -0.04636635258793831, -0.0002219462621724233, -0.053445469588041306, -0.04610690847039223, 0.022886669263243675, -0.0295580867677927, -0.058930858969688416, 0.015158943831920624, 0.03152244910597801, 0.0006254454492591321, 0.04351247102022171, 0.04666285961866379, -0.015612971037626266, 0.000060988168115727603, 0.058374907821416855, 0.03984319046139717, 0.049776189029216766, -0.022701352834701538, -0.003924090880900621, 0.03580327704548836, 0.05863434821367264, 0.043290089815855026, -0.02423948422074318, -0.0007968638092279434, -0.08480112999677658, -0.014918031170964241, 0.03689664602279663, 0.04807127267122269, -0.005925516132265329, -0.02635210007429123, 0.07282964140176773, -0.0052815391682088375, -0.007755523081868887, -0.026963647454977036, -0.055706337094306946, -0.018318600952625275, 0.0024925158359110355, -0.019958658143877983, -0.02607412450015545, -0.004148787818849087, -0.03580327704548836, 0.05811546370387077, 0.00732929352670908, 0.04944261908531189, 0.06919743120670319, 0.007908409461379051, -0.02592587098479271, 0.01745687611401081, -0.03226371854543686, -0.026574481278657913, -0.003970419988036156, -0.05237063020467758, 0.016521025449037552, 0.0035789376124739647, -0.015344261191785336, 0.02155238576233387, 0.004934069234877825, 0.0070698498748242855, 0.04343834146857262, -0.0246286503970623, -0.05989450588822365, 0.05874554067850113, -0.052778325974941254, -0.0745716243982315, 0.07075409591197968, -0.00026494564372114837, 0.00043173108133487403, 0.00047024228842929006, 0.010303634218871593, -0.02931717410683632, -0.036285098642110825, -0.01219386886805296, 0.008385601453483105, 0.016947254538536072, -0.017484674230217934, 0.047960080206394196, 0.06578759104013443, 0.002548110904172063, -0.05607697367668152, 0.028483247384428978, -0.00022889564570505172, 0.0055687809363007545, 0.04180755093693733, 0.03042907826602459, 0.028279399499297142, 0.027686383575201035, 0.05199999734759331, -0.008821097202599049, -0.03474696725606918, 0.003690127981826663, -0.04114041104912758, -0.0563364177942276, 0.018077688291668892, 0.0072459010407328606, 0.0009960797615349293, -0.035729147493839264, 0.03591446578502655, 0.0012983783381059766, -0.03000284917652607, 0.03382038325071335, -0.0046028150245547295, 0.02846471592783928, 0.009747683070600033, -0.001541607198305428, -0.0197362769395113, 0.05666998773813248, -0.012833213433623314, -0.026574481278657913, 0.00576799688860774, -0.012101210653781891, -0.0014362080255523324, 0.03602565452456474, 0.06504632532596588, 0.00971988495439291, -0.034431926906108856, -0.007204204797744751, -0.04010263457894325, -0.022441908717155457, -0.013620811514556408, 0.02790876477956772, -0.019921595230698586, -0.026926584541797638, 0.05466856434941292, -0.04013969749212265, 0.038064144551754, -0.06830790638923645, -0.008881324902176857, -0.01670634187757969, -0.05170348659157753, 0.006879899650812149, -0.0012983783381059766, -0.04299358278512955, -0.03215252608060837, 0.07968638092279434, -0.02097790315747261, -0.00700035598129034, -0.01649322733283043, -0.03157804533839226, -0.008218816481530666, -0.02833499386906624, -0.010127582587301731, -0.0119807543233037, -0.014982892200350761, 0.0534825325012207, -0.053148962557315826, 0.029817530885338783, 0.04495794326066971, 0.007658231537789106, 0.043327152729034424, -0.07116179168224335, 0.03157804533839226, 0.0053880964405834675, -0.013509620912373066, 0.0619329959154129, -0.07709193974733353, 0.05618816241621971, -0.005114753730595112, 0.018920881673693657, 0.036414820700883865, 0.08361510187387466, -0.052185311913490295, 0.0012821630807593465, 0.048664286732673645, -0.021052028983831406, 0.005587312392890453, -0.010952244512736797, 0.036285098642110825, 0.013250176794826984, 0.044142547994852066, -0.055261578410863876, 0.03313471004366875, 0.035154666751623154, -0.004767283797264099, -0.015511046163737774, -0.0690121129155159, 0.009840341284871101, -0.03180042654275894, -0.028112612664699554, -0.003335708985105157, 0.02435067482292652, -0.03478403016924858, 0.012657161802053452, 0.0095160361379385, 0.03322736546397209, -0.02012544311583042, -0.00003865600228891708, 0.05692943185567856, 0.05452030897140503, 0.03832358866930008, 0.07075409591197968, -0.01471418235450983, 0.008353170938789845, 0.021645044907927513, -0.027816105633974075, 0.04266000911593437, 0.002858517225831747, 0.05311189964413643, -0.02648182213306427, -0.0000730410247342661, -0.05114753544330597, -0.022719884291291237, -0.003975053317844868, 0.035692084580659866, 0.02170063927769661, -0.015807554125785828, -0.012814681977033615, 0.03704490140080452, 0.03044760972261429, 0.010368495248258114, 0.02281254343688488, -0.014797575771808624, -0.06997576355934143, 0.042882390320301056, 0.04110334813594818, -0.0717548057436943, 0.00979401171207428, -0.006745544727891684, 0.000855354533996433, -0.0605987124145031, -0.04525445029139519, 0.0365816093981266, -0.04614397510886192, 0.02199714630842209, 0.05196293070912361, 0.012823947705328465, 0.011397005058825016, 0.06782608479261398, -0.07279258221387863, 0.005457590334117413, -0.03013257123529911, -0.08183605968952179, 0.02548111043870449, 0.02014397643506527, 0.03454311937093735, 0.01918032579123974, -0.027927296236157417, 0.0027774409390985966, -0.0075146108865737915, -0.0009590163244865835, 0.009126869961619377, -0.05151817202568054, 0.009812544099986553, -0.03778617084026337, 0.024035636335611343, -0.01013684831559658, -0.031633637845516205, -0.06934568285942078, -0.02520313486456871, -0.019532429054379463, -0.0232202410697937, -0.03459871560335159, -0.014593726955354214, 0.003998217638581991, -0.06315609067678452, 0.031615108251571655, -0.008014967665076256, 0.033875975757837296, 0.04069564864039421, -0.07497932016849518, 0.010303634218871593, 0.027093369513750076, 0.036396291106939316, -0.02720456011593342, -0.039361365139484406, 0.007565573323518038, 0.015566641464829445, 0.01730862259864807, -0.018531715497374535, -0.002967391163110733, 0.01590021327137947, 0.019791873171925545, -0.004306307528167963, -0.019254453480243683, 0.040213823318481445, 0.01858731172978878, -0.03491375222802162, 0.07901924103498459, -0.014908765442669392, -0.01006272155791521, 0.04406842216849327, 0.016502493992447853, -0.0605245865881443, -0.04095509275794029, -0.02703777328133583, 0.03293085843324661, -0.024962222203612328, 0.029965784400701523, -0.058930858969688416, 0.058226652443408966, -0.04258588328957558, -0.01856878027319908, 0.0005223627667874098, -0.010451887734234333, -0.015344261191785336, -0.011285815387964249, 0.05140697956085205, -0.0046699922531843185, -0.02575908601284027, 0.00021398341050371528, 0.008075195364654064, -0.00929365586489439, 0.052741263061761856, 0.034858159720897675, -0.026389162987470627, -0.004116357304155827, -0.0009833391522988677, -0.009038844145834446, 0.02846471592783928, 0.048256587237119675, -0.005693869665265083, -0.025314323604106903, 0.019513897597789764, -0.0373043455183506, -0.021885957568883896, -0.07160655409097672, -0.03828652575612068, -0.06274838745594025, -0.023590873926877975, -0.06979044526815414, -0.002795972628518939, -0.04610690847039223, 0.06560227274894714, 0.009395579807460308, 0.033579468727111816, 0.007894511334598064, 0.03467284142971039, -0.060635775327682495, 0.06586171686649323, -0.021033497527241707, 0.024758372455835342, 0.012017818167805672, 0.01873556524515152, -0.02505487948656082, -0.01219386886805296, -0.07160655409097672, 0.06430505216121674, -0.012138274498283863, -0.0196992140263319, 0.018059156835079193, 0.02336849458515644, 0.0013470241101458669, -0.010803990997374058, -0.0337647870182991, 0.052593011409044266, 0.04466143622994423, 0.053741976618766785, -0.054890941828489304, -0.0010736812837421894, 0.021070560440421104, 0.010526014491915703, 0.04814539849758148, -0.029483960941433907, 0.0422893762588501, -0.024017104879021645, 0.017076976597309113, -0.030744116753339767, 0.04214112088084221, -0.08116891980171204, 0.03550677001476288, -0.03413541987538338, 0.059672124683856964, -0.013426228426396847, 0.07423805445432663, -0.00032343636848963797, 0.006527796853333712, 0.03495081514120102, -0.06315609067678452, 0.022775478661060333, -0.03000284917652607, -0.06552814692258835, -0.04662579670548439, 0.05540983006358147, -0.017910903319716454, -0.05463149771094322, 0.039064858108758926, -0.06886385381221771, -0.04002850875258446, 0.01450106780976057, 0.004707056097686291, 0.011943691410124302, 0.06145117059350014, -0.005457590334117413, -0.043290089815855026, -0.0394354909658432, 0.026092655956745148, -0.02590733952820301, -0.0033472911454737186, 0.013287240639328957, -0.043327152729034424, -0.016233783215284348, -0.026815393939614296, -0.002967391163110733, -0.031318601220846176, -0.06500925868749619, 0.026370631530880928, -0.024406271055340767, -0.013546684756875038, -0.028094081208109856, -0.00482287909835577, 0.012786883860826492, -0.0535566583275795, 0.004906272049993277, -0.03693370893597603, 0.002473984146490693, -0.03263435140252113, -0.03533998131752014, 0.0015844617737457156, 0.03869422525167465, -0.0718289315700531, -0.03887953981757164, -0.04432786628603935, 0.017549535259604454, -0.004459194373339415, -0.015196007676422596, 0.013074126094579697, 0.042066995054483414, -0.028816819190979004, -0.0012532073305919766, -0.05481681600213051, -0.01204561535269022, 0.021774766966700554, -0.018133284524083138, -0.021441195160150528, -0.05081396549940109, -0.032171059399843216, 0.02633356861770153, -0.05800427123904228, 0.05503919720649719, 0.06682536751031876, -0.01190662756562233, 0.02110762521624565, 0.0054946537129580975, 0.025406982749700546, -0.038953665643930435, 0.012471845373511314, -0.006402708124369383, 0.07857447862625122, 0.05266713723540306, 0.049665000289678574, -0.05763363838195801, 0.02776051126420498, 0.03578474372625351, 0.008969350717961788, 0.003497861325740814, 0.025277260690927505, -0.012017818167805672, 0.035729147493839264, 0.05789308249950409, -0.02592587098479271, -0.014918031170964241, -0.027297217398881912, 0.01894867978990078, 0.003150391858071089, -0.016530290246009827, 0.025017816573381424, 0.01590021327137947, -0.005207412410527468, -0.06586171686649323, 0.04744119197130203, 0.02902066707611084, -0.03042907826602459, -0.036822520196437836, -0.07312615215778351, 0.0021936919074505568, -0.040362078696489334, -0.003166607115417719, 0.013583747670054436, -0.011582322418689728, -0.00707448273897171, 0.008385601453483105, -0.02125587873160839, -0.02718602679669857, 0.004051496274769306, -0.05552102252840996, 0.06111760064959526, -0.03489522263407707, 0.06719600409269333, 0.06300783157348633, -0.011387739330530167, -0.016799001023173332, 0.0288909450173378, 0.01572416163980961, -0.03735993802547455, -0.0035650390200316906, 0.03072558529675007, -0.0011547575704753399, -0.004341054707765579, 0.0058328574523329735, 0.05185174196958542, 0.040065571665763855, 0.0029975050128996372, -0.025684958323836327, 0.02281254343688488, -0.021441195160150528, -0.017188167199492455, 0.05166642367839813, -0.025295792147517204, -0.005531717091798782, -0.02212686836719513, 0.036822520196437836, 0.02129294164478779, 0.04403135925531387, -0.04013969749212265, -0.030614394694566727, 0.007653598673641682, 0.030910901725292206, -0.06827083975076675, 0.03435780107975006, -0.058930858969688416, -0.005772629752755165, -0.011795436963438988, 0.010183177888393402, -0.025406982749700546, 0.04818246141076088, -0.012156805954873562, -0.026537418365478516, -0.006842836271971464, -0.0025504273362457752, 0.010609407909214497, -0.02677832916378975, 0.018346399068832397, 0.02027369663119316, 0.043734848499298096, -0.00940947886556387, -0.04573627561330795, 0.018142549321055412, 0.03891660273075104, 0.03758231922984123, 0.01927298493683338, 0.044735562056303024, -0.003004454541951418, 0.05096222087740898, -0.020255165174603462, 0.0018786527216434479, -0.014686385169625282, 0.005754097830504179, 0.011851032264530659, -0.03561795875430107, -0.010127582587301731, 0.04102921858429909, 0.010220241732895374 ]
39,406
pyspark.sql.dataframe
printSchema
Prints out the schema in the tree format. Optionally allows to specify how many levels to print if schema is nested. .. versionadded:: 1.3.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Parameters ---------- level : int, optional, default None How many levels to print for nested schemas. .. versionchanged:: 3.5.0 Added Level parameter. Examples -------- >>> df = spark.createDataFrame( ... [(14, "Tom"), (23, "Alice"), (16, "Bob")], ["age", "name"]) >>> df.printSchema() root |-- age: long (nullable = true) |-- name: string (nullable = true) >>> df = spark.createDataFrame([(1, (2,2))], ["a", "b"]) >>> df.printSchema(1) root |-- a: long (nullable = true) |-- b: struct (nullable = true) >>> df.printSchema(2) root |-- a: long (nullable = true) |-- b: struct (nullable = true) | |-- _1: long (nullable = true) | |-- _2: long (nullable = true)
def printSchema(self, level: Optional[int] = None) -> None: """Prints out the schema in the tree format. Optionally allows to specify how many levels to print if schema is nested. .. versionadded:: 1.3.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Parameters ---------- level : int, optional, default None How many levels to print for nested schemas. .. versionchanged:: 3.5.0 Added Level parameter. Examples -------- >>> df = spark.createDataFrame( ... [(14, "Tom"), (23, "Alice"), (16, "Bob")], ["age", "name"]) >>> df.printSchema() root |-- age: long (nullable = true) |-- name: string (nullable = true) >>> df = spark.createDataFrame([(1, (2,2))], ["a", "b"]) >>> df.printSchema(1) root |-- a: long (nullable = true) |-- b: struct (nullable = true) >>> df.printSchema(2) root |-- a: long (nullable = true) |-- b: struct (nullable = true) | |-- _1: long (nullable = true) | |-- _2: long (nullable = true) """ if level: print(self._jdf.schema().treeString(level)) else: print(self._jdf.schema().treeString())
(self, level: Optional[int] = None) -> NoneType
[ 0.034238651394844055, 0.02069995366036892, 0.06947489082813263, -0.016388947144150734, 0.07257454097270966, -0.0015976997092366219, 0.02363927662372589, -0.03229691460728645, 0.008840234018862247, -0.004725182894617319, -0.04097237065434456, -0.021946938708424568, -0.03284915164113045, -0.03014141321182251, -0.02552756853401661, -0.0021209882106631994, 0.03336575999855995, -0.04040231928229332, 0.07510413229465485, 0.1022527813911438, 0.02463686466217041, 0.007521992549300194, 0.04952312633395195, 0.021501587703824043, -0.03972538560628891, 0.003707554191350937, -0.0025719068944454193, -0.018793847411870956, 0.0026743379421532154, 0.01299536693841219, -0.025260357186198235, 0.01190870814025402, -0.022891085594892502, 0.005825201980769634, -0.05996217206120491, 0.01489256601780653, -0.035663776099681854, 0.018259426578879356, -0.008657639846205711, -0.011650403961539268, -0.0003264985862188041, 0.05725443363189697, -0.06377438455820084, -0.08778775483369827, -0.015676384791731834, 0.01095565501600504, 0.07610172033309937, 0.013262578286230564, -0.028484703972935677, -0.053905386477708817, 0.03096085973083973, 0.06936800479888916, -0.030800534412264824, -0.04182744398713112, -0.056149959564208984, -0.0763154923915863, -0.02353239245712757, -0.05957026407122612, 0.06612583994865417, -0.05037819966673851, 0.0027879024855792522, 0.06017594039440155, -0.05365598946809769, 0.054689206182956696, -0.03024829737842083, -0.022214150056242943, -0.009984788484871387, -0.011240680702030659, -0.0660189613699913, 0.014117653481662273, -0.03773020952939987, -0.008279090747237206, -0.007134536746889353, 0.04963000863790512, -0.014981635846197605, -0.027896840125322342, -0.026079803705215454, -0.07000931352376938, -0.012915203347802162, -0.027184277772903442, 0.000013177891560189892, -0.044214531779289246, 0.0028524785302579403, 0.008287997916340828, 0.02134126052260399, 0.03758769482374191, 0.031833749264478683, 0.03837151452898979, 0.0062393792904913425, 0.03815774619579315, -0.009325667284429073, 0.02027241699397564, 0.01895417459309101, 0.029411036521196365, -0.05016443133354187, -0.02413807064294815, -0.00598107511177659, -0.05386975780129433, -0.031014302745461464, 0.013342740945518017, -0.020717767998576164, 0.0025941745843738317, -0.009779926389455795, 0.03676825016736984, -0.05746820196509361, -0.00900946743786335, -0.044143274426460266, -0.0003173131844960153, 0.0189898032695055, 0.04799111559987068, -0.013396183960139751, 0.016495833173394203, 0.04311005771160126, 0.016861021518707275, 0.04250438138842583, -0.009975881315767765, 0.011686032637953758, -0.009129713289439678, 0.0059766219928860664, -0.04143553599715233, 0.030123598873615265, 0.011588054709136486, 0.06858418136835098, -0.0958397164940834, -0.0158010832965374, 0.04100799933075905, -0.00487214932218194, -0.027558373287320137, 0.031299326568841934, 0.009824462234973907, 0.04802674427628517, 0.03740955516695976, -0.011401006951928139, 0.019969576969742775, 0.07068624347448349, -0.019791435450315475, 0.02406681329011917, 0.01015402190387249, 0.011819638311862946, 0.017368722707033157, -0.028805358335375786, -0.07132755219936371, -0.020860280841588974, -0.045176491141319275, -0.03263538330793381, 0.02159065753221512, -0.001427352661266923, -0.025830406695604324, -0.0015197631437331438, 0.011178331449627876, 0.011588054709136486, -0.028840985149145126, 0.045319005846977234, -0.006911860778927803, 0.010777514427900314, 0.014135467819869518, 0.022196335718035698, -0.075959213078022, 0.02119874767959118, -0.03740955516695976, -0.03259975463151932, 0.007023198530077934, 0.013823721557855606, 0.007299316581338644, -0.028627216815948486, 0.06509262323379517, -0.017849702388048172, -0.03500465676188469, -0.011062540113925934, 0.005709410645067692, 0.06220674514770508, 0.04695789888501167, -0.01475005317479372, 0.03780146315693855, 0.03202970325946808, 0.05903584137558937, 0.029268523678183556, 0.05946337804198265, 0.003569495165720582, -0.030372995883226395, 0.008083135820925236, -0.005197255872189999, -0.0164156686514616, 0.03876342624425888, 0.03229691460728645, -0.009209875948727131, -0.04848990961909294, -0.031049931421875954, 0.0047875321470201015, -0.003335685236379504, -0.04168493300676346, -0.013654488138854504, 0.01214029174298048, 0.01598813198506832, 0.044321417808532715, -0.006600114516913891, 0.015418080613017082, -0.02921508066356182, 0.02481500431895256, 0.01849100925028324, 0.06405940651893616, -0.0031976262107491493, 0.009664135053753853, -0.01235406007617712, 0.022499175742268562, 0.004462425597012043, 0.022891085594892502, -0.003785490756854415, -0.012060128152370453, -0.0475635789334774, -0.000856745638884604, -0.035663776099681854, 0.02488626167178154, -0.05251589044928551, 0.013494160957634449, -0.03039081022143364, -0.0929894670844078, -0.03277789428830147, -0.04717166721820831, -0.012897389940917492, 0.023906487971544266, 0.022873271256685257, -0.008711081929504871, 0.011026911437511444, -0.027558373287320137, -0.006087959744036198, 0.0855788141489029, -0.054796092212200165, -0.010394511744379997, -0.03826463222503662, -0.015239940024912357, -0.019470782950520515, -0.04218372702598572, -0.008092042990028858, -0.03259975463151932, 0.03304510563611984, 0.01884729042649269, 0.0107418866828084, 0.05914272367954254, -0.027451487258076668, 0.007032105699181557, -0.0033445924054831266, 0.005780667066574097, -0.04834739491343498, -0.03290259465575218, -0.006818336900323629, 0.0025852674152702093, -0.0006168123218230903, 0.033205434679985046, -0.00327110942453146, -0.07802564650774002, -0.05657749995589256, 0.03698201850056648, 0.05105513706803322, -0.009779926389455795, -0.044178903102874756, -0.045675285160541534, 0.04079423099756241, -0.03628727048635483, 0.012069035321474075, -0.05914272367954254, -0.0422549843788147, -0.021002793684601784, 0.05793136730790138, 0.012273897416889668, -0.06979554146528244, -0.01716385968029499, -0.06837041676044464, 0.045425888150930405, -0.020931536331772804, 0.01680757850408554, 0.03968975692987442, 0.0007682319264858961, 0.01920357160270214, 0.026507342234253883, -0.046138450503349304, -0.012362967245280743, 0.008412696421146393, 0.005437746178358793, 0.012327339500188828, -0.017858609557151794, -0.044250160455703735, 0.010911120101809502, 0.04834739491343498, -0.026542970910668373, 0.004533682018518448, -0.01991613395512104, -0.01934608444571495, -0.01221154723316431, -0.04670850187540054, 0.022089451551437378, 0.017529048025608063, 0.008034147322177887, 0.002567453309893608, 0.02517128735780716, -0.01816144771873951, 0.02037930116057396, -0.03514716774225235, 0.0023024689871817827, 0.022071637213230133, -0.015008357353508472, -0.014046397060155869, 0.1196393221616745, 0.05932086706161499, 0.07624423503875732, -0.00645314808934927, -0.007312677334994078, -0.03219003230333328, 0.0165938101708889, 0.01991613395512104, -0.046601615846157074, 0.034024883061647415, 0.016780856996774673, 0.05910709872841835, -0.05711192265152931, -0.002429394284263253, -0.026525156572461128, -0.05707629397511482, -0.011205052956938744, 0.03429209068417549, -0.02634701505303383, 0.012220454402267933, 0.03309854865074158, 0.03263538330793381, -0.045319005846977234, -0.04763483256101608, 0.024369653314352036, 0.016246436163783073, 0.023763975128531456, 0.016139550134539604, -0.00809649657458067, -0.004774171859025955, 0.04763483256101608, 0.013333834707736969, -0.02417369745671749, 0.035663776099681854, 0.010287627577781677, -0.021946938708424568, -0.05169644206762314, 0.043680109083652496, 0.02900131233036518, 0.016958998516201973, 0.06038971245288849, -0.04670850187540054, 0.00036852865014225245, 0.015685291960835457, 0.03790834918618202, 0.006631289143115282, 0.0074551901780068874, 0.05636373162269592, 0.0055490839295089245, 0.0031820388976484537, -0.027326788753271103, -0.035628147423267365, -0.02850251831114292, -0.03822900354862213, 0.02588384971022606, 0.04706478491425514, -0.02477937750518322, 0.0479198582470417, 0.05198146775364876, -0.005348675884306431, -0.03329450264573097, -0.026578597724437714, 0.03350827470421791, -0.008942665532231331, -0.022962341085076332, -0.0049612196162343025, 0.04179181903600693, 0.025402870029211044, 0.0005706070805899799, -0.05052071437239647, -0.024440908804535866, -0.021519402042031288, -0.03217221796512604, 0.11579147726297379, -0.021893497556447983, 0.03156653791666031, 0.006626835558563471, -0.0823722779750824, 0.03769458085298538, -0.05903584137558937, 0.03277789428830147, -0.016958998516201973, -0.06014031544327736, -0.044855836778879166, -0.055793680250644684, -0.0018070151563733816, -0.07531790435314178, 0.028698472306132317, -0.04207684099674225, 0.04115051031112671, -0.004671740811318159, -0.0197023656219244, 0.02353239245712757, 0.03242161497473717, -0.04731418192386627, 0.0040549286641180515, 0.0037298216484487057, -0.01240750215947628, -0.029660433530807495, -0.06904735416173935, -0.05746820196509361, -0.02624013088643551, 0.020290229469537735, 0.03311636298894882, 0.007660051807761192, 0.011231773532927036, -0.01164149772375822, 0.01539136003702879, 0.06138730049133301, -0.009949160739779472, -0.016932277008891106, 0.07050810754299164, 0.08108966797590256, 0.006199297960847616, 0.10211027413606644, 0.06908297538757324, 0.023407693952322006, 0.054867349565029144, 0.0010276493849232793, -0.014990543015301228, 0.008826873265206814, 0.10396293550729752, 0.05059197172522545, 0.002411580178886652, -0.04239749535918236, 0.043680109083652496, 0.05636373162269592, 0.07018744945526123, -0.028698472306132317, 0.013716837391257286, -0.010447954759001732, -0.0067025450989604, 0.013992954976856709, 0.010537024587392807, 0.021750984713435173, -0.013520882464945316, -0.04093674197793007, 0.06063910946249962, 0.0720401182770729, -0.014571912586688995, 0.011329751461744308, -0.03464837372303009, 0.026632040739059448, 0.055686794221401215, 0.03229691460728645, 0.031548723578453064, -0.08515127003192902, 0.02599073387682438, 0.010332162491977215, 0.0012659126659855247, 0.012434223666787148, -0.004150679334998131, -0.06131604313850403, -0.04221935570240021, -0.014277980662882328, -0.01590796746313572, -0.03632289543747902, -0.006007796619087458, 0.02116311900317669, 0.006613474804908037, 0.02166191302239895, 0.03915533423423767, -0.013458533212542534, 0.0014028582954779267, 0.013868256472051144, 0.0007442942587658763, -0.055116746574640274, -0.04930935800075531, 0.08650514483451843, 0.013253671117126942, -0.06986679881811142, -0.024939702823758125, 0.0411861389875412, -0.0028123969677835703, -0.019933948293328285, -0.060354083776474, -0.05223086476325989, -0.019363898783922195, -0.10624313354492188, 0.010581559501588345, -0.0030194856226444244, -0.007749122101813555, 0.015569500625133514, -0.03229691460728645, -0.025367241352796555, -0.017137140035629272, 0.0035338669549673796, -0.06951051950454712, -0.008889222517609596, 0.0404735766351223, 0.009815555065870285, -0.06975991278886795, 0.03334794566035271, 0.0008511787164025009, 0.00475635752081871, 0.03801523521542549, -0.05344222113490105, 0.03805086016654968, 0.02356801927089691, -0.004375582095235586, -0.014625354669988155, 0.021715356037020683, -0.03249287232756615, -0.0007537580095231533, 0.07745559513568878, 0.019292641431093216, 0.021537214517593384, -0.015266661532223225, -0.0029927643481642008, 0.007272595539689064, -0.004809800069779158, 0.03236817196011543, -0.01959548145532608, 0.06894046813249588, 0.020575255155563354, 0.024832818657159805, 0.10816705971956253, 0.0029437756165862083, -0.02878754399716854, -0.07660051435232162, -0.012380781583487988, 0.03621601313352585, -0.008390428498387337, 0.03217221796512604, 0.03723141551017761, 0.04086548462510109, 0.021840054541826248, 0.053727246820926666, 0.0369107611477375, 0.026578597724437714, -0.022196335718035698, -0.01601485162973404, -0.02371053211390972, 0.04122176766395569, -0.01439377199858427, 0.03840714320540428, -0.044357042759656906, -0.009067364037036896, 0.01549824420362711, 0.0026609771884977818, -0.04075860232114792, -0.022659502923488617, -0.0058519234880805016, -0.024440908804535866, 0.028627216815948486, -0.03003452904522419, 0.08572132140398026, -0.02499314583837986, 0.028734100982546806, 0.0028836531564593315, 0.07325147092342377, 0.027950281277298927, 0.01024309266358614, 0.06915423274040222, -0.00022225840075407177, -0.004970126785337925, 0.035770662128925323, -0.06587644666433334, 0.016709601506590843, -0.025260357186198235, 0.025972919538617134, -0.023657090961933136, 0.03060457855463028, -0.0023559113033115864, 0.006043424364179373, 0.026863623410463333, -0.022712944075465202, -0.01065281592309475, -0.0076645053923130035, 0.04799111559987068, 0.028217492625117302, -0.04742106422781944, -0.03238598629832268, 0.004304325673729181, -0.004694008268415928, 0.09911751002073288, -0.022837642580270767, 0.03958287090063095, -0.03277789428830147, -0.00539766438305378, 0.01679867133498192, 0.034167394042015076, -0.04699352756142616, 0.003511599265038967, 0.02349676378071308, -0.04275377839803696, -0.02613324671983719, -0.011498984880745411, -0.00919206254184246, -0.0642375499010086, 0.016754137352108955, -0.03252849727869034, 0.046637244522571564, -0.013209136202931404, -0.04025980830192566, -0.0308896042406559, 0.06929674744606018, -0.025082215666770935, -0.04713603854179382, 0.04254001006484032, -0.03493339940905571, -0.021840054541826248, -0.02134126052260399, -0.011792916804552078, 0.06833478808403015, 0.03669699281454086, 0.022374477237462997, 0.004206348210573196, -0.03206533193588257, 0.016852114349603653, -0.03284915164113045, -0.05101950839161873, -0.03993915393948555, -0.0141978170722723, 0.02803935296833515, -0.05233775079250336, -0.002554092789068818, -0.06167232245206833, -0.04168493300676346, 0.06120915710926056, 0.006128041539341211, -0.03386455401778221, -0.01734200119972229, 0.023122668266296387, -0.04795548692345619, -0.036590106785297394, 0.021537214517593384, -0.04111488163471222, 0.02563445270061493, -0.044677697122097015, -0.044143274426460266, -0.01230061799287796, -0.026756739243865013, -0.08258605003356934, -0.054867349565029144, -0.07040122151374817, -0.021982567384839058, 0.044962722808122635, -0.03712452948093414, -0.007660051807761192, -0.020147718489170074, -0.006836150772869587, 0.04061608761548996, 0.017814073711633682, -0.001882724929600954, -0.02002301998436451, -0.008862501941621304, -0.01480349525809288, -0.07966453582048416, -0.0065199509263038635, 0.0009513829136267304, 0.01691446267068386, 0.06623272597789764, 0.07745559513568878, -0.005005754996091127, -0.01043904758989811, 0.034879956394433975, 0.03249287232756615, -0.017956586554646492, -0.08736021816730499, 0.017466699704527855, 0.008430510759353638, -0.01744888536632061, 0.012817226350307465, -0.004201894626021385, -0.024298395961523056, 0.005411025136709213, -0.0011456676293164492, -0.020147718489170074, 0.03865654021501541, 0.045889053493738174, -0.029838573187589645, -0.01480349525809288, 0.013894977979362011, -0.012843946926295757, 0.02900131233036518, 0.02399555779993534, -0.04172056168317795, 0.026418272405862808, 0.045604027807712555, -0.010991283692419529, -0.015061799436807632, -0.016834300011396408, 0.034345533698797226, 0.00033457056269980967, 0.018580079078674316, -0.0067738015204668045, -0.03258194029331207, -0.05778885632753372, -0.07439157366752625, 0.0011890893802046776, 0.007606609724462032, -0.03822900354862213, -0.015569500625133514, 0.06170795112848282, -0.00814993865787983, 0.014990543015301228, 0.0009352389024570584, 0.01503507886081934, 0.020860280841588974, -0.027433674782514572, 0.045105233788490295, 0.04025980830192566, 0.034986842423677444, 0.007775843143463135, 0.03571721911430359, 0.01573873497545719, 0.02009427547454834, -0.03947598859667778, 0.08087589591741562, 0.0032532953191548586, -0.05921398103237152, -0.029268523678183556, 0.015329010784626007, -0.011650403961539268, 0.03049769438803196, 0.006074598990380764, -0.0075353533029556274, -0.026863623410463333, -0.0022189656738191843, -0.007352759130299091, 0.009628507308661938, 0.027718698605895042, 0.0649857446551323, -0.05953463539481163, -0.012781597673892975, 0.011053632944822311, -0.0003292820183560252, -0.007023198530077934, 0.00487214932218194, 0.0020742262713611126, -0.02435183897614479, 0.01299536693841219, -0.006845057941973209, -0.005647061392664909, 0.015569500625133514, 0.05810951068997383, -0.01816144771873951, 0.015916874632239342, 0.053941015154123306, -0.00495231244713068, 0.008724442683160305, 0.047100409865379333, -0.019399527460336685, 0.010447954759001732, 0.07367900758981705, -0.00123807811178267, 0.02481500431895256, 0.030123598873615265, -0.04877493530511856, -0.034238651394844055, -0.0005555764073505998, -0.004996847826987505, 0.03447023406624794, -0.027433674782514572, -0.011864173226058483, 0.0009202082292176783, -0.034274280071258545, -0.011472263373434544, 0.003921322990208864, -0.0134050901979208, 0.056684382259845734, -0.0027522745076566935, -0.0011902027763426304, 0.007263688836246729, 0.0009619600023142993 ]
39,407
pyspark.sql.dataframe
randomSplit
Randomly splits this :class:`DataFrame` with the provided weights. .. versionadded:: 1.4.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Parameters ---------- weights : list list of doubles as weights with which to split the :class:`DataFrame`. Weights will be normalized if they don't sum up to 1.0. seed : int, optional The seed for sampling. Returns ------- list List of DataFrames. Examples -------- >>> from pyspark.sql import Row >>> df = spark.createDataFrame([ ... Row(age=10, height=80, name="Alice"), ... Row(age=5, height=None, name="Bob"), ... Row(age=None, height=None, name="Tom"), ... Row(age=None, height=None, name=None), ... ]) >>> splits = df.randomSplit([1.0, 2.0], 24) >>> splits[0].count() 2 >>> splits[1].count() 2
def randomSplit(self, weights: List[float], seed: Optional[int] = None) -> List["DataFrame"]: """Randomly splits this :class:`DataFrame` with the provided weights. .. versionadded:: 1.4.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Parameters ---------- weights : list list of doubles as weights with which to split the :class:`DataFrame`. Weights will be normalized if they don't sum up to 1.0. seed : int, optional The seed for sampling. Returns ------- list List of DataFrames. Examples -------- >>> from pyspark.sql import Row >>> df = spark.createDataFrame([ ... Row(age=10, height=80, name="Alice"), ... Row(age=5, height=None, name="Bob"), ... Row(age=None, height=None, name="Tom"), ... Row(age=None, height=None, name=None), ... ]) >>> splits = df.randomSplit([1.0, 2.0], 24) >>> splits[0].count() 2 >>> splits[1].count() 2 """ for w in weights: if w < 0.0: raise PySparkValueError( error_class="VALUE_NOT_POSITIVE", message_parameters={"arg_name": "weights", "arg_value": str(w)}, ) seed = seed if seed is not None else random.randint(0, sys.maxsize) df_array = self._jdf.randomSplit( _to_list(self.sparkSession._sc, cast(List["ColumnOrName"], weights)), int(seed) ) return [DataFrame(df, self.sparkSession) for df in df_array]
(self, weights: List[float], seed: Optional[int] = None) -> List[pyspark.sql.dataframe.DataFrame]
[ 0.04223790764808655, -0.030086779966950417, -0.048386234790086746, -0.03614415228366852, -0.0032287808135151863, 0.01926354318857193, 0.039254698902368546, 0.05686292052268982, -0.0021942066960036755, 0.06573979556560516, -0.004215605091303587, 0.030723439529538155, 0.003906369674950838, 0.01241488941013813, 0.008403925225138664, -0.007235197350382805, 0.027176329866051674, 0.026994425803422928, 0.026503287255764008, 0.024138545617461205, -0.03385217487812042, -0.007262482773512602, 0.042892761528491974, 0.03805413842201233, -0.031160008162260056, 0.0395093634724617, -0.049986980855464935, 0.009013300761580467, 0.06992356479167938, 0.04303828254342079, -0.009986482560634613, -0.016162093728780746, -0.03612596169114113, 0.03910917416214943, -0.04907746613025665, -0.027685657143592834, 0.009640865959227085, 0.014406728558242321, 0.034197788685560226, -0.013842828571796417, 0.05679015815258026, -0.024702446535229683, 0.04623977839946747, -0.013942875899374485, -0.05264277011156082, 0.030323253944516182, 0.055553220212459564, -0.010150195099413395, -0.004656720440834761, -0.030723439529538155, 0.05289743095636368, 0.03156019374728203, -0.053515903651714325, 0.02024582028388977, -0.016162093728780746, 0.023683788254857063, -0.00854489952325821, -0.018062980845570564, 0.03940021991729736, -0.03798137605190277, 0.03998231142759323, -0.05591702461242676, -0.03447064384818077, 0.0619925893843174, 0.022228563204407692, -0.04780414327979088, -0.05333400145173073, -0.013342595659196377, -0.03718100115656853, -0.034798070788383484, 0.018117552623152733, -0.003451612079516053, 0.008735897950828075, 0.08542171120643616, -0.08840492367744446, 0.05435265973210335, 0.029522879049181938, -0.016598660498857498, -0.018617786467075348, -0.003278804011642933, 0.017144370824098587, -0.03958212211728096, -0.0202821996062994, -0.042456191033124924, 0.03241514042019844, 0.014488585293293, -0.007994643412530422, 0.06366609781980515, 0.04358399286866188, -0.05107840150594711, -0.003490266390144825, 0.053625043481588364, -0.013997446745634079, -0.04041887819766998, 0.022501418367028236, -0.022210372611880302, -0.004583959002047777, 0.011614515446126461, 0.008340259082615376, 0.0035880394279956818, -0.008126522414386272, 0.001915667438879609, 0.03097810409963131, 0.06031908094882965, -0.008908705785870552, -0.025739293545484543, -0.017098894342780113, -0.029231835156679153, -0.01970010995864868, -0.03203314170241356, -0.01841769367456436, 0.08309335261583328, 0.056608255952596664, 0.03545292094349861, -0.014806915074586868, 0.021901138126850128, -0.00014964374713599682, 0.05540769547224045, -0.02541186846792698, 0.010868712328374386, -0.01035938411951065, 0.04736757650971413, -0.03343379870057106, -0.039363838732242584, -0.021155335009098053, 0.008481234312057495, 0.027030806988477707, -0.043438468128442764, -0.06875938922166824, 0.0660308375954628, 0.03505273535847664, 0.001944089774042368, -0.01212384458631277, 0.006289300974458456, -0.030541537329554558, -0.02333817258477211, -0.007112412713468075, 0.044457126408815384, 0.03709004819393158, -0.04212876781821251, -0.026521477848291397, -0.02794032171368599, 0.026521477848291397, 0.03368845954537392, -0.005297929048538208, 0.047440338879823685, 0.030632488429546356, -0.00004988125147065148, 0.009040585719048977, 0.039836786687374115, 0.012924217619001865, 0.028686124831438065, -0.011105186305940151, -0.06694035232067108, -0.0456576868891716, -0.03305179998278618, 0.00785821583122015, 0.02683071233332157, 0.02539367787539959, -0.010086528956890106, 0.0119419414550066, 0.0012824170989915729, 0.007062389515340328, 0.016780564561486244, -0.06031908094882965, 0.07243382930755615, 0.011478087864816189, -0.008390282280743122, -0.0802556648850441, -0.026485096663236618, 0.04602149501442909, 0.07265211641788483, 0.030759820714592934, -0.031778477132320404, -0.028977170586586, 0.03539834916591644, 0.008353902027010918, -0.02379292994737625, 0.00546164158731699, -0.03199676051735878, 0.02834050916135311, -0.060610126703977585, -0.002576203318312764, -0.040855444967746735, -0.005161501467227936, 0.050969257950782776, -0.05311571806669235, 0.008426662534475327, 0.0018065255135297775, 0.023611027747392654, -0.04151029512286186, -0.0370536707341671, -0.011268899776041508, 0.005616259295493364, -0.02983211539685726, 0.007071484345942736, -0.008558542467653751, -0.06177430599927902, -0.08513066917657852, 0.011059710755944252, 0.05395247042179108, -0.0036858124658465385, 0.042856380343437195, -0.05620807036757469, 0.04194686561822891, 0.00049881252925843, -0.06504856050014496, -0.025684723630547523, 0.041292011737823486, -0.049041084945201874, -0.00120056071318686, -0.056062545627355576, 0.027158139273524284, 0.06639464199542999, 0.058645572513341904, -0.0013142501702532172, -0.06377524137496948, 0.007658122107386589, 0.056098926812410355, -0.03692633658647537, 0.024575114250183105, -0.0677771121263504, -0.050459932535886765, 0.04860451817512512, -0.016325807198882103, 0.0014029279118403792, 0.03310637176036835, -0.04409332200884819, -0.03343379870057106, -0.01988201215863228, -0.028249558061361313, -0.10419411957263947, 0.02988668531179428, -0.11714562028646469, -0.03296084702014923, 0.014615917578339577, 0.011096091009676456, -0.0050932876765728, 0.03192400187253952, 0.026194052770733833, -0.05216981843113899, 0.03261523321270943, 0.05333400145173073, -0.02137361839413643, 0.042456191033124924, 0.05111478269100189, -0.03290627896785736, -0.03998231142759323, 0.027594706043601036, -0.00810378510504961, -0.009308893233537674, -0.02488434873521328, 0.00991372112184763, -0.020427722483873367, 0.04711291193962097, 0.002692166483029723, -0.008403925225138664, 0.04147391393780708, -0.04925936833024025, 0.03849070519208908, -0.01520710252225399, -0.06464837491512299, -0.029031740501523018, 0.041364774107933044, -0.03516187518835068, 0.01645313948392868, -0.07210640609264374, 0.03707186132669449, 0.032778944820165634, -0.008040118962526321, -0.03718100115656853, 0.024702446535229683, 0.0033970412332564592, -0.010595858097076416, 0.03667167201638222, -0.02639414556324482, -0.031723909080028534, -0.026084909215569496, -0.041801340878009796, -0.012242081575095654, 0.04256533458828926, -0.027594706043601036, -0.006548513192683458, 0.018117552623152733, 0.009486248716711998, 0.07676312327384949, -0.003824513405561447, -0.021701045334339142, 0.038345180451869965, -0.023047126829624176, -0.05693568289279938, 0.0074080051854252815, 0.01116885244846344, 0.04049164056777954, -0.04551216587424278, 0.008685874752700329, 0.04609425365924835, -0.036235105246305466, -0.0031855786219239235, 0.002269241726025939, -0.017917459830641747, -0.0027785704005509615, 0.05726310983300209, 0.0883321613073349, -0.005816353019326925, -0.04005507007241249, -0.03638062626123428, -0.04860451817512512, 0.004161034245043993, 0.021537331864237785, 0.006830462720245123, 0.05086011812090874, 0.029650211334228516, -0.017871983349323273, 0.046421680599451065, -0.06606721878051758, 0.0022123968228697777, -0.00374720455147326, -0.01188736967742443, 0.02635776437819004, -0.011496278457343578, 0.006966890301555395, -0.008799564093351364, 0.046967390924692154, -0.011650895699858665, 0.08578552305698395, 0.026994425803422928, -0.028540601953864098, -0.031687527894973755, 0.011405326426029205, -0.007776359096169472, -0.020646005868911743, 0.041837722063064575, -0.013942875899374485, 0.005670830141752958, -0.025993958115577698, 0.01852683536708355, -0.017180752009153366, 0.02837689034640789, -0.037235572934150696, 0.04605787619948387, -0.1006288155913353, 0.014306682161986828, -0.007535337470471859, 0.03136010095477104, 0.020009344443678856, 0.028686124831438065, 0.0373992845416069, 0.007035104092210531, 0.016762373968958855, 0.051951535046100616, 0.007139698136597872, 0.007066937163472176, 0.0328335165977478, 0.033797603100538254, -0.010277527384459972, -0.044893693178892136, 0.05067821592092514, 0.008995110169053078, 0.013588164933025837, 0.003849525237455964, -0.028813457116484642, 0.05260638892650604, 0.0027421899139881134, 0.028558792546391487, -0.013888305053114891, 0.01758093759417534, 0.006052826996892691, -0.01671689935028553, -0.02884983830153942, -0.0006343871937133372, -0.016134807839989662, 0.010068338364362717, 0.01979106105864048, 0.035762157291173935, -0.01882697455585003, -0.07381629198789597, -0.010222956538200378, 0.07567170262336731, 0.05980975180864334, 0.004161034245043993, -0.06242915615439415, 0.1397743672132492, -0.037835851311683655, -0.015361719764769077, 0.00457486417144537, 0.003997321706265211, -0.0437295138835907, -0.032269615679979324, -0.01599838025867939, -0.0278311800211668, 0.03965488448739052, -0.0026739761233329773, 0.037362903356552124, -0.05176963284611702, 0.019427254796028137, -0.00874499324709177, -0.017871983349323273, 0.01845407299697399, 0.036726243793964386, 0.008572185412049294, -0.024065785109996796, -0.10222956538200378, 0.026667000725865364, -0.03041420504450798, 0.022628750652074814, -0.018272170796990395, -0.0065394178964197636, -0.019500017166137695, -0.059154901653528214, -0.0005803846870549023, 0.01603476144373417, -0.024775207042694092, 0.014133874326944351, 0.04682186618447304, 0.05035078898072243, 0.017444511875510216, 0.054570943117141724, 0.0598825141787529, 0.027521945536136627, 0.0456576868891716, -0.02333817258477211, 0.02233770489692688, 0.03303360939025879, 0.014306682161986828, -0.0283586997538805, 0.015298053622245789, -0.016253044828772545, 0.007649026811122894, -0.019645538181066513, -0.01924535259604454, -0.035289209336042404, -0.07647208124399185, 0.0022601464297622442, 0.05078735575079918, -0.02173742465674877, -0.00634387182071805, 0.04660358279943466, -0.050969257950782776, 0.007267030421644449, 0.03707186132669449, -0.013006074354052544, 0.020063916221261024, -0.029541069641709328, 0.021573713049292564, -0.016071142628788948, 0.018645072355866432, -0.008467591367661953, -0.07945529371500015, -0.03156019374728203, 0.07192450016736984, -0.0031423766631633043, 0.04733119532465935, 0.04223790764808655, -0.07174259424209595, 0.057590533047914505, 0.029704783111810684, 0.005261548329144716, -0.02635776437819004, 0.008908705785870552, 0.060610126703977585, -0.012542221695184708, 0.0067031304351985455, -0.009677247144281864, -0.0349435918033123, 0.004583959002047777, 0.007908239029347897, -0.06330229341983795, 0.04314742609858513, -0.006412085611373186, 0.0763993188738823, 0.0037176453042775393, 0.0027444635052233934, -0.07163345813751221, 0.058063481003046036, 0.02583024650812149, -0.06435733288526535, -0.05431627854704857, -0.015288959257304668, -0.0023090329486876726, -0.062210872769355774, 0.026667000725865364, 0.00046328455209732056, 0.00884958729147911, -0.03463435918092728, -0.0870952233672142, -0.056571874767541885, 0.00962267629802227, 0.07203364372253418, -0.040309734642505646, -0.023592837154865265, -0.006352967116981745, 0.02137361839413643, -0.012815075926482677, -0.0010135415941476822, 0.009468058124184608, 0.0507509745657444, 0.05675378069281578, 0.03503454476594925, -0.023720169439911842, 0.019481826573610306, 0.012333032675087452, -0.012587697245180607, -0.013378975912928581, -0.016007475554943085, -0.04525750130414963, 0.07210640609264374, -0.019972965121269226, -0.08127432316541672, -0.061119455844163895, -0.019500017166137695, 0.02233770489692688, -0.030159540474414825, 0.06686759740114212, 0.0006122177583165467, 0.0016496340977028012, -0.0101865753531456, 0.028613364323973656, 0.04027335345745087, 0.00075944559648633, 0.033761221915483475, -0.008071951568126678, 0.02437502145767212, 0.06246553733944893, -0.015816478058695793, -0.01866326294839382, -0.041837722063064575, 0.013115216046571732, 0.07588998973369598, 0.05216981843113899, -0.04754947870969772, 0.044930074363946915, 0.01188736967742443, 0.002216944471001625, 0.037290144711732864, -0.013078835792839527, -0.01777193695306778, -0.008399377577006817, 0.016607755795121193, -0.007453481201082468, -0.04856813699007034, 0.05035078898072243, -0.05693568289279938, -0.025084443390369415, -0.03095991350710392, 0.005557140801101923, 0.0065394178964197636, 0.021228095516562462, 0.013879209756851196, -0.019936583936214447, 0.05842728912830353, 0.004661268088966608, 0.02284703403711319, -0.016880610957741737, 0.04616701602935791, -0.06995994597673416, -0.01040485966950655, 0.012014701962471008, -0.03907279297709465, -0.00619834940880537, 0.0007071484578773379, -0.025684723630547523, 0.09408030658960342, -0.02124628610908985, 0.022919796407222748, 0.01497972384095192, -0.002621679101139307, -0.0059709707275033, -0.024211307987570763, -0.05133306607604027, 0.006030089221894741, 0.044311605393886566, 0.0841120108962059, -0.03750842809677124, 0.014643202535808086, -0.018572309985756874, -0.023683788254857063, 0.001041963929310441, -0.052970193326473236, -0.002342002931982279, -0.03481626138091087, 0.005288833752274513, -0.026739761233329773, 0.029559260234236717, -0.018399503082036972, 0.008508519269526005, -0.04216514900326729, 0.004108737222850323, 0.01569824106991291, 0.05751777067780495, 0.004906837362796068, 0.03448883444070816, 0.03134191036224365, -0.021537331864237785, -0.01850864477455616, -0.00556168844923377, -0.0723610669374466, -0.032687995582818985, -0.007448933552950621, -0.015589099377393723, 0.019099829718470573, 0.0647938996553421, 0.041401155292987823, 0.0032037689816206694, 0.04329294711351395, -0.03359751030802727, -0.0019804704934358597, 0.0017690079985186458, 0.00040075535071082413, 0.011514469049870968, -0.023538265377283096, 0.057554151862859726, 0.054061613976955414, -0.04314742609858513, 0.03765394911170006, 0.0208097193390131, -0.03199676051735878, -0.06661292910575867, 0.037835851311683655, -0.057008445262908936, -0.012833266519010067, 0.005084192845970392, 0.05184239521622658, 0.026175862178206444, -0.00619834940880537, 0.016798755154013634, -0.03896365314722061, -0.02843146026134491, -0.04151029512286186, -0.002040725899860263, -0.0009493069956079125, -0.049441274255514145, 0.02492072992026806, -0.04602149501442909, 0.0314328633248806, 0.015198007225990295, -0.002676249947398901, -0.06923233717679977, 0.04154667630791664, -0.04201962426304817, 0.03403407707810402, -0.021519141271710396, 0.04154667630791664, -0.034306932240724564, 0.0022499144542962313, -0.08542171120643616, -0.016253044828772545, 0.02277427352964878, -0.005748139228671789, 0.030214112251996994, -0.02943192794919014, -0.029722973704338074, -0.04576683044433594, -0.016835136339068413, 0.05209705978631973, 0.04169220104813576, -0.014816010370850563, -0.019081639125943184, 0.040855444967746735, 0.004320199601352215, -0.0009925089543685317, 0.013660925440490246, 0.026048529893159866, 0.005948232486844063, -0.03998231142759323, 0.024120356887578964, 0.020646005868911743, 0.0424925722181797, 0.023592837154865265, -0.010486716404557228, -0.018026601523160934, 0.022446846589446068, -0.046967390924692154, -0.01069590449333191, -0.020082106813788414, 0.031178198754787445, -0.10936016589403152, -0.04100096598267555, -0.03347017616033554, -0.030814392492175102, 0.02895897999405861, 0.010786856524646282, -0.02331998199224472, -0.02741280384361744, 0.03159657493233681, -0.009686342440545559, -0.0007440975168719888, -0.0045202928595244884, -0.0007725199102424085, -0.01594381034374237, -0.02084610052406788, -0.0005727106472477317, 0.03561663627624512, 0.028522411361336708, -0.04962317645549774, 0.018899736925959587, 0.017708269879221916, -0.03659891337156296, -0.022192182019352913, 0.030468774959445, -0.05282467231154442, 0.03659891337156296, -0.016389472410082817, 0.03308818116784096, 0.07294315844774246, -0.00031037224107421935, -0.04525750130414963, 0.05937318503856659, 0.03707186132669449, -0.019863823428750038, -0.03396131470799446, -0.03900003433227539, -0.011760038323700428, 0.007708145305514336, -0.07301592081785202, 0.025684723630547523, -0.011250709183514118, 0.01880878396332264, 0.00211803475394845, 0.008290235884487629, -0.01775374636054039, -0.03341560810804367, 0.06297487020492554, -0.037799473851919174, -0.028522411361336708, -0.07439838349819183, 0.044384364038705826, 0.06846833974123001, 0.03889089077711105, -0.019027069211006165, 0.012387603521347046, 0.006325681693851948, 0.018062980845570564, 0.0067940824665129185, 0.020154867321252823, -0.03232418745756149, 0.03192400187253952, 0.0039450242184102535, -0.01759912818670273, 0.00960448570549488, 0.006689487956464291, -0.032742563635110855, -0.010031958110630512, -0.004688553512096405, 0.006393895484507084, 0.034306932240724564, 0.0014620465226471424, -0.02948649972677231, 0.03596225008368492, -0.023592837154865265, -0.008776826784014702, -0.03232418745756149, -0.0062665631994605064, -0.012987883761525154, -0.0437295138835907, 0.011741847731173038, -0.0007520557846873999, -0.024193117395043373, -0.0228288434445858, -0.05930042266845703, 0.0022214921191334724, 0.052460864186286926, 0.02228313498198986, 0.028267748653888702, -0.006480299402028322, 0.008567637763917446, 0.05187877640128136, 0.013642735779285431 ]
39,408
pyspark.sql.dataframe
registerTempTable
Registers this :class:`DataFrame` as a temporary table using the given name. The lifetime of this temporary table is tied to the :class:`SparkSession` that was used to create this :class:`DataFrame`. .. versionadded:: 1.3.0 .. versionchanged:: 3.4.0 Supports Spark Connect. .. deprecated:: 2.0.0 Use :meth:`DataFrame.createOrReplaceTempView` instead. Parameters ---------- name : str Name of the temporary table to register. Examples -------- >>> df = spark.createDataFrame([(2, "Alice"), (5, "Bob")], schema=["age", "name"]) >>> df.registerTempTable("people") >>> df2 = spark.sql("SELECT * FROM people") >>> sorted(df.collect()) == sorted(df2.collect()) True >>> spark.catalog.dropTempView("people") True
def registerTempTable(self, name: str) -> None: """Registers this :class:`DataFrame` as a temporary table using the given name. The lifetime of this temporary table is tied to the :class:`SparkSession` that was used to create this :class:`DataFrame`. .. versionadded:: 1.3.0 .. versionchanged:: 3.4.0 Supports Spark Connect. .. deprecated:: 2.0.0 Use :meth:`DataFrame.createOrReplaceTempView` instead. Parameters ---------- name : str Name of the temporary table to register. Examples -------- >>> df = spark.createDataFrame([(2, "Alice"), (5, "Bob")], schema=["age", "name"]) >>> df.registerTempTable("people") >>> df2 = spark.sql("SELECT * FROM people") >>> sorted(df.collect()) == sorted(df2.collect()) True >>> spark.catalog.dropTempView("people") True """ warnings.warn("Deprecated in 2.0, use createOrReplaceTempView instead.", FutureWarning) self._jdf.createOrReplaceTempView(name)
(self, name: str) -> NoneType
[ 0.04850698262453079, -0.03633283078670502, 0.016687313094735146, -0.06451163440942764, 0.017218271270394325, 0.023172607645392418, -0.03703445568680763, 0.04903794080018997, -0.04456270858645439, -0.042742274701595306, 0.03219892829656601, 0.02042299509048462, 0.0008254767744801939, 0.020024774596095085, -0.00012096227146685123, -0.04596595838665962, 0.07376550883054733, 0.017863009124994278, -0.003102797083556652, -0.023153645917773247, -0.029297610744833946, -0.029335536062717438, 0.0007063663215376437, -0.007367068901658058, -0.027628879994153976, 0.020233366638422012, -0.016042575240135193, -0.008263063617050648, -0.024841340258717537, -0.00023096163931768388, -0.04168035462498665, -0.002458060160279274, -0.039632365107536316, 0.03722408413887024, -0.02267957478761673, -0.04357663914561272, 0.002183098578825593, -0.012714594602584839, 0.005703078582882881, -0.0047241211868822575, 0.04573840647935867, -0.04782431945204735, -0.017113976180553436, -0.03394351154565811, -0.014762582257390022, -0.005418635904788971, -0.02711688168346882, -0.014753101393580437, 0.0829055979847908, -0.01806211844086647, 0.026396293193101883, -0.004570047836750746, -0.07615482807159424, 0.023115720599889755, -0.0266428105533123, 0.002032581018283963, -0.022603722289204597, 0.0321420393884182, 0.02516370825469494, -0.014250585809350014, 0.030890490859746933, 0.03756541386246681, 0.017891453579068184, 0.03077671304345131, -0.04224923998117447, -0.0030198346357792616, -0.0033422030974179506, -0.04873453825712204, -0.027818508446216583, 0.01234481856226921, -0.052489183843135834, -0.010960530489683151, 0.003711978904902935, 0.0469520278275013, -0.01919989101588726, 0.014696212485432625, -0.009291798807680607, -0.0816161260008812, -0.0846501812338829, 0.002238802146166563, 0.019816182553768158, -0.03631386533379555, 0.001124734291806817, 0.012373263016343117, -0.01541680097579956, 0.05047911778092384, -0.02381734549999237, 0.0020788030233234167, -0.05161689221858978, -0.02123839780688286, 0.06826627999544144, -0.030131977051496506, -0.01471517514437437, 0.04448685795068741, -0.008182471618056297, -0.047710541635751724, -0.010827790014445782, -0.02522059716284275, -0.01808108203113079, -0.027344437316060066, 0.0013072517467662692, 0.01918092742562294, -0.022508908063173294, -0.021143583580851555, -0.0073244026862084866, -0.03729993477463722, 0.004212124273180962, -0.01861204206943512, 0.004005902912467718, -0.008708691224455833, 0.023020906373858452, 0.039328962564468384, 0.006693887524306774, 0.017322568222880363, -0.0076704747043550014, 0.002254209481179714, -0.012809408828616142, 0.006063372828066349, -0.030435381457209587, 0.0201764777302742, 0.010296829976141453, -0.010998455807566643, 0.0526408851146698, -0.021409062668681145, -0.05313391983509064, 0.054726798087358475, 0.0349864661693573, 0.01706656999886036, -0.027306510135531425, 0.04911379516124725, 0.045776329934597015, -0.0008859208901412785, 0.026965180411934853, 0.0408080630004406, -0.001667545991949737, 0.040428806096315384, 0.04922756925225258, 0.014222141355276108, -0.015511615201830864, 0.0013759922003373504, -0.0037664971314370632, -0.00701151555404067, -0.041566576808691025, 0.051958221942186356, 0.040466733276844025, -0.04118731990456581, -0.033753883093595505, 0.007954917848110199, -0.012155190110206604, -0.013122295960783958, 0.002032581018283963, -0.0023573199287056923, 0.010230460204184055, 0.025998074561357498, -0.014819471165537834, -0.004681454971432686, 0.0304922703653574, 0.034569285809993744, -0.032047223299741745, 0.00909268856048584, 0.060301877558231354, 0.03155418857932091, -0.03411417454481125, 0.017787158489227295, -0.07789940387010574, 0.012145708315074444, 0.06500466912984848, 0.049151718616485596, -0.052754662930965424, -0.006068113725632429, 0.02518267184495926, 0.024974079802632332, 0.05173066630959511, 0.04452478140592575, -0.007784252054989338, 0.005191081669181585, 0.023912159726023674, 0.01402303110808134, 0.026434220373630524, 0.004498937167227268, 0.037698157131671906, 0.02243305742740631, -0.11385297775268555, 0.045245371758937836, -0.01846981979906559, -0.027059994637966156, 0.020555734634399414, 0.006490036845207214, 0.08100931346416473, 0.03525194525718689, 0.010846752673387527, 0.012193115428090096, 0.05320977047085762, 0.02383630909025669, 0.018014712259173393, -0.051389336585998535, -0.0030553899705410004, 0.02577051892876625, -0.07293114066123962, 0.031250786036252975, 0.0397082194685936, 0.013700662180781364, 0.018640486523509026, -0.03951859101653099, 0.11612851917743683, -0.029563089832663536, 0.023400163277983665, -0.028216727077960968, 0.022186540067195892, -0.03754645213484764, 0.042135462164878845, -0.007599364034831524, -0.04653484746813774, 0.05480264872312546, 0.0007034033769741654, 0.07270358502864838, 0.01413680799305439, -0.04668654873967171, 0.020043738186359406, -0.022850239649415016, -0.008130324073135853, -0.004790491424500942, 0.011500971391797066, 0.039897847920656204, -0.026206664741039276, -0.06299460679292679, 0.005385450553148985, -0.01117860246449709, 0.013349849730730057, -0.05939166247844696, 0.0690627172589302, -0.0039442735724151134, 0.052792586386203766, -0.03638971969485283, -0.06640791893005371, 0.08836690336465836, 0.02383630909025669, -0.050213638693094254, 0.013179183937609196, -0.030890490859746933, -0.0066796657629311085, 0.020233366638422012, 0.03811533749103546, -0.028975242748856544, 0.019455889239907265, 0.005172118544578552, 0.0051389336585998535, 0.046307291835546494, 0.014098882675170898, -0.030890490859746933, 0.00700677465647459, -0.027951247990131378, 0.029335536062717438, -0.010154608637094498, 0.012951630167663097, -0.014923767186701298, -0.006935663986951113, 0.05495435371994972, 0.0007389587699435651, 0.01934211142361164, -0.0493413470685482, -0.02491719089448452, -0.01694331131875515, 0.050858378410339355, -0.03472098708152771, -0.07843036949634552, -0.07782355695962906, 0.00980379618704319, -0.07198299467563629, -0.016345981508493423, 0.09360065311193466, 0.001668731216341257, 0.012686150148510933, -0.04278020188212395, 0.04790017008781433, -0.06625621765851974, 0.016298573464155197, 0.02941138856112957, -0.036275941878557205, -0.006807664874941111, -0.016526127234101295, -0.04642106965184212, 0.0054613021202385426, 0.002545763272792101, -0.0403529554605484, -0.0013309554196894169, 0.025296447798609734, 0.01218363456428051, 0.0392531082034111, -0.05434754118323326, -0.058064259588718414, -0.0338866226375103, -0.0453970730304718, 0.02099188044667244, -0.012231041677296162, 0.013198146596550941, -0.05829181522130966, -0.03845667093992233, -0.0693281963467598, 0.049720603972673416, 0.015881391242146492, -0.015445245429873466, -0.0024225045926868916, 0.1026269719004631, -0.000562070868909359, -0.03354528918862343, -0.03902555629611015, -0.0221486147493124, -0.005902188364416361, 0.020536771044135094, 0.027553027495741844, 0.015284061431884766, 0.008367359638214111, -0.052489183843135834, -0.027609916403889656, 0.011519934050738811, 0.026472145691514015, 0.004186050035059452, -0.003439387772232294, 0.021484915167093277, 0.009647352620959282, 0.0109131233766675, -0.0583297424018383, -0.034246914088726044, 0.028444282710552216, 0.05635760352015495, -0.01217415276914835, -0.06216023862361908, 0.008547507226467133, -0.010012387298047543, -0.039935771375894547, -0.021465951576828957, 0.027249623090028763, -0.01258185412734747, -0.02859598584473133, -0.020328180864453316, 0.008974171243607998, -0.05059289559721947, -0.04509367048740387, -0.0009238465572707355, 0.003273462876677513, -0.016175314784049988, -0.002725910395383835, -0.0034227953292429447, -0.07782355695962906, 0.0497964583337307, -0.027287548407912254, 0.022281354293227196, 0.036256980150938034, 0.04365249350667, -0.007300699129700661, -0.004814194981008768, -0.03692067787051201, 0.0048023429699242115, -0.03309018164873123, -0.036825865507125854, 0.011576822958886623, 0.027609916403889656, -0.02070743776857853, -0.016810569912195206, -0.06022602692246437, 0.021883133798837662, -0.046079736202955246, -0.0453970730304718, -0.002702206838876009, -0.024993043392896652, -0.00002740725176408887, 0.03978407010436058, -0.10300622880458832, -0.048620760440826416, -0.010059794411063194, -0.0018524338956922293, -0.006376259960234165, 0.020214403048157692, -0.0031217599753290415, -0.011719044297933578, 0.032786775380373, 0.01653560996055603, -0.03667416051030159, -0.019190408289432526, 0.032919514924287796, -0.015151320956647396, -0.00021185063815210015, -0.03333669900894165, 0.012600816786289215, -0.019247297197580338, -0.09011148661375046, 0.010476977564394474, -0.001960285007953644, 0.0028776132967323065, 0.009106910787522793, -0.013311924412846565, 0.013292960822582245, 0.022053800523281097, 0.004366197157651186, 0.013226591050624847, -0.023362237960100174, -0.008903060108423233, -0.05146518722176552, 0.05817803740501404, 0.024272454902529716, -0.0015442875446751714, -0.014734137803316116, -0.05935373529791832, 0.024841340258717537, 0.022622685879468918, 0.05377865582704544, -0.06216023862361908, 0.039897847920656204, -0.054461318999528885, 0.0007383661577478051, -0.027287548407912254, 0.020802251994609833, -0.0021392470225691795, -0.06633206456899643, 0.1136254295706749, -0.0497964583337307, 0.0070162564516067505, 0.015587466768920422, 0.041566576808691025, 0.0013771773083135486, 0.008746616542339325, -0.024443119764328003, 0.04334908723831177, -0.04205961152911186, 0.029771681874990463, 0.028614947572350502, -0.009410317055881023, -0.018905965611338615, 0.03254025802016258, -0.04205961152911186, -0.03716719523072243, 0.015369393862783909, 0.016023611649870872, 0.02633940614759922, -0.03864629939198494, 0.0576850026845932, -0.06530807167291641, -0.06633206456899643, 0.03242648020386696, 0.051996149122714996, -0.027230659499764442, 0.03473994880914688, 0.008827208541333675, -0.01258185412734747, -0.04065636172890663, -0.043766267597675323, -0.01302748080343008, -0.06128794699907303, -0.027894359081983566, 0.08434677869081497, -0.03955651447176933, 0.0016876941081136465, -0.03157315403223038, -0.026111850515007973, 0.023608753457665443, -0.0029558350797742605, -0.01747427135705948, 0.0030980564188212156, 0.038494594395160675, 0.008476396091282368, 0.03857044503092766, 0.012240522541105747, 0.03536572307348251, 0.0288425013422966, -0.022869203239679337, -0.014620360918343067, -0.01964551769196987, 0.042135462164878845, -0.01007875707000494, 0.07164166867733002, -0.007243810687214136, -0.027932284399867058, -0.03982199355959892, -0.05377865582704544, 0.022774389013648033, -0.10361304134130478, 0.06614243984222412, 0.07050389051437378, 0.017625972628593445, -0.0027993915136903524, 0.015900352969765663, 0.06344971060752869, 0.01117860246449709, 0.0431973822414875, 0.01135875005275011, 0.03491061553359032, -0.03881696239113808, 0.014904803596436977, -0.004442048724740744, -0.0956486389040947, -0.06743191182613373, -0.04137694835662842, 0.02546711452305317, -0.05525775998830795, -0.01496169250458479, 0.011681118980050087, 0.06394274532794952, 0.025580890476703644, 0.05730574578046799, 0.04395589604973793, -0.06636999547481537, 0.011794895865023136, 0.0017777676694095135, -0.029619978740811348, -0.022281354293227196, 0.0598846971988678, 0.007580401375889778, -0.08282975107431412, 0.008917282335460186, -0.03733786195516586, -0.0029036870691925287, -0.014809989370405674, -0.0013025110820308328, 0.03449343144893646, -0.036579348146915436, -0.022489946335554123, -0.044335152953863144, 0.03693963959813118, -0.01570124365389347, -0.023020906373858452, 0.05396828427910805, 0.026396293193101883, 0.013017999939620495, -0.0020598401315510273, -0.022205503657460213, 0.001886804006062448, -0.01261977944523096, -0.0007792548276484013, 0.09489012509584427, -0.021655580028891563, 0.00227317214012146, -0.048582833260297775, -0.06250157207250595, 0.0018536190036684275, -0.020043738186359406, -0.048355281352996826, -0.005703078582882881, 0.03242648020386696, -0.04983438178896904, -0.005930632818490267, 0.002780428621917963, 0.04259057343006134, -0.06113624572753906, -0.006689147092401981, 0.009765869937837124, -0.011984524317085743, 0.02601703628897667, 0.03902555629611015, -0.07255188375711441, -0.044411007314920425, -0.04721750691533089, 0.018849078565835953, 0.0014791026478633285, 0.007357587572187185, -0.08154027909040451, 0.01698123663663864, 0.01499961782246828, 0.0007644401048310101, 0.0266428105533123, -0.020233366638422012, 0.05423376336693764, 0.062311939895153046, -0.07600311934947968, 0.0005528857582248747, 0.022584760561585426, 0.004214494489133358, -0.012970592826604843, -0.036844827234745026, 0.0011152528459206223, 0.0712624117732048, -0.06413237750530243, 0.057836707681417465, -0.006655962206423283, 0.005413895007222891, 0.03051123395562172, 0.06746983528137207, 0.09853099286556244, -0.028197765350341797, -0.006731813307851553, -0.01355844084173441, 0.024310380220413208, -0.02996131032705307, 0.0003718497173395008, 0.0011916968505829573, 0.03210411220788956, -0.007509290706366301, 0.033203959465026855, -0.00831995252519846, 0.02245202101767063, -0.0345313586294651, 0.005646190140396357, 0.05738160014152527, -0.04486611485481262, 0.01647872105240822, 0.02123839780688286, -0.07664786279201508, 0.03255922347307205, 0.012297411449253559, 0.03773608058691025, 0.012363781221210957, 0.02011958882212639, -0.027344437316060066, -0.047407135367393494, -0.020024774596095085, 0.02690829150378704, -0.05180652067065239, -0.019086113199591637, -0.03161107748746872, -0.00761832669377327, 0.011121714487671852, 0.003605312667787075, 0.0371861569583416, 0.047482989728450775, 0.012297411449253559, 0.02742028795182705, -0.04949305206537247, -0.04843113198876381, 0.006869294214993715, 0.05290636420249939, -0.045510850846767426, 0.07209677249193192, 0.0833607092499733, -0.00630988972261548, -0.007898028939962387, -0.031535226851701736, -0.009908091276884079, 0.005110489204525948, -0.013330887071788311, 0.019550703465938568, -0.011700081638991833, -0.07471364736557007, -0.023324310779571533, -0.044411007314920425, 0.038513559848070145, -0.013947179540991783, -0.041301097720861435, -0.054764725267887115, 0.013842884451150894, 0.05525775998830795, -0.05404413491487503, 0.047407135367393494, 0.07285528630018234, 0.009130614809691906, -0.0356312058866024, -0.01720879040658474, 0.018981818109750748, -0.02353290282189846, 0.03565016761422157, 0.01873530074954033, -0.019237816333770752, 0.02235720492899418, 0.04657277092337608, -0.0154073191806674, 0.059239957481622696, 0.08138857036828995, -0.07710296660661697, -0.026699699461460114, 0.0015893243253231049, 0.044069673866033554, -0.029032129794359207, 0.013236072845757008, -0.007092107553035021, 0.028671836480498314, 0.0014518435345962644, 0.04956890270113945, -0.049189645797014236, 0.011112232692539692, -0.0576850026845932, 0.014819471165537834, -0.020252328366041183, 0.014487621374428272, -0.016971755772829056, -0.013586885295808315, 0.01259133592247963, 0.03638971969485283, -0.061743054538965225, -0.032654035836458206, -0.027363399043679237, -0.010220978409051895, 0.00761832669377327, 0.009822758845984936, 0.044941965490579605, 0.025618817657232285, -0.021958986297249794, 0.060339804738759995, -0.0263204425573349, -0.025941185653209686, -0.017844045534729958, -0.032028261572122574, 0.03108011931180954, 0.031023230403661728, -0.03138352558016777, 0.044107601046562195, -0.0036147942300885916, 0.05905032902956009, 0.05848144367337227, -0.0013534737518057227, 0.017663899809122086, -0.031193895265460014, 0.007803214713931084, 0.017607010900974274, 0.01983514614403248, 0.022793350741267204, -0.0031644264236092567, 0.05127555876970291, 0.03312810882925987, -0.010941566899418831, 0.014610880054533482, -0.08131272345781326, 0.0013108073035255075, -0.008372100070118904, 0.026244591921567917, 0.03834289312362671, -0.058405593037605286, -0.014648805372416973, -0.019114557653665543, -0.036541420966386795, 0.047179583460092545, 0.050820451229810715, 0.03358321636915207, -0.009566760621964931, -0.014990136958658695, 0.046041812747716904, -0.014411769807338715, 0.0016568794380873442, 0.0038376078009605408, -0.007613586261868477, 0.04008747637271881, -0.003629016224294901, -0.017218271270394325, 0.03195241093635559, -0.0521857775747776, 0.03553638979792595, 0.016886422410607338, 0.014335918240249157, 0.025561928749084473, 0.04816565290093422, 0.012942148372530937, 0.012951630167663097, 0.008993133902549744, 0.00902157835662365, -0.016327017918229103, -0.030928416177630424, 0.059808842837810516, 0.00873713567852974, 0.022300317883491516, 0.00901209656149149, 0.02719273418188095, 0.09322139620780945, 0.005892707034945488, 0.02381734549999237, -0.05795048549771309, -0.005997003056108952, 0.03197137266397476, 0.007395513355731964, 0.0015359912067651749, 0.03830496594309807, 0.018924929201602936, -0.017995748668909073, 0.015340949408710003, 0.01816641539335251, 0.0356312058866024, -0.02552400343120098, -0.007969140075147152, 0.023400163277983665, 0.02719273418188095, 0.04114939644932747 ]
39,409
pyspark.sql.dataframe
repartition
Returns a new :class:`DataFrame` partitioned by the given partitioning expressions. The resulting :class:`DataFrame` is hash partitioned. .. versionadded:: 1.3.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Parameters ---------- numPartitions : int can be an int to specify the target number of partitions or a Column. If it is a Column, it will be used as the first partitioning column. If not specified, the default number of partitions is used. cols : str or :class:`Column` partitioning columns. .. versionchanged:: 1.6.0 Added optional arguments to specify the partitioning columns. Also made numPartitions optional if partitioning columns are specified. Returns ------- :class:`DataFrame` Repartitioned DataFrame. Examples -------- >>> df = spark.createDataFrame( ... [(14, "Tom"), (23, "Alice"), (16, "Bob")], ["age", "name"]) Repartition the data into 10 partitions. >>> df.repartition(10).rdd.getNumPartitions() 10 Repartition the data into 7 partitions by 'age' column. >>> df.repartition(7, "age").rdd.getNumPartitions() 7 Repartition the data into 7 partitions by 'age' and 'name columns. >>> df.repartition(3, "name", "age").rdd.getNumPartitions() 3
def repartition( # type: ignore[misc] self, numPartitions: Union[int, "ColumnOrName"], *cols: "ColumnOrName" ) -> "DataFrame": """ Returns a new :class:`DataFrame` partitioned by the given partitioning expressions. The resulting :class:`DataFrame` is hash partitioned. .. versionadded:: 1.3.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Parameters ---------- numPartitions : int can be an int to specify the target number of partitions or a Column. If it is a Column, it will be used as the first partitioning column. If not specified, the default number of partitions is used. cols : str or :class:`Column` partitioning columns. .. versionchanged:: 1.6.0 Added optional arguments to specify the partitioning columns. Also made numPartitions optional if partitioning columns are specified. Returns ------- :class:`DataFrame` Repartitioned DataFrame. Examples -------- >>> df = spark.createDataFrame( ... [(14, "Tom"), (23, "Alice"), (16, "Bob")], ["age", "name"]) Repartition the data into 10 partitions. >>> df.repartition(10).rdd.getNumPartitions() 10 Repartition the data into 7 partitions by 'age' column. >>> df.repartition(7, "age").rdd.getNumPartitions() 7 Repartition the data into 7 partitions by 'age' and 'name columns. >>> df.repartition(3, "name", "age").rdd.getNumPartitions() 3 """ if isinstance(numPartitions, int): if len(cols) == 0: return DataFrame(self._jdf.repartition(numPartitions), self.sparkSession) else: return DataFrame( self._jdf.repartition(numPartitions, self._jcols(*cols)), self.sparkSession, ) elif isinstance(numPartitions, (str, Column)): cols = (numPartitions,) + cols return DataFrame(self._jdf.repartition(self._jcols(*cols)), self.sparkSession) else: raise PySparkTypeError( error_class="NOT_COLUMN_OR_STR", message_parameters={ "arg_name": "numPartitions", "arg_type": type(numPartitions).__name__, }, )
(self, numPartitions: Union[int, ForwardRef('ColumnOrName')], *cols: 'ColumnOrName') -> 'DataFrame'
[ 0.022922083735466003, 0.0003695881168823689, -0.020521080121397972, 0.01226762868463993, -0.017660507932305336, 0.01357129868119955, 0.021946676075458527, 0.01816697046160698, -0.0733056515455246, 0.011564210057258606, 0.02385997585952282, -0.0024080381263047457, 0.010091719217598438, 0.06190088018774986, 0.0018746118294075131, -0.018307654187083244, 0.04644441977143288, 0.013121110387146473, 0.04066700115799904, -0.0020950164180248976, -0.011995640583336353, -0.039203889667987823, 0.04355571046471596, 0.025810791179537773, -0.049858346581459045, 0.030293915420770645, 0.027255145832896233, 0.011461041867733002, -0.0015182128408923745, 0.01122656837105751, 0.007198322098702192, 0.029900001361966133, -0.01901107281446457, 0.0327887088060379, -0.04014178365468979, -0.0035006823018193245, -0.01223011314868927, -0.005088064819574356, 0.07353074103593826, -0.006584002636373043, 0.008525439538061619, 0.019827039912343025, 0.026092158630490303, -0.08576085418462753, -0.015512735582888126, 0.04036687687039375, 0.056723713874816895, -0.04599422961473465, 0.004293201025575399, 0.03802214562892914, 0.017351005226373672, -0.01221135538071394, -0.04603174701333046, -0.019958345219492912, -0.01988331228494644, 0.035058408975601196, 0.002586237620562315, -0.03772202134132385, 0.0041103120893239975, -0.020464805886149406, 0.012295765802264214, -0.02100878395140171, -0.03188833221793175, 0.05706135556101799, -0.011526694521307945, -0.013927698135375977, -0.003512406023219228, -0.0192080307751894, -0.08793676644563675, -0.03901631385087967, -0.015569008886814117, 0.01704150065779686, -0.023240966722369194, 0.05139648914337158, -0.032657403498888016, 0.040441907942295074, -0.038791216909885406, -0.03095044009387493, -0.00456284498795867, 0.006635586731135845, 0.032901257276535034, -0.025473149493336678, -0.03680288791656494, -0.030462736263871193, 0.029881242662668228, 0.028361856937408447, 0.03744065389037132, 0.011320358142256737, 0.0213276669383049, -0.021383941173553467, -0.026167189702391624, 0.06812848150730133, -0.03128807991743088, -0.04059197008609772, 0.05229686573147774, -0.07551907747983932, -0.03185081481933594, 0.008122146129608154, -0.007911119610071182, -0.04873287305235863, 0.011348494328558445, 0.0368216447532177, -0.00912100076675415, -0.02481662482023239, 0.0074843792244791985, -0.0419425368309021, -0.0391288585960865, -0.0004188274615444243, -0.0306690726429224, -0.03147565945982933, -0.03890376538038254, 0.06178833171725273, -0.018232623115181923, 0.04907051473855972, -0.013693224638700485, 0.03742189705371857, -0.008403513580560684, -0.025454392656683922, -0.0013236002996563911, 0.026073401793837547, 0.010729486122727394, 0.045206401497125626, 0.0026659583672881126, -0.024160102009773254, -0.048695359379053116, 0.046932123601436615, 0.033145107328891754, 0.014002729207277298, 0.015071926638484001, 0.004598015919327736, 0.03333268687129021, -0.003667158307507634, -0.013711982406675816, 0.009411747567355633, 0.014743664301931858, -0.0018277172930538654, 0.031100502237677574, 0.052784569561481476, -0.01300856377929449, -0.03168199583888054, 0.01124532613903284, -0.019395608454942703, 0.024403953924775124, 0.06325144320726395, -0.006780960131436586, -0.029862485826015472, 0.04674454405903816, -0.016300564631819725, -0.01759485714137554, 0.10031694173812866, -0.021102573722600937, 0.043480679392814636, 0.05649862065911293, -0.07398092746734619, -0.006621518172323704, 0.009594636037945747, -0.003758602775633335, 0.001907438156194985, -0.009430505335330963, -0.03235727921128273, 0.00725928507745266, -0.013524404726922512, 0.013092974200844765, 0.04351819306612015, -0.03640897199511528, -0.004998965188860893, 0.018035665154457092, -0.04243024066090584, -0.04186750575900078, -0.00002989531094499398, 0.10736989229917526, 0.05661116912961006, 0.04483124241232872, -0.04036687687039375, -0.06426437199115753, 0.05698632448911667, 0.009754078462719917, -0.014584222808480263, -0.04993337765336037, 0.003915699664503336, 0.02093375287950039, -0.031531933695077896, -0.03599629923701286, 0.013458752073347569, 0.03200088068842888, 0.023503577336668968, -0.029562359675765038, -0.015400188975036144, 0.08328481763601303, 0.0182420015335083, -0.06887879967689514, -0.026936260983347893, 0.022265559062361717, 0.0680159404873848, -0.005819620564579964, -0.051096361130476, 0.00532253785058856, -0.0011319185141474009, -0.020389774814248085, 0.0673031359910965, 0.007381211034953594, 0.026955019682645798, 0.057999249547719955, -0.03333268687129021, 0.010851412080228329, -0.003254485782235861, -0.05068369209766388, -0.012877258472144604, 0.09101305156946182, -0.029599875211715698, -0.007882983423769474, -0.044493600726127625, 0.05578582361340523, 0.040516939014196396, 0.03200088068842888, -0.006602760404348373, -0.0016424836358055472, -0.025510665029287338, 0.0754440426826477, -0.03331393003463745, 0.0708296149969101, 0.03965407982468605, -0.01595354452729225, 0.012605270370841026, 0.014368507079780102, -0.06321392953395844, 0.015709692612290382, -0.05342233553528786, -0.03397045284509659, -0.0057680364698171616, -0.01014799252152443, -0.04835771769285202, 0.017707403749227524, -0.0528596006333828, -0.006584002636373043, 0.04378080368041992, -0.0461818091571331, -0.004696494899690151, 0.07960828393697739, 0.007437484338879585, -0.0479450449347496, 0.06017515808343887, 0.018954800441861153, -0.012098808772861958, 0.03123180754482746, -0.008722396567463875, 0.010870169848203659, 0.08501054346561432, -0.025792034342885017, 0.03211342543363571, -0.01608484983444214, -0.05597340315580368, -0.014349749311804771, 0.008970938622951508, 0.053835008293390274, 0.07484379410743713, -0.016431869938969612, 0.03650275990366936, -0.020502321422100067, 0.023165935650467873, 0.016263049095869064, -0.041642408818006516, -0.03128807991743088, 0.0036038504913449287, 0.003850047243759036, -0.030012547969818115, -0.01355254091322422, 0.00886308029294014, 0.012342660687863827, -0.007925188168883324, -0.0863611102104187, 0.07176750898361206, 0.02100878395140171, 0.008164350874722004, 0.03916637599468231, -0.0250229611992836, -0.033257655799388885, -0.05646110698580742, -0.006372977048158646, -0.03185081481933594, 0.005270953755825758, -0.05124642699956894, -0.026879988610744476, 0.023728670552372932, -0.017435414716601372, 0.024366436526179314, -0.03115677647292614, -0.040516939014196396, -0.02213425375521183, -0.01090768538415432, -0.02791167050600052, 0.00005810534639749676, -0.016431869938969612, 0.019376851618289948, 0.004872349556535482, 0.022396864369511604, -0.012108187191188335, -0.02787415310740471, -0.04558155685663223, 0.02125263586640358, 0.01219259761273861, -0.01945188269019127, 0.004848902113735676, 0.04967076703906059, 0.026561105623841286, -0.05349736660718918, -0.013393099419772625, -0.010992095805704594, 0.019827039912343025, 0.0051021333783864975, -0.009894762188196182, 0.011620483361184597, -0.06490213423967361, 0.007329626940190792, -0.00906472746282816, -0.0919884592294693, 0.05308469384908676, 0.014096518978476524, -0.016422491520643234, 0.042167630046606064, -0.007976772263646126, -0.02020219713449478, -0.029449813067913055, 0.018260760232806206, -0.016103608533740044, 0.07529398053884506, 0.01327117346227169, -0.013505646958947182, -0.029806211590766907, -0.0040798308327794075, -0.025848306715488434, 0.023709913715720177, 0.03603381663560867, -0.00762975262477994, -0.06527729332447052, -0.07375583797693253, 0.027198871597647667, -0.004323682747781277, -0.020145922899246216, 0.05045859515666962, 0.055673275142908096, -0.07461869716644287, 0.02213425375521183, -0.05195922404527664, -0.025191782042384148, 0.006823165342211723, 0.010795138776302338, -0.022865809500217438, -0.0075828577391803265, 0.05012095347046852, -0.004696494899690151, -0.02297835797071457, -0.0065980711951851845, -0.0069732279516756535, 0.05368494614958763, -0.017810571938753128, -0.020277228206396103, 0.01901107281446457, -0.02153400331735611, -0.05454780533909798, 0.08733651787042618, -0.01739789918065071, 0.0030247021932154894, -0.006138504017144442, -0.015531493350863457, -0.013758877292275429, -0.07311806827783585, -0.0271425973623991, -0.004752768203616142, -0.021721580997109413, 0.01122656837105751, -0.03337020054459572, 0.023128420114517212, 0.011545452289283276, 0.010391844436526299, 0.0023740394972264767, -0.0472322478890419, 0.03436436876654625, 0.012173839844763279, 0.04817013815045357, 0.0239725224673748, -0.0726303681731224, 0.07251781970262527, -0.024554016068577766, -0.047344792634248734, 0.05019598826766014, -0.02526681311428547, -0.059237267822027206, 0.042242661118507385, -0.017463551834225655, -0.026561105623841286, 0.09063789248466492, 0.013693224638700485, 0.015137579292058945, -0.03235727921128273, 0.014284096658229828, -0.0026565794833004475, -0.03308883309364319, -0.0013458752073347569, -0.04787001386284828, -0.002175909699872136, -0.024366436526179314, -0.03006882220506668, 0.031138017773628235, 0.024291405454277992, -0.011526694521307945, 0.08088381588459015, -0.03355778008699417, 0.0034444087650626898, -0.02438519522547722, 0.07675708830356598, -0.03421430289745331, -0.008295656181871891, 0.03725307434797287, 0.032938770949840546, 0.024403953924775124, 0.018148211762309074, -0.02157151885330677, 0.08853701502084732, 0.04895796999335289, 0.009332026354968548, -0.019264305010437965, 0.019226789474487305, 0.04726976156234741, -0.012811606749892235, 0.005167785566300154, -0.02273450419306755, -0.005969683174043894, 0.0015522114699706435, 0.03721556067466736, -0.05008343979716301, 0.002820710651576519, -0.0444185696542263, 0.04741982743144035, 0.0364840030670166, 0.021102573722600937, 0.045131370425224304, 0.045769136399030685, -0.04468118026852608, 0.008525439538061619, 0.06111305207014084, -0.03563990071415901, 0.036108847707509995, -0.04993337765336037, 0.0394665002822876, -0.03732810541987419, -0.0050646173767745495, -0.025285571813583374, -0.12837867438793182, -0.011601725593209267, 0.0754440426826477, 0.035902511328458786, -0.023203451186418533, 0.005777415353804827, -0.01357129868119955, 0.02778036519885063, 0.008412891998887062, 0.027536513283848763, -0.00467070285230875, 0.012502102181315422, 0.05897465720772743, 0.01270843856036663, -0.03834103047847748, 0.022678231820464134, 0.014265338890254498, 0.005524184554815292, -0.049220576882362366, -0.045769136399030685, 0.020952509716153145, -0.049858346581459045, 0.03569617494940758, 0.0001134263293351978, -0.02104629948735237, -0.019339336082339287, -0.011254705488681793, 0.020502321422100067, -0.02682371437549591, -0.026955019682645798, 0.019583187997341156, 0.005411637481302023, -0.03492710366845131, 0.0017937186639755964, 0.029093414545059204, -0.011273463256657124, 0.03957904875278473, -0.06100050359964371, -0.06373915076255798, 0.01988331228494644, 0.0026495452038943768, 0.0025792033411562443, -0.017172804102301598, 0.004009488970041275, 0.009106932207942009, 0.07521894574165344, 0.01843895949423313, 0.010391844436526299, 0.009725941345095634, 0.01736038364470005, -0.004164241254329681, -0.025323087349534035, 0.019301820546388626, 0.019827039912343025, 0.04948318749666214, 0.031025471165776253, -0.03038770519196987, -0.02220928482711315, 0.07780753076076508, 0.057436514645814896, -0.0239725224673748, -0.0553356371819973, -0.04355571046471596, 0.008473855443298817, 0.025210540741682053, 0.0384160615503788, -0.022002948448061943, 0.0016753098461776972, 0.015231368131935596, 0.04243024066090584, 0.018467096611857414, 0.025923337787389755, 0.02742396481335163, 0.003967283759266138, 0.027574028819799423, 0.01596292480826378, -0.04198005050420761, 0.013092974200844765, -0.008525439538061619, -0.01511882059276104, 0.059049688279628754, 0.06388921290636063, -0.09844115376472473, 0.04659448191523552, 0.062013428658246994, 0.007329626940190792, 0.04310552030801773, -0.0037914288695901632, -0.056723713874816895, 0.01812007650732994, 0.024835383519530296, 0.008084629662334919, -0.01712591014802456, 0.03749692812561989, 0.02072741650044918, -0.033463992178440094, -0.09604015201330185, -0.0058524468913674355, 0.0648646205663681, -0.018823495134711266, 0.06126311421394348, -0.03852861002087593, -0.005510116461664438, -0.03280746564269066, 0.03764699026942253, -0.033126350492239, 0.011723651550710201, -0.019020453095436096, 0.01060756016522646, -0.02774284966289997, 0.018626537173986435, -0.03764699026942253, -0.008708328008651733, -0.01397459302097559, 0.10969585925340652, -0.04426850751042366, 0.034495674073696136, 0.01728535257279873, -0.02181537076830864, -0.041117191314697266, 0.009181964211165905, -0.04359322413802147, 0.04561907425522804, 0.02421637438237667, 0.03603381663560867, -0.00686537055298686, -0.0007450380362570286, -0.008530128747224808, 0.028080489486455917, -0.0029262234456837177, -0.07281794399023056, -0.029205961152911186, -0.034908343106508255, 0.02262195758521557, -0.028530677780508995, 0.008436339907348156, -0.09468958526849747, 0.026617377996444702, -0.03715928643941879, 0.002226321492344141, 0.04152986407279968, -0.0008300345507450402, -0.0010750588262453675, -0.014021486975252628, 0.01293353270739317, 0.0021477730479091406, 0.028286825865507126, 0.0041525173000991344, -0.043405648320913315, -0.030650313943624496, -0.02566072903573513, -0.044005896896123886, -0.028155522421002388, 0.023784944787621498, 0.036465246230363846, -0.012417691759765148, 0.010551286861300468, -0.007123290561139584, -0.05368494614958763, 0.127553328871727, 0.034945860505104065, 0.007728231139481068, 0.027086324989795685, 0.017416656017303467, 0.02978745475411415, 0.002501827199012041, 0.0021477730479091406, 0.027555270120501518, -0.03616512194275856, -0.10084216296672821, -0.03464573621749878, -0.06163826957345009, -0.09086298942565918, 0.02706756629049778, 0.009735320694744587, 0.023278482258319855, -0.07660702615976334, 0.03391417860984802, -0.0037117081228643656, -0.04081706702709198, -0.027086324989795685, -0.030819134786725044, 0.00381487631238997, -0.05747402831912041, 0.06058783084154129, -0.011057748459279537, 0.027967942878603935, -0.055598244071006775, -0.04032936319708824, -0.04674454405903816, 0.0011307462118566036, -0.03303255885839462, 0.00584306800737977, 0.039316438138484955, 0.028418131172657013, -0.07210514694452286, -0.04006675258278847, -0.053872521966695786, 0.0011225396301597357, 0.007226458750665188, 0.02065238542854786, 0.023315997794270515, 0.00010404740896774456, -0.0027198870666325092, 0.03428933769464493, 0.0032146251760423183, 0.005120891146361828, 0.09401430934667587, -0.01323365792632103, -0.042842913419008255, -0.0015697969356551766, 0.01792311854660511, 0.05342233553528786, -0.04261781647801399, 0.005500737112015486, -0.009181964211165905, 0.017154047265648842, 0.05466035380959511, 0.025210540741682053, -0.0061853984370827675, 0.016188018023967743, -0.007901741191744804, -0.022565685212612152, -0.004527674056589603, 0.007451552897691727, -0.03419554606080055, 0.04363074153661728, -0.0368216447532177, -0.07127980142831802, -0.0715424120426178, -0.035508595407009125, -0.03924140706658363, -0.04085458070039749, 0.021308908239006996, -0.004956759978085756, 0.006415182258933783, -0.0177167821675539, 0.011132779531180859, -0.016019197180867195, -0.018091939389705658, -0.042280178517103195, -0.04771995171904564, 0.05184667557477951, 0.02234059013426304, -0.024366436526179314, 0.030612798407673836, -0.06899134814739227, 0.01453732792288065, -0.007915809750556946, -0.03605257347226143, 0.020389774814248085, 0.02738644927740097, -0.023391028866171837, 0.04258030280470848, 0.032376036047935486, 0.0239725224673748, -0.010373086668550968, 0.035827480256557465, -0.040516939014196396, 0.019114241003990173, -0.03804090619087219, -0.03704673796892166, -0.03637145832180977, 0.01194874569773674, 0.018954800441861153, 0.021702824160456657, -0.011461041867733002, 0.004342440515756607, 0.042917944490909576, 0.005130270030349493, 0.021308908239006996, 0.019620703533291817, 0.033707842230796814, -0.03038770519196987, 0.05878707766532898, 0.024610288441181183, -0.026767442002892494, -0.019676975905895233, 0.04186750575900078, 0.006330771837383509, 0.03228224813938141, -0.04306800663471222, 0.025041719898581505, 0.015212610363960266, 0.03389542177319527, -0.020314743742346764, 0.07461869716644287, -0.04235520958900452, 0.034064240753650665, -0.012258250266313553, 0.012455207295715809, 0.039954204112291336, 0.02935602329671383, 0.007498447317630053, -0.04648193344473839, -0.03288249671459198, -0.0465194508433342, -0.009505536407232285, 0.014415401965379715, 0.04310552030801773, 0.028980866074562073, 0.01611298695206642, -0.023240966722369194, -0.03768450394272804, -0.025173025205731392, -0.0021653585135936737, -0.03267616033554077, 0.008112766779959202, 0.0005955615197308362, 0.01723845675587654, 0.012980426661670208, -0.04321806877851486, 0.006926333531737328, 0.02209673821926117, -0.037271831184625626, 0.03732810541987419, 0.009800972416996956, -0.0089005958288908, 0.09791593998670578, 0.01267092302441597 ]
39,410
pyspark.sql.dataframe
repartitionByRange
Returns a new :class:`DataFrame` partitioned by the given partitioning expressions. The resulting :class:`DataFrame` is range partitioned. .. versionadded:: 2.4.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Parameters ---------- numPartitions : int can be an int to specify the target number of partitions or a Column. If it is a Column, it will be used as the first partitioning column. If not specified, the default number of partitions is used. cols : str or :class:`Column` partitioning columns. Returns ------- :class:`DataFrame` Repartitioned DataFrame. Notes ----- At least one partition-by expression must be specified. When no explicit sort order is specified, "ascending nulls first" is assumed. Due to performance reasons this method uses sampling to estimate the ranges. Hence, the output may not be consistent, since sampling can return different values. The sample size can be controlled by the config `spark.sql.execution.rangeExchange.sampleSizePerPartition`. Examples -------- >>> df = spark.createDataFrame( ... [(14, "Tom"), (23, "Alice"), (16, "Bob")], ["age", "name"]) Repartition the data into 2 partitions by range in 'age' column. For example, the first partition can have ``(14, "Tom")``, and the second partition would have ``(16, "Bob")`` and ``(23, "Alice")``. >>> df.repartitionByRange(2, "age").rdd.getNumPartitions() 2
def repartitionByRange( # type: ignore[misc] self, numPartitions: Union[int, "ColumnOrName"], *cols: "ColumnOrName" ) -> "DataFrame": """ Returns a new :class:`DataFrame` partitioned by the given partitioning expressions. The resulting :class:`DataFrame` is range partitioned. .. versionadded:: 2.4.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Parameters ---------- numPartitions : int can be an int to specify the target number of partitions or a Column. If it is a Column, it will be used as the first partitioning column. If not specified, the default number of partitions is used. cols : str or :class:`Column` partitioning columns. Returns ------- :class:`DataFrame` Repartitioned DataFrame. Notes ----- At least one partition-by expression must be specified. When no explicit sort order is specified, "ascending nulls first" is assumed. Due to performance reasons this method uses sampling to estimate the ranges. Hence, the output may not be consistent, since sampling can return different values. The sample size can be controlled by the config `spark.sql.execution.rangeExchange.sampleSizePerPartition`. Examples -------- >>> df = spark.createDataFrame( ... [(14, "Tom"), (23, "Alice"), (16, "Bob")], ["age", "name"]) Repartition the data into 2 partitions by range in 'age' column. For example, the first partition can have ``(14, "Tom")``, and the second partition would have ``(16, "Bob")`` and ``(23, "Alice")``. >>> df.repartitionByRange(2, "age").rdd.getNumPartitions() 2 """ if isinstance(numPartitions, int): if len(cols) == 0: raise PySparkValueError( error_class="CANNOT_BE_EMPTY", message_parameters={"item": "partition-by expression"}, ) else: return DataFrame( self._jdf.repartitionByRange(numPartitions, self._jcols(*cols)), self.sparkSession, ) elif isinstance(numPartitions, (str, Column)): cols = (numPartitions,) + cols return DataFrame(self._jdf.repartitionByRange(self._jcols(*cols)), self.sparkSession) else: raise PySparkTypeError( error_class="NOT_COLUMN_OR_INT_OR_STR", message_parameters={ "arg_name": "numPartitions", "arg_type": type(numPartitions).__name__, }, )
(self, numPartitions: Union[int, ForwardRef('ColumnOrName')], *cols: 'ColumnOrName') -> 'DataFrame'
[ 0.016923200339078903, -0.004230800084769726, -0.03669702261686325, -0.026814863085746765, -0.034891627728939056, 0.04051686078310013, 0.016419589519500732, -0.013740004040300846, -0.11182045191526413, -0.012447722256183624, 0.04952482879161835, 0.0025014220736920834, 0.005943549796938896, 0.038616444915533066, 0.002434907481074333, -0.00608132965862751, 0.030330631881952286, -0.004321069922298193, 0.028810299932956696, -0.0037770760245621204, -0.01001518964767456, -0.03812233731150627, 0.03152789548039436, 0.004720157012343407, -0.03529071807861328, 0.03865445405244827, -0.0040051257237792015, -0.013141373172402382, -0.0408969409763813, -0.016296062618494034, -0.0023303846828639507, -0.005254649091511965, 0.0016094144666567445, 0.021056603640317917, -0.015355357900261879, -0.009521082043647766, -0.00741637172177434, 0.002027505775913596, 0.0781450867652893, 0.020847558975219727, -0.004527740180492401, 0.001508454792201519, -0.0016426716465502977, -0.06138342246413231, -0.003881598822772503, 0.03622192144393921, 0.04393760859966278, -0.06480417400598526, -0.003344731405377388, 0.05104516074061394, 0.04500184208154678, -0.029494449496269226, -0.03320026025176048, -0.023033035919070244, -0.017778387293219566, 0.06685662269592285, -0.01525083463639021, -0.01970730908215046, 0.025180505588650703, -0.02212083712220192, 0.02632075548171997, -0.012894319370388985, -0.036259930580854416, 0.01538386382162571, -0.0040051257237792015, -0.0038602191489189863, -0.010490293614566326, -0.03103378601372242, -0.07974143326282501, -0.007516143377870321, -0.0006360453553497791, 0.023869220167398453, -0.00553020928055048, 0.039870716631412506, -0.018880628049373627, 0.045267898589372635, -0.03838839381933212, 0.023774199187755585, -0.007820210419595242, -0.013198385946452618, 0.0639679878950119, 0.016714155673980713, -0.0005368674173951149, -0.025655610486865044, 0.03884449228644371, 0.00614784425124526, 0.01336942333728075, 0.01025274209678173, 0.05461794137954712, -0.048422589898109436, -0.017426811158657074, 0.05883686617016792, -0.02485743537545204, -0.055644165724515915, 0.07263388484716415, -0.04382358118891716, -0.04743437096476555, 0.01648610457777977, -0.022006811574101448, -0.060623254626989365, -0.0030026566237211227, 0.038711465895175934, -0.024458348751068115, -0.0029408931732177734, 0.02223486267030239, -0.021265650168061256, -0.05047503858804703, 0.023185070604085922, -0.0566323846578598, -0.01666664518415928, -0.03669702261686325, 0.06944118440151215, 0.0028031128458678722, 0.049676861613988876, -0.029684491455554962, 0.045952048152685165, -0.0014692588010802865, -0.009544837288558483, 0.029209386557340622, 0.006447159685194492, 0.01122195366770029, 0.035461753606796265, 0.004423217382282019, -0.011402493342757225, -0.052451469004154205, 0.07582657784223557, 0.03576581925153732, 0.021626729518175125, 0.008162285201251507, -0.0158589668571949, 0.023869220167398453, -0.018728595227003098, -0.0456099733710289, 0.012704278342425823, 0.026130713522434235, -0.01499427855014801, 0.005240395665168762, 0.05594823509454727, -0.008542368188500404, -0.013426436111330986, -0.0020346324890851974, 0.003924358170479536, 0.024078264832496643, 0.05264151096343994, -0.012837306596338749, -0.009544837288558483, 0.048726655542850494, 0.05366773530840874, 0.004321069922298193, 0.08924351632595062, -0.034093454480171204, 0.06153545528650284, 0.06351188570261002, -0.08034957200288773, 0.026928888633847237, 0.012371704913675785, -0.005287906154990196, 0.00039552399539388716, -0.010661331005394459, -0.04135304316878319, -0.04055486619472504, -0.003325727302581072, 0.0005840808153152466, 0.024097269400954247, -0.03217403590679169, -0.025769634172320366, -0.020999591797590256, -0.033314283937215805, -0.03259212523698807, 0.005938798654824495, 0.07544649392366409, 0.069175124168396, 0.05822873115539551, -0.05629030987620354, -0.016923200339078903, 0.052945576608181, 0.020258430391550064, -0.009711123071610928, -0.0723298192024231, 0.024135276675224304, 0.04188515990972519, -0.02400224842131138, -0.018224984407424927, -0.0018053947715088725, 0.01509880181401968, 0.003817459801211953, -0.03899652883410454, -0.008338073268532753, 0.036830052733421326, 0.02128465473651886, -0.05442790314555168, -0.04465976729989052, 0.021303657442331314, 0.06465213745832443, -0.00924077071249485, -0.036982085555791855, -0.018795110285282135, 0.024078264832496643, -0.005615727975964546, 0.06214359030127525, 0.01937473565340042, 0.047054290771484375, 0.048308562487363815, -0.01919419690966606, 0.007188322022557259, -0.009288281202316284, -0.030843744054436684, -0.020524488762021065, 0.09448865801095963, -0.04253130033612251, -0.02841121330857277, -0.05374375358223915, 0.03555677458643913, 0.018728595227003098, 0.02810714580118656, 0.032535113394260406, -0.0020619509741663933, -0.047054290771484375, 0.068110890686512, -0.019745318219065666, 0.11965016275644302, 0.03276316449046135, -0.020676521584391594, -0.026225734502077103, 0.05131122097373009, -0.04017478600144386, 0.009815646335482597, -0.07920932024717331, -0.02223486267030239, 0.042493291199207306, 0.017578843981027603, -0.06050923094153404, 0.0046773976646363735, -0.06377794593572617, 0.002817366039380431, 0.07198774069547653, -0.027803080156445503, -0.00803400669246912, 0.0760546326637268, 0.013036850839853287, -0.068110890686512, 0.08696301281452179, 0.0067702303640544415, -0.012466725893318653, 0.028221171349287033, -0.017312785610556602, -0.01365448534488678, 0.07058143615722656, -0.020220421254634857, 0.029760507866740227, -0.0184815414249897, -0.053287651389837265, -0.025921668857336044, 0.011069920845329762, 0.0358988493680954, 0.10026592761278152, -0.005539711564779282, 0.020999591797590256, -0.0033043476287275553, 0.03485362231731415, 0.027175942435860634, -0.04906873032450676, -0.041543085128068924, -0.022348886355757713, 0.007981745526194572, -0.02521851472556591, -0.018291499465703964, 0.00680348789319396, 0.01615353301167488, 0.01496577262878418, -0.10885580629110336, 0.08658292889595032, 0.0073736123740673065, 0.005126371048390865, 0.052451469004154205, 0.003993248101323843, 0.015431374311447144, -0.09745331108570099, 0.005553964525461197, -0.05112117901444435, 0.0037248143926262856, -0.04321544989943504, -0.012618759647011757, 0.013359921053051949, 0.011174443177878857, -0.020429467782378197, -0.027442000806331635, -0.025959676131606102, -0.02286199852824211, -0.006651454605162144, -0.043633539229631424, -0.014585689641535282, -0.015792453661561012, 0.0073973676189780235, 0.030178599059581757, 0.03335229307413101, 0.02202581614255905, -0.02453436516225338, -0.06149744614958763, -0.002135592047125101, 0.041657108813524246, -0.014509672299027443, 0.008789421990513802, 0.07263388484716415, 0.03479661047458649, -0.05655636638402939, -0.03470158949494362, -0.02322307787835598, 0.009977181442081928, -0.0005659675225615501, -0.02767005003988743, -0.002974150236696005, -0.0634358674287796, -0.03705810382962227, 0.02033444680273533, -0.07145562767982483, 0.07396417111158371, 0.01755983941257, -0.02652980200946331, 0.040022753179073334, -0.02232988364994526, -0.011022410355508327, -0.008779919706285, 0.00988216046243906, -0.03559478372335434, 0.08445446938276291, -0.003620291594415903, 0.029608475044369698, -0.03156590089201927, -0.010110210627317429, -0.0497908890247345, 0.029551461338996887, 0.05165329575538635, -0.008048259653151035, -0.04188515990972519, -0.08529064804315567, 0.03776125609874725, 0.023033035919070244, -0.04519188031554222, 0.02626374363899231, 0.04131503403186798, -0.07172168046236038, 0.03040664829313755, -0.04811852052807808, 0.014405149966478348, -0.0026083204429596663, -0.006228611804544926, -0.012495231814682484, -0.012457223609089851, 0.04047885164618492, 0.0077251894399523735, 0.00250379741191864, 0.010718343779444695, -0.009758633561432362, 0.020144404843449593, -0.011564028449356556, 0.00797224324196577, 0.026757851243019104, -0.011830086819827557, -0.0424552820622921, 0.08065363764762878, -0.023451127111911774, 0.00868965033441782, -0.013597473502159119, -0.013027348555624485, -0.011250460520386696, -0.07126558572053909, -0.022995028644800186, -0.005249897949397564, 0.011278966441750526, 0.00882267951965332, -0.04827055335044861, 0.006076578516513109, 0.03968067839741707, -0.012894319370388985, -0.011839589104056358, -0.07411620765924454, -0.0014823240926489234, 0.00897471234202385, 0.04446972534060478, 0.030444657430052757, -0.048422589898109436, 0.08057761937379837, -0.007083798758685589, -0.03576581925153732, 0.01297033578157425, -0.01541236974298954, -0.0665905624628067, 0.04108698293566704, -0.027023909613490105, -0.0036416712682694197, 0.08301015198230743, -0.006252367049455643, 0.02652980200946331, -0.054123833775520325, 0.01472822017967701, -0.027480008080601692, -0.019897351041436195, 0.04503984749317169, -0.03968067839741707, -0.024705402553081512, -0.000542212335858494, 0.0024218419566750526, 0.025655610486865044, 0.03375137969851494, -0.009706372395157814, 0.0959329754114151, -0.060205165296792984, 0.02468639798462391, -0.010547306388616562, 0.04849860444664955, -0.02405926026403904, -0.001209139358252287, 0.04819453880190849, 0.047776445746421814, 0.0019966240506619215, 0.02149369940161705, -0.018044445663690567, 0.06366392225027084, 0.032535113394260406, 0.0011176818516105413, -0.04884067922830582, 0.031261835247278214, 0.057962674647569656, -0.010746849700808525, -0.039756692945957184, -0.014633200131356716, -0.021740753203630447, 0.00768243009224534, 0.05336366966366768, -0.03413146361708641, 0.00748288631439209, -0.06647653877735138, 0.025598596781492233, 0.04199918359518051, 0.018681084737181664, 0.011421497911214828, 0.04150507599115372, -0.007411620579659939, 0.0033732375595718622, 0.040706902742385864, -0.039604660123586655, 0.05005694553256035, -0.03669702261686325, 0.033789388835430145, -0.04230324923992157, -0.03492963686585426, -0.03072972036898136, -0.11242858320474625, -0.021379675716161728, 0.06206757202744484, 0.0259406715631485, -0.014756727032363415, 0.02027743309736252, -0.003693932667374611, 0.02375519461929798, -0.001508454792201519, 0.02903834916651249, -0.01764535903930664, -0.007862969301640987, 0.05070308595895767, 0.025180505588650703, -0.05237545445561409, 0.006380645092576742, 0.018281998112797737, 0.024971460923552513, -0.05568217486143112, -0.06860499829053879, -0.00016688024334143847, -0.047776445746421814, 0.025769634172320366, 0.0014086830196902156, -0.020049383863806725, -0.03177494928240776, -0.020524488762021065, 0.04074490815401077, -0.003914855886250734, -0.004026505630463362, 0.03479661047458649, 0.008376081474125385, -0.015478884801268578, -0.020296437665820122, 0.041277024894952774, 0.043595533818006516, -0.011450003832578659, -0.03888250142335892, -0.0665905624628067, 0.02023942582309246, -0.028183162212371826, 0.01268527377396822, -0.009045978076756, -0.036449968814849854, -0.013559465296566486, 0.06218159571290016, -0.013806519098579884, -0.03046366199851036, 0.03181295469403267, 0.008347575552761555, 0.009098239243030548, -0.007392616476863623, 0.01050929818302393, 0.01551689300686121, 0.04766242206096649, 0.04241727665066719, 0.008798924274742603, 0.012048634700477123, 0.05332566052675247, 0.06879504024982452, -0.02506648190319538, -0.05788665637373924, -0.02044847048819065, 0.0017531333724036813, 0.01428162306547165, 0.026510797441005707, -0.020676521584391594, -0.017512328922748566, 0.018728595227003098, 0.034986648708581924, 0.018025441095232964, 0.005093113519251347, -0.0056062256917357445, 0.0016331695951521397, 0.013682992197573185, 0.03339030221104622, -0.00702678645029664, -0.00816703587770462, 0.00894145481288433, -0.011811082251369953, 0.03166092187166214, 0.0487646646797657, -0.05317362770438194, 0.048992712050676346, 0.09745331108570099, -0.03072972036898136, 0.0277840755879879, 0.016733158379793167, -0.03382739797234535, -0.016647640615701675, 0.0201824139803648, 0.02459137700498104, -0.010300252586603165, 0.06408201158046722, 0.023090049624443054, -0.011801580898463726, -0.08331421762704849, -0.01997336745262146, 0.058950889855623245, -0.041124992072582245, 0.07974143326282501, 0.001111149205826223, 0.026282746344804764, -0.009677866473793983, 0.04496383294463158, -0.018890131264925003, -0.02447735145688057, -0.005767761263996363, 0.008965210057795048, -0.015735439956188202, 0.007539898622781038, -0.03669702261686325, -0.021151624619960785, -0.007112305145710707, 0.08133778721094131, -0.02122764103114605, 0.0009086361969821155, 0.048726655542850494, -0.02877229079604149, -0.03616490960121155, 0.001373050268739462, -0.021360671147704124, 0.038445405662059784, -0.005297408439218998, 0.032326068729162216, -0.016172535717487335, 0.007796454709023237, -0.005705997813493013, 0.05940698832273483, -0.02767005003988743, -0.08392234891653061, -0.04253130033612251, -0.03817934915423393, 0.02584565244615078, -0.017065731808543205, -0.050513043999671936, -0.06966923177242279, 0.06780682504177094, -0.06229562312364578, -0.007905729115009308, 0.06871902942657471, -0.0324971042573452, 0.03453055024147034, 0.0034159969072788954, -0.00594830047339201, -0.01680917479097843, 0.017284279689192772, 0.011630543507635593, -0.0414290577173233, -0.03139486536383629, -0.03124283254146576, -0.038293372839689255, -0.01892813853919506, 0.0508551187813282, 0.024211294949054718, -0.015611913986504078, 0.02432531863451004, 0.010765854269266129, -0.03472059220075607, 0.09137198328971863, 0.03350432589650154, 0.007102803327143192, 0.028791295364499092, -0.003005032194778323, 0.026757851243019104, -0.010708841495215893, 0.007568405009806156, 0.025180505588650703, -0.03605088219046593, -0.07472433894872665, -0.005468445830047131, -0.038920510560274124, -0.06993529200553894, 0.009478322230279446, 0.013293406926095486, 0.024287311360239983, -0.05655636638402939, 0.04522988945245743, 0.015630917623639107, -0.012210169807076454, -0.018281998112797737, -0.014604693278670311, 0.02772706374526024, -0.04040283337235451, 0.04268333315849304, -0.03183196112513542, 0.008798924274742603, -0.058798857033252716, -0.0176833663135767, -0.04697827249765396, -0.008846434764564037, -0.05724051594734192, -0.00113490445073694, 0.016524113714694977, 0.030995776876807213, -0.04465976729989052, -0.05488400161266327, -0.05104516074061394, 0.004147656727582216, 0.01779739186167717, 0.016999216750264168, 0.007330853026360273, 0.02715693786740303, -0.006238114088773727, 0.03418847545981407, -0.0015120181487873197, -0.009255023673176765, 0.09638907760381699, -0.02721395157277584, -0.04040283337235451, 0.025712622329592705, 0.00959709845483303, 0.06024317443370819, -0.016524113714694977, 0.006518425419926643, 0.0035704057663679123, -0.0025489323306828737, 0.045533955097198486, 0.027689054608345032, -0.0020667018834501505, 0.01386353187263012, 0.02280498668551445, -0.006808238569647074, -0.014557182788848877, -0.014148593880236149, -0.008000749163329601, 0.057278525084257126, -0.03679204359650612, -0.04621810466051102, -0.09821347892284393, -0.06678060442209244, -0.03968067839741707, -0.054009810090065, 0.006789234466850758, -0.02447735145688057, -0.010233737528324127, -0.014785232953727245, 0.053819768130779266, -0.036716029047966, -0.024439344182610512, -0.001354046049527824, -0.010832368396222591, 0.04420366510748863, 0.013198385946452618, -0.04469777271151543, 0.030900757759809494, -0.050246987491846085, 0.036716029047966, -0.02385021559894085, -0.04382358118891716, 0.02521851472556591, 0.03321926295757294, -0.02259594015777111, 0.018757101148366928, 0.01982133463025093, 0.028601253405213356, -0.027803080156445503, 0.0037628228310495615, -0.04644615575671196, 0.022823991253972054, -0.02348913624882698, -0.01949826441705227, -0.010423779487609863, 0.0006609882693737745, 0.010651828721165657, 0.02003037929534912, -0.006594441831111908, -0.00924077071249485, 0.023147061467170715, 0.02405926026403904, 0.02432531863451004, 0.005620479118078947, 0.04545794054865837, -0.016619134694337845, 0.02343212440609932, -0.037780262529850006, -0.015792453661561012, 0.012523738667368889, 0.03076772764325142, 0.013578468933701515, -0.003629793645814061, -0.03857843577861786, 0.031261835247278214, 0.010613820515573025, 0.03816034272313118, -0.018595566973090172, 0.06389196962118149, -0.03367536514997482, 0.003997999243438244, -0.001962179085239768, 0.014490668661892414, 0.02405926026403904, 0.02405926026403904, 0.016267556697130203, -0.06309379637241364, -0.04906873032450676, -0.04644615575671196, -0.015345855616033077, 0.011250460520386696, 0.016476603224873543, 0.01598249562084675, 0.02846822515130043, -0.02584565244615078, -0.026187727227807045, -0.004311567638069391, 0.001732941484078765, -0.035100676119327545, -0.020201416686177254, 0.0066324505023658276, 0.011107929050922394, -0.00647566607221961, -0.039034534245729446, 0.004789047408849001, 0.06537429243326187, -0.01216265931725502, 0.024344323202967644, 0.01457618735730648, -0.003107179421931505, 0.07225380092859268, 0.01389203779399395 ]
39,411
pyspark.sql.dataframe
replace
Returns a new :class:`DataFrame` replacing a value with another value. :func:`DataFrame.replace` and :func:`DataFrameNaFunctions.replace` are aliases of each other. Values to_replace and value must have the same type and can only be numerics, booleans, or strings. Value can have None. When replacing, the new value will be cast to the type of the existing column. For numeric replacements all values to be replaced should have unique floating point representation. In case of conflicts (for example with `{42: -1, 42.0: 1}`) and arbitrary replacement will be used. .. versionadded:: 1.4.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Parameters ---------- to_replace : bool, int, float, string, list or dict Value to be replaced. If the value is a dict, then `value` is ignored or can be omitted, and `to_replace` must be a mapping between a value and a replacement. value : bool, int, float, string or None, optional The replacement value must be a bool, int, float, string or None. If `value` is a list, `value` should be of the same length and type as `to_replace`. If `value` is a scalar and `to_replace` is a sequence, then `value` is used as a replacement for each item in `to_replace`. subset : list, optional optional list of column names to consider. Columns specified in subset that do not have matching data types are ignored. For example, if `value` is a string, and subset contains a non-string column, then the non-string column is simply ignored. Returns ------- :class:`DataFrame` DataFrame with replaced values. Examples -------- >>> df = spark.createDataFrame([ ... (10, 80, "Alice"), ... (5, None, "Bob"), ... (None, 10, "Tom"), ... (None, None, None)], ... schema=["age", "height", "name"]) Replace 10 to 20 in all columns. >>> df.na.replace(10, 20).show() +----+------+-----+ | age|height| name| +----+------+-----+ | 20| 80|Alice| | 5| NULL| Bob| |NULL| 20| Tom| |NULL| NULL| NULL| +----+------+-----+ Replace 'Alice' to null in all columns. >>> df.na.replace('Alice', None).show() +----+------+----+ | age|height|name| +----+------+----+ | 10| 80|NULL| | 5| NULL| Bob| |NULL| 10| Tom| |NULL| NULL|NULL| +----+------+----+ Replace 'Alice' to 'A', and 'Bob' to 'B' in the 'name' column. >>> df.na.replace(['Alice', 'Bob'], ['A', 'B'], 'name').show() +----+------+----+ | age|height|name| +----+------+----+ | 10| 80| A| | 5| NULL| B| |NULL| 10| Tom| |NULL| NULL|NULL| +----+------+----+
def replace( # type: ignore[misc] self, to_replace: Union[ "LiteralType", List["LiteralType"], Dict["LiteralType", "OptionalPrimitiveType"] ], value: Optional[ Union["OptionalPrimitiveType", List["OptionalPrimitiveType"], _NoValueType] ] = _NoValue, subset: Optional[List[str]] = None, ) -> "DataFrame": """Returns a new :class:`DataFrame` replacing a value with another value. :func:`DataFrame.replace` and :func:`DataFrameNaFunctions.replace` are aliases of each other. Values to_replace and value must have the same type and can only be numerics, booleans, or strings. Value can have None. When replacing, the new value will be cast to the type of the existing column. For numeric replacements all values to be replaced should have unique floating point representation. In case of conflicts (for example with `{42: -1, 42.0: 1}`) and arbitrary replacement will be used. .. versionadded:: 1.4.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Parameters ---------- to_replace : bool, int, float, string, list or dict Value to be replaced. If the value is a dict, then `value` is ignored or can be omitted, and `to_replace` must be a mapping between a value and a replacement. value : bool, int, float, string or None, optional The replacement value must be a bool, int, float, string or None. If `value` is a list, `value` should be of the same length and type as `to_replace`. If `value` is a scalar and `to_replace` is a sequence, then `value` is used as a replacement for each item in `to_replace`. subset : list, optional optional list of column names to consider. Columns specified in subset that do not have matching data types are ignored. For example, if `value` is a string, and subset contains a non-string column, then the non-string column is simply ignored. Returns ------- :class:`DataFrame` DataFrame with replaced values. Examples -------- >>> df = spark.createDataFrame([ ... (10, 80, "Alice"), ... (5, None, "Bob"), ... (None, 10, "Tom"), ... (None, None, None)], ... schema=["age", "height", "name"]) Replace 10 to 20 in all columns. >>> df.na.replace(10, 20).show() +----+------+-----+ | age|height| name| +----+------+-----+ | 20| 80|Alice| | 5| NULL| Bob| |NULL| 20| Tom| |NULL| NULL| NULL| +----+------+-----+ Replace 'Alice' to null in all columns. >>> df.na.replace('Alice', None).show() +----+------+----+ | age|height|name| +----+------+----+ | 10| 80|NULL| | 5| NULL| Bob| |NULL| 10| Tom| |NULL| NULL|NULL| +----+------+----+ Replace 'Alice' to 'A', and 'Bob' to 'B' in the 'name' column. >>> df.na.replace(['Alice', 'Bob'], ['A', 'B'], 'name').show() +----+------+----+ | age|height|name| +----+------+----+ | 10| 80| A| | 5| NULL| B| |NULL| 10| Tom| |NULL| NULL|NULL| +----+------+----+ """ if value is _NoValue: if isinstance(to_replace, dict): value = None else: raise PySparkTypeError( error_class="ARGUMENT_REQUIRED", message_parameters={"arg_name": "value", "condition": "`to_replace` is dict"}, ) # Helper functions def all_of(types: Union[Type, Tuple[Type, ...]]) -> Callable[[Iterable], bool]: """Given a type or tuple of types and a sequence of xs check if each x is instance of type(s) >>> all_of(bool)([True, False]) True >>> all_of(str)(["a", 1]) False """ def all_of_(xs: Iterable) -> bool: return all(isinstance(x, types) for x in xs) return all_of_ all_of_bool = all_of(bool) all_of_str = all_of(str) all_of_numeric = all_of((float, int)) # Validate input types valid_types = (bool, float, int, str, list, tuple) if not isinstance(to_replace, valid_types + (dict,)): raise PySparkTypeError( error_class="NOT_BOOL_OR_DICT_OR_FLOAT_OR_INT_OR_LIST_OR_STR_OR_TUPLE", message_parameters={ "arg_name": "to_replace", "arg_type": type(to_replace).__name__, }, ) if ( not isinstance(value, valid_types) and value is not None and not isinstance(to_replace, dict) ): raise PySparkTypeError( error_class="NOT_BOOL_OR_FLOAT_OR_INT_OR_LIST_OR_NONE_OR_STR_OR_TUPLE", message_parameters={ "arg_name": "value", "arg_type": type(value).__name__, }, ) if isinstance(to_replace, (list, tuple)) and isinstance(value, (list, tuple)): if len(to_replace) != len(value): raise PySparkValueError( error_class="LENGTH_SHOULD_BE_THE_SAME", message_parameters={ "arg1": "to_replace", "arg2": "value", "arg1_length": str(len(to_replace)), "arg2_length": str(len(value)), }, ) if not (subset is None or isinstance(subset, (list, tuple, str))): raise PySparkTypeError( error_class="NOT_LIST_OR_STR_OR_TUPLE", message_parameters={"arg_name": "subset", "arg_type": type(subset).__name__}, ) # Reshape input arguments if necessary if isinstance(to_replace, (float, int, str)): to_replace = [to_replace] if isinstance(to_replace, dict): rep_dict = to_replace if value is not None: warnings.warn("to_replace is a dict and value is not None. value will be ignored.") else: if isinstance(value, (float, int, str)) or value is None: value = [value for _ in range(len(to_replace))] rep_dict = dict(zip(to_replace, cast("Iterable[Optional[Union[float, str]]]", value))) if isinstance(subset, str): subset = [subset] # Verify we were not passed in mixed type generics. if not any( all_of_type(rep_dict.keys()) and all_of_type(x for x in rep_dict.values() if x is not None) for all_of_type in [all_of_bool, all_of_str, all_of_numeric] ): raise PySparkValueError( error_class="MIXED_TYPE_REPLACEMENT", message_parameters={}, ) if subset is None: return DataFrame(self._jdf.na().replace("*", rep_dict), self.sparkSession) else: return DataFrame( self._jdf.na().replace(self._jseq(subset), self._jmap(rep_dict)), self.sparkSession, )
(self, to_replace: Union[ForwardRef('LiteralType'), List[ForwardRef('LiteralType')], Dict[ForwardRef('LiteralType'), ForwardRef('OptionalPrimitiveType')]], value: Union[ForwardRef('OptionalPrimitiveType'), List[ForwardRef('OptionalPrimitiveType')], pyspark._globals._NoValueType, NoneType] = <no value>, subset: Optional[List[str]] = None) -> 'DataFrame'
[ 0.0590001717209816, -0.07895171642303467, 0.03879229351878166, -0.014098520390689373, -0.05964101478457451, -0.003922486212104559, -0.040608011186122894, -0.003193528624251485, -0.0008864979026839137, -0.03129444271326065, 0.0012369583128020167, 0.018317395821213722, -0.008913042023777962, 0.027064887806773186, 0.019577719271183014, -0.012603223323822021, -0.011770128272473812, 0.03304607793688774, 0.081856869161129, -0.0001535350311314687, -0.032832466065883636, 0.0008411049493588507, -0.0211157388985157, 0.033900532871484756, 0.006184123922139406, -0.013190661557018757, 0.007011877838522196, 0.0007249523187056184, -0.05391616001725197, 0.0317857563495636, 0.05699220299720764, -0.0669466108083725, -0.04280823469161987, 0.008111990056931973, 0.009762157686054707, -0.06634849309921265, -0.05417249724268913, 0.028239764273166656, 0.0227498859167099, -0.016747333109378815, -0.05075467377901077, -0.05331804230809212, -0.03575897589325905, -0.03191392496228218, 0.00538307148963213, 0.042893681675195694, 0.02049625851213932, 0.031572140753269196, 0.007492509204894304, 0.04831947386264801, 0.01370333507657051, -0.021863387897610664, -0.0217138584703207, 0.04047984257340431, -0.04998566582798958, 0.06916819512844086, -0.05472789332270622, 0.0886070653796196, 0.081856869161129, -0.025142362341284752, 0.0339646190404892, -0.016886182129383087, -0.09527182579040527, 0.02326255850493908, -0.007989161647856236, 0.028282487764954567, 0.03689112886786461, -0.003580703865736723, -0.03225570544600487, -0.05737670883536339, -0.04831947386264801, -0.0026661690790206194, 0.015284078195691109, 0.04609788954257965, -0.0030306479893624783, 0.056095022708177567, -0.004480552393943071, 0.011599237099289894, -0.04784952476620674, -0.04990021884441376, 0.09604083001613617, 0.0011822197120636702, 0.005660769529640675, -0.03943313658237457, 0.001497967867180705, -0.0050359489396214485, 0.01393831055611372, 0.04101387783885002, 0.024202460423111916, -0.04169744253158569, -0.04041576012969017, -0.08202775567770004, 0.04784952476620674, -0.006445800885558128, -0.019631121307611465, 0.018659178167581558, 0.04080026596784592, -0.09672439843416214, 0.030931299552321434, -0.06365695595741272, 0.03740380331873894, 0.01650167815387249, -0.0021081026643514633, -0.0076740812510252, 0.04780680313706398, -0.006248208228498697, -0.0031855180859565735, 0.01587151736021042, 0.001594094093888998, -0.025313252583146095, -0.08694087713956833, 0.005351029336452484, 0.009746136143803596, -0.019107768312096596, -0.0291155818849802, -0.0026314568240195513, -0.053787991404533386, -0.029713701456785202, -0.036186203360557556, 0.03469090536236763, -0.034455928951501846, 0.0739104300737381, 0.029201027005910873, -0.0030012759380042553, 0.03699793666601181, 0.038471873849630356, 0.037724222987890244, 0.0227498859167099, 0.023604340851306915, 0.018082421272993088, 0.004718197975307703, -0.01823195070028305, -0.023775232955813408, 0.11031024158000946, 0.005650089122354984, 0.03419959172606468, -0.03567352890968323, -0.021895429119467735, 0.004485893063247204, -0.007385702338069677, 0.006467162165790796, -0.042338285595178604, 0.0420178659260273, -0.031166275963187218, 0.024031570181250572, -0.012005103752017021, 0.06570765376091003, 0.00540977343916893, -0.05075467377901077, -0.021265268325805664, -0.018659178167581558, 0.024202460423111916, 0.0342850387096405, -0.03644254058599472, -0.00965535081923008, 0.03804464638233185, 0.05972646176815033, -0.06314428150653839, 0.011097244918346405, -0.0001607945596333593, 0.027107609435915947, -0.00595448911190033, -0.027470754459500313, 0.046995069831609726, -0.02326255850493908, 0.003228240879252553, 0.043513160198926926, -0.03302471712231636, 0.008592621423304081, 0.019011640921235085, 0.042829595506191254, 0.0046300822868943214, 0.014771404676139355, 0.015754029154777527, 0.02556958980858326, 0.08386483788490295, -0.006910411175340414, -0.03484043478965759, 0.03191392496228218, 0.03486179560422897, -0.019129129126667976, 0.0046380930580198765, -0.04272279143333435, 0.04154791310429573, -0.0226430781185627, -0.018370799720287323, -0.014696639962494373, -0.01163127925246954, -0.005361710209399462, 0.02223721146583557, 0.05810299515724182, -0.019567037001252174, 0.02386067807674408, 0.03650662302970886, -0.012656626291573048, -0.04584155231714249, 0.009495140053331852, -0.04554249346256256, -0.04678145423531532, 0.032212983816862106, 0.020827360451221466, 0.0006969154928810894, 0.10193657875061035, 0.0009999802568927407, -0.04340635612607002, -0.0319993682205677, -0.00939367339015007, 0.0020159815903753042, 0.014952976256608963, -0.056564975529909134, 0.014600513502955437, -0.006883709691464901, -0.02162841334939003, -0.03462682291865349, 0.028709715232253075, 0.019567037001252174, -0.002025327179580927, -0.006723498925566673, -0.01252845861017704, 0.004365735221654177, 0.039582666009664536, 0.002380460500717163, -0.025227807462215424, 0.023091668263077736, 0.05468517169356346, 0.016651207581162453, 0.01019472535699606, -0.004053324926644564, 0.0365707091987133, -0.04304321110248566, -0.008886340074241161, -0.06267433613538742, 0.027705729007720947, -0.046439673751592636, 0.014707320369780064, -0.01654439978301525, 0.05643680691719055, -0.035011325031518936, -0.02680855058133602, -0.02454424276947975, -0.015561776235699654, -0.03131580352783203, -0.016095811501145363, -0.01081954687833786, -0.02332664281129837, -0.004728878848254681, -0.01481412723660469, 0.04383358359336853, 0.004744899924844503, -0.02098757028579712, 0.0021254587918519974, -0.008416390046477318, -0.024821940809488297, 0.021938152611255646, 0.005495219025760889, -0.013927629217505455, 0.01658712327480316, 0.03921952098608017, 0.04545705020427704, 0.008341624401509762, 0.0026114305946975946, -0.08134419471025467, -0.04265870526432991, 0.03622892498970032, -0.010045195929706097, -0.022279934957623482, -0.04447442293167114, 0.012122591957449913, 0.06861279904842377, -0.014365538023412228, 0.0719451755285263, 0.028731076046824455, 0.008875659666955471, 0.042466454207897186, 0.02776981331408024, 0.04426081106066704, -0.016095811501145363, -0.019759289920330048, 0.05113917961716652, -0.05280536785721779, 0.03366556018590927, -0.04819130897521973, -0.01984473690390587, -0.033387862145900726, 0.04280823469161987, 0.0017796711763367057, -0.038365066051483154, -0.02042149379849434, -0.013596528209745884, -0.014376218430697918, -0.02796206623315811, 0.0018090431112796068, -0.029799146577715874, 0.03975355625152588, -0.07514938712120056, 0.027449391782283783, -0.010397658683359623, -0.025932732969522476, 0.012848879210650921, -0.05400160700082779, -0.011001118458807468, -0.007577954791486263, 0.09305023401975632, 0.03011956624686718, 0.05054106190800667, -0.05079739913344383, -0.0054631768725812435, -0.022301295772194862, -0.012432332150638103, 0.07185973227024078, 0.01221871841698885, -0.034947242587804794, -0.03016228973865509, -0.05178002268075943, 0.04938754439353943, -0.011503111571073532, -0.02152160555124283, 0.02676582895219326, -0.02554822899401188, -0.029265111312270164, 0.022344019263982773, -0.05293353646993637, -0.042274199426174164, 0.014525748789310455, -0.034925881773233414, 0.005343019030988216, 0.03708338364958763, 0.025954095646739006, 0.005762236192822456, -0.016373509541153908, 0.022963499650359154, -0.007989161647856236, 0.04537160322070122, -0.006616692058742046, -0.01194101944565773, -0.028068874031305313, -0.030845854431390762, -0.01597832329571247, 0.010541848838329315, 0.029371919110417366, 0.023561619222164154, 0.009858284145593643, -0.0032202303409576416, 0.003716882783919573, -0.004427148960530758, 0.010013153776526451, -0.0037329038605093956, -0.029350556433200836, 0.04537160322070122, 0.049729328602552414, 0.021468201652169228, -0.023518895730376244, -0.0026274516712874174, -0.0232411976903677, -0.007818270474672318, -0.019097087904810905, -0.0017382835503667593, 0.04221011698246002, -0.03827961906790733, -0.05455700308084488, 0.05212180316448212, -0.04477348551154137, 0.02114778198301792, 0.0010407004738226533, 0.035011325031518936, 0.014312135055661201, -0.030610879883170128, 0.014376218430697918, -0.0408216267824173, -0.008635343983769417, 0.07318414002656937, -0.02341208979487419, 0.014707320369780064, -0.04994294047355652, -0.008646024391055107, 0.0020239921286702156, -0.04716596007347107, 0.019043684005737305, -0.04379085823893547, -0.0037809668574482203, 0.03148669749498367, -0.04955843836069107, -0.01717456243932247, -0.014312135055661201, -0.046396948397159576, -0.01998358592391014, -0.018349438905715942, 0.013767419382929802, -0.01871258206665516, -0.04018078371882439, -0.04317137971520424, 0.0026902006939053535, 0.038984544575214386, -0.0046087210066616535, -0.03125172108411789, 0.0033110161311924458, -0.03708338364958763, -0.00424557738006115, 0.035502638667821884, -0.03693385049700737, -0.015465649776160717, -0.04831947386264801, 0.028303848579525948, 0.018552372232079506, 0.02958553284406662, 0.018050378188490868, 0.09612628072500229, 0.001144169713370502, -0.004274948965758085, 0.02625315450131893, 0.05506967753171921, -0.029329195618629456, -0.04199650138616562, -0.0075138709507882595, -0.03986036404967308, 0.045157987624406815, 0.008720789104700089, 0.0030306479893624783, 0.015081144869327545, 0.026573576033115387, 0.005225531291216612, -0.02110505849123001, -0.016768695786595345, 0.054856061935424805, -0.035481277853250504, -0.023689787834882736, 0.06365695595741272, -0.04421808943152428, 0.007978481240570545, 0.04485892876982689, -0.040672097355127335, -0.03986036404967308, -0.02396748587489128, 0.021820664405822754, 0.05156640708446503, 0.0049211313016712666, 0.012945005670189857, -0.04304321110248566, -0.014589833095669746, 0.03571625426411629, 0.017185242846608162, -0.019791333004832268, 0.024117015302181244, -0.022066321223974228, -0.05353165790438652, 0.005059980321675539, -0.031166275963187218, 0.015519053675234318, -0.07138977944850922, -0.01825331151485443, 0.043021850287914276, -0.0011221407912671566, -0.017494982108473778, 0.05925650894641876, -0.007786228321492672, 0.013286788016557693, -0.05340348929166794, 0.0021334693301469088, 0.026082264259457588, 0.006296270992606878, 0.0017316080629825592, -0.0002364773245062679, -0.03629301115870476, 0.025377336889505386, -0.025142362341284752, 0.06241799518465996, 0.006194804795086384, -0.09381924569606781, -0.04438897967338562, 0.03763877972960472, 0.022514909505844116, -0.10578162968158722, 0.046311505138874054, -0.034327760338783264, 0.014013075269758701, 0.042466454207897186, -0.02339072711765766, 0.012443012557923794, -0.0035967249423265457, 0.025868648663163185, -0.04383358359336853, -0.006200144998729229, 0.007353660184890032, -0.0016982308588922024, 0.04776407778263092, -0.029692338779568672, 0.03413550928235054, 0.009895666502416134, 0.019022323191165924, 0.0375533327460289, -0.024715134873986244, 0.026936719194054604, 0.011332220397889614, -0.019043684005737305, -0.0053777312859892845, -0.017462940886616707, -0.016896864399313927, 0.010061217471957207, -0.008854297921061516, 0.011439027264714241, 0.025420060381293297, -0.012015785090625286, -0.03746788576245308, 0.01755906641483307, 0.058914728462696075, -0.08279676735401154, 0.04148383066058159, 0.03738244250416756, -0.06126448139548302, 0.0018344097770750523, -0.0556250736117363, -0.005076001398265362, 0.08010523021221161, -0.08194231241941452, 0.0026461428496986628, 0.0069638146087527275, 0.012272121384739876, 0.023647064343094826, -0.039539940655231476, -0.030952662229537964, -0.018039697781205177, -0.03518221899867058, 0.010146662592887878, 0.009804880246520042, -0.0005604028701782227, -0.035032689571380615, 0.07237240672111511, -0.02561231330037117, 0.018541691824793816, -0.06604943424463272, -0.037232913076877594, 0.017420217394828796, 0.005404432769864798, -0.009650010615587234, 0.019000960513949394, 0.004672805313020945, 0.06442596763372421, -0.035566721111536026, -0.009372311644256115, 0.0445171482861042, -0.04618333652615547, 0.12013648450374603, -0.04216739535331726, -0.004897099919617176, -0.013671292923390865, -0.01995154283940792, 0.027684368193149567, 0.016277382150292397, 0.05391616001725197, 0.006734179798513651, -0.05468517169356346, -0.028709715232253075, 0.08091696351766586, 0.061136312782764435, -0.06784378737211227, -0.06801468133926392, -0.0013844853965565562, 0.026915358379483223, -0.042359646409749985, 0.014109201729297638, -0.023668425157666206, -0.0008524531731382012, 0.11210460215806961, -0.03347330540418625, 0.0422314777970314, 0.0582311637699604, -0.04336363077163696, 0.042936403304338455, 0.008613982237875462, -0.0036688195541501045, 0.049729328602552414, -0.02723577804863453, 0.000756994413677603, -0.028773799538612366, -0.025954095646739006, -0.014119882136583328, -0.018936876207590103, 0.00569281168282032, -0.06130720302462578, -0.0019051694544032216, -0.09082864969968796, 0.052591755986213684, -0.005401762668043375, -0.013820822350680828, 0.04327818751335144, 0.03511813282966614, -0.06891185790300369, 0.09014508873224258, 0.023689787834882736, -0.004077356308698654, 0.0024805921129882336, 0.030247734859585762, 0.011278816498816013, -0.025249168276786804, 0.0014352187281474471, 0.05186546593904495, -0.04896031692624092, -0.030290458351373672, 0.033815089613199234, -0.010488444939255714, -0.04614061489701271, 0.00725219352170825, -0.0153481625020504, -0.04135566204786301, -0.02341208979487419, -0.0019612431060522795, 0.01881938986480236, 0.03253340348601341, 0.035588085651397705, -0.042466454207897186, 0.046354226768016815, 0.06959542632102966, 0.021938152611255646, -0.02606090158224106, 0.030568156391382217, -0.015230674296617508, -0.031636226922273636, 0.0028998092748224735, -0.014141243882477283, -0.09672439843416214, -0.04285096004605293, 0.016095811501145363, -0.0022295955568552017, -0.028197040781378746, 0.012571181170642376, -0.013511082157492638, -0.016298744827508926, -0.028859244659543037, -0.05844477564096451, -0.041227493435144424, 0.020239921286702156, -0.007380362134426832, 0.009361631236970425, 0.03261885046958923, -0.0476786345243454, -0.030205013230443, -0.005318987183272839, -0.02223721146583557, -0.020827360451221466, 0.06327245384454727, 0.04020214453339577, -0.009244143962860107, 0.07237240672111511, 0.025783203542232513, 0.017900848761200905, -0.03975355625152588, 0.012154634110629559, -0.048575811088085175, -0.030418626964092255, 0.035502638667821884, -0.018637817353010178, 0.0466960109770298, -0.016619164496660233, -0.025185083970427513, 0.01811446249485016, 0.07724280655384064, 0.006483183242380619, 0.001491292379796505, 0.038365066051483154, 0.010904991999268532, 0.003935837186872959, 0.005751555785536766, -0.011738087050616741, 0.052036359906196594, 0.023454811424016953, 0.03654934838414192, 0.01645895466208458, -0.006226846482604742, 0.10244925320148468, 0.03466954454779625, -0.01503842230886221, -0.010232108645141125, 0.009511161595582962, 0.023689787834882736, 0.007054600864648819, -0.060495469719171524, -0.03990308567881584, 0.007738165557384491, -0.03742516413331032, 0.0023484183475375175, 0.02732122503221035, -0.02849610149860382, -0.03413550928235054, 0.008133350871503353, -0.010921013541519642, -0.0007950444123707712, -0.02789798192679882, -0.026829911395907402, 0.013585846871137619, -0.02108369767665863, 0.030504072085022926, -0.052719924598932266, -0.024074291810393333, -0.0365707091987133, -0.0032202303409576416, -0.0002885457070078701, -0.028175679966807365, -0.02952144853770733, 0.021756580099463463, 0.05981190502643585, 0.008330943994224072, 0.013468359597027302, -0.049131207168102264, 0.0003244261897634715, 0.06925364583730698, 0.003580703865736723, -0.04878942668437958, 0.005489878356456757, 0.021254587918519974, -0.039582666009664536, 0.028837883844971657, 0.04934482276439667, -0.03479771316051483, -0.013906268402934074, -0.04537160322070122, 0.03528902307152748, -0.01873394288122654, -0.026381323114037514, 0.011834212578833103, 0.03073904663324356, 0.030034121125936508, -0.023198474198579788, 0.016159895807504654, 0.02559095062315464, 0.011567195877432823, 0.05348893254995346, -0.0397321954369545, -0.00882759690284729, -0.018541691824793816, 0.0020413482561707497, 0.04193241894245148, 0.12124727666378021, 0.011492430232465267, -0.06254616379737854, -0.011449707671999931, -0.07408131659030914, -0.026488129049539566, 0.010702058672904968, -0.08775261044502258, -0.028004789724946022, 0.04037303850054741, -0.017334772273898125, -0.006787583231925964, 0.022899415343999863, 0.029991399496793747, 0.01874462328851223, -0.005302966106683016, -0.006899730768054724, 0.013874226249754429, 0.06297339498996735, -0.031016746535897255, 0.005003906786441803, -0.036698877811431885, 0.031550779938697815, 0.06152081862092018, 0.012624584138393402, 0.0035646827891469, 0.08010523021221161, -0.0031107531394809484, -0.0291155818849802, -0.04218875616788864, 0.05131006985902786, 0.04052256792783737, 0.0006882374291308224, 0.0036688195541501045, 0.018531009554862976, 0.011513791978359222, 0.016725972294807434 ]
39,412
pyspark.sql.dataframe
rollup
Create a multi-dimensional rollup for the current :class:`DataFrame` using the specified columns, so we can run aggregation on them. .. versionadded:: 1.4.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Parameters ---------- cols : list, str or :class:`Column` Columns to roll-up by. Each element should be a column name (string) or an expression (:class:`Column`) or list of them. Returns ------- :class:`GroupedData` Rolled-up data by given columns. Examples -------- >>> df = spark.createDataFrame([(2, "Alice"), (5, "Bob")], schema=["age", "name"]) >>> df.rollup("name", df.age).count().orderBy("name", "age").show() +-----+----+-----+ | name| age|count| +-----+----+-----+ | NULL|NULL| 2| |Alice|NULL| 1| |Alice| 2| 1| | Bob|NULL| 1| | Bob| 5| 1| +-----+----+-----+
def rollup(self, *cols: "ColumnOrName") -> "GroupedData": # type: ignore[misc] """ Create a multi-dimensional rollup for the current :class:`DataFrame` using the specified columns, so we can run aggregation on them. .. versionadded:: 1.4.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Parameters ---------- cols : list, str or :class:`Column` Columns to roll-up by. Each element should be a column name (string) or an expression (:class:`Column`) or list of them. Returns ------- :class:`GroupedData` Rolled-up data by given columns. Examples -------- >>> df = spark.createDataFrame([(2, "Alice"), (5, "Bob")], schema=["age", "name"]) >>> df.rollup("name", df.age).count().orderBy("name", "age").show() +-----+----+-----+ | name| age|count| +-----+----+-----+ | NULL|NULL| 2| |Alice|NULL| 1| |Alice| 2| 1| | Bob|NULL| 1| | Bob| 5| 1| +-----+----+-----+ """ jgd = self._jdf.rollup(self._jcols(*cols)) from pyspark.sql.group import GroupedData return GroupedData(jgd, self)
(self, *cols: 'ColumnOrName') -> 'GroupedData'
[ -0.0632086992263794, -0.025533560663461685, 0.0011139219859614968, 0.003572251880541444, -0.02700142189860344, -0.03299972414970398, 0.009101654402911663, -0.009011045098304749, 0.002713733585551381, 0.07567647099494934, -0.013165459036827087, 0.028378676623106003, 0.023884480819106102, 0.0571560300886631, 0.01075526513159275, 0.013772537931799889, 0.06802909076213837, 0.007815008983016014, 0.06317245960235596, 0.0021791416220366955, -0.011498256586492062, -0.027019545435905457, 0.04356471076607704, 0.021492406725883484, -0.03368835151195526, -0.002976499032229185, 0.03450383245944977, -0.05074092745780945, -0.001203964464366436, 0.0028790945652872324, -0.07143598049879074, 0.021148094907402992, -0.023068999871611595, -0.02901293896138668, -0.005613215267658234, -0.014977634884417057, 0.011543561704456806, -0.04436206817626953, 0.0018065129406750202, -0.05233564227819443, 0.09162361919879913, 0.034540075808763504, -0.013962816447019577, -0.06944258511066437, 0.060997843742370605, 0.059656836092472076, 0.021057484671473503, -0.015041060745716095, 0.0031305341981351376, -0.0354461632668972, -0.01780463010072708, 0.0006246344419196248, -0.00851269718259573, 0.010873056016862392, -0.008050591684877872, 0.04175253584980965, -0.006193111650645733, -0.026330918073654175, -0.01447022520005703, 0.00847645290195942, -0.02214479073882103, -0.00864860974252224, -0.009251158684492111, 0.04657292366027832, -0.017433132976293564, 0.011652291752398014, -0.04827636852860451, -0.03113318420946598, -0.062810018658638, -0.04842134192585945, -0.05704730004072189, 0.04834885522723198, 0.00012288818834349513, 0.09155113250017166, 0.013591320253908634, 0.018112698569893837, -0.03932422026991844, -0.006229354999959469, 0.02629467472434044, -0.04280359670519829, 0.01684417575597763, -0.03129627928137779, -0.04552186280488968, -0.03385144844651222, 0.07611139118671417, 0.014406799338757992, 0.0019050500122830272, 0.03526494652032852, 0.011018030345439911, 0.0023071265313774347, -0.0007197736413218081, -0.00573553703725338, -0.010900238528847694, -0.021274946630001068, 0.0274182241410017, -0.027490710839629173, -0.05925815552473068, 0.046717897057533264, -0.023775748908519745, 0.05469147115945816, 0.033217187970876694, -0.044579531997442245, 0.0014395472826436162, -0.027581319212913513, -0.0075386520475149155, -0.021365555003285408, -0.0019175087800249457, -0.011896935291588306, -0.013419163413345814, -0.002718264004215598, 0.03185805305838585, -0.016807932406663895, 0.0599830262362957, 0.013636624440550804, 0.008114018477499485, -0.026856448501348495, 0.014134973287582397, 0.005916754715144634, -0.04099142178893089, 0.043709684163331985, -0.011951301246881485, 0.021927330642938614, 0.04526815563440323, -0.047044090926647186, -0.032601047307252884, -0.03095196560025215, 0.019027847796678543, -0.004319774452596903, -0.023485802114009857, 0.032492317259311676, 0.03714960813522339, -0.04225994646549225, -0.01459707785397768, -0.05407533422112465, 0.0008828695281408727, -0.010537803173065186, 0.1096728965640068, 0.017233794555068016, 0.0060028331354260445, 0.029792174696922302, 0.029755929484963417, -0.014696747995913029, 0.02276093140244484, 0.027925632894039154, 0.05820709466934204, 0.03791072219610214, 0.07313942164182663, 0.03486626595258713, -0.016481740400195122, 0.021111851558089256, -0.036660321056842804, -0.060454193502664566, 0.011244552209973335, -0.004421709571033716, 0.03133252263069153, -0.01692572422325611, -0.016826054081320763, -0.006202172487974167, -0.05875074490904808, -0.059584349393844604, 0.013808781281113625, 0.010275037959218025, -0.021329311653971672, 0.0453406423330307, -0.04780520498752594, 0.018284855410456657, -0.005300614982843399, 0.030752627179026604, -0.01472393050789833, -0.018112698569893837, 0.028197459876537323, -0.008625958114862442, 0.056249942630529404, -0.022634077817201614, -0.057917144149541855, 0.02874111197888851, -0.030299583449959755, 0.04171629250049591, -0.009011045098304749, -0.03809193894267082, -0.0186291690915823, -0.055887509137392044, -0.013518833555281162, -0.01164323091506958, -0.011190187186002731, -0.01640019379556179, -0.038780566304922104, -0.05037849396467209, 0.008752809837460518, -0.022797174751758575, -0.053060512989759445, -0.04164380580186844, 0.008191036060452461, 0.07339312881231308, 0.052879296243190765, -0.0010748469503596425, -0.027744414284825325, 0.04566683620214462, 0.04947240650653839, 0.06128779426217079, -0.02002454549074173, 0.02310524508357048, 0.08720190823078156, 0.0036809826269745827, -0.0060209548100829124, -0.014461164362728596, -0.028251824900507927, -0.0037874479312449694, 0.02230788767337799, -0.04621049016714096, 0.06893517822027206, -0.017405951395630836, -0.018846631050109863, 0.03863559290766716, -0.004281265661120415, 0.028124971315264702, -0.007833130657672882, -0.048638805747032166, 0.03316282108426094, 0.04581180959939957, 0.08249025046825409, 0.00031260037212632596, -0.011987544596195221, 0.0007730063516646624, 0.006560077425092459, -0.02734573557972908, 0.02663898840546608, 0.005794432945549488, 0.026765840128064156, -0.012494953349232674, -0.02214479073882103, -0.07110978662967682, 0.027019545435905457, -0.0382731594145298, -0.005268901586532593, 0.02636716142296791, -0.04602926969528198, 0.001076545799151063, 0.07966326177120209, 0.0021655503660440445, -0.047587741166353226, 0.02944786101579666, 0.015729688107967377, -0.028722990304231644, 0.04004909098148346, -0.008462862111628056, -0.005545258522033691, 0.045993026345968246, -0.008843419142067432, 0.060816626995801926, 0.00332987355068326, 0.0008692782139405608, 0.009840115904808044, 0.021945452317595482, -0.009251158684492111, -0.0054818326607346535, 0.030897600576281548, 0.034268248826265335, 0.0005745164235122502, 0.0247905682772398, 0.046717897057533264, -0.04062898829579353, -0.008548940531909466, 0.0557425357401371, -0.06078038364648819, -0.014787356369197369, 0.04987108334898949, -0.03747580200433731, -0.001899386988952756, 0.004500992130488157, -0.030136486515402794, 0.006396981421858072, 0.018103638663887978, -0.03617103397846222, 0.047841448336839676, 0.03569986671209335, 0.04566683620214462, -0.05019727721810341, -0.04570307955145836, -0.06469468772411346, 0.08691196143627167, 0.0027816900983452797, -0.0018959891749545932, 0.000033695148886181414, -0.023358948528766632, 0.024500619620084763, -0.04171629250049591, -0.019897691905498505, -0.050777170807123184, -0.0069904690608382225, 0.02734573557972908, -0.027925632894039154, -0.03772950544953346, 0.04095517843961716, -0.015276643447577953, 0.009359888732433319, 0.02205418236553669, -0.01949901320040226, -0.036116667091846466, -0.013473528437316418, -0.041680049151182175, -0.038961783051490784, 0.06107033044099808, 0.052625592797994614, 0.01817612536251545, -0.059511858969926834, -0.038236912339925766, -0.030154608190059662, -0.019535258412361145, -0.0100485160946846, -0.02930288575589657, 0.03341652452945709, -0.019444648176431656, -0.01695290580391884, -0.07201587408781052, -0.07698123902082443, 0.016971029341220856, -0.013065788894891739, 0.011878813616931438, -0.011027091182768345, -0.0015052387025207281, -0.059656836092472076, 0.00003399599881959148, -0.020423224195837975, -0.016001515090465546, 0.09176859259605408, 0.029393495991826057, -0.015367252752184868, -0.0010029261466115713, -0.02522549033164978, -0.01138046570122242, -0.0405927412211895, 0.041063908487558365, 0.017233794555068016, -0.06309997290372849, -0.0712910071015358, -0.006143276579678059, -0.022706566378474236, -0.012848327867686749, 0.03809193894267082, -0.02901293896138668, -0.030390191823244095, -0.03660595417022705, -0.038309402763843536, 0.05320548638701439, 0.009885420091450214, 0.010782447643578053, 0.01177008356899023, 0.01755998656153679, 0.09655273705720901, 0.02558792568743229, -0.013120154850184917, 0.031694959849119186, -0.0020907979924231768, 0.03430449217557907, 0.006551016122102737, -0.00544558884575963, -0.0030716382898390293, 0.06440473347902298, -0.04853007569909096, 0.04950864985585213, -0.07596641778945923, 0.028813598677515984, 0.011697595939040184, 0.032148003578186035, 0.01897348277270794, -0.03256480395793915, -0.0023762157652527094, -0.021583016961812973, 0.0245368629693985, 0.05436528101563454, -0.05324173346161842, 0.032691653817892075, 0.05690232664346695, -0.05117585137486458, 0.06719549000263214, 0.03794696554541588, 0.002539311768487096, 0.00032562538399361074, -0.019009726122021675, -0.021311189979314804, -0.039215490221977234, 0.02152865193784237, 0.02364889718592167, 0.052190668880939484, 0.062411341816186905, -0.02576914243400097, -0.06009175628423691, -0.052081938832998276, -0.027744414284825325, 0.0059711202047765255, 0.07647382467985153, 0.025279855355620384, -0.021981695666909218, -0.05889572203159332, 0.0008234074921347201, -0.0019684762228280306, 0.0011835774639621377, 0.02937537245452404, -0.0027341204695403576, -0.01450646948069334, -0.039650410413742065, 0.03379708155989647, -0.0018688065465539694, -0.0002835772465914488, -0.00021972633840050548, 0.023250218480825424, -0.09829242527484894, -0.012793962843716145, -0.002552903024479747, 0.03809193894267082, 0.02223539911210537, -0.02944786101579666, 0.030843235552310944, 0.07110978662967682, 0.0003508259542286396, -0.011226430535316467, -0.012041909620165825, 0.0358448401093483, 0.039904117584228516, 0.030988210812211037, -0.0013817842118442059, -0.050052300095558167, 0.06813781708478928, -0.007914679124951363, -0.046717897057533264, -0.052879296243190765, -0.024500619620084763, -0.0009151488775387406, 0.041861265897750854, -0.01213251892477274, -0.013573198579251766, -0.02727324888110161, 0.017251916229724884, 0.005889572203159332, 0.021419920027256012, 0.00025512039428576827, 0.027454467490315437, -0.018031151965260506, 0.033742718398571014, -0.004081926308572292, -0.02460934966802597, -0.010247855447232723, -0.019190944731235504, 0.04356471076607704, -0.00004795895438292064, -0.01080056931823492, -0.03425012528896332, -0.12199568748474121, 0.009101654402911663, 0.08857916295528412, 0.018900996074080467, -0.05748222395777702, 0.00926928035914898, -0.0023490332532674074, 0.0013296841643750668, -0.02064068429172039, 0.012621806003153324, -0.02002454549074173, 0.022797174751758575, 0.037439554929733276, -0.06831903755664825, 0.08147543668746948, 0.052081938832998276, -0.028722990304231644, -0.00661897286772728, -0.04929118603467941, -0.07350186258554459, 0.015403496101498604, -0.01605588011443615, -0.028034362941980362, -0.01265804935246706, -0.03772950544953346, -0.006279190070927143, -0.017233794555068016, -0.02417442761361599, -0.009722324088215828, -0.006315433420240879, -0.006582729518413544, 0.02584163099527359, -0.01019349042326212, -0.01577499322593212, 0.050777170807123184, -0.015376313589513302, -0.008761870674788952, 0.019897691905498505, -0.025279855355620384, -0.03185805305838585, 0.061360280960798264, -0.007683626376092434, -0.02821558155119419, -0.01597433164715767, -0.00564945861697197, 0.009776690043509007, -0.0319124199450016, 0.0003225106920581311, -0.0023161873687058687, -0.0015414822846651077, -0.026004726067185402, 0.0015267583075910807, 0.010990847833454609, 0.02312336675822735, -0.01217782311141491, -0.01142576988786459, 0.016726383939385414, -0.03954168036580086, 0.13286875188350677, 0.029393495991826057, -0.006759416777640581, -0.0486750490963459, -0.02636716142296791, -0.0054908934980630875, -0.04030279442667961, 0.051828235387802124, 0.04849382862448692, -0.027055788785219193, 0.024065697565674782, 0.04331100732088089, 0.0019832001999020576, 0.005055970977991819, 0.012793962843716145, -0.03609854727983475, -0.008612366393208504, 0.06929761171340942, -0.055343855172395706, 0.05135706812143326, 0.03546428307890892, 0.05784465745091438, -0.008915905840694904, 0.04990732669830322, -0.05991053953766823, 0.05001605674624443, 0.0015086365165188909, 0.0035292129032313824, 0.00886607076972723, 0.04631922021508217, -0.04718906432390213, 0.03546428307890892, -0.027291370555758476, 0.009586411528289318, 0.01958962343633175, 0.013346676714718342, -0.00190844782628119, -0.03396017849445343, -0.054292794317007065, -0.0005702691269107163, -0.005835206713527441, -0.0638248398900032, 0.10104693472385406, -0.0274182241410017, -0.048203881829977036, -0.0013613972114399076, 0.005454649683088064, 0.043455980718135834, 0.07415424287319183, -0.006433224771171808, -0.03419576212763786, -0.012431527487933636, -0.003705899929627776, -0.014941391535103321, -0.02047758921980858, 0.007946391589939594, 0.06683304905891418, -0.033307794481515884, -0.021129973232746124, 0.017704959958791733, -0.026421526446938515, -0.004906466696411371, -0.013881267979741096, -0.02709203213453293, 0.006727703381329775, 0.0037308174651116133, -0.0029379904735833406, -0.08249025046825409, 0.002134969923645258, -0.017360646277666092, -0.027218883857131004, 0.06277377903461456, -0.023594532161951065, -0.02680208347737789, -0.023522045463323593, 0.014153094962239265, 0.0007939595961943269, -0.023141488432884216, -0.041680049151182175, 0.01904596947133541, -0.0368596613407135, 0.044941965490579605, 0.019172823056578636, 0.013247006572782993, -0.03769326210021973, -0.05168326199054718, -0.05124833807349205, 0.04360095411539078, 0.027237005531787872, -0.015022939071059227, -0.038055695593357086, -0.0024985377676784992, -0.004195187706500292, -0.07252328097820282, 0.00506956223398447, 0.023667018860578537, -0.04708033427596092, 0.03649722412228584, -0.027563197538256645, -0.0002905144647229463, -0.07611139118671417, 0.09140615910291672, 0.021583016961812973, 0.04207872599363327, 0.006428694352507591, 0.06973253190517426, 0.007158095482736826, 0.03394205868244171, 0.006084381137043238, -0.0074888174422085285, -0.021111851558089256, -0.09416066855192184, 0.012141579762101173, -0.011534499935805798, -0.02944786101579666, -0.017777446657419205, -0.00012522419274318963, 0.006410572677850723, -0.03415951877832413, 0.00595299806445837, -0.04066523164510727, 0.03310845419764519, 0.022652199491858482, 0.017659654840826988, 0.012105335481464863, -0.02734573557972908, 0.05030600726604462, -0.06541955471038818, 0.005200945306569338, 0.022724688053131104, -0.05454649776220322, -0.03899802640080452, 0.0028609728906303644, -0.056249942630529404, 0.042477406561374664, -0.009251158684492111, 0.03183993324637413, -0.01640019379556179, -0.017333462834358215, -0.023685140535235405, -0.045123182237148285, -0.0007679095724597573, -0.030643897131085396, -0.014914209023118019, -0.003291364759206772, -0.034612562507390976, 0.051103364676237106, 0.003993582911789417, 0.0420062392950058, 0.06146901100873947, -0.00675035547465086, 0.0372583381831646, -0.0008069846080616117, 0.02725512720644474, -0.036207277327775955, -0.017958665266633034, 0.028197459876537323, 0.011715717613697052, 0.01852949894964695, 0.06690553575754166, 0.04892875254154205, -0.007434451952576637, -0.009414254687726498, 0.019952058792114258, -0.010429073125123978, 0.006940633989870548, 0.03874432295560837, 0.005857858806848526, 0.050849657505750656, -0.04646419361233711, -0.012105335481464863, -0.05788090080022812, -0.025642290711402893, -0.06451346725225449, -0.044144608080387115, 0.02689269185066223, -0.0368596613407135, 0.01569344475865364, -0.03751204535365105, 0.035772353410720825, 0.06157774105668068, -0.0070176515728235245, -0.04331100732088089, -0.05277056619524956, 0.06027297303080559, -0.017496559768915176, -0.007996226660907269, 0.07828600704669952, -0.06027297303080559, -0.01270335353910923, 0.019553380087018013, -0.01949901320040226, -0.006637094542384148, 0.025877874344587326, 0.025098638609051704, 0.027671927586197853, 0.00018220863421447575, 0.0070176515728235245, 0.027979997918009758, 0.12011102586984634, 0.051284581422805786, 0.029484104365110397, 0.015403496101498604, -0.0020115154329687357, 0.002881359774619341, 0.058786991983652115, -0.05273432284593582, 0.01631864532828331, 0.05697481334209442, 0.0094414371997118, 0.03838188946247101, 0.0732119083404541, -0.032691653817892075, -0.006446816027164459, 0.001848419546149671, 0.05780841410160065, -0.019825205206871033, -0.08198284357786179, -0.009024636819958687, -0.038780566304922104, -0.006052667740732431, 0.014615199528634548, 0.014352434314787388, 0.016019636765122414, -0.004317509476095438, 0.006908921059221029, 0.07100106030702591, 0.02002454549074173, 0.02310524508357048, -0.04787769168615341, 0.013174519874155521, 0.009323645383119583, 0.0032052863389253616, 0.016517983749508858, -0.039904117584228516, -0.040012847632169724, 0.01922718808054924, -0.02045946754515171, 0.017324402928352356, -0.06237509846687317, 0.006759416777640581, -0.003286834340542555, -0.02761756256222725, -0.007153565064072609, 0.03642473742365837, 0.019118456169962883, -0.011878813616931438, -0.02636716142296791, 0.01877414435148239, -0.04189750924706459, 0.0037285522557795048, -0.021583016961812973, 0.05436528101563454, -0.06237509846687317, -0.008879662491381168, -0.002584615955129266, -0.0014259560266509652, -0.002387541811913252, 0.05969307944178581, 0.03535555303096771, 0.050849657505750656, -0.00006190421845531091 ]
39,413
pyspark.sql.dataframe
sameSemantics
Returns `True` when the logical query plans inside both :class:`DataFrame`\s are equal and therefore return the same results. .. versionadded:: 3.1.0 .. versionchanged:: 3.5.0 Supports Spark Connect. Notes ----- The equality comparison here is simplified by tolerating the cosmetic differences such as attribute names. This API can compare both :class:`DataFrame`\s very fast but can still return `False` on the :class:`DataFrame` that return the same results, for instance, from different plans. Such false negative semantic can be useful when caching as an example. This API is a developer API. Parameters ---------- other : :class:`DataFrame` The other DataFrame to compare against. Returns ------- bool Whether these two DataFrames are similar. Examples -------- >>> df1 = spark.range(10) >>> df2 = spark.range(10) >>> df1.withColumn("col1", df1.id * 2).sameSemantics(df2.withColumn("col1", df2.id * 2)) True >>> df1.withColumn("col1", df1.id * 2).sameSemantics(df2.withColumn("col1", df2.id + 2)) False >>> df1.withColumn("col1", df1.id * 2).sameSemantics(df2.withColumn("col0", df2.id * 2)) True
def sameSemantics(self, other: "DataFrame") -> bool: """ Returns `True` when the logical query plans inside both :class:`DataFrame`\\s are equal and therefore return the same results. .. versionadded:: 3.1.0 .. versionchanged:: 3.5.0 Supports Spark Connect. Notes ----- The equality comparison here is simplified by tolerating the cosmetic differences such as attribute names. This API can compare both :class:`DataFrame`\\s very fast but can still return `False` on the :class:`DataFrame` that return the same results, for instance, from different plans. Such false negative semantic can be useful when caching as an example. This API is a developer API. Parameters ---------- other : :class:`DataFrame` The other DataFrame to compare against. Returns ------- bool Whether these two DataFrames are similar. Examples -------- >>> df1 = spark.range(10) >>> df2 = spark.range(10) >>> df1.withColumn("col1", df1.id * 2).sameSemantics(df2.withColumn("col1", df2.id * 2)) True >>> df1.withColumn("col1", df1.id * 2).sameSemantics(df2.withColumn("col1", df2.id + 2)) False >>> df1.withColumn("col1", df1.id * 2).sameSemantics(df2.withColumn("col0", df2.id * 2)) True """ if not isinstance(other, DataFrame): raise PySparkTypeError( error_class="NOT_STR", message_parameters={"arg_name": "other", "arg_type": type(other).__name__}, ) return self._jdf.sameSemantics(other._jdf)
(self, other: pyspark.sql.dataframe.DataFrame) -> bool
[ 0.042981889098882675, -0.07654903829097748, 0.06890862435102463, 0.053519148379564285, -0.010944630019366741, -0.015479997731745243, -0.027302732691168785, 0.03805725648999214, -0.009441893547773361, 0.03602946922183037, -0.008504945784807205, -0.018630312755703926, 0.05301220342516899, 0.04949978366494179, -0.020114945247769356, -0.05159999057650566, -0.011795577593147755, -0.006029051728546619, 0.05916799232363701, 0.028063153848052025, -0.02721220627427101, 0.028751153498888016, 0.015534313395619392, 0.014176419004797935, -0.01358799822628498, 0.058624833822250366, -0.03809346631169319, 0.020295996218919754, -0.00993073545396328, 0.0898020938038826, -0.038491785526275635, -0.06430988758802414, 0.017453471198678017, 0.012248208746314049, 0.003910736180841923, -0.02065810188651085, -0.018367785960435867, -0.0003604078374337405, -0.0008090788032859564, -0.07560756802558899, -0.045263152569532394, -0.029022732749581337, 0.009695366956293583, -0.028950311243534088, -0.057212624698877335, -0.0002680427278392017, -0.03975915163755417, -0.028624417260289192, -0.026578523218631744, -0.015217471867799759, 0.04175072908401489, 0.014520418830215931, -0.016032207757234573, 0.06416504085063934, -0.058045465499162674, 0.014330313540995121, -0.00881273578852415, 0.023192837834358215, -0.0071651567704975605, -0.023192837834358215, -0.009161261841654778, -0.02880547009408474, -0.02956588938832283, 0.011777471750974655, -0.028696836903691292, -0.01533515565097332, -0.019734734669327736, -0.02013305015861988, -0.016195155680179596, 0.009414735250175, -0.09450946003198624, 0.012972419150173664, -0.011044208891689777, 0.07032082974910736, -0.06887240707874298, -0.016122734174132347, -0.015769680961966515, 0.029131364077329636, -0.02404378540813923, -0.03157557547092438, 0.011098524555563927, -0.0596749372780323, 0.020748628303408623, -0.08639830350875854, -0.04160588979721069, 0.016711154952645302, -0.007767156697809696, 0.08350145816802979, 0.029330521821975708, -0.07184167206287384, 0.018512628972530365, 0.01804189197719097, 0.000755328859668225, 0.014737682417035103, -0.0012526577338576317, -0.0027406837325543165, -0.035594940185546875, -0.0353957824409008, 0.00854568276554346, 0.011686945334076881, 0.003949210047721863, 0.10645893216133118, 0.01841305010020733, 0.012990524061024189, 0.00043480913154780865, 0.001236815587617457, -0.03740546852350235, -0.05438820272684097, -0.024224838241934776, -0.03950567916035652, -0.0563797801733017, 0.023156628012657166, 0.016140839084982872, -0.020531365647912025, 0.015661049634218216, -0.0012006050674244761, 0.007368841208517551, -0.004505946766585112, -0.03184715285897255, 0.033766310662031174, 0.040157467126846313, 0.08755704015493393, 0.09921682626008987, -0.07705599069595337, 0.012782313860952854, 0.0041212099604308605, 0.05018778145313263, -0.02275831252336502, -0.05384504422545433, 0.05033262446522713, 0.05916799232363701, 0.0034354731906205416, 0.026469890028238297, 0.13195113837718964, 0.03986778482794762, 0.03474399447441101, 0.04797894135117531, 0.07061051577329636, -0.021092629060149193, 0.05033262446522713, 0.008314840495586395, 0.005449683405458927, 0.038455571979284286, 0.017055155709385872, -0.06956040859222412, 0.01400441862642765, -0.054207149893045425, -0.005988314747810364, -0.01288189273327589, 0.01837684027850628, 0.018901892006397247, -0.01906483992934227, 0.045951150357723236, -0.018901892006397247, -0.04551662504673004, -0.027755364775657654, 0.024405891075730324, -0.01598694548010826, 0.04290946573019028, -0.0028040523175150156, -0.02141852304339409, -0.008993787690997124, 0.016222313046455383, 0.02538357488811016, -0.017136629670858383, 0.02044083923101425, -0.012112419120967388, -0.03101431205868721, -0.050549887120723724, 0.007649472448974848, 0.0599646233022213, 0.03447241708636284, 0.040628205984830856, -0.02130989171564579, -0.0487755723297596, 0.04251115024089813, 0.017172839492559433, 0.0032046311534941196, 0.015208418481051922, -0.023029891774058342, 0.008876103907823563, -0.04059199243783951, -0.06669978052377701, 0.001957631204277277, -0.0006642367225140333, 0.024405891075730324, -0.029927995055913925, -0.05094820261001587, 0.06662736088037491, 0.025220626965165138, -0.034110311418771744, -0.01895620860159397, -0.011261471547186375, -0.00903452467173338, 0.010329050943255424, -0.06206483393907547, 0.023500628769397736, -0.014357471838593483, -0.0013431840343400836, 0.035069890320301056, 0.0280088372528553, 0.009985051117837429, 0.027791574597358704, 0.010283787734806538, 0.030109047889709473, 0.009396630339324474, -0.0376589410007, 0.007174209225922823, 0.0005974735831841826, -0.03588462620973587, -0.02324715442955494, -0.04917388781905174, -0.015814945101737976, 0.0017437628703191876, 0.030851364135742188, 0.052686307579278946, -0.0033426836598664522, -0.021110733970999718, 0.019879575818777084, -0.003793052164837718, 0.07640419900417328, -0.05178104341030121, -0.042330097407102585, 0.03351283818483353, 0.018919996917247772, -0.06597556918859482, 0.036174312233924866, 0.019879575818777084, 0.016104629263281822, -0.057864412665367126, -0.02849767915904522, -0.04631325602531433, 0.013289261609315872, -0.0372244156897068, -0.025890521705150604, 0.015570524148643017, 0.0140768401324749, 0.013615155592560768, -0.00829220935702324, -0.030453048646450043, -0.05532967671751976, 0.022052207961678505, 0.03602946922183037, 0.03718820586800575, -0.029620205983519554, -0.08386356383562088, 0.025546522811055183, 0.01787894405424595, -0.008477788418531418, -0.01787894405424595, -0.0015785524155944586, -0.05319325625896454, -0.001592131331562996, -0.02956588938832283, 0.016448630020022392, -0.006952419877052307, -0.05091199278831482, 0.029547784477472305, 0.010229472070932388, 0.01746252365410328, -0.0008096446399576962, -0.01421262975782156, -0.032589469105005264, 0.0018682365771383047, -0.042330097407102585, -0.01895620860159397, -0.029927995055913925, 0.02534736506640911, 0.013597050681710243, -0.03119536302983761, -0.00854568276554346, -0.028859784826636314, -0.005685051903128624, 0.04964462295174599, 0.007436735555529594, -0.02918568067252636, -0.03823830932378769, -0.029203785583376884, -0.04258357360959053, -0.052758727222681046, 0.012447366490960121, -0.021708207204937935, -0.018883787095546722, -0.02245052345097065, -0.021943574771285057, -0.010157051496207714, -0.02272210270166397, -0.0752454623579979, 0.019426943734288216, -0.06257177889347076, -0.01917347125709057, 0.003478473052382469, 0.032824836671352386, 0.012148629873991013, -0.04341641440987587, 0.05301220342516899, 0.03416462615132332, -0.028280416503548622, -0.02686820738017559, 0.008414419367909431, -0.0223781019449234, 0.009749682620167732, 0.037767574191093445, 0.05522104352712631, 0.02755620703101158, -0.0299098901450634, -0.005110209807753563, -0.003548630978912115, 0.041388627141714096, 0.007373367436230183, 0.009156735613942146, 0.035794101655483246, -0.01754399761557579, 0.023645469918847084, -0.03344041481614113, 0.042981889098882675, -0.017227156087756157, 0.008966630324721336, 0.023229049518704414, 0.04200420528650284, 0.002067394321784377, 0.008984735235571861, -0.021165048703551292, 0.017109470441937447, -0.008939472027122974, -0.03157557547092438, 0.012338735163211823, -0.025962943211197853, 0.02949346974492073, 0.006282525602728128, 0.032698098570108414, 0.0049925255589187145, 0.07727324962615967, 0.0066853673197329044, 0.0076087359338998795, -0.05033262446522713, -0.007613262161612511, 0.008337472565472126, 0.035558730363845825, 0.031032416969537735, 0.07350736111402512, -0.04812378063797951, 0.05159999057650566, -0.06590314954519272, 0.0036074731033295393, 0.010546314530074596, -0.02742946892976761, 0.030724627897143364, 0.020223576575517654, -0.01951747015118599, -0.08545682579278946, 0.00212171021848917, -0.018919996917247772, 0.00817905180156231, 0.01533515565097332, 0.0483410470187664, -0.05366399139165878, 0.020875364542007446, -0.05598146468400955, 0.021183155477046967, 0.06651872396469116, -0.038636624813079834, 0.04113515093922615, -0.019390733912587166, 0.01350652426481247, 0.04185936227440834, 0.014610945247113705, -0.021364206448197365, -0.05435199290513992, -0.030923785641789436, -0.04573388770222664, -0.019300207495689392, 0.030434943735599518, -0.04033851996064186, -0.010374314151704311, 0.04435788840055466, -0.060145676136016846, 0.0030167889781296253, 0.012909051030874252, -0.016258524730801582, 0.0671343058347702, -0.023029891774058342, 0.026777680963277817, 0.00960484053939581, 0.0010721709113568068, -0.003439999418333173, -0.049789465963840485, -0.04710988700389862, -0.01655726134777069, 0.015995997935533524, -0.029366731643676758, -0.002523420611396432, -0.04471999406814575, 0.03344041481614113, -0.051201675087213516, -0.0013182893162593246, -0.05366399139165878, 0.03693472966551781, -0.029728837311267853, -0.023319575935602188, -0.006689893547445536, 0.004379210062325001, -0.024025680497288704, -0.04515451937913895, -0.0357578881084919, 0.04500967636704445, 0.04439409822225571, 0.014556629583239555, -0.029294312000274658, 0.035486310720443726, 0.0036708414554595947, -0.07256588339805603, -0.04645809903740883, 0.044538941234350204, -0.00323405209928751, 0.06039914861321449, 0.08437051624059677, -0.021219365298748016, 0.08024251461029053, 0.07028461992740631, 0.03237220644950867, 0.051237888634204865, 0.02165389060974121, 0.023410102352499962, -0.013343577273190022, -0.03577599301934242, -0.0022348680067807436, 0.021545259281992912, -0.005911367479711771, 0.0014529471518471837, 0.004218525718897581, -0.01635810360312462, 0.013904839754104614, 0.0103109460324049, 0.023410102352499962, 0.002251841826364398, -0.003473946824669838, -0.01124336663633585, -0.008065893314778805, 0.04019367694854736, 0.07205893844366074, -0.06315115094184875, -0.01749873347580433, -0.021545259281992912, -0.06843788176774979, -0.06351325660943985, 0.009785893373191357, -0.004711893852800131, -0.049680836498737335, 0.01010273490101099, 0.051889676600694656, 0.06072504445910454, -0.029547784477472305, 0.005585473030805588, -0.06402020156383514, 0.03885388746857643, 0.010663998313248158, -0.04403199255466461, -0.029022732749581337, 0.05036883428692818, 0.012628419324755669, -0.019843365997076035, -0.05525725334882736, 0.033766310662031174, -0.027719153091311455, 0.020839154720306396, -0.0375140979886055, -0.03550441563129425, -0.022251365706324577, 0.02092968113720417, 0.03197389096021652, -0.06134062260389328, -0.004055578261613846, -0.03351283818483353, 0.009831156581640244, 0.03333178535103798, -0.07792504131793976, -0.00553568359464407, -0.020259786397218704, 0.0409540981054306, -0.11652545630931854, 0.013044839724898338, -0.002713525900617242, -0.01906483992934227, 0.08053220063447952, -0.07857683300971985, -0.02621641755104065, -0.002022131346166134, 0.02183494344353676, -0.029891785234212875, 0.013253050856292248, 0.03271620720624924, 0.020042523741722107, 0.023464417085051537, -0.005381788592785597, 0.009541472420096397, 0.024912837892770767, 0.01048294547945261, -0.04236631095409393, 0.01624947041273117, 0.005417999345809221, -0.0007768288487568498, -0.053555361926555634, 0.04334399476647377, 0.04928251728415489, -0.03885388746857643, 0.033549048006534576, -0.03816588968038559, -0.05145515128970146, -0.0004367894143797457, -0.03885388746857643, -0.016267577186226845, 0.02648799680173397, 0.00295342062599957, 0.036282941699028015, 0.01023852452635765, -0.0038451047148555517, -0.005834420211613178, 0.026705259457230568, -0.036355361342430115, 0.0014031577156856656, -0.04928251728415489, -0.004815999418497086, -0.015461892820894718, -0.029022732749581337, -0.01616799831390381, 0.008400840684771538, 0.0028538417536765337, 0.03957809880375862, -0.048920415341854095, -0.04649430885910988, 0.01110757701098919, -0.002200920833274722, -0.013406945392489433, -0.03798483684659004, 0.05174483358860016, -0.011370103806257248, 0.02351873368024826, -0.02458694390952587, 0.036970943212509155, 0.008061367087066174, 0.027139784768223763, -0.06459956616163254, -0.011143787764012814, -0.03315073251724243, 0.01124336663633585, -0.004938209895044565, 0.009641051292419434, 0.05837136134505272, 0.014113050885498524, 0.0003867170598823577, 0.023029891774058342, 0.09117808938026428, -0.002747473306953907, 0.0038564205169677734, 0.015995997935533524, 0.00609694654121995, 0.020295996218919754, 0.032517049461603165, 0.004997051786631346, 0.028280416503548622, -0.03965052217245102, 0.11855324357748032, -0.03972294181585312, 0.014040629379451275, -0.004815999418497086, 0.04787030816078186, -0.003548630978912115, 0.014484208077192307, 0.0012990523828193545, 0.04638567566871643, 0.0014959471300244331, 0.06344082951545715, -0.05040504410862923, 0.03416462615132332, -0.00873126182705164, -0.019263997673988342, 0.03914357349276543, -0.05753851681947708, -0.029674522578716278, -0.025437891483306885, 0.05453304573893547, -0.0019734734669327736, 0.029312416911125183, -0.011288629844784737, 0.032245468348264694, -0.058045465499162674, 0.007803367450833321, 0.059421464800834656, -0.00653599901124835, -0.04873936250805855, -0.029131364077329636, 0.006554104387760162, -0.051382727921009064, 0.003933367785066366, 0.05681430548429489, -0.0262526273727417, -0.013787155970931053, 0.08364630490541458, -0.00026775983860716224, -0.004938209895044565, 0.013913892209529877, -0.01830441877245903, -0.10001345723867416, 0.0026207363698631525, -0.00021386839216575027, -0.01822294481098652, 0.012284419499337673, 0.01050105132162571, 0.05026020482182503, 0.03311452269554138, 0.06785851716995239, 0.023609260097146034, -0.07307282835245132, 0.03706146776676178, -0.026397470384836197, -0.06945177912712097, 0.0028017889708280563, -0.016231365501880646, -0.02179873362183571, 0.020386522635817528, 0.039940204471349716, 0.031865257769823074, -0.01955368183553219, -0.037767574191093445, 0.04964462295174599, 0.012682734988629818, -0.019535576924681664, -0.014040629379451275, -0.023880839347839355, 0.027990732342004776, -0.03526904806494713, 0.05225178226828575, -0.03530525788664818, 0.037115782499313354, -0.09038145840167999, -0.02100210264325142, -0.012166734784841537, -0.013615155592560768, 0.0713709369301796, 0.001326210331171751, 0.004666631110012531, -0.00960484053939581, 0.02397136390209198, -0.033657677471637726, -0.028407152742147446, -0.0006031314842402935, -0.03128588944673538, 0.043742310255765915, 0.0009991840925067663, -0.037115782499313354, 0.020259786397218704, 0.041424836963415146, 0.0012277630157768726, 0.046639151871204376, 0.035033680498600006, -0.05069473013281822, -0.026578523218631744, 0.04330778121948242, -0.013551787473261356, 0.04953599348664284, -0.024405891075730324, -0.01419452391564846, 0.01061873510479927, 0.02587241679430008, 0.04779788851737976, 0.024822311475872993, 0.023265259340405464, 0.08893303573131561, 0.02853389084339142, 0.0120852617546916, 0.06470820307731628, 0.00799347274005413, -0.0022812627721577883, 0.02659662812948227, -0.034454312175512314, -0.007441262248903513, -0.030579784885048866, -0.009097893722355366, -0.06152167543768883, -0.01232968270778656, 0.02911325916647911, -0.01459284033626318, -0.03452673181891441, -0.012800418771803379, -0.016385260969400406, 0.013913892209529877, 0.016756419092416763, 0.05551072955131531, -0.09320588409900665, -0.014810102991759777, -0.06908967345952988, 0.015271787531673908, 0.030851364135742188, 0.009102419950067997, 0.012546945363283157, -0.019245892763137817, -0.019263997673988342, -0.03360336273908615, 0.033549048006534576, -0.013406945392489433, 0.024460207670927048, 0.01864841766655445, 0.03530525788664818, 0.08024251461029053, 0.06782230734825134, -0.0009228024864569306, 0.033585257828235626, 0.06499788165092468, -0.044575151056051254, -0.0488479919731617, 0.012166734784841537, 0.0447562038898468, -0.0010003156494349241, 0.0030462101567536592, 0.008744840510189533, -0.013026734814047813, 0.023953258991241455, 0.027610521763563156, 0.0051464200951159, -0.0338568352162838, -0.030235784128308296, 0.020259786397218704, -0.0030937364790588617, -0.030507363379001617, 0.04562525451183319, 0.04931873083114624, -0.011315788142383099, 0.034273259341716766, -0.02207031287252903, -0.013714734464883804, 0.08299451321363449, 0.025365469977259636, -0.007454840932041407, -0.02024168148636818, -0.008649787865579128, -0.023229049518704414, -0.058588624000549316, 0.007142525166273117, 0.03421894088387489, 0.040700625628232956, -0.003849630942568183, 0.003387946868315339, -0.020911576226353645, 0.006069788709282875, -0.008744840510189533, -0.028515785932540894, 0.015425682067871094, 0.012945260852575302, 0.008781051263213158, 0.01735389232635498, -0.015624839812517166, -0.019770944491028786, -0.01658441871404648, 0.02013305015861988, 0.07245725393295288, 0.00854568276554346, -0.006889051757752895, 0.01662968099117279, -0.07281935960054398, -0.022685891017317772, 0.07365220040082932, 0.01804189197719097, 0.04120757430791855, -0.050441253930330276, -0.005060420371592045, -0.006821156945079565, 0.06474441289901733 ]
39,414
pyspark.sql.dataframe
sample
Returns a sampled subset of this :class:`DataFrame`. .. versionadded:: 1.3.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Parameters ---------- withReplacement : bool, optional Sample with replacement or not (default ``False``). fraction : float, optional Fraction of rows to generate, range [0.0, 1.0]. seed : int, optional Seed for sampling (default a random seed). Returns ------- :class:`DataFrame` Sampled rows from given DataFrame. Notes ----- This is not guaranteed to provide exactly the fraction specified of the total count of the given :class:`DataFrame`. `fraction` is required and, `withReplacement` and `seed` are optional. Examples -------- >>> df = spark.range(10) >>> df.sample(0.5, 3).count() # doctest: +SKIP 7 >>> df.sample(fraction=0.5, seed=3).count() # doctest: +SKIP 7 >>> df.sample(withReplacement=True, fraction=0.5, seed=3).count() # doctest: +SKIP 1 >>> df.sample(1.0).count() 10 >>> df.sample(fraction=1.0).count() 10 >>> df.sample(False, fraction=1.0).count() 10
def sample( # type: ignore[misc] self, withReplacement: Optional[Union[float, bool]] = None, fraction: Optional[Union[int, float]] = None, seed: Optional[int] = None, ) -> "DataFrame": """Returns a sampled subset of this :class:`DataFrame`. .. versionadded:: 1.3.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Parameters ---------- withReplacement : bool, optional Sample with replacement or not (default ``False``). fraction : float, optional Fraction of rows to generate, range [0.0, 1.0]. seed : int, optional Seed for sampling (default a random seed). Returns ------- :class:`DataFrame` Sampled rows from given DataFrame. Notes ----- This is not guaranteed to provide exactly the fraction specified of the total count of the given :class:`DataFrame`. `fraction` is required and, `withReplacement` and `seed` are optional. Examples -------- >>> df = spark.range(10) >>> df.sample(0.5, 3).count() # doctest: +SKIP 7 >>> df.sample(fraction=0.5, seed=3).count() # doctest: +SKIP 7 >>> df.sample(withReplacement=True, fraction=0.5, seed=3).count() # doctest: +SKIP 1 >>> df.sample(1.0).count() 10 >>> df.sample(fraction=1.0).count() 10 >>> df.sample(False, fraction=1.0).count() 10 """ # For the cases below: # sample(True, 0.5 [, seed]) # sample(True, fraction=0.5 [, seed]) # sample(withReplacement=False, fraction=0.5 [, seed]) is_withReplacement_set = type(withReplacement) == bool and isinstance(fraction, float) # For the case below: # sample(faction=0.5 [, seed]) is_withReplacement_omitted_kwargs = withReplacement is None and isinstance(fraction, float) # For the case below: # sample(0.5 [, seed]) is_withReplacement_omitted_args = isinstance(withReplacement, float) if not ( is_withReplacement_set or is_withReplacement_omitted_kwargs or is_withReplacement_omitted_args ): argtypes = [type(arg).__name__ for arg in [withReplacement, fraction, seed]] raise PySparkTypeError( error_class="NOT_BOOL_OR_FLOAT_OR_INT", message_parameters={ "arg_name": "withReplacement (optional), " + "fraction (required) and seed (optional)", "arg_type": ", ".join(argtypes), }, ) if is_withReplacement_omitted_args: if fraction is not None: seed = cast(int, fraction) fraction = withReplacement withReplacement = None seed = int(seed) if seed is not None else None args = [arg for arg in [withReplacement, fraction, seed] if arg is not None] jdf = self._jdf.sample(*args) return DataFrame(jdf, self.sparkSession)
(self, withReplacement: Union[float, bool, NoneType] = None, fraction: Union[int, float, NoneType] = None, seed: Optional[int] = None) -> pyspark.sql.dataframe.DataFrame
[ 0.05821998044848442, -0.11408840119838715, 0.04278315231204033, -0.030816763639450073, -0.016934996470808983, 0.048889610916376114, -0.00796020682901144, 0.05002745985984802, -0.026777397841215134, -0.018300417810678482, -0.03555780649185181, 0.03438202664256096, -0.036619797348976135, 0.04748626425862312, -0.023913808166980743, -0.011994833126664162, -0.011065589264035225, 0.0446416400372982, 0.021789822727441788, 0.011994833126664162, -0.01387228537350893, 0.03599398210644722, -0.014137783087790012, 0.10437875241041183, -0.028313495218753815, 0.03764386102557182, -0.015474756248295307, -0.03906617686152458, 0.02890138328075409, 0.03313039243221283, 0.043427933007478714, -0.02228289097547531, -0.023098349571228027, 0.04009024053812027, -0.06417472660541534, -0.04612084478139877, -0.0017162567237392068, 0.029982341453433037, -0.0024558589793741703, 0.014829975552856922, -0.002300590043887496, -0.04001438245177269, 0.043579645454883575, -0.03204943612217903, -0.07536358386278152, 0.04524849355220795, 0.02087954245507717, -0.017465993762016296, 0.014735154807567596, 0.011416425928473473, 0.04540020599961281, 0.03191668540239334, -0.05294794216752052, 0.021182969212532043, -0.07744964212179184, -0.007974429987370968, -0.039597172290086746, 0.021619144827127457, 0.06800548732280731, 0.05385822057723999, 0.046196699142456055, -0.008690327405929565, -0.022548388689756393, 0.004025143571197987, -0.014137783087790012, -0.009150208905339241, -0.05237901583313942, 0.016754837706685066, 0.00364823080599308, -0.015531648881733418, -0.000875907251611352, 0.036695655435323715, 0.03974888473749161, 0.0830630287528038, -0.053061727434396744, 0.054768502712249756, -0.024501698091626167, 0.0011028845328837633, -0.03292178735136986, -0.04293486475944519, 0.08389745652675629, -0.023970700800418854, 0.011881047859787941, -0.017001371830701828, -0.007661521900445223, 0.009619571268558502, -0.024008629843592644, 0.008685586042702198, 0.09542766958475113, -0.03978681191802025, -0.009719133377075195, 0.021334683522582054, 0.04289693757891655, -0.029394451528787613, 0.07073632627725601, -0.019390856847167015, -0.0027972140815109015, -0.002301775151863694, 0.030020268633961678, -0.02768767811357975, -0.009965667501091957, -0.006386181805282831, 0.04543813318014145, 0.003999067936092615, 0.011625031940639019, -0.022415639832615852, 0.004380721598863602, -0.007414987776428461, -0.027953175827860832, -0.0065331538207829, -0.009254511445760727, 0.06201281026005745, -0.00833474937826395, 0.012952523306012154, -0.03197357803583145, -0.012383597902953625, -0.015038580633699894, -0.0009345776634290814, -0.06436436623334885, 0.01665053516626358, -0.022548388689756393, 0.04160737246274948, 0.008481721393764019, 0.0028090665582567453, 0.02080368623137474, 0.009226065129041672, 0.026018831878900528, -0.017627188935875893, -0.01304734405130148, 0.05533742532134056, 0.051734235137701035, 0.0302288755774498, -0.016166947782039642, 0.029754770919680595, -0.009012718684971333, 0.007111561018973589, 0.008756701834499836, 0.038061074912548065, 0.024046558886766434, 0.014052444137632847, -0.004150781314820051, -0.03826967999339104, 0.0369611531496048, 0.040545377880334854, 0.013796428218483925, 0.01786424033343792, 0.04255558177828789, -0.011454354040324688, -0.016603125259280205, 0.032580431550741196, -0.009496304206550121, 0.05230316147208214, 0.014393799006938934, -0.06352994590997696, -0.013986069709062576, -0.04043159633874893, 0.03170808032155037, -0.012165510095655918, -0.0034680713433772326, -0.019220178946852684, 0.045058850198984146, -0.012212920933961868, -0.0278773196041584, 0.06963640451431274, -0.05954746901988983, 0.03220114856958389, -0.04676562547683716, -0.02211221307516098, -0.03836449980735779, -0.02886345610022545, 0.05655113235116005, 0.0419108010828495, 0.0666779950261116, 0.015721291303634644, 0.005603909958153963, 0.07217760384082794, 0.015474756248295307, -0.012544794008135796, 0.0008450904861092567, -0.042403869330883026, 0.051848020404577255, -0.04111430421471596, -0.03618362173438072, -0.02503269538283348, -0.015228222124278545, -0.024236200377345085, -0.004577474668622017, -0.03743525594472885, 0.03195461258292198, -0.001707959920167923, 0.022908708080649376, -0.027042895555496216, 0.02220703475177288, 0.008984272368252277, 0.0024096339475363493, -0.018831413239240646, 0.001585878082551062, -0.05071017146110535, -0.0581061951816082, 0.06603321433067322, 0.024046558886766434, -0.03570951893925667, 0.05154459550976753, -0.06519879400730133, -0.009183395653963089, -0.010638895444571972, -0.020253725349903107, 0.00490223616361618, -0.02484305389225483, -0.05074809864163399, -0.01719101332128048, -0.0633782297372818, 0.03578537330031395, 0.014811011031270027, 0.014886867254972458, -0.028104888275265694, 0.010316504165530205, -0.03703701123595238, -0.03032369539141655, -0.03718872368335724, 0.03813692927360535, -0.03053230233490467, -0.06819512695074081, 0.024160342290997505, 0.017684081569314003, -0.0038331313990056515, 0.020310617983341217, -0.04532434791326523, -0.04824483022093773, -0.057271771132946014, 0.0010448067914694548, -0.05548914149403572, 0.08951085060834885, -0.07145696133375168, -0.073543019592762, 0.025677476078271866, 0.009610089473426342, 0.014621369540691376, 0.04551399126648903, -0.002967891516163945, -0.003735939972102642, 0.03971095755696297, 0.06311273574829102, -0.007490844465792179, 0.005129805766046047, -0.016299698501825333, -0.03978681191802025, 0.057271771132946014, 0.023041456937789917, -0.011331086978316307, -0.004596438724547625, -0.027972139418125153, 0.002388299209997058, 0.00891315657645464, 0.03140465170145035, 0.01921069622039795, 0.019684800878167152, 0.060154322534799576, -0.032390788197517395, 0.015854040160775185, -0.035178523510694504, -0.029356524348258972, -0.019030537456274033, 0.05685456097126007, -0.09178654849529266, 0.012184474617242813, -0.0772220715880394, 0.006390922702848911, 0.05101359635591507, 0.0026383891236037016, -0.07866334915161133, 0.061443887650966644, 0.005769846495240927, -0.03986267000436783, 0.0497240349650383, 0.009662240743637085, 0.007505067158490419, -0.008633434772491455, 0.003667194861918688, -0.021296754479408264, 0.04926889389753342, -0.04581741616129875, 0.05905440077185631, 0.021562252193689346, 0.020083047449588776, 0.05366858094930649, -0.017627188935875893, 0.021239861845970154, 0.04509677737951279, -0.03208736330270767, -0.055792566388845444, 0.0009304292034357786, -0.003053230233490467, 0.03546298295259476, -0.039293743669986725, 0.018452130258083344, 0.025506798177957535, -0.03730250895023346, -0.029527200385928154, -0.012269813567399979, -0.0005840369267389178, -0.058713048696517944, 0.044831279665231705, 0.11598481982946396, -0.02328799106180668, -0.051923878490924835, 0.0005573685630224645, -0.060192253440618515, -0.04733454808592796, -0.002619425067678094, -0.000218828659853898, 0.00625817384570837, 0.0371507927775383, -0.058561332523822784, 0.0019627907313406467, -0.06755034625530243, -0.01960894465446472, 0.007078373804688454, -0.02065197378396988, 0.009994113817811012, -0.019627908244729042, 0.0014507584273815155, -0.04926889389753342, 0.0575372688472271, -0.007367577403783798, 0.046500127762556076, 0.01665053516626358, 0.016963442787528038, -0.08533873409032822, 0.015019617043435574, -0.026492934674024582, 0.009505786933004856, 0.039255816489458084, 0.012544794008135796, -0.025961939245462418, -0.029565129429101944, 0.014782564714550972, -0.03043748065829277, 0.012449972331523895, 0.01041132491081953, 0.06079910695552826, -0.06284723430871964, -0.01169140636920929, -0.011302640661597252, 0.03557676821947098, 0.004601180087774992, 0.01951412297785282, -0.05689248815178871, 0.03982474282383919, 0.018414201214909554, 0.0415315143764019, 0.020158905535936356, -0.009349332191050053, 0.006300842855125666, 0.049117181450128555, 0.009221323765814304, -0.009842400439083576, 0.02753596380352974, -0.04414857178926468, -0.028806563466787338, 0.05237901583313942, -0.013673161156475544, 0.032599397003650665, 0.015873003751039505, 0.03337692469358444, 0.03411652892827988, -0.02051922306418419, 0.013597304932773113, -0.09246926009654999, 0.014393799006938934, 0.023174205794930458, -0.039483387023210526, -0.0223208200186491, 0.01715308427810669, 0.023762095719575882, -0.06243002414703369, -0.08109075576066971, -0.0058646672405302525, 0.011027660220861435, 0.0386110357940197, 0.04509677737951279, -0.038155894726514816, 0.02643604204058647, 0.008292079903185368, -0.06910540908575058, -0.0672469213604927, -0.025165444239974022, -0.02503269538283348, -0.018622808158397675, -0.03614569455385208, -0.036752548068761826, 0.010032041929662228, 0.025184407830238342, 0.013246467337012291, -0.03028576821088791, -0.020026154816150665, -0.03599398210644722, -0.0014839457580819726, 0.01713412068784237, 0.05643734708428383, 0.025468870997428894, -0.03434409946203232, -0.05385822057723999, -0.006708572618663311, -0.004579845350235701, -0.000916798715479672, 0.05825790762901306, -0.060154322534799576, -0.0019414561102166772, -0.04942060634493828, 0.013009415939450264, 0.002908628433942795, -0.07050875574350357, 0.06834684312343597, 0.027023931965231895, 0.029622022062540054, 0.005931041669100523, 0.009870846755802631, -0.023212134838104248, 0.051620449870824814, 0.04475542530417442, 0.003408808261156082, 0.012819773517549038, 0.06311273574829102, 0.031082263216376305, -0.010259611532092094, 0.0007733822567388415, -0.036600835621356964, -0.007765824440866709, 0.06174731254577637, -0.06269551813602448, -0.03627844154834747, -0.03902824595570564, 0.07312580943107605, 0.046310484409332275, -0.011653478257358074, -0.01105610653758049, -0.008898933418095112, -0.04961024969816208, -0.0034680713433772326, 0.036392226815223694, -0.03455270454287529, 0.018973644822835922, -0.03178393840789795, -0.04282107949256897, -0.02051922306418419, -0.0036411192268133163, 0.002576755592599511, -0.04452785477042198, -0.039483387023210526, 0.07422573119401932, -0.026777397841215134, 0.020993327721953392, 0.05981297045946121, -0.04111430421471596, 0.016878103837370872, -0.02093643508851528, 0.005456937942653894, -0.020481295883655548, -0.013151646591722965, 0.05097566917538643, 0.002073019975796342, -0.05947161465883255, 0.012070689350366592, -0.0043001240119338036, 0.03766282647848129, 0.032409753650426865, -0.07638764381408691, -0.05124116688966751, -0.011918975971639156, 0.02651190012693405, 0.03921788930892944, -0.00398010341450572, -0.060306038707494736, 0.016849659383296967, 0.0076283342204988, -0.07380852103233337, -0.004812156315892935, 0.0034419954754412174, 0.02186567895114422, -0.04676562547683716, 0.022662173956632614, 0.0008948714239522815, 0.0037074938882142305, 0.013796428218483925, -0.052985869348049164, -0.01713412068784237, 0.0553753562271595, 0.035083699971437454, -0.030077161267399788, -0.015142884105443954, -0.002863588510081172, 0.024217234924435616, 0.006860285997390747, -0.03978681191802025, 0.0034396250266581774, -0.0006323363049887121, 0.05294794216752052, 0.035216450691223145, 0.04373135790228844, 0.02370520308613777, 0.02463444694876671, -0.03455270454287529, 0.025430941954255104, 0.0013251209165900946, -0.054351288825273514, 0.06709520518779755, 0.021334683522582054, -0.057309698313474655, -0.022415639832615852, 0.009880328550934792, 0.05127909407019615, -0.004046478308737278, 0.03039955347776413, 0.01790216937661171, -0.00015645433450117707, 0.006860285997390747, 0.02620847336947918, -0.002068279078230262, -0.017447030171751976, 0.019220178946852684, 0.008439051918685436, 0.0023740760516375303, 0.052985869348049164, 0.02332592010498047, -0.010202719829976559, 0.044717494398355484, -0.01799699105322361, 0.038990318775177, 0.008097697049379349, -0.0606473907828331, 0.007595147006213665, 0.006741759832948446, 0.03821278735995293, -0.0060922373086214066, 0.006011639721691608, -0.00017897428188007325, -0.01322750374674797, 0.04179701581597328, -0.023951737210154533, -0.019409820437431335, 0.05973711237311363, -0.00478845089673996, -0.0347992368042469, -0.009927739389240742, -0.025791261345148087, 0.01529459748417139, 0.009154949337244034, 0.09762750566005707, 0.001585878082551062, 0.03690426051616669, -0.045020923018455505, 0.020329581573605537, 0.008510167710483074, 0.025791261345148087, -0.03466648980975151, -0.0036411192268133163, 0.0865524411201477, -0.019893405959010124, -0.007277497556060553, 0.0034514775034040213, -0.027270466089248657, 0.11810880154371262, -0.022624246776103973, 0.012212920933961868, 0.033869992941617966, 0.021751893684267998, -0.0011840749066323042, -0.011653478257358074, -0.05355479568243027, 0.0016949219861999154, 0.021315718069672585, 0.025374049320816994, 0.010430289432406425, -0.051848020404577255, -0.025867117568850517, 0.002929963171482086, -0.003337692702189088, -0.057195913046598434, 0.0028019549790769815, -0.046158771961927414, -0.0023148132022470236, -0.00032061286037787795, 0.003581856144592166, -0.019409820437431335, 0.05495814234018326, -0.03167015314102173, 0.033964816480875015, 0.02617054432630539, 0.04657598212361336, 0.016081610694527626, -0.011672441847622395, -0.0002920184633694589, -0.06117838993668556, -0.013616268523037434, 0.06447815150022507, -0.040735021233558655, -0.051620449870824814, 0.051848020404577255, -0.028161780908703804, -0.033964816480875015, 0.05378236621618271, -0.04612084478139877, -0.025127515196800232, 0.00041217420948669314, 0.03481820225715637, -0.007803753018379211, -0.0025340861175209284, -0.0017174419481307268, -0.03722665086388588, 0.008576542139053345, 0.06588149815797806, -0.0026028312277048826, -0.03828864544630051, 0.004380721598863602, -0.010430289432406425, -0.01705826446413994, -0.06243002414703369, 0.04327622056007385, -0.06717106699943542, -0.08154589682817459, 0.05787862464785576, 0.03684736788272858, 0.02886345610022545, 0.0016546231927350163, -0.019760657101869583, -0.02474823221564293, -0.041986655443906784, -0.0530238002538681, -0.04691733792424202, 0.021751893684267998, -0.05344101041555405, 0.03819382190704346, 0.02768767811357975, 0.003335322020575404, -0.04103844612836838, -0.021732930094003677, -0.031233975663781166, -0.008690327405929565, 0.04259350895881653, 0.03324417769908905, -0.021524325013160706, 0.06038189306855202, -0.005580205004662275, 0.00859550666064024, -0.0657297894358635, -0.02878759801387787, 0.018660735338926315, -0.04851032793521881, 0.0014377206098288298, 0.011900012381374836, 0.008183035999536514, 0.009472599253058434, -0.04460370913147926, 0.006272397004067898, 0.03760593384504318, -0.0010400657774880528, 0.0274032149463892, 0.0581061951816082, 0.028446244075894356, 0.000493957195430994, 0.05127909407019615, -0.006993034854531288, 0.03286489471793175, 0.003617414040490985, 0.051810093224048615, -0.005916818510740995, -0.04411064088344574, 0.02766871266067028, 0.0584854781627655, -0.04657598212361336, 0.026777397841215134, -0.0604577511548996, 0.021657073870301247, 0.030721943825483322, -0.06201281026005745, -0.0551857128739357, -0.03705597296357155, -0.024312056601047516, -0.029906485229730606, -0.002339703496545553, -0.015323043800890446, 0.001993607496842742, 0.008168812841176987, -0.00277587934397161, 0.007704190909862518, -0.058713048696517944, -0.056058064103126526, -0.001272969413548708, -0.022908708080649376, 0.010515628382563591, -0.02643604204058647, -0.013151646591722965, -0.0015977306757122278, -0.003733569523319602, -0.012212920933961868, -0.017522886395454407, -0.009586384519934654, -0.013929177075624466, 0.021069183945655823, -0.02055715210735798, 0.05404786393046379, -0.002785361371934414, 0.06296101957559586, 0.031233975663781166, 0.018584879115223885, -0.014090373180806637, 0.05215144902467728, 0.07873920351266861, -0.009548455476760864, -0.008377418853342533, 0.05086188390851021, -0.03565262630581856, 0.024046558886766434, -0.04050745069980621, 0.03204943612217903, -0.014848939143121243, 0.008680845610797405, -0.016584159806370735, 0.015218740329146385, -0.028692778199911118, -0.06626078486442566, 0.005343152675777674, -0.004707853309810162, -0.01726686954498291, 0.014630851335823536, 0.03836449980735779, 0.05962332710623741, 0.006940883584320545, -0.012279295362532139, 0.03493198752403259, 0.064516082406044, 0.03282696381211281, -0.0697881206870079, 0.027346322312951088, -0.05093774199485779, -0.005281519144773483, 0.011425907723605633, 0.027099788188934326, -0.025468870997428894, -0.00582199776545167, 0.006315066013485193, -0.021751893684267998, -0.012108617462217808, 0.026720505207777023, 0.03711286559700966, 0.02053818851709366, -0.021277790889143944, 0.029546165838837624, -0.015816111117601395, -0.03716975823044777, -0.005362117197364569, -0.030153019353747368, 0.028294529765844345, -0.0018466353649273515, -0.00034787386539392173, -0.001035324763506651, -0.005091877654194832, 0.013796428218483925, -0.06819512695074081, -0.05950954183936119, 0.022984564304351807, 0.07073632627725601, 0.04175908491015434, -0.057385556399822235, 0.061709385365247726, 0.05234108865261078, 0.021827751770615578 ]
39,415
pyspark.sql.dataframe
sampleBy
Returns a stratified sample without replacement based on the fraction given on each stratum. .. versionadded:: 1.5.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Parameters ---------- col : :class:`Column` or str column that defines strata .. versionchanged:: 3.0.0 Added sampling by a column of :class:`Column` fractions : dict sampling fraction for each stratum. If a stratum is not specified, we treat its fraction as zero. seed : int, optional random seed Returns ------- a new :class:`DataFrame` that represents the stratified sample Examples -------- >>> from pyspark.sql.functions import col >>> dataset = spark.range(0, 100).select((col("id") % 3).alias("key")) >>> sampled = dataset.sampleBy("key", fractions={0: 0.1, 1: 0.2}, seed=0) >>> sampled.groupBy("key").count().orderBy("key").show() +---+-----+ |key|count| +---+-----+ | 0| 3| | 1| 6| +---+-----+ >>> dataset.sampleBy(col("key"), fractions={2: 1.0}, seed=0).count() 33
def sampleBy( self, col: "ColumnOrName", fractions: Dict[Any, float], seed: Optional[int] = None ) -> "DataFrame": """ Returns a stratified sample without replacement based on the fraction given on each stratum. .. versionadded:: 1.5.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Parameters ---------- col : :class:`Column` or str column that defines strata .. versionchanged:: 3.0.0 Added sampling by a column of :class:`Column` fractions : dict sampling fraction for each stratum. If a stratum is not specified, we treat its fraction as zero. seed : int, optional random seed Returns ------- a new :class:`DataFrame` that represents the stratified sample Examples -------- >>> from pyspark.sql.functions import col >>> dataset = spark.range(0, 100).select((col("id") % 3).alias("key")) >>> sampled = dataset.sampleBy("key", fractions={0: 0.1, 1: 0.2}, seed=0) >>> sampled.groupBy("key").count().orderBy("key").show() +---+-----+ |key|count| +---+-----+ | 0| 3| | 1| 6| +---+-----+ >>> dataset.sampleBy(col("key"), fractions={2: 1.0}, seed=0).count() 33 """ if isinstance(col, str): col = Column(col) elif not isinstance(col, Column): raise PySparkTypeError( error_class="NOT_COLUMN_OR_STR", message_parameters={"arg_name": "col", "arg_type": type(col).__name__}, ) if not isinstance(fractions, dict): raise PySparkTypeError( error_class="NOT_DICT", message_parameters={"arg_name": "fractions", "arg_type": type(fractions).__name__}, ) for k, v in fractions.items(): if not isinstance(k, (float, int, str)): raise PySparkTypeError( error_class="DISALLOWED_TYPE_FOR_CONTAINER", message_parameters={ "arg_name": "fractions", "arg_type": type(fractions).__name__, "allowed_types": "float, int, str", "return_type": type(k).__name__, }, ) fractions[k] = float(v) col = col._jc seed = seed if seed is not None else random.randint(0, sys.maxsize) return DataFrame( self._jdf.stat().sampleBy(col, self._jmap(fractions), seed), self.sparkSession )
(self, col: 'ColumnOrName', fractions: Dict[Any, float], seed: Optional[int] = None) -> 'DataFrame'
[ 0.0387263223528862, -0.07576889544725418, 0.0356394425034523, 0.022562291473150253, 0.03449822962284088, 0.016790760681033134, 0.029634054750204086, 0.035265274345874786, 0.010532811284065247, 0.03085009939968586, -0.03876373916864395, 0.055863186717033386, 0.0029676149133592844, 0.03088751621544361, -0.006150376051664352, 0.013769359327852726, 0.009803185239434242, 0.031093308702111244, 0.03678065165877342, -0.00968158058822155, 0.003912387415766716, 0.0017363704973831773, 0.026079464703798294, 0.1025966927409172, -0.04471300169825554, 0.015303445048630238, -0.00791831687092781, -0.03651873394846916, 0.022319084033370018, -0.009887373074889183, 0.035358816385269165, -0.040110740810632706, -0.02359125204384327, 0.026303965598344803, -0.049876511096954346, -0.05043775960803032, 0.020541789010167122, -0.005818302743136883, -0.00825039017945528, -0.0624859519302845, 0.04602258652448654, 0.0015364247374236584, 0.01265621092170477, -0.0550026036798954, -0.028717344626784325, 0.07161563634872437, 0.04950234293937683, 0.006178438663482666, -0.01379742193967104, 0.015817925333976746, 0.0008062137640081346, 0.01606113463640213, -0.04602258652448654, 0.0624859519302845, -0.019643787294626236, -0.02258099988102913, -0.045611001551151276, -0.01353550422936678, 0.06005386263132095, 0.07857514917850494, 0.07423480600118637, 0.006571314297616482, -0.01932574436068535, 0.010822790674865246, 0.00021514623949769884, -0.00959739275276661, -0.04901592433452606, 0.0337124802172184, -0.02108433097600937, -0.06581603735685349, 0.012684273533523083, -0.004735555965453386, 0.036369066685438156, 0.11337271332740784, -0.031037183478474617, 0.01891416124999523, -0.014386734925210476, 0.00008798779163043946, 0.008909860625863075, -0.03410535678267479, 0.04901592433452606, -0.04890367388725281, -0.006655502133071423, -0.05040034279227257, -0.020654039457440376, -0.004288893658667803, 0.03638777509331703, 0.0035358816385269165, 0.06289753317832947, 0.00019512244034558535, -0.027576135471463203, 0.04527425020933151, 0.029952097684144974, 0.00222161877900362, 0.04142032936215401, -0.018942223861813545, -0.0031944538932293653, -0.0009073558612726629, 0.03279576823115349, 0.004087778273969889, 0.018764493986964226, -0.030793974176049232, 0.05118609592318535, 0.02415250428020954, -0.0033815375063568354, 0.001627627993002534, 0.016351113095879555, -0.01173014659434557, -0.05803335830569267, -0.01622951030731201, -0.030700432136654854, 0.08972533792257309, 0.01353550422936678, -0.003893679240718484, -0.006080219522118568, -0.012169793248176575, 0.01399385929107666, -0.0008851396851241589, -0.06076478213071823, 0.00712788850069046, 0.005757500417530537, 0.04142032936215401, -0.03853923827409744, -0.006650825031101704, 0.007249492686241865, 0.014592527411878109, 0.010532811284065247, -0.026696842163801193, -0.03133651614189148, 0.0999775230884552, 0.06383295357227325, 0.027744511142373085, -0.0032599330879747868, 0.032271936535835266, 0.032271936535835266, -0.0011476414510980248, 0.00035165887675248086, 0.021720414981245995, 0.08822866529226303, 0.04845467582345009, 0.03232806175947189, -0.04216866195201874, 0.04351566359400749, 0.0224874597042799, 0.06327170133590698, -0.004845467396080494, 0.01223527267575264, 0.0032739643938839436, -0.014573819003999233, 0.017492324113845825, -0.03215968608856201, 0.06151311472058296, 0.03264610469341278, -0.08867766708135605, -0.018502576276659966, -0.05324401706457138, 0.0076704309321939945, 0.010392498224973679, -0.0018766832072287798, -0.07023121416568756, 0.03627552464604378, -0.018240658566355705, -0.0004457853501662612, 0.03816507011651993, -0.05874427780508995, 0.03126168251037598, -0.02847413718700409, 0.005345916375517845, -0.019830871373414993, -0.06315945088863373, 0.03303897753357887, 0.012796523980796337, 0.01353550422936678, -0.010280248709022999, 0.001270999782718718, 0.026640716940164566, -0.009190485812723637, 0.017314594238996506, 0.01645400933921337, -0.05915585905313492, 0.06465612351894379, -0.04643417149782181, -0.011253084056079388, -0.009700288996100426, -0.020298579707741737, -0.02531242184340954, -0.005949261132627726, -0.04370274767279625, 0.0038866635877639055, -0.0036808715667575598, -0.002092998707666993, -0.0017808028496801853, -0.011281145736575127, 0.03691161051392555, 0.03416148200631142, -0.018184533342719078, -0.0030775265768170357, -0.05275759845972061, -0.07917381823062897, 0.05470326915383339, 0.013685171492397785, -0.030868807807564735, 0.03782832249999046, -0.024302169680595398, -0.033862147480249405, -0.022992584854364395, -0.024844713509082794, 0.025798840448260307, 0.0025349839124828577, -0.05395493283867836, -0.0023186684120446444, -0.05200926586985588, 0.05515227094292641, 0.013769359327852726, 0.03191647678613663, -0.03380602225661278, 0.020784996449947357, -0.017539095133543015, 0.013872255571186543, -0.045311667025089264, 0.025069214403629303, 0.003182761138305068, -0.027669677510857582, 0.020186329260468483, 0.0325525626540184, -0.024713754653930664, 0.012572024017572403, -0.029783722013235092, -0.05051259323954582, -0.05590060353279114, 0.028361886739730835, -0.035882651805877686, 0.07842548191547394, -0.09608618170022964, -0.10678736865520477, -0.008619880303740501, -0.01879255659878254, -0.010673124343156815, 0.07090471684932709, -0.07060538232326508, -0.020710164681077003, 0.05721019208431244, 0.019999245181679726, -0.01900770142674446, 0.002140939002856612, -0.01596759259700775, -0.022693250328302383, 0.04770633950829506, -0.021757831797003746, -0.015986301004886627, 0.04272991418838501, -0.013357775285840034, 0.018455805256962776, -0.013123920187354088, 0.054591018706560135, -0.04370274767279625, -0.0019526859978213906, 0.08014664798974991, -0.018072284758090973, 0.012983608059585094, -0.06282269954681396, -0.011907876469194889, -0.01236623153090477, 0.03794057294726372, -0.05721019208431244, -0.010878915898501873, -0.039362408220767975, 0.049614593386650085, 0.028305761516094208, 0.003907710313796997, -0.10880786925554276, 0.030026931315660477, 0.015864696353673935, -0.07139113545417786, 0.047332171350717545, 0.008082015439867973, -0.007983796298503876, -0.011374687775969505, -0.007815420627593994, 0.004812727682292461, 0.03921274095773697, -0.03129909932613373, 0.048117924481630325, 0.07071763277053833, 0.022375209257006645, 0.06821071356534958, -0.028043843805789948, -0.035751692950725555, 0.018193887546658516, -0.013657108880579472, -0.036724526435136795, -0.023871878162026405, -0.030214015394449234, 0.026734258979558945, -0.05848236009478569, 0.028623804450035095, 0.0611763633787632, -0.03868890553712845, -0.004092455375939608, -0.02789417654275894, 0.014012567698955536, -0.014330610632896423, 0.028305761516094208, 0.08950083702802658, -0.0350220650434494, -0.04078424349427223, -0.032945435494184494, -0.06199953332543373, -0.05096159502863884, -0.02688392624258995, -0.014180943369865417, 0.018867390230298042, 0.048080507665872574, -0.024844713509082794, -0.03666840121150017, -0.05571351945400238, -0.035227857530117035, 0.009237256832420826, -0.006842585746198893, 0.03992365673184395, -0.011580480262637138, -0.02737034298479557, -0.03700515255331993, 0.050849344581365585, 0.017613928765058517, 0.041083578020334244, 0.05548902228474617, 0.007544149644672871, -0.06723787635564804, -0.010860207490622997, -0.006094250828027725, 0.011823688633739948, 0.026696842163801193, -0.007773327175527811, -0.06405745446681976, 0.02389058656990528, -0.00215029320679605, -0.042842164635658264, 0.012899420224130154, 0.01236623153090477, 0.04815534129738808, -0.10454235970973969, -0.024975672364234924, 0.00968158058822155, 0.02160816639661789, -0.00671162735670805, 0.016828177496790886, -0.05646185576915741, -0.009606746956706047, 0.04097132757306099, 0.07139113545417786, 0.009153068996965885, 0.0051307701505720615, 0.037248361855745316, 0.08216715604066849, 0.04669608920812607, -0.013049086555838585, 0.04766892269253731, -0.046808335930109024, -0.01958766207098961, 0.11554288119077682, -0.05440393462777138, 0.04546133428812027, -0.031579725444316864, 0.024320878088474274, 0.03404923155903816, 0.005593802314251661, 0.015920821577310562, -0.039624325931072235, -0.01337648369371891, 0.0168562401086092, -0.042131245136260986, -0.01680946908891201, 0.04871658980846405, 0.006931450683623552, -0.010392498224973679, -0.046808335930109024, 0.011215667240321636, -0.0035101575776934624, 0.03565815091133118, 0.02050437219440937, -0.035134315490722656, 0.07670430839061737, 0.034479521214962006, -0.0305881816893816, -0.03221581131219864, -0.014517693780362606, -0.08388832211494446, -0.009321444667875767, -0.05021326243877411, -0.017314594238996506, 0.049128174781799316, 0.010261540301144123, 0.056125104427337646, -0.03464789688587189, -0.03505948185920715, -0.008526339195668697, -0.011075354181230068, 0.03492852300405502, 0.07217688858509064, 0.018334200605750084, -0.09870535135269165, -0.05979194492101669, -0.016687864437699318, -0.019213493913412094, 0.011552417650818825, 0.02531242184340954, -0.08111948519945145, -0.025144048035144806, -0.025798840448260307, 0.004571857396513224, -0.009106297977268696, -0.03666840121150017, 0.03816507011651993, 0.04299183189868927, -0.016566259786486626, 0.008063307031989098, 0.011599188670516014, -0.03094364143908024, 0.04026040807366371, 0.0475192554295063, -0.013853547163307667, 0.020055370405316353, 0.06218661740422249, 0.05664893984794617, -0.009887373074889183, -0.014807673171162605, -0.02398412860929966, -0.0056966980919241905, 0.07850031554698944, -0.054366517812013626, -0.02714584209024906, -0.03040109947323799, 0.0199431199580431, 0.04841725900769234, 0.0293534304946661, -0.0022835901472717524, -0.007979119196534157, -0.05096159502863884, -0.02222554199397564, 0.02662200853228569, 0.005645249970257282, -0.007815420627593994, -0.015696320682764053, -0.0010903470683842897, -0.02389058656990528, -0.005916521418839693, 0.022543583065271378, -0.018165824934840202, -0.03850182145833969, 0.06338395178318024, -0.048828840255737305, 0.03206614404916763, 0.0411958284676075, -0.0374915711581707, 0.03752898797392845, 0.01584598794579506, 0.013629046268761158, -0.013329712674021721, 0.01913866028189659, 0.025499505922198296, -0.0074131907895207405, -0.01707138679921627, -0.004225752782076597, 0.012983608059585094, 0.02027987129986286, -0.018193887546658516, -0.03947465866804123, -0.009555298835039139, -0.003858600975945592, -0.0009032633970491588, 0.07255104929208755, 0.0026238486170768738, -0.028586387634277344, 0.019213493913412094, -0.04370274767279625, -0.06562895327806473, 0.0134232547134161, -0.010439269244670868, 0.02402154542505741, -0.031168142333626747, 0.01316133700311184, 0.002960599260404706, -0.008067984133958817, 0.03343185409903526, -0.05215892940759659, -0.0549277700483799, -0.009616101160645485, 0.014059338718652725, -0.022599708288908005, -0.0711292177438736, 0.002981646219268441, 0.04647158831357956, 0.02548079751431942, -0.06667662411928177, 0.010224123485386372, 0.01036443654447794, 0.016201447695493698, 0.0017048000590875745, 0.029895972460508347, 0.011524355039000511, 0.045573584735393524, -0.053131766617298126, 0.022113291546702385, -0.007141919806599617, -0.007258846890181303, 0.04097132757306099, 0.006870648358017206, -0.032945435494184494, -0.029503097757697105, 0.007431899197399616, 0.009747060015797615, -0.014817027375102043, 0.028530262410640717, 0.03431114926934242, -0.009644163772463799, 0.030419807881116867, -0.004045684821903706, -0.02733292616903782, 0.010673124343156815, -0.0004919716157019138, -0.004190674517303705, 0.02349771000444889, 0.07053054869174957, 0.027688385918736458, 0.028530262410640717, 0.03331960365176201, -0.0381089448928833, 0.012815232388675213, 0.02957792952656746, -0.05264534801244736, 0.04052232578396797, 0.02076628804206848, 0.06716304272413254, 0.019091889262199402, 0.04205641150474548, 0.005172864068299532, -0.012403648346662521, 0.01874578557908535, -0.007581566460430622, -0.01430254802107811, 0.043553080409765244, 0.040335241705179214, -0.031093308702111244, -0.00032067313441075385, -0.015874050557613373, -0.00029144130530767143, -0.0018556362483650446, 0.036761943250894547, -0.0014826381811872125, 0.019924411550164223, -0.02619171515107155, 0.02183266542851925, -0.008900506421923637, 0.053842682391405106, -0.05803335830569267, -0.014583173207938671, 0.028006426990032196, -0.021570749580860138, 0.010860207490622997, -0.02164558134973049, -0.014957340434193611, 0.1299857497215271, -0.0014522371347993612, 0.032945435494184494, 0.04748183861374855, 0.013217462226748466, -0.016790760681033134, -0.01563084125518799, -0.0826161578297615, 0.01809099316596985, 0.027838051319122314, 0.043104082345962524, 0.00317340693436563, -0.07026863098144531, -0.04467558488249779, -0.018549347296357155, -0.02085983008146286, -0.059829361736774445, -0.003746350761502981, -0.0636458694934845, 0.0330951027572155, 0.009934143163263798, 0.03565815091133118, -0.017875846475362778, 0.03657485917210579, -0.016304343938827515, 0.04718250408768654, 0.008900506421923637, 0.06461870670318604, -0.01570567488670349, -0.04022299125790596, -0.0026612654328346252, -0.023179668933153152, 0.009756414219737053, 0.018231304362416267, -0.02795030176639557, -0.05096159502863884, 0.008395380340516567, -0.04070940986275673, -0.024657629430294037, 0.03743544593453407, -0.02460150420665741, -0.010205415077507496, 0.03414277359843254, 0.035227857530117035, -0.00519157201051712, 0.04968942701816559, 0.0027454530354589224, 0.0035358816385269165, -0.03505948185920715, 0.06746237725019455, -0.010373789817094803, -0.003622407792136073, 0.03691161051392555, -0.02415250428020954, -0.008451505564153194, -0.07573147863149643, 0.039137907326221466, -0.06925837695598602, -0.051897015422582626, 0.04396466538310051, 0.024844713509082794, 0.05447876825928688, -0.030962349846959114, -0.011907876469194889, -0.014424151740968227, -0.019157368689775467, -0.04516199976205826, -0.07595597207546234, 0.005294468253850937, -0.06678887456655502, 0.06809846311807632, 0.007095148786902428, 0.02785675972700119, -0.021140456199645996, -0.02476987987756729, -0.04299183189868927, -0.0075020557269454, 0.037734780460596085, 0.0293534304946661, -0.03010176494717598, 0.04770633950829506, 0.005023196805268526, -0.013095857575535774, -0.030924933031201363, -0.03419889882206917, 0.002995677525177598, -0.043328579515218735, -0.013254879042506218, -0.0024718432687222958, -0.008947277441620827, 0.03215968608856201, -0.038352154195308685, 0.03730448707938194, -0.01857740990817547, -0.018717722967267036, -0.014779611490666866, -0.0088911522179842, 0.015649549663066864, 0.02027987129986286, 0.04052232578396797, -0.02323579415678978, 0.03139264136552811, -0.0020251809619367123, 0.029914680868387222, 0.0030330943409353495, -0.01879255659878254, 0.008451505564153194, 0.040110740810632706, -0.0177823044359684, 0.02720196731388569, -0.016931073740124702, -0.03071914054453373, 0.049839094281196594, -0.03977398946881294, -0.03661227598786354, -0.04291699826717377, -0.03071914054453373, -0.058819111436605453, -0.015088299289345741, -0.006688241846859455, 0.005575093906372786, -0.0018041882431134582, -0.02450796216726303, 0.0074880244210362434, -0.03550848364830017, -0.06166278198361397, -0.01487315259873867, -0.06151311472058296, 0.01056087389588356, -0.03797798603773117, -0.012141730636358261, 0.013600983656942844, -0.04055974259972572, -0.02490083873271942, -0.005589125212281942, 0.012244626879692078, 0.038576655089855194, 0.02521887980401516, -0.005799594335258007, 0.04467558488249779, 0.026173006743192673, 0.0462096706032753, 0.024302169680595398, 0.04153257608413696, -0.01073860377073288, 0.061625365167856216, 0.04845467582345009, 0.0034329856280237436, -0.002619171515107155, 0.0337124802172184, -0.08762999624013901, 0.0061456989496946335, -0.02824963629245758, 0.04632192105054855, -0.025724006816744804, 0.021159164607524872, -0.01425577700138092, 0.009747060015797615, -0.01839032582938671, -0.049577176570892334, 0.025817548856139183, 0.007908962666988373, -0.04164482653141022, -0.004595242906361818, 0.06761204451322556, 0.04516199976205826, -0.0009506189962849021, -0.015677612274885178, -0.014639298431575298, 0.034255024045705795, 0.01839032582938671, 0.0017293548444285989, 0.028661221265792847, -0.03322606161236763, -0.03167326748371124, -0.007155951112508774, 0.021682998165488243, -0.030906224623322487, -0.008105400949716568, 0.009471111930906773, -0.01984957978129387, -0.007792035583406687, 0.017482969909906387, 0.01319875381886959, 0.03107460029423237, 0.024171212688088417, 0.008418765850365162, -0.023254502564668655, -0.01375065091997385, -0.0029722920153290033, -0.05803335830569267, 0.045349083840847015, -0.009153068996965885, -0.021009497344493866, -0.002951245056465268, 0.0028015782590955496, 0.021421082317829132, -0.04714508727192879, -0.06278528273105621, -0.009924789890646935, 0.06693854182958603, 0.0007126718992367387, -0.02059791423380375, 0.030962349846959114, 0.05795852467417717, 0.0023525774013251066 ]
39,416
pyspark.sql.dataframe
select
Projects a set of expressions and returns a new :class:`DataFrame`. .. versionadded:: 1.3.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Parameters ---------- cols : str, :class:`Column`, or list column names (string) or expressions (:class:`Column`). If one of the column names is '*', that column is expanded to include all columns in the current :class:`DataFrame`. Returns ------- :class:`DataFrame` A DataFrame with subset (or all) of columns. Examples -------- >>> df = spark.createDataFrame([ ... (2, "Alice"), (5, "Bob")], schema=["age", "name"]) Select all columns in the DataFrame. >>> df.select('*').show() +---+-----+ |age| name| +---+-----+ | 2|Alice| | 5| Bob| +---+-----+ Select a column with other expressions in the DataFrame. >>> df.select(df.name, (df.age + 10).alias('age')).show() +-----+---+ | name|age| +-----+---+ |Alice| 12| | Bob| 15| +-----+---+
def select(self, *cols: "ColumnOrName") -> "DataFrame": # type: ignore[misc] """Projects a set of expressions and returns a new :class:`DataFrame`. .. versionadded:: 1.3.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Parameters ---------- cols : str, :class:`Column`, or list column names (string) or expressions (:class:`Column`). If one of the column names is '*', that column is expanded to include all columns in the current :class:`DataFrame`. Returns ------- :class:`DataFrame` A DataFrame with subset (or all) of columns. Examples -------- >>> df = spark.createDataFrame([ ... (2, "Alice"), (5, "Bob")], schema=["age", "name"]) Select all columns in the DataFrame. >>> df.select('*').show() +---+-----+ |age| name| +---+-----+ | 2|Alice| | 5| Bob| +---+-----+ Select a column with other expressions in the DataFrame. >>> df.select(df.name, (df.age + 10).alias('age')).show() +-----+---+ | name|age| +-----+---+ |Alice| 12| | Bob| 15| +-----+---+ """ jdf = self._jdf.select(self._jcols(*cols)) return DataFrame(jdf, self.sparkSession)
(self, *cols: 'ColumnOrName') -> 'DataFrame'
[ 0.036491457372903824, -0.053013529628515244, 0.0534779354929924, 0.02314876578748226, 0.002831079764291644, 0.0021322406828403473, 0.03804542496800423, 0.022094925865530968, -0.04165348783135414, 0.05047716945409775, 0.02979331836104393, 0.028435830026865005, -0.02834651991724968, 0.04283235967159271, 0.002947180764749646, -0.021648382768034935, 0.07451902329921722, -0.012806840240955353, 0.05104874446988106, 0.015369994565844536, -0.008712044917047024, -0.001188919530250132, 0.034615978598594666, 0.023934680968523026, -0.029364638030529022, 0.04101046547293663, 0.007600154262036085, -0.02582802064716816, 0.02579229697585106, -0.009136260487139225, -0.024166882038116455, -0.010029345750808716, -0.02704261615872383, -0.047512125223875046, -0.0733044221997261, 0.018415413796901703, -0.0003002998710144311, 0.0002849499578587711, 0.09402399510145187, -0.06623119115829468, -0.017915286123752594, -0.015325340442359447, 0.02273794636130333, -0.08202093094587326, -0.041939277201890945, -0.027024755254387856, 0.0590507872402668, -0.018397552892565727, 0.003239666111767292, -0.012994388118386269, 0.024059712886810303, 0.04490431770682335, -0.0021411716006696224, -0.04426129534840584, -0.01331589836627245, -0.00511291204020381, 0.003284320468083024, 0.0784485936164856, 0.03608063608407974, 0.01789742521941662, -0.026346009224653244, -0.027524882927536964, -0.04333248734474182, 0.0350625216960907, -0.011797654442489147, 0.038509827107191086, 0.010654505342245102, -0.032669052481651306, -0.10324063897132874, -0.006238199304789305, -0.04058178514242172, -0.017343712970614433, 0.007193800527602434, 0.08087778836488724, -0.004463192541152239, -0.04572595655918121, -0.06948202103376389, -0.019737180322408676, -0.014780557714402676, -0.02693544700741768, -0.02045164816081524, -0.058729276061058044, -0.04758357256650925, -0.02250574342906475, 0.04272519052028656, 0.012020925059914589, -0.00928808469325304, -0.00242695864289999, 0.029311053454875946, -0.0020060923416167498, -0.028864510357379913, 0.03465170040726662, -0.05394233763217926, 0.04043889418244362, -0.011931616812944412, -0.01621842570602894, 0.004894106183201075, 0.07559072226285934, 0.03277622163295746, 0.07194693386554718, 0.025774436071515083, 0.011056393384933472, -0.02609594538807869, -0.023791786283254623, 0.02606022357940674, -0.0224342979490757, -0.04497576504945755, -0.021183978766202927, -0.016307733952999115, -0.03775963559746742, 0.005697882734239101, 0.04872672259807587, -0.00232202117331326, -0.041367702186107635, -0.02529216930270195, 0.009413116611540318, -0.02548864856362343, -0.017022201791405678, -0.0420464463531971, 0.005416560918092728, 0.0031213322654366493, 0.05833631753921509, 0.025042105466127396, 0.005805053282529116, -0.02472059428691864, 0.035384032875299454, 0.013324829749763012, -0.024863488972187042, 0.02479204162955284, 0.02522072196006775, 0.03327634930610657, -0.013065834529697895, 0.02354172244668007, 0.03554478660225868, -0.004934295080602169, 0.06108701974153519, 0.037831082940101624, 0.002195873064920306, 0.0196835957467556, 0.017986733466386795, -0.014039297588169575, -0.018326105549931526, 0.022720085456967354, 0.033865787088871, -0.03715233877301216, -0.013190866447985172, 0.055335551500320435, -0.026846136897802353, -0.047476403415203094, 0.06147997826337814, -0.03445522114634514, -0.007626946549862623, -0.02032661624252796, -0.05733606219291687, 0.025452924892306328, 0.005014672875404358, 0.01766522228717804, 0.012449606321752071, -0.019290637224912643, -0.029650425538420677, 0.0266317967325449, 0.017888493835926056, -0.04179638251662254, 0.05658587068319321, -0.014959175139665604, -0.0031190996523946524, -0.008703114464879036, 0.013539169915020466, -0.007140215486288071, 0.030454201623797417, 0.06891044229269028, 0.04308242350816727, 0.059300851076841354, -0.01508420705795288, -0.08795101940631866, 0.045797403901815414, -0.0033289745915681124, 0.00513077387586236, 0.008305691182613373, -0.05440674349665642, 0.04519010707736015, -0.04215361550450325, -0.04669049009680748, 0.03836693614721298, 0.0957387238740921, -0.014530494809150696, -0.03129370138049126, -0.01562005840241909, -0.010886707343161106, 0.009082674980163574, -0.0839499980211258, -0.024166882038116455, 0.04786936193704605, 0.0422607846558094, -0.026185255497694016, -0.03693800047039986, 0.010270478203892708, 0.005818449426442385, -0.01834396831691265, 0.03800969943404198, -0.018022457137703896, 0.00852896273136139, 0.026863999664783478, -0.018326105549931526, 0.01424470730125904, -0.014476909302175045, -0.0015695970505475998, -0.02482776530086994, 0.007613550405949354, -0.06337331980466843, 0.03954580798745155, -0.03440163657069206, 0.009087140671908855, -0.03222250938415527, 0.016906101256608963, 0.07269712537527084, 0.006376627366989851, -0.010377648286521435, 0.05104874446988106, -0.014637664891779423, 0.07480480521917343, 0.02693544700741768, -0.026685383170843124, 0.020648127421736717, 0.051441699266433716, -0.06948202103376389, 0.053084976971149445, -0.02136259526014328, 0.008006507530808449, -0.03475887328386307, 0.00022396899294108152, -0.051334530115127563, 0.025042105466127396, -0.06544527411460876, -0.03897423297166824, 0.04744068160653114, 0.04397550970315933, 0.012020925059914589, 0.08830825239419937, -0.030436338856816292, -0.04118908569216728, 0.048619553446769714, 0.005255805794149637, 0.0010348623618483543, 0.03954580798745155, -0.0034986608661711216, -0.019058436155319214, -0.0037554227747023106, -0.020951775833964348, 0.032365404069423676, 0.022184234112501144, -0.024595562368631363, 0.04061751067638397, 0.02925746701657772, 0.013092627748847008, 0.0534779354929924, 0.07780557125806808, 0.018093904480338097, -0.011038531549274921, 0.01873692497611046, -0.006559710018336773, -0.026310287415981293, -0.03588416054844856, 0.008180659264326096, -0.0034897299483418465, -0.021451903507113457, 0.009413116611540318, -0.029275329783558846, 0.015102068893611431, -0.02230926603078842, 0.026310287415981293, 0.08902271836996078, -0.025506509467959404, -0.0008992250659503043, 0.028060734272003174, 0.002297461498528719, -0.04090329632163048, -0.026310287415981293, -0.06358765810728073, -0.033508554100990295, 0.036491457372903824, -0.0012257592752575874, -0.007577826734632254, 0.04476142302155495, -0.02163052000105381, -0.006398954428732395, -0.0016745345201343298, -0.01756698451936245, -0.03274049982428551, -0.048655275255441666, 0.03243685141205788, 0.026560351252555847, 0.03163307532668114, -0.007077699527144432, 0.03218678757548332, 0.016164839267730713, 0.022880839183926582, -0.001561782555654645, -0.023666754364967346, 0.006398954428732395, 0.007515310775488615, -0.05922940373420715, 0.036795105785131454, 0.03808114677667618, 0.01746874488890171, -0.04554734006524086, -0.05237051099538803, -0.013199797831475735, -0.0016187167493626475, -0.002857872284948826, 0.025685127824544907, -0.011770861223340034, -0.017450882121920586, -0.03425874561071396, -0.07001787424087524, -0.039081402122974396, -0.002064142841845751, -0.01703113317489624, 0.00003924690463463776, -0.01554861105978489, -0.00014833585009910166, -0.048619553446769714, -0.05297780781984329, -0.012440674938261509, 0.029650425538420677, 0.06951774656772614, -0.009377393871545792, -0.04461853206157684, -0.03450880944728851, -0.012297781184315681, 0.006577571853995323, 0.040188830345869064, 0.03029344603419304, -0.026881860569119453, 0.0031012380495667458, -0.0701964870095253, -0.007836821489036083, 0.017048994079232216, -0.000774193147663027, 0.05951518937945366, 0.016700690612196922, -0.07373310625553131, 0.0032240371219813824, 0.0028623377438634634, 0.015637919306755066, 0.0029985331930220127, 0.03281194716691971, -0.014825212769210339, -0.009350600652396679, 0.0012145957443863153, 0.02327379770576954, -0.030757850036025047, 0.007760909385979176, -0.02384537272155285, 0.03665221109986305, 0.03972442448139191, -0.04665476456284523, 0.058157701045274734, -0.013548100367188454, -0.05633580684661865, 0.13310539722442627, -0.0018196608871221542, 0.02089819125831127, -0.025613680481910706, 0.013414137996733189, -0.007220592815428972, -0.011038531549274921, -0.01937994547188282, -0.03090074472129345, -0.041939277201890945, 0.0323832668364048, -0.011458281427621841, 0.03872416913509369, 0.04040316864848137, -0.031079361215233803, -0.01503062155097723, -0.045940298587083817, 0.01121714897453785, 0.016209494322538376, 0.006849962752312422, -0.021380456164479256, -0.05626435950398445, 0.054192401468753815, -0.013155143707990646, 0.015298547223210335, 0.030150553211569786, -0.03868844732642174, -0.07651952654123306, -0.0007736349361948669, -0.0050771888345479965, -0.018558308482170105, -0.007515310775488615, -0.049155402928590775, 0.009145190939307213, -0.03429446741938591, -0.025417201220989227, 0.009752488695085049, 0.058729276061058044, -0.0020295358262956142, -0.018397552892565727, -0.04026027396321297, -0.00804223120212555, -0.019808627665042877, -0.03070426546037197, -0.0017951009795069695, 0.016754277050495148, 0.07723399996757507, -0.06833887100219727, -0.016977546736598015, 0.011047462932765484, 0.017817048355937004, -0.011547590605914593, -0.029971934854984283, 0.06783874332904816, 0.026346009224653244, 0.00789487175643444, 0.034544531255960464, -0.014896659180521965, 0.03504465892910957, 0.020808883011341095, 0.010065068490803242, -0.052013274282217026, -0.005371906794607639, 0.04483287036418915, 0.025845881551504135, 0.007711789570748806, -0.03883133828639984, -0.029811179265379906, 0.030990052968263626, 0.015119930729269981, -0.08330697566270828, -0.033133458346128464, -0.04143914952874184, 0.028025010600686073, 0.0367593839764595, 0.006974994670599699, -0.004275644663721323, -0.019897935912013054, -0.0053808377124369144, -0.02932891435921192, 0.03493748977780342, -0.02872161567211151, 0.01753126084804535, -0.030882881954312325, -0.01743302121758461, -0.04926257207989693, 0.04365399852395058, 0.022916562855243683, -0.07630518823862076, -0.0476907454431057, 0.06030110642313957, 0.06369482725858688, 0.01653100550174713, 0.0132980365306139, 0.05069150775671005, 0.0451543815433979, -0.004027813673019409, 0.03345496580004692, 0.023595308884978294, 0.02979331836104393, 0.03986731916666031, -0.03168665990233421, 0.030489925295114517, -0.02834651991724968, -0.012565706856548786, 0.020773159340023994, -0.04704772308468819, -0.04936974495649338, 0.02105894684791565, -0.033169180154800415, 0.00804669689387083, -0.006381093058735132, -0.048655275255441666, -0.03972442448139191, 0.05812197923660278, -0.0073277633637189865, -0.05626435950398445, -0.008511100895702839, -0.030239861458539963, -0.005514800548553467, -0.06369482725858688, 0.005237943958491087, 0.016280941665172577, -0.024899212643504143, 0.014021435752511024, -0.017450882121920586, -0.030204137787222862, -0.01770094595849514, 0.0006430212524719536, -0.03459811583161354, 0.03127583861351013, 0.015218169428408146, 0.03490176424384117, -0.02498852089047432, -0.04719061776995659, 0.02163052000105381, 0.019790764898061752, 0.006858893670141697, -0.038545552641153336, 0.01941566914319992, -0.045761678367853165, -0.012833632528781891, -0.03533044457435608, 0.03708089143037796, -0.024631286039948463, -0.05830059573054314, 0.09838224947452545, 0.032329678535461426, 0.008118143305182457, -0.059336572885513306, -0.032526157796382904, 0.008555755019187927, -0.025845881551504135, 0.0026301355101168156, 0.034044403582811356, -0.01692396216094494, 0.04454708471894264, 0.06348048895597458, 0.008006507530808449, -0.013833887875080109, -0.0010996110504493117, 0.01743302121758461, 0.00852896273136139, 0.041296254843473434, 0.0037688191514462233, 0.05504976585507393, -0.00759122334420681, -0.013780303299427032, 0.015673642978072166, 0.025131413713097572, -0.01914774440228939, 0.034008681774139404, 0.01692396216094494, 0.011386835016310215, 0.0036750452127307653, 0.04904823377728462, 0.0032329680398106575, 0.006448074243962765, -0.05108446627855301, 0.0031525902450084686, 0.024059712886810303, 0.030990052968263626, 0.00930594652891159, 0.011252871714532375, -0.09359531849622726, -0.05454963818192482, -0.0039853923954069614, -0.05494259297847748, 0.11631540209054947, 0.011226079426705837, 0.02990048937499523, -0.009511356242001057, 0.01864761672914028, 0.03288339450955391, 0.018245728686451912, -0.00794399157166481, -0.008301225490868092, 0.013521308079361916, -0.06762440502643585, 0.003820171346887946, -0.0035835038870573044, -0.04844093322753906, 0.11552948504686356, -0.001769424881786108, -0.03775963559746742, 0.029400361701846123, 0.028596583753824234, -0.0069214096292853355, 0.0224700216203928, -0.051334530115127563, 0.020540956407785416, 0.03761674463748932, 0.07305435836315155, -0.04293953254818916, 0.018897680565714836, -0.027935702353715897, 0.00288019934669137, 0.049798425287008286, -0.055942848324775696, 0.05047716945409775, -0.042439404875040054, 0.015057414770126343, -0.06791018694639206, 0.0030119295697659254, -0.08659353107213974, 0.01921919174492359, 0.0239882655441761, -0.008439654484391212, 0.05551416799426079, 0.016468489542603493, 0.05558561533689499, -0.049798425287008286, -0.015003829263150692, 0.01827252097427845, -0.03609849885106087, 0.02990048937499523, -0.06022965908050537, 0.010967085137963295, -0.022648638114333153, -0.04815514758229256, -0.08673642575740814, 0.0021411716006696224, 0.03132942318916321, -0.043618276715278625, -0.008511100895702839, -0.002587713999673724, -0.016852514818310738, 0.08230672031641006, 0.011127839796245098, -0.015968361869454384, 0.0037330957129597664, 0.02025516889989376, -0.01776346191763878, 0.06705282628536224, 0.008502170443534851, 0.03475887328386307, -0.04172493517398834, 0.015896914526820183, -0.0335799977183342, -0.05397806316614151, -0.08609340339899063, 0.0044006765820086, 0.017924217507243156, 0.010770605877041817, -0.007100026588886976, -0.008796888403594494, 0.0026971169281750917, -0.01470911130309105, -0.04933401942253113, 0.03436591476202011, 0.027792807668447495, -0.02334524504840374, 0.017004340887069702, -0.00801097322255373, 0.013306967914104462, -0.022827254608273506, -0.023470276966691017, -0.056478701531887054, -0.01877264864742756, 0.002449285937473178, 0.011047462932765484, 0.052549127489328384, 0.01934422366321087, -0.06548099964857101, -0.014441185630857944, -0.0006279504741542041, -0.06901761889457703, -0.00178058841265738, 0.012431744486093521, -0.06051544472575188, -0.00598813546821475, -0.021309010684490204, 0.015503956936299801, 0.01390533521771431, 0.018558308482170105, 0.030239861458539963, -0.021916307508945465, -0.007278643548488617, 0.03708089143037796, 0.04311814904212952, 0.0507272332906723, -0.029007403180003166, 0.06130136176943779, -0.013190866447985172, -0.011252871714532375, 0.011288595385849476, 0.005304925609380007, -0.014182191342115402, 0.04726206138730049, 0.046404700726270676, 0.03188313916325569, -0.03073998913168907, 0.00111691455822438, -0.02227354235947132, 0.05390661582350731, -0.007046441547572613, -0.008604874834418297, -0.10831335932016373, 0.03993876650929451, -0.08909416943788528, -0.0024113296531140804, 0.013941057957708836, 0.032561883330345154, 0.01554861105978489, -0.037330955266952515, -0.007626946549862623, 0.02475631795823574, 0.011440419591963291, -0.0020909353625029325, -0.07198265939950943, 0.032329678535461426, -0.048619553446769714, 0.03822404146194458, 0.07609084993600845, -0.05379944667220116, 0.03261546790599823, -0.04051033779978752, -0.05294208228588104, 0.0022795996628701687, 0.06869610399007797, -0.009904313832521439, 0.05158459395170212, 0.0015115465503185987, 0.05690738186240196, 0.019022712484002113, 0.05126308277249336, 0.04001021012663841, 0.01662924513220787, 0.015664711594581604, -0.07284002006053925, -0.023470276966691017, 0.025274308398365974, -0.0037688191514462233, 0.03016841411590576, 0.0393671914935112, 0.004849452059715986, 0.017647361382842064, -0.016146978363394737, 0.031722381711006165, 0.032865531742572784, 0.010618781670928001, -0.01904057338833809, -0.026792552322149277, -0.018683340400457382, -0.04440419003367424, 0.023130903020501137, -0.04490431770682335, -0.016906101256608963, 0.04261802136898041, -0.025774436071515083, 0.007466191425919533, 0.030793573707342148, 0.07401889562606812, 0.011565451510250568, -0.03504465892910957, -0.08809391409158707, 0.026381732895970345, -0.031490180641412735, -0.024702733382582664, -0.0038849201519042253, -0.07119674235582352, 0.02445266954600811, 0.06062261387705803, 0.004126053303480148, -0.07305435836315155, -0.02707833983004093, -0.01571829803287983, 0.028864510357379913, 0.03247257322072983, 0.051334530115127563, 0.0020976336672902107, 0.008439654484391212, 0.021487627178430557, 0.005264736711978912, -0.004858382977545261, -0.012940802611410618, -0.02032661624252796, 0.022755807265639305, 0.01462873350828886, -0.027828531339764595, -0.047476403415203094, 0.05097729712724686, -0.02082674391567707, 0.012985456734895706, 0.017254404723644257, -0.02327379770576954, 0.02575657330453396, 0.023184489458799362 ]
39,417
pyspark.sql.dataframe
selectExpr
Projects a set of SQL expressions and returns a new :class:`DataFrame`. This is a variant of :func:`select` that accepts SQL expressions. .. versionadded:: 1.3.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Returns ------- :class:`DataFrame` A DataFrame with new/old columns transformed by expressions. Examples -------- >>> df = spark.createDataFrame([ ... (2, "Alice"), (5, "Bob")], schema=["age", "name"]) >>> df.selectExpr("age * 2", "abs(age)").show() +---------+--------+ |(age * 2)|abs(age)| +---------+--------+ | 4| 2| | 10| 5| +---------+--------+
def selectExpr(self, *expr: Union[str, List[str]]) -> "DataFrame": """Projects a set of SQL expressions and returns a new :class:`DataFrame`. This is a variant of :func:`select` that accepts SQL expressions. .. versionadded:: 1.3.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Returns ------- :class:`DataFrame` A DataFrame with new/old columns transformed by expressions. Examples -------- >>> df = spark.createDataFrame([ ... (2, "Alice"), (5, "Bob")], schema=["age", "name"]) >>> df.selectExpr("age * 2", "abs(age)").show() +---------+--------+ |(age * 2)|abs(age)| +---------+--------+ | 4| 2| | 10| 5| +---------+--------+ """ if len(expr) == 1 and isinstance(expr[0], list): expr = expr[0] # type: ignore[assignment] jdf = self._jdf.selectExpr(self._jseq(expr)) return DataFrame(jdf, self.sparkSession)
(self, *expr: Union[str, List[str]]) -> pyspark.sql.dataframe.DataFrame
[ 0.03997240215539932, -0.047743815928697586, 0.06307076662778854, 0.00121428316924721, 0.009696275927126408, 0.013941769488155842, 0.026300475001335144, 0.0028085920494049788, -0.06692049652338028, 0.01220579445362091, 0.0431385338306427, 0.002381344325840473, -0.002338619437068701, 0.04853534698486328, -0.006588610354810953, -0.03723801672458649, 0.06609298288822174, -0.002078897785395384, 0.024807356297969818, 0.04698826000094414, -0.024501536041498184, -0.025347037240862846, 0.0416274257004261, 0.04252689331769943, -0.05468771606683731, 0.014184626750648022, -0.00777590973302722, -0.013123253360390663, 0.029430625960230827, -0.005702633410692215, -0.010038074105978012, -0.003370760241523385, -0.04094383120536804, -0.033208396285772324, -0.10196381062269211, 0.011657118797302246, -0.023314237594604492, -0.03614066541194916, 0.08534161746501923, -0.06540938466787338, -0.03527717664837837, -0.022378789260983467, 0.03193115070462227, -0.04785175248980522, -0.07073424011468887, -0.029286710545420647, 0.0483914315700531, -0.0547596737742424, -0.0281353909522295, -0.0023251273669302464, 0.028926923871040344, 0.05947289243340492, -0.001713488483801484, -0.025185132399201393, 0.01753065176308155, -0.006786493584513664, -0.005621681455522776, 0.03569092974066734, 0.055479250848293304, 0.013141242787241936, 0.0011535689700394869, -0.019518477842211723, -0.06807181239128113, 0.029754435643553734, -0.02246873639523983, 0.022036990150809288, 0.01755763590335846, -0.016505256295204163, -0.08901145309209824, -0.018690966069698334, -0.04133959487080574, -0.022702598944306374, 0.0088642667979002, 0.05073005333542824, 0.0009483776520937681, -0.03520521894097328, -0.03691420704126358, -0.003730547847226262, -0.023242279887199402, 0.0015898115234449506, -0.0017708296654745936, -0.05083798989653587, -0.0013997986679896712, 0.02115551196038723, 0.03531315550208092, 0.011675108224153519, 0.02086768113076687, 0.027199942618608475, 0.005927500780671835, -0.011792038567364216, 0.005846548825502396, -0.007555539719760418, -0.08843579143285751, 0.0027681158389896154, -0.021335404366254807, -0.0016437796875834465, 0.023476140573620796, 0.041159700602293015, 0.02108355425298214, 0.053968142718076706, 0.017791496589779854, 0.07066228240728378, -0.047455985099077225, -0.0017562132561579347, -0.008702362887561321, -0.019374562427401543, -0.00028038135496899486, -0.018619008362293243, 0.002274532336741686, -0.006665065418928862, 0.017080916091799736, 0.10189185291528702, -0.030114222317934036, -0.020220063626766205, -0.03928880766034126, 0.025418994948267937, -0.023260269314050674, -0.024735398590564728, -0.006030939985066652, -0.009372467175126076, 0.020435936748981476, 0.042131129652261734, -0.014490446075797081, -0.003930679522454739, -0.011890980415046215, 0.03673431649804115, 0.032650724053382874, -0.09117017686367035, 0.06379034370183945, 0.04166340455412865, 0.03288458660244942, 0.0024173229467123747, 0.011243362911045551, 0.027487773448228836, 0.019068744033575058, 0.03261474519968033, 0.026660261675715446, -0.0029929832089692354, -0.008814796805381775, 0.021047575399279594, -0.02917877584695816, 0.009669291786849499, 0.024231694638729095, 0.05069407448172569, -0.053896185010671616, 0.01735975220799446, 0.02176715061068535, -0.002049664966762066, -0.03849727287888527, 0.08541357517242432, -0.021749161183834076, 0.01908673346042633, -0.022936459630727768, -0.0472760908305645, 0.07519561052322388, -0.011207384057343006, 0.03824542090296745, -0.008711357600986958, 0.01441848836839199, 0.00884178001433611, 0.04907502979040146, 0.019788319244980812, -0.04008033871650696, 0.03558299317955971, -0.04706021770834923, -0.012709497474133968, -0.014004732482135296, 0.007312682922929525, -0.0367702916264534, 0.016280388459563255, 0.04785175248980522, 0.03932478651404381, 0.03907293453812599, 0.004099329933524132, -0.0660570040345192, 0.06479775160551071, 0.03720203787088394, 0.03932478651404381, -0.024033812806010246, -0.05537131428718567, 0.06364642828702927, -0.009795217774808407, -0.017305783927440643, 0.04450572654604912, 0.07490777969360352, -0.008688870817422867, -0.04508138820528984, 0.018160279840230942, 0.013510025106370449, 0.003390998113900423, -0.08728447556495667, -0.0352591872215271, 0.021479319781064987, 0.00988516490906477, -0.032452840358018875, -0.021443340927362442, -0.01406769547611475, 0.011908969841897488, -0.01794440671801567, 0.05490358918905258, -0.017809486016631126, 0.027020050212740898, 0.0324348546564579, -0.03662637993693352, 0.003199860919266939, -0.03382003679871559, -0.015677744522690773, -0.008661886677145958, -0.017539646476507187, -0.07256916165351868, 0.027955496683716774, -0.02613857015967369, -0.00018284519319422543, -0.021029585972428322, 0.037777699530124664, 0.06321468204259872, 0.018852870911359787, 0.002183461096137762, 0.030330095440149307, -0.03479146212339401, 0.05932897701859474, 0.02254069410264492, -0.0435343012213707, -0.006790990941226482, 0.04666445404291153, -0.0604083389043808, 0.05828559398651123, -0.006934906356036663, 0.012565582059323788, -0.022972438484430313, -0.011360293254256248, -0.080232635140419, 0.013959758915007114, -0.07041043788194656, -0.0070518371649086475, 0.06781996041536331, 0.02799147553741932, 0.013608966022729874, 0.03642849624156952, -0.03781367838382721, -0.045585088431835175, 0.03167929872870445, 0.03313643857836723, 0.029610520228743553, 0.030743850395083427, 0.016676155850291252, 0.013815844431519508, 0.015165047720074654, -0.032326918095350266, 0.011890980415046215, 0.015704728662967682, -0.010829607024788857, 0.062315214425325394, 0.032740671187639236, 0.007402630057185888, 0.04231102392077446, 0.05958082899451256, 0.02406979165971279, -0.009705270640552044, 0.011450240388512611, -0.0037665264680981636, -0.049182966351509094, -0.00867987610399723, -0.04184329882264137, -0.007465593051165342, -0.015893617644906044, -0.02764967828989029, -0.014742297120392323, 0.02225286327302456, 0.02095762826502323, 0.007330672349780798, 0.07073424011468887, 0.0018596522277221084, 0.007402630057185888, 0.02363804541528225, -0.03407188504934311, -0.03112162835896015, 0.002083395142108202, 0.007978290319442749, -0.01724282093346119, 0.004875122103840113, -0.024087781086564064, -0.042958639562129974, 0.0401163175702095, -0.023350216448307037, -0.010199978947639465, 0.008499981835484505, 0.011423256248235703, -0.007087816018611193, -0.06249510869383812, -0.0063322619535028934, 0.04087187349796295, 0.014130658470094204, -0.03275866061449051, 0.0001933858438860625, 0.02752375230193138, 0.013590976595878601, 0.028603114187717438, -0.03828139975667, 0.024015823379158974, -0.008603421039879322, 0.0032066069543361664, 0.050226349383592606, 0.047527942806482315, -0.011522198095917702, -0.02764967828989029, -0.05483163148164749, -0.02446555718779564, 0.02538301609456539, -0.019950222223997116, 0.03759780526161194, 0.015093090012669563, -0.006237817462533712, -0.00978622306138277, -0.052169203758239746, -0.004722212441265583, -0.016433298587799072, -0.010460824705660343, 0.016478272154927254, -0.02191106602549553, 0.015884622931480408, -0.009804212488234043, -0.062459129840135574, 0.022792544215917587, 0.04533324018120766, 0.05087396875023842, -0.003098670858889818, -0.024555504322052002, 0.02358407713472843, -0.0043489327654242516, 0.0008646146161481738, 0.031355489045381546, 0.03103168122470379, -0.03124755434691906, 0.007299190852791071, -0.10448232293128967, 0.005320359021425247, -0.006746017839759588, -0.011621139943599701, 0.03319040685892105, -0.015668749809265137, -0.05461575835943222, -0.001692126039415598, -0.011360293254256248, 0.028926923871040344, -0.030635913833975792, 0.031085649505257607, -0.031913161277770996, -0.007708449382334948, -0.02239677868783474, 0.022774554789066315, -0.04119567945599556, -0.017395731061697006, -0.032596755772829056, 0.046484559774398804, 0.04087187349796295, -0.05238507688045502, 0.04554910957813263, -0.03936076536774635, -0.05684644356369972, 0.11045479774475098, -0.01852906122803688, -0.006979879457503557, -0.040835894644260406, 0.0005329353734850883, -0.030402053147554398, 0.006633583921939135, -0.05393216386437416, -0.03642849624156952, 0.003890203544870019, 0.02980840392410755, -0.009345483034849167, 0.017593614757061005, 0.0226846095174551, -0.03835335746407509, -0.015839649364352226, -0.07490777969360352, 0.01517404243350029, 0.05407607555389404, 0.007991782389581203, 0.001931609702296555, -0.07184958457946777, 0.038461294025182724, -0.008455009199678898, 0.02565285563468933, 0.018852870911359787, -0.02295444905757904, -0.030474010854959488, -0.00805024802684784, -0.00994812697172165, -0.04008033871650696, 0.0019597180653363466, -0.010208973661065102, -0.017881443724036217, -0.029700467362999916, -0.03049200028181076, -0.022378789260983467, 0.05130571126937866, -0.04382213205099106, 0.004695228300988674, -0.0374898687005043, 0.024663440883159637, 0.007384640630334616, -0.04914698749780655, -0.014337535947561264, -0.006952895317226648, 0.04943481832742691, -0.05051418021321297, -0.03157136216759682, 0.003258326556533575, 0.035025324672460556, -0.0510178841650486, -0.02784756012260914, 0.0960632935166359, 0.02446555718779564, 0.038065530359745026, 0.03407188504934311, -0.020238053053617477, 0.004591789562255144, 0.028711050748825073, -0.026120580732822418, -0.033352311700582504, -0.013770870864391327, 0.05080201104283333, 0.016811076551675797, 0.009552360512316227, -0.011009500361979008, -0.027667667716741562, 0.020777733996510506, 0.014004732482135296, -0.07490777969360352, -0.05745808035135269, -0.04623270779848099, 0.02351211942732334, 0.045117367058992386, -0.01296134851872921, 0.02378196083009243, 0.0034854423720389605, -0.02426767349243164, -0.0028333275113254786, 0.03720203787088394, -0.011423256248235703, 0.05170147866010666, -0.0028580627404153347, -0.03160734102129936, -0.07041043788194656, 0.03666235879063606, 0.016055522486567497, -0.09721460938453674, -0.023116353899240494, 0.08728447556495667, 0.053968142718076706, 0.019338583573698997, 0.01950048841536045, 0.007033847738057375, 0.03723801672458649, 0.040835894644260406, 0.0027118991129100323, 0.03256077691912651, 0.03205707669258118, 0.033154428005218506, -0.02979041449725628, 0.032596755772829056, -0.031139617785811424, -0.03500733524560928, 0.011243362911045551, -0.019608424976468086, -0.030024275183677673, -0.027973486110568047, -0.042814724147319794, 0.013006322085857391, 0.0014301557093858719, -0.05562316253781319, -0.060948021709918976, 0.055407293140888214, 0.019248636439442635, -0.05184539407491684, -0.04540519788861275, 0.004486101679503918, -0.0038722141180187464, -0.08375855535268784, -0.005073005333542824, 0.024861324578523636, -0.021605245769023895, -0.0006414338713511825, -0.003087427467107773, 0.0016392823308706284, -0.03547505661845207, 0.014670339412987232, -0.049470797181129456, -0.006633583921939135, 0.01998620107769966, 0.020759744569659233, -0.0266242828220129, -0.05655861273407936, -0.0004598535306286067, 0.0049695661291480064, 0.007802893873304129, -0.06271097809076309, 0.01765657775104046, -0.010532782413065434, -0.02592269703745842, -0.004274726379662752, 0.007681465242058039, -0.0009433181257918477, -0.045117367058992386, 0.06807181239128113, 0.03614066541194916, 0.0012199048651382327, -0.04450572654604912, -0.03986446559429169, 0.03405389562249184, -0.061487700790166855, 0.0009264530963264406, 0.0068854354321956635, 0.03013221174478531, 0.03892901912331581, 0.05386020615696907, 0.047599900513887405, -0.009759238921105862, -0.004187028389424086, 0.019806308671832085, -0.00813569687306881, 0.043318428099155426, 0.020633818581700325, 0.030887765809893608, -0.03993642330169678, -0.004274726379662752, 0.04299461841583252, 0.02300841733813286, -0.032650724053382874, 0.03209305554628372, 0.030312106013298035, -0.00950738787651062, -0.009453419595956802, 0.0457649827003479, 0.009534372016787529, -0.0046142758801579475, -0.028099412098526955, -0.011036484502255917, 0.0012907380005344748, 0.06227923557162285, -0.01600155420601368, 0.0034652044996619225, -0.0697268396615982, -0.04044012725353241, -0.011657118797302246, -0.01998620107769966, 0.1065690889954567, 0.007596015930175781, 0.02835126407444477, 0.00875183381140232, 0.03802955150604248, 0.03567294031381607, 0.0156597550958395, -0.0028040946926921606, 0.025113174691796303, 0.019680382683873177, -0.09325695037841797, -0.03133749961853027, -0.022576672956347466, -0.0750516951084137, 0.07569931447505951, 0.010955533012747765, -0.013393093831837177, 0.03932478651404381, 0.049506776034832, 0.0039059442933648825, 0.05126973241567612, -0.0723532885313034, -0.00043568029650487006, -0.000646493339445442, 0.08116808533668518, -0.046556517481803894, 0.012547592632472515, -0.05857342109084129, 0.0131322480738163, 0.040332190692424774, -0.03954065963625908, 0.04716815426945686, -0.0136899184435606, -0.0067640068009495735, -0.08483792096376419, 0.013456056825816631, -0.07184958457946777, 0.017350757494568825, 0.03157136216759682, -0.0022363048046827316, 0.03766976296901703, -0.014076690189540386, 0.03871314600110054, -0.039720550179481506, 0.005644168239086866, 0.003384252078831196, -0.024519525468349457, 0.034665536135435104, -0.06472579389810562, 0.027145974338054657, 0.010065058246254921, -0.04008033871650696, -0.07764216512441635, 0.04626868665218353, 0.03730997443199158, -0.03993642330169678, -0.0046142758801579475, -0.0050010476261377335, 0.01376187615096569, 0.030815808102488518, -0.007820882834494114, -0.004825651179999113, 0.02579677104949951, 0.03421580046415329, -0.007663475815206766, 0.04094383120536804, 0.028603114187717438, 0.01099151186645031, -0.03299252316355705, 0.019662393257021904, -0.05868135765194893, -0.024591483175754547, -0.07037445902824402, 0.06159563735127449, 0.026102591305971146, 0.000648742017801851, 0.021407362073659897, -0.00589152192696929, 0.05940093472599983, -0.005468771792948246, -0.045657046139240265, 0.0068449592217803, 0.041447531431913376, -0.0026939096860587597, -0.0019282366847619414, -0.019410541281104088, 0.012007911689579487, -0.05407607555389404, -0.020993607118725777, -0.04277874529361725, -0.008594426326453686, -0.00245330180041492, 0.011657118797302246, 0.025329047814011574, -0.009705270640552044, -0.06616494059562683, 0.004360176157206297, -0.014661344699561596, -0.056306760758161545, -0.02784756012260914, -0.007600513286888599, -0.025275079533457756, 0.027631688863039017, -0.05040624365210533, -0.007308185566216707, 0.050154391676187515, 0.021587256342172623, 0.07706650346517563, -0.051053863018751144, -0.031193586066365242, 0.056594591587781906, 0.05551522597670555, 0.03423378989100456, -0.029214752838015556, 0.02536502666771412, 0.013375104404985905, 0.01316822599619627, 0.008810299448668957, -0.02881898730993271, 0.010559766553342342, 0.06443796306848526, 0.023871907964348793, 0.04097981005907059, -0.020975617691874504, -0.014931186102330685, 0.0010945413960143924, 0.03669833764433861, -0.01690102368593216, 0.020723765715956688, -0.10174793750047684, 0.06217129901051521, -0.05461575835943222, -0.017377741634845734, 0.04817556217312813, 0.03015020117163658, -0.004393906332552433, -0.04292266070842743, -0.04148351028561592, 0.008882256224751472, 0.023602066561579704, 0.028099412098526955, -0.09714265167713165, 0.003175125690177083, -0.028243327513337135, -0.022720586508512497, 0.025329047814011574, -0.06508557498455048, 0.01157616637647152, -0.027109995484352112, -0.038821082562208176, 0.0008100842824205756, 0.07562735676765442, -0.022972438484430313, 0.07433211803436279, 0.011531192809343338, 0.07145381718873978, 0.04472159966826439, 0.033640142530202866, 0.01624440960586071, 0.0027276398614048958, 0.009858180768787861, -0.09476805478334427, -0.03993642330169678, 0.0025544920936226845, -0.004758191294968128, 0.02308037504553795, 0.040835894644260406, 0.02446555718779564, 0.038533251732587814, 0.005698136053979397, 0.006156865507364273, 0.034953366965055466, 0.003692320315167308, -0.03340627998113632, 0.013213199563324451, -0.005302370060235262, -0.035834845155477524, 0.04403800144791603, -0.03027612715959549, -0.012799443677067757, -0.015938591212034225, -0.03034808486700058, 0.019446520134806633, 0.06645277142524719, 0.09793418645858765, -0.016523245722055435, -0.006701044272631407, -0.07015858590602875, -0.011774049140512943, -0.02468143031001091, -0.017089910805225372, -0.016424303874373436, -0.032866597175598145, 0.006674060132354498, 0.01675710827112198, -0.028585124760866165, -0.0772823765873909, -0.011207384057343006, 0.012997327372431755, 0.029142796993255615, 0.04155546799302101, 0.03738193213939667, -0.010244952514767647, -0.011000505648553371, 0.03083379752933979, 0.032650724053382874, -0.04072795808315277, -0.01935657300055027, 0.0037125584203749895, 0.02784756012260914, -0.003885706188157201, -0.01648726686835289, -0.021605245769023895, 0.09613525122404099, 0.0029367662500590086, 0.02448354661464691, -0.02806343324482441, -0.02509518526494503, 0.02412375994026661, 0.015839649364352226 ]
39,418
pyspark.sql.dataframe
semanticHash
Returns a hash code of the logical query plan against this :class:`DataFrame`. .. versionadded:: 3.1.0 .. versionchanged:: 3.5.0 Supports Spark Connect. Notes ----- Unlike the standard hash code, the hash is calculated against the query plan simplified by tolerating the cosmetic differences such as attribute names. This API is a developer API. Returns ------- int Hash value. Examples -------- >>> spark.range(10).selectExpr("id as col0").semanticHash() # doctest: +SKIP 1855039936 >>> spark.range(10).selectExpr("id as col1").semanticHash() # doctest: +SKIP 1855039936
def semanticHash(self) -> int: """ Returns a hash code of the logical query plan against this :class:`DataFrame`. .. versionadded:: 3.1.0 .. versionchanged:: 3.5.0 Supports Spark Connect. Notes ----- Unlike the standard hash code, the hash is calculated against the query plan simplified by tolerating the cosmetic differences such as attribute names. This API is a developer API. Returns ------- int Hash value. Examples -------- >>> spark.range(10).selectExpr("id as col0").semanticHash() # doctest: +SKIP 1855039936 >>> spark.range(10).selectExpr("id as col1").semanticHash() # doctest: +SKIP 1855039936 """ return self._jdf.semanticHash()
(self) -> int
[ 0.0655859112739563, -0.05259280279278755, 0.06761931627988815, 0.033275458961725235, 0.03289635106921196, 0.0026817675679922104, -0.013966732658445835, -0.006375929340720177, -0.055384427309036255, -0.008068997412919998, -0.015879511833190918, 0.012398597784340382, 0.01733563467860222, 0.007340935058891773, -0.03253447264432907, -0.05255834013223648, 0.005561706144362688, 0.01734425127506256, 0.03997880220413208, 0.0015196683816611767, 0.004232669249176979, -0.006755039095878601, 0.032051969319581985, 0.045389726758003235, -0.004850876051932573, 0.01531946286559105, 0.008181006647646427, 0.011312967166304588, 0.04218452796339989, 0.01681005209684372, -0.07065219432115555, -0.04501061514019966, -0.01876591145992279, 0.009805145673453808, -0.03441278636455536, -0.06817074865102768, 0.02872614748775959, 0.025727737694978714, 0.04990457370877266, -0.06386268883943558, -0.01690482906997204, 0.007857901975512505, -0.02577943354845047, -0.0524204820394516, -0.0037673988845199347, -0.014457850717008114, 0.009899922646582127, -0.05841730162501335, -0.0274337287992239, -0.056142643094062805, 0.014009812846779823, 0.016336165368556976, -0.011020018719136715, 0.030070262029767036, -0.02534862793982029, -0.015104060061275959, 0.01830064132809639, -0.011562834493815899, -0.020368510857224464, 0.05845176428556442, -0.03148330748081207, 0.020110026001930237, 0.022746559232473373, 0.0018029232742264867, -0.01651710458099842, -0.011106180027127266, -0.016474023461341858, 0.03639449551701546, -0.035033147782087326, -0.02524523437023163, -0.018524659797549248, -0.00994300376623869, 0.031018035486340523, 0.04246024414896965, -0.06565484404563904, -0.05500531569123268, -0.017697513103485107, 0.010666757822036743, 0.01687898114323616, 0.009150320664048195, 0.040461305528879166, -0.04663044586777687, 0.028105786070227623, -0.09608697891235352, -0.038634687662124634, 0.00036403111880645156, 0.06055409833788872, 0.06689556688070297, -0.023108435794711113, -0.05855515971779823, 0.01612076163291931, 0.043769896030426025, -0.023780494928359985, 0.038738079369068146, 0.01836957037448883, -0.04797456040978432, -0.021729856729507446, 0.01995493657886982, 0.05297191068530083, -0.005712488200515509, 0.01472495123744011, 0.07113469392061234, -0.005005966406315565, 0.03222429379820824, -0.035463955253362656, 0.005363535135984421, -0.025555415078997612, -0.058693017810583115, -0.030190888792276382, -0.04163309559226036, -0.026227472350001335, 0.0628976821899414, -0.0005708180251531303, -0.0606919564306736, 0.048629388213157654, 0.011588682420551777, 0.03349947929382324, 0.00007693927182117477, 0.020902710035443306, 0.01691344566643238, 0.04397668316960335, 0.044562578201293945, 0.010658142156898975, -0.032948046922683716, -0.014819728210568428, 0.037152715027332306, 0.029294811189174652, -0.0320347398519516, -0.046320267021656036, 0.04928421229124069, 0.044459182769060135, -0.00513090007007122, 0.03977201506495476, 0.09043480455875397, 0.022057270631194115, -0.00852134358137846, 0.061312317848205566, 0.03604985028505325, 0.015250533819198608, 0.042012207210063934, 0.02524523437023163, -0.01039104163646698, -0.008542884141206741, 0.008710898458957672, -0.012596769258379936, 0.02531416341662407, -0.027123549953103065, 0.0014765877276659012, 0.00404526898637414, 0.01733563467860222, 0.05590139329433441, -0.021884948015213013, 0.059520162642002106, 0.03200027346611023, -0.027089085429906845, 0.008366253226995468, 0.0042908284813165665, -0.0612778514623642, 0.025434790179133415, -0.05807265639305115, 0.031018035486340523, -0.03137991204857826, 0.021333515644073486, -0.031621165573596954, -0.06999737024307251, 0.021833250299096107, -0.0013527310220524669, -0.025589879602193832, -0.07272005826234818, -0.020937174558639526, 0.008874604478478432, 0.014371690340340137, -0.047078486531972885, 0.023022275418043137, -0.03275849297642708, 0.0905037373304367, -0.0001568403240526095, 0.0484570637345314, 0.016474023461341858, -0.03044937178492546, 0.004665629472583532, -0.04104720056056976, -0.039634156972169876, 0.020299581810832024, 0.020230652764439583, -0.0010263954754918814, 0.020437439903616905, -0.045424189418554306, 0.08471370488405228, 0.0274337287992239, -0.030552765354514122, -0.06724020838737488, -0.016456790268421173, 0.03479189798235893, 0.02002386562526226, -0.04466596990823746, 0.006009744480252266, 0.01146805752068758, -0.023108435794711113, 0.015767501667141914, 0.05407477542757988, 0.023970048874616623, 0.016103530302643776, 0.010778767056763172, 0.02869168296456337, -0.035395026206970215, -0.01678420417010784, 0.0171805452555418, -0.010890777222812176, -0.0199204720556736, -0.004605316556990147, -0.05186904966831207, -0.03380965813994408, 0.0659305602312088, 0.036118779331445694, -0.029794545844197273, 0.00676796305924654, -0.004605316556990147, 0.03279295563697815, -0.023539243265986443, 0.07713151723146439, -0.03332715481519699, 0.007194461300969124, 0.009563894011080265, 0.025624344125390053, -0.09257160127162933, 0.042804889380931854, -0.015741653740406036, 0.005535857751965523, -0.07692472636699677, -0.01704268716275692, -0.04900849610567093, 0.03365457057952881, -0.012794939801096916, -0.032844655215740204, 0.052902981638908386, -0.001857851049862802, 0.023539243265986443, 0.03313760086894035, -0.015664108097553253, -0.037083785980939865, 0.05186904966831207, 0.08767765015363693, 0.04656151682138443, -0.022453611716628075, -0.062036070972681046, 0.0383245050907135, 0.07947509735822678, -0.020971639081835747, -0.033378854393959045, -0.052730660885572433, -0.07285791635513306, 0.03467126935720444, -0.032948046922683716, 0.07726937532424927, -0.005540166050195694, 0.0014119668630883098, 0.10015378892421722, -0.014888657256960869, 0.012381365522742271, -0.02591729164123535, -0.06224285811185837, 0.011347431689500809, -0.037945397198200226, -0.02204003743827343, -0.03193134441971779, -0.025434790179133415, 0.08533406257629395, -0.05834837257862091, 0.010899392887949944, 0.01621554046869278, -0.04497615247964859, -0.0338958203792572, 0.0033107444178313017, -0.011657611466944218, -0.09264053404331207, -0.014190751127898693, 0.006057132966816425, -0.04680277034640312, -0.004206821322441101, -0.027588820084929466, -0.023504778742790222, 0.0002560603606980294, 0.015448705293238163, -0.021006103605031967, 0.07616651058197021, -0.01182993408292532, -0.07720044255256653, -0.017818138003349304, -0.04328739270567894, -0.02114396169781685, -0.0021561842877417803, -0.04880170896649361, -0.0165429525077343, 0.053695667535066605, 0.051937978714704514, 0.005919275339692831, 0.0019483204232528806, 0.014225215651094913, 0.04090934246778488, -0.050352610647678375, 0.034205999225378036, -0.005221369210630655, 0.026365330442786217, -0.045458655804395676, 0.01568995602428913, 0.00842225831001997, -0.019834309816360474, 0.04345971345901489, 0.009839610196650028, -0.003110419725999236, 0.07651115208864212, -0.004971501883119345, 0.01366516761481762, -0.04680277034640312, -0.007672655861824751, -0.03670467436313629, 0.025538181886076927, -0.005643559154123068, 0.07906152307987213, -0.026658277958631516, 0.0230050440877676, -0.017921531572937965, -0.01145082525908947, -0.0018298487411811948, -0.04663044586777687, -0.02042020671069622, -0.07037647813558578, 0.02012725919485092, -0.008611813187599182, 0.028347037732601166, 0.018886538222432137, 0.08953873068094254, 0.01969645358622074, -0.02167816087603569, -0.0383245050907135, 0.04807795584201813, 0.023418616503477097, -0.06992843747138977, -0.017525190487504005, 0.04504508152604103, -0.045320797711610794, 0.06727467477321625, -0.020041096955537796, -0.022918881848454475, -0.027158012613654137, -0.0398409441113472, 0.0034766048192977905, -0.03887593746185303, -0.01307065598666668, 0.012993110343813896, -0.03077678382396698, -0.027674980461597443, 0.0274337287992239, 0.0763043686747551, 0.01477664802223444, -0.035067614167928696, 0.0017426104750484228, -0.05321316421031952, 0.07203077524900436, 0.07913045585155487, -0.07609757781028748, 0.010968321934342384, -0.048629388213157654, -0.006836892105638981, 0.04401114583015442, -0.053764596581459045, 0.03461957350373268, 0.0033602872863411903, -0.05493638664484024, -0.04663044586777687, -0.04345971345901489, 0.021299051120877266, -0.02591729164123535, 0.03486082702875137, 0.02340138517320156, -0.06286321580410004, 0.02257423661649227, -0.040426839143037796, -0.0306389257311821, 0.033206529915332794, -0.007577878423035145, 0.03573967143893242, 0.006836892105638981, -0.027278639376163483, 0.03137991204857826, -0.025469254702329636, -0.046251337975263596, -0.006263920105993748, 0.031190358102321625, -0.0567285418510437, -0.012002256698906422, -0.017318403348326683, -0.015250533819198608, -0.020506368950009346, 0.03777307644486427, 0.006238071713596582, 0.018852073699235916, -0.03811771795153618, -0.03074231930077076, -0.028415966778993607, -0.041322916746139526, 0.027089085429906845, -0.005923583172261715, -0.01923118159174919, -0.005479853134602308, 0.016232771798968315, 0.014251064509153366, -0.01475941576063633, -0.06165696308016777, -0.03430939465761185, -0.0413573794066906, -0.024176836013793945, 0.03167286142706871, 0.019041627645492554, -0.017283938825130463, 0.12083248049020767, -0.051214221864938736, 0.028054090216755867, 0.07575293630361557, 0.0338958203792572, -0.018679751083254814, -0.019403504207730293, 0.040220052003860474, -0.006660261657088995, 0.015078212134540081, -0.011528369970619678, 0.024573177099227905, -0.04059916362166405, 0.032413847744464874, -0.00756926229223609, 0.024435319006443024, 0.008129309862852097, 0.016629112884402275, -0.024831660091876984, -0.02951883152127266, 0.026761671528220177, -0.012433062307536602, 0.007797589525580406, 0.02617577649652958, 0.08843586593866348, -0.03570520505309105, 0.01313958503305912, -0.025296932086348534, 0.0019213949562981725, -0.06007159501314163, -0.004889648873358965, 0.00044453798909671605, -0.020609760656952858, -0.01902439445257187, 0.06424179673194885, 0.02210896648466587, -0.015534866601228714, -0.040288981050252914, -0.03186241537332535, 0.02786453627049923, -0.031621165573596954, -0.040530234575271606, -0.025555415078997612, 0.04252917319536209, 0.005729720462113619, 0.03608431667089462, -0.02326352708041668, 0.04149523749947548, -0.017525190487504005, -0.07637329399585724, -0.03220706060528755, -0.05817604809999466, -0.007694195955991745, 0.00738832401111722, 0.03815218433737755, -0.01730978675186634, -0.04156416654586792, -0.01497481856495142, -0.0036704675294458866, 0.002683921717107296, -0.07382292300462723, -0.017059920355677605, -0.042942747473716736, -0.0015702880918979645, -0.04900849610567093, 0.023315222933888435, 0.02869168296456337, -0.02379772625863552, 0.06613734364509583, -0.013897803612053394, 0.013441149145364761, -0.02994963712990284, 0.013544542714953423, -0.057728011161088943, -0.028174715116620064, 0.0389104038476944, 0.016827285289764404, 0.03928951174020767, 0.027450961992144585, 0.014647405594587326, 0.05424709990620613, -0.00036295410245656967, -0.05983034521341324, 0.017464878037571907, -0.03210366517305374, -0.02383219078183174, -0.026089614257216454, 0.03935844078660011, 0.03077678382396698, -0.015293614938855171, 0.049628857523202896, 0.003773861099034548, -0.005729720462113619, -0.0172408577054739, -0.03749736025929451, -0.04556204751133919, 0.044562578201293945, 0.05800372734665871, -0.0002623878244776279, -0.00005684620555257425, -0.02164369635283947, -0.009434652514755726, 0.04773331061005592, 0.03742843121290207, -0.012277972884476185, -0.007026446517556906, -0.014035660773515701, -0.04518293961882591, -0.0242285318672657, -0.004545003641396761, 0.02124735526740551, -0.054522812366485596, 0.050524935126304626, 0.030104726552963257, -0.06999737024307251, -0.00573402876034379, -0.022987810894846916, 0.022815488278865814, -0.0330859050154686, 0.06138124689459801, -0.022419147193431854, 0.0013602700782939792, -0.017128849402070045, -0.04152970388531685, -0.007875134237110615, -0.02078208327293396, -0.00984822679311037, 0.013561774976551533, -0.0005492776981554925, 0.03667021170258522, -0.015870895236730576, 0.012570920400321484, 0.03382689133286476, -0.042908281087875366, 0.0002792161831166595, 0.04556204751133919, 0.040357910096645355, -0.0729268491268158, 0.036118779331445694, -0.00983099453151226, 0.03468850255012512, 0.011941943317651749, 0.030569996684789658, 0.011347431689500809, 0.0005277374293655157, -0.04156416654586792, 0.06358697265386581, -0.06613734364509583, -0.007302162703126669, 0.02426299639046192, 0.03187964856624603, -0.03808325529098511, -0.015560714527964592, -0.015526250004768372, -0.001936473185196519, 0.06375929713249207, 0.11428423225879669, 0.0041680485010147095, 0.018817609176039696, -0.014862808398902416, -0.015431473031640053, 0.0007926831603981555, 0.004514847416430712, -0.033309925347566605, -0.0033710573334246874, 0.0465959832072258, -0.0040689632296562195, 0.05748676136136055, -0.04187434911727905, 0.04339078441262245, -0.04266703128814697, 0.02462487481534481, -0.012269356288015842, -0.005725412629544735, -0.04773331061005592, -0.10242844372987747, -0.01598290540277958, 0.005686639808118343, 0.017128849402070045, 0.039427369832992554, -0.042150065302848816, -0.04166756197810173, 0.04177095368504524, 0.009512197226285934, 0.007228925358504057, 0.026227472350001335, -0.011200957000255585, -0.02081654779613018, 0.0358775295317173, 0.002701153978705406, -0.00573402876034379, 0.0417020246386528, -0.0320347398519516, -0.011580066755414009, -0.012596769258379936, 0.020144490525126457, 0.0002959099074359983, -0.026089614257216454, 0.013940883800387383, -0.009546661749482155, -0.01344976481050253, -0.009563894011080265, -0.03722164407372475, -0.021402444690465927, -0.05317869782447815, 0.04924974963068962, 0.029363740235567093, -0.021833250299096107, -0.024297460913658142, 0.038738079369068146, -0.0057943412102758884, 0.03518823906779289, -0.02905355952680111, 0.008529960177838802, -0.011235421523451805, -0.027244174852967262, 0.050456006079912186, -0.04511401057243347, 0.057831402868032455, -0.053695667535066605, -0.0017232241807505488, 0.010115326382219791, -0.02121289074420929, 0.07685580104589462, -0.021764321252703667, 0.061105530709028244, -0.014854192733764648, -0.030759552493691444, 0.0010678605176508427, -0.001526130479760468, 0.012889716774225235, -0.04880170896649361, 0.015801966190338135, -0.030001332983374596, -0.04235685244202614, -0.016723891720175743, 0.02459041029214859, 0.00591496704146266, 0.04914635419845581, 0.03430939465761185, -0.06972165405750275, -0.03894486650824547, -0.0033301308285444975, -0.037049319595098495, 0.01148528978228569, 0.0006095905555412173, -0.04749206081032753, -0.03946183621883392, 0.020506368950009346, 0.02826087735593319, 0.013932268135249615, 0.0029768699314445257, 0.031052500009536743, 0.0031642704270780087, 0.02074761874973774, 0.03763521835207939, 0.019420737400650978, -0.02826087735593319, -0.037152715027332306, -0.04669937491416931, -0.0024534405674785376, 0.026485955342650414, -0.014544012024998665, -0.0518345832824707, 0.019317343831062317, 0.0306389257311821, -0.026365330442786217, 0.023573707789182663, 0.003364595351740718, -0.009158936329185963, -0.00522998534142971, -0.024280229583382607, 0.029415437951683998, -0.04070255532860756, -0.05738336592912674, -0.05314423516392708, -0.0001688221236690879, 0.061967141926288605, -0.017189161852002144, 0.015741653740406036, -0.010675374418497086, 0.006022668443620205, 0.05576353520154953, 0.012338285334408283, 0.015595179051160812, 0.0747879296541214, 0.035033147782087326, 0.059520162642002106, 0.04273596033453941, 0.03760075196623802, 0.015621027909219265, -0.000637054443359375, 0.021523069590330124, -0.009934387169778347, -0.03770414739847183, -0.015052363276481628, 0.01575026847422123, 0.06444858759641647, 0.04973224923014641, 0.03210366517305374, -0.03577413409948349, 0.014345841482281685, 0.006677493918687105, 0.012734627351164818, 0.012872484512627125, -0.0514899380505085, 0.022660398855805397, 0.056142643094062805, -0.04856045916676521, 0.050214752554893494, 0.06682663410902023, -0.0005376997869461775, 0.022953346371650696, 0.000986007391475141, -0.020110026001930237, -0.0007829900132492185, 0.008267167955636978, 0.006940285675227642, 0.07589079439640045, 0.02512460947036743, 0.04163309559226036, -0.02991517260670662, 0.022160664200782776, 0.03849682956933975, -0.014526779763400555, 0.018524659797549248, -0.06927361339330673, -0.018059389665722847, 0.060312848538160324, -0.0237632617354393, -0.0023198905400931835, 0.05817604809999466, 0.03673914074897766, -0.04742313176393509, -0.009934387169778347, 0.00862042885273695, 0.002739926567301154, -0.008077613078057766, 0.0025439097080379725, 0.03815218433737755, 0.02822641283273697, 0.0013645781436935067, 0.009081391617655754, -0.017154697328805923, 0.030001332983374596, 0.0131051205098629, -0.034602340310811996, -0.014733566902577877, -0.010270416736602783, -0.0262102410197258, 0.046906162053346634, 0.03594645857810974 ]
39,419
pyspark.sql.dataframe
show
Prints the first ``n`` rows to the console. .. versionadded:: 1.3.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Parameters ---------- n : int, optional Number of rows to show. truncate : bool or int, optional If set to ``True``, truncate strings longer than 20 chars by default. If set to a number greater than one, truncates long strings to length ``truncate`` and align cells right. vertical : bool, optional If set to ``True``, print output rows vertically (one line per column value). Examples -------- >>> df = spark.createDataFrame([ ... (14, "Tom"), (23, "Alice"), (16, "Bob")], ["age", "name"]) Show only top 2 rows. >>> df.show(2) +---+-----+ |age| name| +---+-----+ | 14| Tom| | 23|Alice| +---+-----+ only showing top 2 rows Show :class:`DataFrame` where the maximum number of characters is 3. >>> df.show(truncate=3) +---+----+ |age|name| +---+----+ | 14| Tom| | 23| Ali| | 16| Bob| +---+----+ Show :class:`DataFrame` vertically. >>> df.show(vertical=True) -RECORD 0----- age | 14 name | Tom -RECORD 1----- age | 23 name | Alice -RECORD 2----- age | 16 name | Bob
def show(self, n: int = 20, truncate: Union[bool, int] = True, vertical: bool = False) -> None: """Prints the first ``n`` rows to the console. .. versionadded:: 1.3.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Parameters ---------- n : int, optional Number of rows to show. truncate : bool or int, optional If set to ``True``, truncate strings longer than 20 chars by default. If set to a number greater than one, truncates long strings to length ``truncate`` and align cells right. vertical : bool, optional If set to ``True``, print output rows vertically (one line per column value). Examples -------- >>> df = spark.createDataFrame([ ... (14, "Tom"), (23, "Alice"), (16, "Bob")], ["age", "name"]) Show only top 2 rows. >>> df.show(2) +---+-----+ |age| name| +---+-----+ | 14| Tom| | 23|Alice| +---+-----+ only showing top 2 rows Show :class:`DataFrame` where the maximum number of characters is 3. >>> df.show(truncate=3) +---+----+ |age|name| +---+----+ | 14| Tom| | 23| Ali| | 16| Bob| +---+----+ Show :class:`DataFrame` vertically. >>> df.show(vertical=True) -RECORD 0----- age | 14 name | Tom -RECORD 1----- age | 23 name | Alice -RECORD 2----- age | 16 name | Bob """ print(self._show_string(n, truncate, vertical))
(self, n: int = 20, truncate: Union[bool, int] = True, vertical: bool = False) -> NoneType
[ 0.018089476972818375, 0.0019535403698682785, 0.010328053496778011, -0.01852896809577942, 0.060966283082962036, 0.04795732721686363, 0.014397745952010155, -0.059067677706480026, -0.028848232701420784, -0.03688213974237442, -0.028285682201385498, 0.06842005997896194, -0.00725161237642169, 0.018792662769556046, -0.007576835807412863, -0.011215826496481895, 0.03141486272215843, -0.07552224397659302, 0.025947587564587593, 0.04328113794326782, 0.024787329137325287, 0.028848232701420784, -0.007537281606346369, 0.01614692248404026, -0.02559599280357361, 0.005871608387678862, -0.0013767075724899769, -0.015795329585671425, 0.015426157042384148, 0.03930813446640968, -0.01170805748552084, -0.015013034455478191, 0.004300425760447979, 0.024365417659282684, -0.06834974139928818, 0.000363679340807721, 0.021201077848672867, -0.06029825285077095, 0.005744155962020159, 0.03355958312749863, -0.005256319884210825, -0.012569461017847061, 0.07105700671672821, -0.06166946887969971, -0.08670291304588318, -0.022607451304793358, 0.06725980341434479, -0.012797996401786804, -0.02800440788269043, -0.026861729100346565, 0.050875551998615265, 0.030237024649977684, -0.033542003482580185, -0.055059514939785004, -0.040819983929395676, -0.084944948554039, -0.013685770332813263, -0.019794704392552376, 0.038429148495197296, -0.04173412546515465, -0.04106609895825386, -0.006170462816953659, -0.0033335441257804632, 0.057555824518203735, -0.004970650654286146, 0.007572440896183252, 0.018212534487247467, 0.009721554815769196, -0.02104286104440689, -0.054356325417757034, 0.010275314562022686, 0.037128254771232605, -0.004032335709780455, 0.04953949898481369, -0.10639213770627975, 0.011769586242735386, -0.06448221206665039, -0.006152883172035217, -0.03248722106218338, -0.04697286710143089, 0.06606438755989075, -0.020286934450268745, 0.01933763176202774, -0.02928772382438183, 0.010609328746795654, 0.005322244018316269, 0.023556752130389214, 0.015109722502529621, 0.000014309230209619273, 0.0608256459236145, -0.05818869546055794, 0.022607451304793358, 0.015619533136487007, -0.001631612773053348, -0.031028110533952713, 0.0021447192411869764, 0.029164666309952736, -0.03695245832204819, -0.010204995982348919, -0.026474976912140846, -0.02670351229608059, 0.047676052898168564, 0.032030150294303894, -0.011699267663061619, -0.09535210579633713, -0.006350654177367687, -0.07615511119365692, 0.05555174499750137, -0.01181353535503149, 0.030324922874569893, -0.04975045472383499, 0.011233406141400337, 0.04925822466611862, -0.015127302147448063, 0.05273899808526039, 0.02629918046295643, -0.01573380082845688, 0.011171877384185791, -0.023591911420226097, -0.031133588403463364, 0.014010993763804436, -0.044792987406253815, 0.0020403398666530848, -0.0915549024939537, -0.05832933261990547, 0.03878074139356613, -0.016973167657852173, -0.017992788925766945, 0.06384934484958649, -0.01181353535503149, 0.08220251649618149, -0.04753541573882103, 0.004069692455232143, 0.08846087753772736, 0.022062480449676514, -0.006649508606642485, 0.05432116612792015, 0.03276849910616875, -0.017808200791478157, 0.03566914051771164, -0.04591808840632439, -0.05034816265106201, -0.02410172112286091, 0.04795732721686363, -0.06662693619728088, -0.04626968130469322, 0.014063732698559761, -0.013457234017550945, 0.03980036452412605, 0.004381731618195772, 0.00744938338175416, -0.013237488456070423, 0.026246441528201103, -0.03835882991552353, 0.0252971388399601, -0.0004161436518188566, 0.006495686713606119, -0.09120330959558487, 0.005177211482077837, -0.04665643349289894, -0.016771001741290092, -0.0024237963370978832, -0.018986038863658905, 0.04493362456560135, -0.10526704043149948, 0.021165918558835983, -0.04510942101478577, 0.004544343799352646, 0.012244237586855888, 0.054461803287267685, 0.04535553976893425, 0.03352442383766174, 0.04757057502865791, -0.004632242023944855, -0.05245772376656532, 0.07390491664409637, 0.009044738486409187, -0.009053528308868408, -0.008249258622527122, -0.04591808840632439, -0.05020752549171448, -0.06258361041545868, -0.02791650965809822, -0.045214902609586716, -0.005247530061751604, -0.03716341406106949, -0.007792186923325062, -0.026949627324938774, 0.03681182116270065, -0.011171877384185791, -0.049082428216934204, -0.022572290152311325, 0.017263231799006462, 0.023873185738921165, 0.005194791126996279, -0.02482248842716217, 0.022695349529385567, 0.00022180593805387616, -0.004882752429693937, -0.06965063512325287, 0.02371496893465519, 0.07636606693267822, 0.054356325417757034, -0.06504476070404053, 0.06212653964757919, -0.013615450821816921, -0.06525571644306183, 0.008482188917696476, -0.029762374237179756, -0.019706806167960167, 0.015162461437284946, -0.012191498652100563, 0.015373418107628822, -0.006117723882198334, -0.0026501347310841084, 0.003955424763262272, 0.0007207663147710264, -0.04074966534972191, -0.014037363231182098, -0.04753541573882103, 0.12931601703166962, -0.06413061916828156, -0.007822951301932335, 0.043105341494083405, 0.011083979159593582, -0.00957212783396244, 0.01180474553257227, -0.018669605255126953, 0.026791410520672798, -0.013492393307387829, 0.011338884942233562, -0.016111763194203377, 0.0061748577281832695, 0.030869893729686737, -0.019355211406946182, 0.021288976073265076, -0.0016777593409642577, 0.03282123804092407, 0.023556752130389214, -0.028057146817445755, -0.04795732721686363, 0.049187906086444855, 0.02593000791966915, -0.00017675805429462343, -0.055973656475543976, -0.0003837311523966491, -0.03508901223540306, 0.03130938485264778, -0.021587830036878586, 0.0046893758699297905, 0.01743902824819088, -0.052774157375097275, 0.029779953882098198, 0.008249258622527122, 0.008512953296303749, 0.0145120145753026, -0.059981819242239, 0.00408946955576539, -0.028180204331874847, 0.02352159284055233, -0.0036829400341957808, -0.04398432374000549, -0.07608479261398315, 0.030254604294896126, 0.04975045472383499, -0.030360082164406776, -0.07098668813705444, -0.04096062108874321, 0.0273188017308712, -0.003964214585721493, 0.02332821674644947, 0.09844613075256348, -0.002263382077217102, -0.004199342802166939, 0.03835882991552353, -0.000853712554089725, -0.00435975706204772, -0.038815900683403015, -0.03322556987404823, -0.03744468837976456, -0.04662127420306206, -0.047992486506700516, -0.019689226523041725, 0.0015426157042384148, 0.06367354840040207, -0.07868658751249313, 0.003676347667351365, -0.02710784412920475, 0.019284892827272415, -0.025472935289144516, 0.054461803287267685, -0.02510376274585724, 0.01031047385185957, -0.012938634492456913, 0.0027006762102246284, -0.008205309510231018, -0.015725011005997658, -0.008842571638524532, -0.07017802447080612, -0.04757057502865791, -0.005792499985545874, -0.10034473240375519, 0.047289300709962845, 0.04236699640750885, 0.04036291316151619, -0.04198024049401283, -0.018511388450860977, -0.008574482053518295, 0.02791650965809822, -0.015303099527955055, -0.04542585834860802, -0.0016360076842829585, 0.04008163884282112, 0.013624240644276142, -0.012745257467031479, -0.03515933081507683, -0.025367457419633865, 0.036636024713516235, -0.03141486272215843, -0.02302936278283596, 0.0113125154748559, 0.0049091218970716, -0.02093738131225109, 0.013184749521315098, 0.02083190344274044, 0.0042762537486851215, 0.0026413449086248875, 0.02162298932671547, -0.00319070927798748, 0.021675728261470795, -0.00607816968113184, 0.03545818477869034, 0.013395705260336399, 0.05344218388199806, -0.06757623702287674, 0.021710887551307678, -0.02021661587059498, 0.06634566187858582, -0.011083979159593582, 0.018300432711839676, 0.066591776907444, -0.017491767182946205, 0.026246441528201103, -0.05927863344550133, 0.022203117609024048, 0.028953710570931435, 0.06771687418222427, -0.03547576442360878, -0.014002203941345215, 0.03162581846117973, 0.03491321578621864, -0.0002700126788113266, -0.02621128223836422, -0.04338661581277847, -0.005366193130612373, 0.027477018535137177, 0.008737093769013882, 0.040819983929395676, -0.006948363035917282, 0.021376874297857285, -0.005410142242908478, -0.015083353035151958, -0.053371865302324295, -0.005766130518168211, -0.008556902408599854, 0.029164666309952736, -0.02631676010787487, 0.010934552177786827, 0.008776647970080376, 0.06219685822725296, -0.015496475622057915, -0.051649060100317, 0.037022776901721954, 0.023169999942183495, -0.0027424278669059277, 0.03804239630699158, -0.08023359626531601, 0.0039312527514994144, -0.022800827398896217, -0.0045707132667303085, 0.023293057456612587, -0.035633981227874756, 0.046797070652246475, -0.02151751145720482, -0.061739787459373474, -0.007321930956095457, -0.10336843878030777, 0.021746046841144562, -0.04335145652294159, 0.012279396876692772, -0.07186567783355713, 0.039413612335920334, -0.007308746222406626, 0.001775546232238412, 0.05878640338778496, 0.00786690041422844, -0.007053840905427933, 0.006130908615887165, 0.007506517227739096, -0.008930469863116741, -0.0032038940116763115, 0.03028976358473301, 0.015487685799598694, 0.009879772551357746, -0.02740669995546341, 0.005766130518168211, 0.0629703626036644, -0.045214902609586716, -0.02552567422389984, -0.04219119995832443, 0.0723579078912735, -0.020409991964697838, -0.04626968130469322, 0.0198474433273077, 0.05903251841664314, 0.02062094770371914, 0.017975209280848503, 0.07010770589113235, -0.004397113807499409, 0.01265735924243927, 0.022185537964105606, -0.005713391583412886, -0.010468690656125546, 0.08656227588653564, 0.007748237811028957, 0.0033247543033212423, -0.03479015827178955, 0.008693144656717777, 0.05411021038889885, 0.0036631629336625338, -0.00693078339099884, -0.018792662769556046, -0.02760007604956627, 0.05555174499750137, -0.002300738822668791, -0.025771791115403175, 0.02313484065234661, -0.059841182082891464, -0.036741502583026886, 0.040714506059885025, 0.0845230370759964, -0.05351250246167183, -0.002696281298995018, -0.04665643349289894, 0.011919013224542141, 0.03758532553911209, 0.040609028190374374, 0.010002830065786839, -0.03030734322965145, -0.011795955710113049, 0.03856978565454483, -0.009642446413636208, -0.022097639739513397, -0.019407950341701508, -0.0009212843724526465, -0.047676052898168564, -0.014591122977435589, 0.022554710507392883, -0.04275374859571457, 0.054461803287267685, 0.03171371668577194, 0.021499931812286377, -0.05952474847435951, 0.02851421758532524, 0.026070645079016685, 0.02909434773027897, 0.016393039375543594, 0.0004425131483003497, -0.06507991999387741, -0.0193200521171093, 0.022361334413290024, 0.003542302642017603, -0.05481339991092682, -0.024488475173711777, 0.09239872545003891, 0.02371496893465519, 0.024681851267814636, -0.03825335204601288, -0.003907080739736557, 0.007119764573872089, -0.07566288113594055, 0.0027292431332170963, -0.006368233822286129, 0.01645456813275814, -0.033752959221601486, 0.03171371668577194, -0.00403892807662487, 0.017359919846057892, 0.025859689339995384, -0.04236699640750885, 0.0488714724779129, 0.05323122814297676, -0.027529757469892502, 0.009712764993309975, -0.0006932980613783002, -0.015241570770740509, 0.016015075147151947, 0.024172041565179825, 0.00552880484610796, 0.028057146817445755, 0.00907110795378685, 0.024875227361917496, 0.055973656475543976, 0.0015294309705495834, -0.0027204533107578754, 0.03589767962694168, 0.030254604294896126, 0.039026860147714615, -0.020902222022414207, -0.0640251412987709, 0.06507991999387741, 0.03192467242479324, -0.00383676216006279, 0.02939320169389248, -0.03507143259048462, -0.004164183512330055, -0.012112390249967575, 0.016015075147151947, 0.07242822647094727, 0.0012151943519711494, 0.019179414957761765, -0.012921054847538471, -0.058751244097948074, 0.010943342000246048, -0.005739761050790548, -0.0031731296330690384, 0.0789678618311882, 0.0071505289524793625, -0.00010197579831583425, 0.04633999988436699, -0.0567823201417923, 0.04106609895825386, -0.001091587357223034, 0.004326795227825642, -0.016779791563749313, -0.02044515125453472, -0.03210046887397766, 0.03491321578621864, 0.07868658751249313, 0.012859526090323925, -0.00018527319480199367, -0.007800976745784283, -0.050488799810409546, -0.022976623848080635, -0.0319070927798748, -0.037515006959438324, 0.021587830036878586, -0.002948988927528262, 0.06817394495010376, 0.013219908811151981, -0.0030039253178983927, -0.01245519332587719, 0.07798340171575546, -0.03997616097331047, -0.02661561407148838, 0.06813878566026688, 0.023380955681204796, -0.0056826272048056126, 0.01180474553257227, -0.018300432711839676, 0.010345633141696453, -0.010916972532868385, 0.047992486506700516, -0.013931885361671448, 0.06697852909564972, 0.06965063512325287, 0.027441859245300293, 0.023380955681204796, -0.007897664792835712, -0.050277844071388245, 0.020181456580758095, 0.04219119995832443, -0.017377499490976334, 0.0025973955634981394, -0.06662693619728088, -0.022343754768371582, 0.021851524710655212, 0.058469969779253006, 0.008244863711297512, 0.03695245832204819, -0.020251775160431862, 0.005269505083560944, 0.013378125615417957, 0.010178626514971256, -0.047183822840452194, 0.07341268658638, -0.005695811938494444, -0.0052782949060201645, -0.015821699053049088, -0.02232617512345314, -0.004348769783973694, -0.015900807455182076, -0.025666311383247375, -0.010996080935001373, 0.04795732721686363, 0.05245772376656532, -0.008803017437458038, -0.024787329137325287, 0.030641358345746994, 0.026246441528201103, -0.08262442797422409, 0.05882156267762184, -0.013764878734946251, -0.025261979550123215, -0.010407161898911, 0.030869893729686737, 0.01785214990377426, 0.05903251841664314, -0.04806280508637428, 0.018564127385616302, -0.022167958319187164, -0.012727677822113037, -0.03261027857661247, -0.06279456615447998, -0.05970054492354393, -0.00575294578447938, 0.024769749492406845, -0.05970054492354393, -0.005374982953071594, -0.04721898213028908, 0.0056518628261983395, 0.07847563177347183, -0.009800664149224758, 0.006161672994494438, -0.029832692816853523, 0.05611429363489151, -0.04387884587049484, 0.0030676517635583878, 0.013764878734946251, -0.044406235218048096, 0.021675728261470795, -0.02144719287753105, 0.031028110533952713, 0.03079957515001297, -0.04711350426077843, -0.07010770589113235, 0.01066206768155098, 0.019900182262063026, -0.012701308354735374, 0.042824067175388336, 0.0011811337899416685, 0.015461316332221031, -0.015821699053049088, 0.025683891028165817, 0.0785459503531456, -0.00004645563967642374, -0.00992372166365385, 0.02294146455824375, 0.046902548521757126, -0.012314556166529655, -0.030869893729686737, 0.00448720995336771, -0.0023468853905797005, 0.00436415197327733, 0.009703975170850754, -0.008688749745488167, 0.028549376875162125, -0.025174081325531006, 0.021095599979162216, 0.008482188917696476, 0.0362844318151474, -0.049082428216934204, -0.00005122824586578645, -0.022677769884467125, 0.05280931666493416, 0.012305766344070435, -0.0014008795842528343, -0.0033555186819285154, 0.004676191136240959, -0.01394946500658989, 0.03515933081507683, 0.010741176083683968, 0.04025743529200554, -0.015689851716160774, 0.016428198665380478, 0.016779791563749313, -0.03681182116270065, -0.0014415326295420527, -0.03421002998948097, -0.04423043876886368, 0.04233183711767197, -0.02520924061536789, 0.03878074139356613, -0.10575927048921585, -0.060438890010118484, 0.00287647289223969, -0.030254604294896126, 0.015505265444517136, -0.013167169876396656, -0.0026611220091581345, -0.034825317561626434, -0.03790175914764404, -0.0009130439138971269, 0.04134737327694893, 0.012701308354735374, -0.02890097163617611, -0.0021677925251424313, -0.04785184934735298, 0.03934329375624657, 0.0010981797240674496, -0.0003941690665669739, 0.012956214137375355, -0.010372002609074116, 0.01774667203426361, -0.011962962336838245, 0.015619533136487007, -0.03206530958414078, -0.0036323985550552607, -0.02600032649934292, 0.012244237586855888, -0.00027330886223353446, 0.0537937767803669, 0.01972438581287861, 0.013685770332813263, -0.0287075936794281, 0.0687364935874939, 0.0016975364414975047, 0.003964214585721493, -0.017465397715568542, 0.033542003482580185, 0.014766919426620007, -0.03255753964185715, -0.03719857335090637, 0.04785184934735298, -0.011294934898614883, 0.08016327768564224, -0.056571364402770996, 0.023064522072672844, -0.006552820559591055, -0.023064522072672844, 0.017579665407538414, -0.02091980166733265, 0.01754450611770153, -0.021746046841144562, 0.029568998143076897, 0.00446084002032876, 0.001393188489601016, -0.026685932651162148, 0.05041848123073578, -0.06216169893741608, -0.0066582984291017056, 0.022888725623488426, 0.030623778700828552, -0.0305183008313179, 0.00005328836414264515, 0.007765817455947399, 0.05112166702747345, 0.010161046870052814, 0.014810868538916111, 0.03867526352405548, 0.022959044203162193, 0.0029841482173651457, -0.02730122208595276, 0.05558690428733826, 0.01415163092315197, 0.02821536362171173, -0.0196364875882864, 0.03529996797442436, -0.00458389800041914, -0.06588859111070633, -0.019759545102715492, 0.03818303346633911, 0.0059199524112045765, 0.05432116612792015, -0.02302936278283596, -0.003208288922905922, 0.046586114913225174, 0.014090102165937424 ]
39,421
pyspark.sql.dataframe
sortWithinPartitions
Returns a new :class:`DataFrame` with each partition sorted by the specified column(s). .. versionadded:: 1.6.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Parameters ---------- cols : str, list or :class:`Column`, optional list of :class:`Column` or column names to sort by. Other Parameters ---------------- ascending : bool or list, optional, default True boolean or list of boolean. Sort ascending vs. descending. Specify list for multiple sort orders. If a list is specified, the length of the list must equal the length of the `cols`. Returns ------- :class:`DataFrame` DataFrame sorted by partitions. Examples -------- >>> df = spark.createDataFrame([(2, "Alice"), (5, "Bob")], schema=["age", "name"]) >>> df.sortWithinPartitions("age", ascending=False) DataFrame[age: bigint, name: string]
def sortWithinPartitions( self, *cols: Union[str, Column, List[Union[str, Column]]], **kwargs: Any ) -> "DataFrame": """Returns a new :class:`DataFrame` with each partition sorted by the specified column(s). .. versionadded:: 1.6.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Parameters ---------- cols : str, list or :class:`Column`, optional list of :class:`Column` or column names to sort by. Other Parameters ---------------- ascending : bool or list, optional, default True boolean or list of boolean. Sort ascending vs. descending. Specify list for multiple sort orders. If a list is specified, the length of the list must equal the length of the `cols`. Returns ------- :class:`DataFrame` DataFrame sorted by partitions. Examples -------- >>> df = spark.createDataFrame([(2, "Alice"), (5, "Bob")], schema=["age", "name"]) >>> df.sortWithinPartitions("age", ascending=False) DataFrame[age: bigint, name: string] """ jdf = self._jdf.sortWithinPartitions(self._sort_cols(cols, kwargs)) return DataFrame(jdf, self.sparkSession)
(self, *cols: Union[str, pyspark.sql.column.Column, List[Union[str, pyspark.sql.column.Column]]], **kwargs: Any) -> pyspark.sql.dataframe.DataFrame
[ -0.011678087525069714, 0.022644540295004845, -0.03820924088358879, 0.0014198455028235912, 0.0069475495256483555, 0.04514310508966446, 0.05521545559167862, 0.047661192715168, -0.051748521625995636, 0.024487487971782684, -0.024195536971092224, 0.008398186415433884, -0.02954191155731678, 0.030910436064004898, 0.007887270301580429, -0.0080241234973073, 0.026330437511205673, -0.012672549113631248, 0.024998405948281288, -0.008763127028942108, 0.0007515487959608436, -0.01770872436463833, 0.003913983702659607, 0.015336613170802593, -0.01087521854788065, 0.029140476137399673, 0.024998405948281288, -0.03164031729102135, -0.024140795692801476, 0.017845576629042625, 0.03519848361611366, 0.06773290783166885, 0.005323565565049648, 0.00240404368378222, -0.02304597571492195, 0.011833186261355877, 0.06079903990030289, -0.004812648985534906, 0.03483354300260544, -0.029049241915345192, -0.003190946066752076, -0.017644859850406647, 0.0026503782719373703, -0.06999553740024567, -0.01741677150130272, 0.053208284080028534, 0.050982147455215454, -0.011203664354979992, 0.025454580783843994, 0.041384220123291016, 0.027571232989430428, -0.04423075541853905, -0.00031932268757373095, -0.005784302484244108, -0.0167781263589859, 0.014561114832758904, 0.018028046935796738, -0.023356175050139427, 0.007563386112451553, -0.0195607952773571, -0.008284143172204494, -0.012946254573762417, -0.007317051291465759, 0.05579936131834984, -0.018520716577768326, -0.005191274452954531, -0.00389345595613122, -0.02280876412987709, -0.1300646960735321, -0.01733466051518917, -0.010847847908735275, -0.018219640478491783, 0.006112748757004738, 0.0728420689702034, 0.005506035406142473, 0.02412254922091961, -0.05163904279470444, -0.022754022851586342, -0.00925123505294323, -0.0035148304887115955, 0.009570557624101639, -0.05820796638727188, -0.02654940076172352, -0.014588485471904278, 0.053974658250808716, 0.01383123453706503, 0.06134645268321037, 0.03589187189936638, 0.07911904156208038, 0.05985019728541374, -0.004725975915789604, 0.07032398134469986, -0.019506053999066353, -0.02910398319363594, 0.03623856231570244, -0.03831872344017029, -0.0041443523950874805, 0.04882900044322014, -0.022553306072950363, -0.0033802588004618883, 0.034559838473796844, 0.012426214292645454, 0.015564700588583946, -0.019597290083765984, 0.019159361720085144, -0.021476732566952705, -0.03114764764904976, 0.0036471213679760695, -0.049996811896562576, -0.02596549689769745, -0.0080378083512187, -0.006035198923200369, 0.037990275770425797, 0.03109290637075901, 0.006815258413553238, 0.00045674550347030163, 0.016650397330522537, -0.02804565615952015, -0.010419043712317944, -0.028319360688328743, -0.02687784656882286, 0.04645689204335213, 0.012480955570936203, -0.047296252101659775, -0.08955632895231247, 0.001500816666521132, 0.026768365874886513, 0.013347689062356949, -0.05813497677445412, 0.04915744811296463, 0.07178374379873276, -0.01111243013292551, -0.014177927747368813, -0.0021896413527429104, 0.011130676604807377, -0.017197808250784874, 0.06339011341333389, 0.0363115519285202, 0.019725019112229347, -0.017261672765016556, 0.020856333896517754, -0.02571003884077072, 0.011741952039301395, -0.001871459069661796, 0.019725019112229347, 0.004502450115978718, 0.034267887473106384, -0.026074979454278946, 0.015701552852988243, 0.07276908308267593, -0.03536270931363106, -0.010546772740781307, 0.0010457817697897553, -0.0660906732082367, 0.001368525787256658, -0.04087330400943756, -0.014780079014599323, -0.024633465334773064, -0.0188309159129858, -0.018721433356404305, 0.012161632999777794, 0.004871951881796122, -0.01663215085864067, 0.0519309937953949, -0.019506053999066353, 0.021421991288661957, -0.00973478052765131, -0.01985274814069271, -0.026220954954624176, -0.019542548805475235, 0.06072605401277542, 0.06886421889066696, 0.018274381756782532, -0.044048283249139786, -0.061200473457574844, -0.0015852090436965227, 0.018219640478491783, -0.0393405556678772, -0.037406373769044876, -0.023885337635874748, -0.009981115348637104, -0.005565338302403688, -0.005569899920374155, 0.02862956002354622, 0.020692110061645508, 0.018274381756782532, -0.01542784832417965, -0.04090980067849159, 0.017909441143274307, -0.05258788540959358, -0.12232796102762222, 0.015044660307466984, 0.029760874807834625, 0.09503043442964554, -0.0376618318259716, -0.0000227196669584373, -0.014716214500367641, 0.01627633348107338, -0.01768135465681553, 0.03727864474058151, 0.042698007076978683, 0.025801273062825203, 0.05488700792193413, -0.04014342278242111, 0.02430501952767372, 0.02304597571492195, -0.048938482999801636, -0.03439561650156975, 0.04572701081633568, -0.05671171098947525, 0.02673187106847763, -0.06667457520961761, 0.025600556284189224, -0.02222486026585102, -0.007307928055524826, 0.03578238934278488, -0.0010948206763714552, -0.0006243899115361273, 0.06492286175489426, -0.03211474046111107, 0.06572573632001877, 0.06189386174082756, -0.002757579553872347, -0.012088645249605179, 0.04970485717058182, -0.017517130821943283, 0.06499585509300232, -0.03996095433831215, -0.033683981746435165, -0.02552756853401661, -0.010327808558940887, -0.06623665243387222, 0.01782733015716076, -0.03667649254202843, -0.008311513811349869, 0.04459569603204727, -0.037844300270080566, 0.004867390263825655, 0.02277226932346821, -0.0013730876380577683, -0.022425577044487, 0.06612716615200043, 0.015363982878625393, -0.04955888167023659, 0.026385178789496422, -0.002256927080452442, -0.011185417883098125, 0.018849162384867668, -0.0033392030745744705, 0.049996811896562576, 0.005902908276766539, -0.04601896181702614, 0.0006911055534146726, -0.02198764868080616, 0.017544500529766083, 0.03674948215484619, -0.002636693185195327, 0.01426003873348236, -0.014898684807121754, 0.06528780609369278, -0.03676772862672806, -0.016349321231245995, -0.03926756605505943, 0.039741989225149155, 0.05105513706803322, -0.045945972204208374, 0.003932231105864048, -0.01409581582993269, 0.005547091364860535, 0.0006489093066193163, -0.07393688708543777, 0.01595701090991497, 0.01343892328441143, -0.0024222906213253736, 0.053500235080718994, -0.00286934245377779, -0.025272110477089882, -0.07977592945098877, -0.024761194363236427, -0.010920836590230465, 0.036110833287239075, -0.02974262833595276, -0.05200398340821266, 0.05109163001179695, -0.01578366383910179, -0.010975576937198639, -0.030308285728096962, -0.04200461879372597, -0.05309880152344704, -0.008320637047290802, -0.02828286774456501, 0.02620270848274231, 0.007244063541293144, 0.006290656980127096, -0.013822111301124096, 0.042406052350997925, 0.026987329125404358, -0.05346374213695526, -0.007207569200545549, 0.021057050675153732, 0.011002947576344013, -0.053500235080718994, 0.045252587646245956, 0.05952174961566925, 0.06415648758411407, -0.005232330411672592, -0.06415648758411407, -0.026385178789496422, 0.0006603137007914484, -0.047150276601314545, 0.0008872608887031674, -0.00009622447396395728, -0.03674948215484619, -0.02605673111975193, -0.05813497677445412, -0.04098278656601906, 0.014999043196439743, -0.021440237760543823, -0.00928316731005907, 0.03036302700638771, 0.016029998660087585, -0.0020847211126238108, -0.008325198665261269, 0.03466932103037834, 0.025345098227262497, 0.09809593111276627, 0.04444972053170204, -0.01762661337852478, -0.0027963544707745314, 0.011148924008011818, -0.02862956002354622, 0.038866132497787476, 0.05152956023812294, -0.021002309396862984, -0.0770023837685585, -0.017872948199510574, 0.000786332122515887, 0.029560158029198647, 0.011751075275242329, 0.06339011341333389, 0.036056093871593475, -0.06298868358135223, 0.019195856526494026, -0.045508045703172684, -0.006961234845221043, 0.008288704790174961, 0.0007652339991182089, 0.01397721003741026, -0.024998405948281288, 0.057514578104019165, 0.027589481323957443, -0.013968086801469326, 0.01498991996049881, 0.0008507668972015381, 0.01850247010588646, -0.004386125132441521, 0.019122866913676262, 0.03247968107461929, -0.015920517966151237, -0.02222486026585102, 0.12532047927379608, -0.04842756688594818, 0.02271752804517746, -0.02456047758460045, 0.020838087424635887, 0.00004554625047603622, 0.001362823648378253, -0.04302645102143288, 0.01733466051518917, -0.014999043196439743, -0.0034144718665629625, -0.010200079530477524, 0.04415776580572128, 0.027589481323957443, -0.031950514763593674, 0.0007082121446728706, -0.054850514978170395, 0.02605673111975193, 0.021531473845243454, 0.06481338292360306, 0.022699281573295593, -0.05937577411532402, 0.09021322429180145, -0.01559207122772932, -0.05623728781938553, 0.012581313960254192, -0.05430310592055321, -0.06893720477819443, 0.02518087439239025, -0.030162310227751732, -0.05970422178506851, 0.07255011796951294, -0.027680715546011925, 0.049814339727163315, -0.0181557759642601, -0.009534063749015331, 0.011878804303705692, -0.019451314583420753, 0.04178565368056297, -0.05882836505770683, -0.006021513603627682, -0.04791665077209473, -0.023757608607411385, 0.02330143377184868, 0.041530195623636246, -0.007955696433782578, 0.06280621141195297, -0.013384182937443256, 0.012216374278068542, 0.03846469894051552, 0.040362387895584106, -0.020272430032491684, 0.007038784679025412, 0.018484221771359444, 0.02019944041967392, 0.0001273014204343781, -0.029906850308179855, -0.0072212545201182365, 0.051456570625305176, -0.029760874807834625, 0.02430501952767372, -0.022589799016714096, -0.007271433714777231, 0.039012107998132706, 0.02886677160859108, -0.021914660930633545, -0.01800980046391487, -0.0175627488642931, 0.017991552129387856, 0.008425557054579258, -0.034359123557806015, 0.006153804715722799, -0.0547410324215889, 0.024159042164683342, 0.061820872128009796, 0.03713266924023628, 0.012800278142094612, 0.013521035201847553, -0.03403067588806152, 0.029286453500390053, 0.05758756771683693, 0.006942987907677889, -0.0020516482181847095, -0.0036585256457328796, 0.02092932164669037, 0.03541744872927666, -0.013146971352398396, -0.03176804631948471, -0.10174533724784851, -0.015701552852988243, 0.09707409888505936, 0.00677876453846693, 0.026713624596595764, -0.015491712838411331, -0.04142071679234505, 0.01622159220278263, 0.007034222595393658, 0.047880157828330994, -0.0782431811094284, 0.03853768855333328, 0.05725912004709244, -0.014059321954846382, -0.024140795692801476, -0.01566505990922451, 0.013739999383687973, 0.02465171180665493, -0.10174533724784851, -0.01501728966832161, 0.02906748838722706, -0.024615218862891197, 0.05149306356906891, 0.01613035798072815, -0.04112876206636429, 0.003861523699015379, -0.01089346595108509, 0.010747489519417286, -0.031220635399222374, -0.011933545581996441, 0.011532111093401909, 0.04277099296450615, -0.04919394105672836, -0.030144061893224716, 0.012435338459908962, 0.008936474099755287, 0.03423139452934265, -0.05711314454674721, -0.05835394188761711, 0.008151852525770664, 0.01908637396991253, -0.04572701081633568, 0.0009568276582285762, 0.023283185437321663, 0.02488892339169979, 0.024961911141872406, 0.025874260812997818, 0.014205298386514187, 0.01215250976383686, 0.018338246271014214, -0.006044322624802589, -0.023118963465094566, -0.0022204332053661346, 0.05120111256837845, 0.03926756605505943, 0.029560158029198647, -0.05269736796617508, -0.033446770161390305, 0.10298612713813782, 0.056784696877002716, -0.007809720933437347, -0.027589481323957443, -0.010044979862868786, -0.011377011425793171, 0.02125776745378971, 0.004158037714660168, 0.005912031512707472, 0.04861003905534744, 0.04142071679234505, 0.023830596357584, 0.022206611931324005, -0.006938425824046135, 0.031019918620586395, -0.020765097811818123, 0.060616571456193924, -0.006473127286881208, -0.006984043400734663, 0.03289936110377312, 0.027534740045666695, 0.003640278708189726, 0.010683625005185604, 0.05842692777514458, -0.03585537523031235, 0.04809912294149399, 0.04861003905534744, -0.023958325386047363, 0.022626293823122978, 0.044632188975811005, -0.06572573632001877, 0.048026133328676224, 0.010683625005185604, 0.017526254057884216, -0.0022033266723155975, 0.012079521082341671, 0.04452270641922951, -0.0038409957196563482, -0.039924461394548416, -0.04017991945147514, 0.002990229055285454, -0.045508045703172684, 0.037698324769735336, -0.0049814339727163315, 0.06236828491091728, -0.03627505898475647, 0.012581313960254192, 0.0030404082499444485, -0.02131250873208046, -0.02014470100402832, -0.019943982362747192, -0.028611313551664352, -0.003024442121386528, -0.012809401378035545, -0.006797011476010084, 0.03472406044602394, 0.12189003080129623, -0.02049139328300953, -0.023283185437321663, -0.018484221771359444, 0.013621393591165543, -0.06682055443525314, -0.013794740661978722, -0.03897561505436897, 0.06736796349287033, 0.01663215085864067, 0.012070397846400738, -0.04353736713528633, 0.009461075067520142, -0.021677449345588684, 0.031202388927340508, 0.031987011432647705, -0.0772213488817215, -0.014068445190787315, -0.06765991449356079, -0.001351419254206121, -0.025947250425815582, -0.014187050983309746, -0.0982419103384018, 0.010619760490953922, 0.016121234744787216, 0.012873265892267227, 0.057514578104019165, -0.030727965757250786, -0.0030609359964728355, -0.04944939911365509, 0.015820158645510674, 0.004940378479659557, 0.008722071535885334, -0.025691792368888855, -0.04043537750840187, -0.014752708375453949, -0.021640954539179802, -0.09284079074859619, -0.049084458500146866, 0.05747808516025543, 0.032132986932992935, -0.016787249594926834, 0.04010692983865738, -0.03414015844464302, -0.05481402203440666, 0.08174660801887512, 0.008425557054579258, 0.03549043834209442, 0.026330437511205673, 0.04481465741991997, 0.004995119292289019, 0.005469541531056166, 0.03297235071659088, 0.038282230496406555, -0.011203664354979992, -0.10086947679519653, -0.004203655291348696, -0.037953782826662064, -0.06886421889066696, -0.01551908254623413, 0.02915872447192669, 0.030764460563659668, -0.03041776828467846, -0.006920178886502981, -0.02169569581747055, -0.014579362235963345, 0.019870994612574577, 0.004203655291348696, 0.019542548805475235, -0.020509639754891396, 0.0659811943769455, -0.010446413420140743, 0.0034828982315957546, -0.09159999340772629, -0.03996095433831215, -0.11116079241037369, -0.012727290391921997, -0.07145529240369797, 0.0038273106329143047, 0.024998405948281288, 0.04853704944252968, -0.0717107504606247, -0.002027699025347829, -0.05123760551214218, -0.022151870653033257, 0.009292290546000004, 0.03955952078104019, -0.009388087317347527, 0.011659840121865273, -0.005624641198664904, 0.045216094702482224, 0.0029286453500390053, -0.00017106572340708226, 0.053536731749773026, 0.0052597010508179665, 0.03700494021177292, 0.051748521625995636, 0.024834182113409042, 0.036548763513565063, -0.045216094702482224, 0.006710338406264782, -0.01089346595108509, -0.007745856419205666, 0.03671298548579216, 0.03430438041687012, -0.004972310736775398, -0.04678533598780632, 0.016413185745477676, 0.01855720952153206, 0.029176970943808556, 0.059010833501815796, -0.0505807138979435, 0.03549043834209442, -0.0349612720310688, -0.07276908308267593, -0.06313465535640717, -0.0405813530087471, -0.06765991449356079, -0.03846469894051552, 0.023830596357584, -0.005355497822165489, -0.005839043762534857, -0.02359338477253914, 0.023794101551175117, 0.007896394468843937, -0.0217504370957613, -0.05196748673915863, -0.04185864329338074, 0.03733338415622711, 0.020856333896517754, -0.016759879887104034, 0.050398245453834534, -0.05590884014964104, -0.016385816037654877, 0.017197808250784874, -0.03050900250673294, 0.033829957246780396, 0.004871951881796122, 0.013302071020007133, 0.0393405556678772, 0.027936173602938652, 0.037953782826662064, -0.012654302641749382, 0.03820924088358879, 0.004187689162790775, 0.039012107998132706, -0.024724699556827545, -0.011769321747124195, -0.034067168831825256, -0.0012522011529654264, 0.014077569358050823, -0.026896094903349876, -0.006313466001302004, 0.030764460563659668, 0.040763821452856064, -0.015008166432380676, 0.05638326331973076, 0.004954063333570957, 0.003740637330338359, -0.0043199798092246056, 0.015683306381106377, -0.030436014756560326, 0.01946956105530262, -0.053682707250118256, 0.016668643802404404, -0.0010343774920329452, 0.02983386255800724, -0.08079776167869568, -0.0009123505442403257, -0.006942987907677889, 0.005679382011294365, 0.009908126667141914, 0.0175627488642931, -0.02459697052836418, 0.01589314639568329, 0.016522668302059174, -0.01409581582993269, -0.005291633307933807, 0.0015156423905864358, 0.036877211183309555, -0.0021976244170218706, -0.02892151288688183, -0.003038127440959215, -0.011085059493780136, 0.006359083577990532, -0.01715219020843506, 0.013128724880516529, 0.042588524520397186, -0.030198803171515465, -0.01835649274289608, -0.061236970126628876, 0.0019535706378519535, -0.012070397846400738, 0.014643226750195026, -0.04481465741991997, 0.03143959864974022, -0.013256453908979893, -0.07663744688034058, -0.09437353909015656, 0.001500816666521132, -0.0447416715323925, 0.02072860486805439, 0.018958644941449165, -0.009862509556114674, 0.052624378353357315, 0.03299059718847275 ]
39,422
pyspark.sql.dataframe
subtract
Return a new :class:`DataFrame` containing rows in this :class:`DataFrame` but not in another :class:`DataFrame`. .. versionadded:: 1.3.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Parameters ---------- other : :class:`DataFrame` Another :class:`DataFrame` that needs to be subtracted. Returns ------- :class:`DataFrame` Subtracted DataFrame. Notes ----- This is equivalent to `EXCEPT DISTINCT` in SQL. Examples -------- >>> df1 = spark.createDataFrame([("a", 1), ("a", 1), ("b", 3), ("c", 4)], ["C1", "C2"]) >>> df2 = spark.createDataFrame([("a", 1), ("a", 1), ("b", 3)], ["C1", "C2"]) >>> df1.subtract(df2).show() +---+---+ | C1| C2| +---+---+ | c| 4| +---+---+
def subtract(self, other: "DataFrame") -> "DataFrame": """Return a new :class:`DataFrame` containing rows in this :class:`DataFrame` but not in another :class:`DataFrame`. .. versionadded:: 1.3.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Parameters ---------- other : :class:`DataFrame` Another :class:`DataFrame` that needs to be subtracted. Returns ------- :class:`DataFrame` Subtracted DataFrame. Notes ----- This is equivalent to `EXCEPT DISTINCT` in SQL. Examples -------- >>> df1 = spark.createDataFrame([("a", 1), ("a", 1), ("b", 3), ("c", 4)], ["C1", "C2"]) >>> df2 = spark.createDataFrame([("a", 1), ("a", 1), ("b", 3)], ["C1", "C2"]) >>> df1.subtract(df2).show() +---+---+ | C1| C2| +---+---+ | c| 4| +---+---+ """ return DataFrame(getattr(self._jdf, "except")(other._jdf), self.sparkSession)
(self, other: pyspark.sql.dataframe.DataFrame) -> pyspark.sql.dataframe.DataFrame
[ 0.02574537880718708, -0.039928775280714035, 0.016935007646679878, 0.05461561679840088, -0.04489383101463318, -0.03666502982378006, -0.03194301947951317, 0.036838632076978683, 0.05996260046958923, -0.002970787463709712, -0.0047480519860982895, -0.025241930037736893, -0.006635988596826792, 0.025832179933786392, -0.0135497422888875, -0.0010665756417438388, 0.005659469868987799, 0.028314707800745964, 0.07673268765211105, -0.025415532290935516, -0.021839303895831108, -0.03555396944284439, 0.006197640206664801, 0.05412952974438667, -0.04024126008152962, 0.050692182034254074, -0.08138525485992432, -0.03114444389939308, 0.02461695671081543, 0.033262405544519424, -0.008788670413196087, -0.04541464149951935, -0.031456928700208664, -0.03590117394924164, -0.056004445999860764, -0.039616286754608154, -0.00766892870888114, -0.02058935910463333, 0.010355440899729729, 0.007694968953728676, 0.011258178390562534, -0.024443354457616806, 0.08194078505039215, -0.02072824165225029, 0.028245266526937485, -0.01819363236427307, -0.009617626667022705, -0.05711550638079643, -0.028470952063798904, 0.016874246299266815, 0.029582012444734573, 0.05621276795864105, -0.024599596858024597, 0.03454706817865372, -0.06530958414077759, 0.024130867794156075, -0.019894946366548538, 0.008897172287106514, -0.031630534678697586, 0.017082570120692253, -0.039477404206991196, -0.030918758362531662, -0.0690246969461441, 0.03411306068301201, 0.007369462866336107, 0.0021233861334621906, -0.013020251877605915, -0.025988424196839333, -0.02102336660027504, 0.004205541685223579, -0.031682614237070084, 0.047393716871738434, -0.01727353408932686, 0.09916224330663681, -0.02326285094022751, -0.02484264224767685, 0.05649053305387497, 0.02701268345117569, -0.042775869369506836, -0.03418250381946564, 0.04218561574816704, -0.07173290848731995, 0.009530824609100819, -0.023019805550575256, 0.053851764649152756, 0.01871444284915924, 0.028036942705512047, -0.009652347303926945, -0.0001409171090926975, -0.03126596659421921, -0.02109280787408352, 0.022099709138274193, -0.05315735191106796, -0.04617849364876747, 0.05319207161664963, -0.021804582327604294, -0.04468550533056259, 0.037012238055467606, 0.020085908472537994, -0.027359889820218086, 0.09992609918117523, 0.05867793783545494, 0.023071886971592903, 0.0012011182261630893, 0.04010237753391266, -0.015146893449127674, -0.004327063914388418, -0.059302907437086105, 0.01900956779718399, 0.020068548619747162, -0.025241930037736893, 0.0770798921585083, 0.020519917830824852, -0.000050012688006972894, -0.016987089067697525, -0.016492320224642754, -0.0382969006896019, -0.0007090612198226154, -0.07555218786001205, 0.029842417687177658, 0.0034069661051034927, 0.06652481108903885, 0.042775869369506836, -0.02715156599879265, 0.027203647419810295, 0.0029252166859805584, 0.00660560792312026, -0.0445813424885273, 0.01878388412296772, 0.046074334532022476, 0.048157572746276855, -0.05499754473567009, 0.006527486722916365, 0.0320124588906765, -0.002688682172447443, 0.011544623412191868, 0.07666324824094772, 0.04263698682188988, 0.03272423520684242, 0.04548408091068268, 0.04597017168998718, -0.020033828914165497, 0.0599973239004612, 0.05492810532450676, -0.07819095253944397, -0.01058980543166399, -0.01916581206023693, 0.002614900702610612, -0.007903292775154114, 0.018992207944393158, -0.028002222999930382, 0.03458179160952568, 0.004930335562676191, -0.07881592959165573, 0.018436677753925323, -0.00645370502024889, 0.013141774572432041, 0.028314707800745964, 0.0008832071325741708, -0.04121343791484833, 0.012594924308359623, 0.06541375070810318, 0.03555396944284439, 0.021301133558154106, -0.021231692284345627, -0.005958935711532831, 0.07534386217594147, 0.006991875357925892, -0.07003159821033478, 0.006614288315176964, 0.05343511700630188, 0.018575560301542282, 0.05492810532450676, -0.021162251010537148, -0.07326062023639679, 0.034008897840976715, 0.021752500906586647, 0.01209147460758686, 0.010615846142172813, -0.006349543109536171, 0.025016244500875473, -0.04058846831321716, -0.0237142201513052, 0.015459379181265831, 0.059233468025922775, -0.06246249005198479, -0.030068103224039078, -0.017308255657553673, 0.0507616251707077, -0.011015133000910282, 0.00131830049213022, -0.017369017004966736, -0.0004931420553475618, 0.013002892024815083, -0.016787445172667503, -0.014261516742408276, -0.02918272465467453, 0.030484750866889954, -0.04895614832639694, 0.045900728553533554, -0.02409614622592926, 0.03345336765050888, 0.03989405184984207, -0.05319207161664963, 0.022273311391472816, -0.04093567281961441, -0.038956593722105026, -0.03944268450140953, 0.011509902775287628, -0.02737724967300892, 0.04475494846701622, -0.022794121876358986, 0.06937190145254135, -0.01512085273861885, 0.06367771327495575, -0.0009510209201835096, -0.04017181694507599, -0.04933807626366615, 0.05281014367938042, 0.001653572078794241, -0.002716892631724477, -0.03867882862687111, -0.027221007272601128, 0.006952814757823944, 0.00048093555960804224, -0.0331408828496933, 0.07464944571256638, -0.003233362687751651, 0.009487424045801163, -0.05503226816654205, -0.03687335550785065, -0.018523478880524635, 0.017933227121829987, -0.06871221214532852, -0.0450674332678318, 0.06131670996546745, -0.07444112002849579, -0.00031682613189332187, 0.03968572989106178, -0.04301891475915909, -0.03286311775445938, 0.024946803227066994, 0.06944134831428528, 0.03150901198387146, 0.02663075551390648, -0.0202768724411726, -0.009600265882909298, 0.05142131820321083, 0.00315090105868876, 0.0336790531873703, 0.014634763821959496, -0.07631603628396988, -0.02296772599220276, 0.027221007272601128, -0.0019476127345114946, -0.0319082997739315, -0.031040281057357788, -0.035519249737262726, -0.024669038131833076, 0.04812285304069519, 0.005585688166320324, -0.05801824480295181, -0.026092585176229477, -0.0211101695895195, -0.06180279701948166, 0.02244691550731659, -0.021283771842718124, 0.013983750715851784, 0.010772088542580605, 0.030953479930758476, -0.018523478880524635, -0.03208190202713013, 0.029668815433979034, 0.005173380486667156, -0.00332884443923831, 0.03425194323062897, -0.045692406594753265, 0.003300633979961276, -0.011440461501479149, -0.05024081468582153, 0.021457375958561897, -0.01294213067740202, -0.03360961005091667, -0.015034051612019539, -0.044859107583761215, -0.015034051612019539, -0.00609781825914979, -0.12582771480083466, 0.0008197333663702011, -0.02013798989355564, -0.010937011800706387, 0.017082570120692253, 0.024530155584216118, 0.020762963220477104, -0.03045002929866314, 0.04197729378938675, 0.009661027230322361, -0.04024126008152962, -0.018905406817793846, 0.07051768898963928, 0.025762738659977913, -0.022637879475951195, 0.00864544790238142, 0.06242777034640312, -0.03225550428032875, -0.06728866696357727, 0.03569285199046135, 0.030206985771656036, -0.018297795206308365, 0.004259792622178793, -0.02977297641336918, 0.023471174761652946, 0.023679498583078384, -0.017577340826392174, -0.04833117499947548, 0.014539281837642193, 0.03277631476521492, 0.025641217827796936, -0.003715112106874585, 0.02888759970664978, 0.02716892585158348, -0.03189093619585037, -0.043678607791662216, 0.030918758362531662, 0.005650789476931095, 0.00438565481454134, -0.0002308382245246321, 0.0034330065827816725, 0.021752500906586647, 0.025623856112360954, -0.018384596332907677, 0.020033828914165497, 0.02484264224767685, -0.06589983403682709, 0.007386823184788227, -0.0336790531873703, 0.018002668395638466, 0.01840195618569851, 0.042532823979854584, 0.04256754368543625, 0.03826218098402023, -0.05024081468582153, 0.03202982246875763, -0.054442014545202255, -0.04003293439745903, -0.006228020880371332, -0.028835518285632133, -0.002599710365757346, -0.005763631779700518, 0.008619407191872597, -0.03444290906190872, 0.07548274099826813, -0.018245713785290718, 0.021752500906586647, 0.0038409745320677757, 0.0428105890750885, -0.08124637603759766, 0.007278320845216513, -0.014834407716989517, -0.057358551770448685, 0.019738702103495598, -0.000004522333711065585, 0.01747317798435688, -0.03642198443412781, -0.031231245025992393, -0.009305140003561974, 0.010042954236268997, -0.07527441531419754, -0.12464721500873566, -0.04847005754709244, -0.04308835417032242, -0.0009119601454585791, 0.043366119265556335, -0.020450476557016373, 0.02041575498878956, -0.027481412515044212, -0.047046512365341187, 0.02543289214372635, 0.03357489034533501, 0.04982416704297066, 0.0018640661146491766, -0.02043311670422554, -0.04676874727010727, -0.02446071431040764, -0.007148118689656258, -0.006223680451512337, -0.08256576210260391, -0.028193186968564987, 0.03597061708569527, -0.01591074839234352, -0.0004405185463838279, -0.04722011461853981, 0.007117738015949726, 0.03159581124782562, -0.04409525543451309, -0.03135276585817337, -0.044650785624980927, -0.002439127303659916, 0.0234190933406353, 0.006184619851410389, 0.037602487951517105, 0.030068103224039078, -0.00574193149805069, -0.03180413693189621, 0.01738637685775757, 0.036248382180929184, 0.017846425995230675, -0.042845308780670166, 0.0009732638718560338, -0.025936342775821686, -0.019790783524513245, -0.018818603828549385, -0.05520587041974068, 0.042914751917123795, 0.002690852154046297, 0.00630180211737752, 0.006570887286216021, -0.009235698729753494, 0.02192610502243042, 0.04760204255580902, 0.020103270187973976, -0.02635299041867256, 0.02260315790772438, -0.04645625874400139, -0.025259289890527725, 0.02260315790772438, -0.037463605403900146, -0.005216781049966812, -0.029061203822493553, 0.02380102127790451, -0.005524927284568548, -0.044789668172597885, -0.020641440525650978, 0.009200978092849255, 0.008198418654501438, 0.012933450751006603, 0.01537257805466652, -0.030172264203429222, 0.00525584165006876, 0.09909280389547348, 0.03638726472854614, -0.04656042158603668, 0.04840061813592911, -0.011588024906814098, -0.07051768898963928, -0.002171127125620842, -0.000781215145252645, -0.02694324217736721, -0.01762942224740982, -0.01489516906440258, 0.0965234711766243, 0.04631737619638443, 0.0024044066667556763, -0.015537501312792301, -0.09034319221973419, 0.009183618240058422, -0.03473803400993347, -0.04208145663142204, -0.06669840961694717, 0.05037969723343849, 0.0125688835978508, 0.015902068465948105, -0.04579656571149826, 0.020311594009399414, -0.004413865506649017, 0.011726907454431057, 0.04499799385666847, -0.05652525648474693, -0.01208279374986887, 0.028904959559440613, -0.02895704098045826, -0.07895480841398239, -0.0342693030834198, -0.04020654037594795, 0.009209658019244671, 0.031613171100616455, -0.06923302263021469, -0.028904959559440613, 0.005234141368418932, 0.04124815762042999, -0.03538036718964577, 0.006692409515380859, -0.01810683123767376, -0.04020654037594795, 0.01219563651829958, -0.051456037908792496, -0.04357444494962692, 0.021943464875221252, 0.047393716871738434, -0.016891608014702797, -0.013002892024815083, 0.005707210395485163, -0.026144666597247124, 0.012759847566485405, -0.013193855993449688, 0.00877130962908268, -0.01065924670547247, -0.005672489758580923, 0.03347072750329971, 0.0013562763342633843, -0.0010660331463441253, 0.00677487114444375, -0.045900728553533554, 0.005828733090311289, 0.015389937907457352, -0.048227015882730484, 0.027793899178504944, 0.024408632889389992, 0.01164010539650917, -0.04937279596924782, -0.051664359867572784, 0.054580897092819214, 0.06152503192424774, 0.05079634487628937, 0.008671487681567669, -0.021144889295101166, -0.053851764649152756, 0.06204584240913391, 0.08589894324541092, 0.025120407342910767, 0.00748230516910553, -0.01727353408932686, -0.001559175201691687, 0.0011837579077109694, -0.007456264458596706, -0.013098374009132385, -0.023818381130695343, -0.011943911202251911, 0.03451234847307205, -0.0008175633265636861, -0.1131199523806572, -0.019964387640357018, 0.033192962408065796, -0.013376139104366302, -0.014027152210474014, 0.027064764872193336, -0.03742888569831848, 0.01566770300269127, -0.018662361428141594, 0.021717781201004982, -0.0005080610862933099, 0.03451234847307205, 0.04555352404713631, -0.0032528929878026247, -0.07103849947452545, 0.009556865319609642, -0.06562206894159317, 0.0616639144718647, 0.030345868319272995, 0.06024036556482315, 0.0057592918165028095, -0.006996215786784887, 0.0646151751279831, -0.0019606330897659063, 0.047393716871738434, 0.02102336660027504, -0.016474958509206772, 0.05853905528783798, 0.018124191090464592, 0.0042098816484212875, -0.0071654790081083775, -0.07083017379045486, 0.08930157124996185, -0.01878388412296772, 0.0128379687666893, 0.018297795206308365, 0.020328953862190247, 0.024981524795293808, -0.007022256031632423, -0.016822166740894318, -0.012343198992311954, 0.03833162412047386, 0.04305363446474075, -0.028036942705512047, 0.0037064317148178816, 0.0496852844953537, 0.008259180001914501, 0.040900953114032745, -0.022585798054933548, 0.006310482509434223, -0.02222122997045517, 0.0002548443153500557, -0.024495434015989304, 0.020259512588381767, -0.01591074839234352, 0.024512795731425285, -0.05944179370999336, -0.035588689148426056, 0.08666279911994934, 0.015077452175319195, 0.041942574083805084, -0.04749787971377373, 0.0342172235250473, -0.01788114570081234, 0.0002487410674802959, 0.04749787971377373, -0.010259958915412426, -0.04274114966392517, 0.001382316811941564, 0.023401733487844467, 0.05471977964043617, -0.017863785848021507, 0.011214776895940304, -0.027741817757487297, 0.015094812959432602, 0.029165364801883698, -0.05798352509737015, -0.03919963911175728, -0.02529400959610939, 0.013758067041635513, 0.028540393337607384, 0.03919963911175728, -0.010693967342376709, -0.040900953114032745, 0.062219444662332535, -0.019808143377304077, 0.0007513770833611488, -0.06346938759088516, -0.019513018429279327, 0.025172486901283264, -0.0006895308615639806, 0.007412863429635763, 0.02326285094022751, 0.018210992217063904, 0.008879812434315681, 0.04288003221154213, 0.023228129372000694, 0.06430268287658691, -0.0815935805439949, 0.07208012044429779, 0.010971732437610626, -0.05037969723343849, 0.014712885022163391, 0.021387934684753418, -0.01021655835211277, -0.023696858435869217, 0.02244691550731659, -0.0377066507935524, -0.015719784423708916, 0.06603872030973434, 0.020242152735590935, -0.01062452606856823, -0.019061649218201637, 0.011292899027466774, -0.0799269899725914, -0.0502755343914032, -0.000653725175652653, -0.00834164209663868, -0.018835965543985367, -0.007243600208312273, 0.00826351996511221, 0.022655239328742027, 0.035658132284879684, -0.04847005754709244, -0.0456576831638813, 0.007673268672078848, -0.038505226373672485, 0.04228977859020233, 0.0559697262942791, 0.029095923528075218, 0.05267126113176346, 0.011796348728239536, 0.017160693183541298, -0.002951257163658738, 0.05065746232867241, 0.02326285094022751, 0.07284396886825562, -0.025346091017127037, 0.05971955880522728, 0.03916491940617561, -0.004752391949295998, 0.03913019970059395, -0.04687291011214256, 0.004238092340528965, -0.017160693183541298, -0.031092362478375435, -0.033852655440568924, -0.02940841019153595, 0.027898060157895088, -0.021908745169639587, -0.025537054985761642, 0.0674622654914856, -0.009348541498184204, 0.0007985754637047648, -0.016370797529816628, 0.003229022491723299, -0.004186010919511318, -0.008033495396375656, 0.029009122401475906, -0.07534386217594147, -0.006375583354383707, -0.004381314851343632, -0.008181058801710606, 0.020832404494285583, -0.00014864788681734353, 0.025050966069102287, -0.013896949589252472, -0.061247266829013824, -0.03307143971323967, 0.060587573796510696, -0.014200755394995213, 0.022880923002958298, 0.037984415888786316, 0.03933852165937424, 0.02343645505607128, 0.04586600884795189, 0.02312396839261055, -0.03187357634305954, 0.045310478657484055, -0.04527575895190239, -0.029616734012961388, 0.02192610502243042, 0.04676874727010727, 0.020467836409807205, -0.007959714159369469, 0.06270553171634674, -0.016856886446475983, 0.00860204640775919, -0.01772490330040455, 0.027446692809462547, -0.016900287941098213, 0.003912585787475109, 0.05364343896508217, 0.04600489139556885, -0.014365678653120995, 0.01840195618569851, 0.03098819963634014, -0.0610736645758152, 0.0009125026990659535, 0.018575560301542282, -0.010416202247142792, 0.047636762261390686, 0.026960602030158043, 0.008202758617699146, 0.04676874727010727, -0.017455818131566048, -0.015615622512996197, -0.008276540786027908, 0.05867793783545494, -0.012178275734186172, -0.005316602997481823, -0.0002570143551565707, -0.03958156704902649, 0.0020289893727749586, 0.018575560301542282, 0.01789850741624832, -0.058782100677490234, 0.040970392525196075, -0.0008766970131546259, -0.008727909065783024, 0.0066490089520812035, -0.03237702697515488, -0.034685950726270676, -0.016691964119672775, 0.016448918730020523, 0.041491203010082245, 0.029130645096302032, -0.004238092340528965, 0.002864455571398139, -0.031682614237070084, 0.0062974621541798115, 0.056004445999860764, -0.016900287941098213, 0.04746316000819206, -0.0007703649462200701, 0.0502755343914032, 0.03437346592545509, 0.01530313678085804 ]
39,423
pyspark.sql.dataframe
summary
Computes specified statistics for numeric and string columns. Available statistics are: - count - mean - stddev - min - max - arbitrary approximate percentiles specified as a percentage (e.g., 75%) If no statistics are given, this function computes count, mean, stddev, min, approximate quartiles (percentiles at 25%, 50%, and 75%), and max. .. versionadded:: 2.3.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Parameters ---------- statistics : str, optional Column names to calculate statistics by (default All columns). Returns ------- :class:`DataFrame` A new DataFrame that provides statistics for the given DataFrame. Notes ----- This function is meant for exploratory data analysis, as we make no guarantee about the backward compatibility of the schema of the resulting :class:`DataFrame`. Examples -------- >>> df = spark.createDataFrame( ... [("Bob", 13, 40.3, 150.5), ("Alice", 12, 37.8, 142.3), ("Tom", 11, 44.1, 142.2)], ... ["name", "age", "weight", "height"], ... ) >>> df.select("age", "weight", "height").summary().show() +-------+----+------------------+-----------------+ |summary| age| weight| height| +-------+----+------------------+-----------------+ | count| 3| 3| 3| | mean|12.0| 40.73333333333333| 145.0| | stddev| 1.0|3.1722757341273704|4.763402145525822| | min| 11| 37.8| 142.2| | 25%| 11| 37.8| 142.2| | 50%| 12| 40.3| 142.3| | 75%| 13| 44.1| 150.5| | max| 13| 44.1| 150.5| +-------+----+------------------+-----------------+ >>> df.select("age", "weight", "height").summary("count", "min", "25%", "75%", "max").show() +-------+---+------+------+ |summary|age|weight|height| +-------+---+------+------+ | count| 3| 3| 3| | min| 11| 37.8| 142.2| | 25%| 11| 37.8| 142.2| | 75%| 13| 44.1| 150.5| | max| 13| 44.1| 150.5| +-------+---+------+------+ See Also -------- DataFrame.display
def summary(self, *statistics: str) -> "DataFrame": """Computes specified statistics for numeric and string columns. Available statistics are: - count - mean - stddev - min - max - arbitrary approximate percentiles specified as a percentage (e.g., 75%) If no statistics are given, this function computes count, mean, stddev, min, approximate quartiles (percentiles at 25%, 50%, and 75%), and max. .. versionadded:: 2.3.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Parameters ---------- statistics : str, optional Column names to calculate statistics by (default All columns). Returns ------- :class:`DataFrame` A new DataFrame that provides statistics for the given DataFrame. Notes ----- This function is meant for exploratory data analysis, as we make no guarantee about the backward compatibility of the schema of the resulting :class:`DataFrame`. Examples -------- >>> df = spark.createDataFrame( ... [("Bob", 13, 40.3, 150.5), ("Alice", 12, 37.8, 142.3), ("Tom", 11, 44.1, 142.2)], ... ["name", "age", "weight", "height"], ... ) >>> df.select("age", "weight", "height").summary().show() +-------+----+------------------+-----------------+ |summary| age| weight| height| +-------+----+------------------+-----------------+ | count| 3| 3| 3| | mean|12.0| 40.73333333333333| 145.0| | stddev| 1.0|3.1722757341273704|4.763402145525822| | min| 11| 37.8| 142.2| | 25%| 11| 37.8| 142.2| | 50%| 12| 40.3| 142.3| | 75%| 13| 44.1| 150.5| | max| 13| 44.1| 150.5| +-------+----+------------------+-----------------+ >>> df.select("age", "weight", "height").summary("count", "min", "25%", "75%", "max").show() +-------+---+------+------+ |summary|age|weight|height| +-------+---+------+------+ | count| 3| 3| 3| | min| 11| 37.8| 142.2| | 25%| 11| 37.8| 142.2| | 75%| 13| 44.1| 150.5| | max| 13| 44.1| 150.5| +-------+---+------+------+ See Also -------- DataFrame.display """ if len(statistics) == 1 and isinstance(statistics[0], list): statistics = statistics[0] jdf = self._jdf.summary(self._jseq(statistics)) return DataFrame(jdf, self.sparkSession)
(self, *statistics: str) -> pyspark.sql.dataframe.DataFrame
[ 0.02235107682645321, -0.03047005645930767, 0.034672822803258896, -0.014986683614552021, 0.04443470388650894, -0.013888232409954071, 0.041454561054706573, 0.01670599728822708, 0.0004169932217337191, 0.03564710170030594, -0.03834069147706032, 0.03266695886850357, -0.010678847320377827, -0.00699665118008852, 0.0014088819734752178, 0.05517086014151573, 0.06667115539312363, -0.0454280860722065, 0.06055804342031479, 0.05616424232721329, -0.027489913627505302, -0.02643922157585621, 0.00937503483146429, 0.05948824808001518, -0.043594151735305786, 0.003259531920775771, 0.04940161108970642, -0.0829855352640152, 0.030871229246258736, 0.027585430070757866, -0.01805279217660427, -0.04351773485541344, -0.030871229246258736, -0.015235028229653835, -0.057310450822114944, 0.030813919380307198, 0.001607080572284758, -0.017546549439430237, 0.0002808809222187847, 0.011462090536952019, -0.007555427961051464, -0.0054349410347640514, -0.02307700924575329, -0.062353771179914474, -0.014986683614552021, 0.03962062671780586, 0.05444492772221565, -0.01865455135703087, 0.007173357997089624, -0.024127699434757233, 0.02747081033885479, 0.054979827255010605, -0.058112796396017075, 0.032036542892456055, -0.04325028881430626, 0.006323253270238638, 0.005067199002951384, -0.013324679806828499, 0.006772185210138559, 0.004341266583651304, 0.024930046871304512, 0.022924181073904037, -0.01588454656302929, -0.003858903655782342, -0.05070064589381218, 0.036793310195207596, 0.013085886836051941, 0.0045084222219884396, -0.04703277722001076, -0.04198945686221123, -0.016171099618077278, 0.014766993001103401, 0.03003067709505558, 0.09269010275602341, -0.044893186539411545, -0.01588454656302929, -0.05333692580461502, -0.03856993466615677, 0.005382406525313854, -0.05960287153720856, 0.10063715279102325, -0.003302514785900712, -0.004169335588812828, -0.0751148983836174, 0.002073921961709857, -0.020784590393304825, -0.003450566902756691, 0.014241646975278854, 0.006867702584713697, 0.035627998411655426, -0.042638976126909256, 0.026401014998555183, 0.03587634116411209, 0.014002854004502296, -0.00393292959779501, 0.003529368666931987, -0.07198192924261093, -0.017909515649080276, -0.00028908945387229323, 0.005052871536463499, -0.002977755619212985, 0.01896020770072937, 0.03858903795480728, 0.03793951869010925, -0.03950600326061249, -0.030412746593356133, -0.004854673054069281, -0.030164401978254318, -0.014002854004502296, 0.030737506225705147, -0.039353176951408386, 0.01730775646865368, 0.02147231623530388, -0.015473822131752968, 0.03341199457645416, 0.007990032434463501, 0.019695691764354706, -0.0035723515320569277, -0.059946734458208084, -0.01398374978452921, -0.00455140508711338, 0.028903571888804436, 0.006170425098389387, -0.10583329945802689, 0.02126217819750309, 0.04963085055351257, -0.0016369298100471497, -0.06804660707712173, 0.0094657763838768, 0.03025991842150688, 0.05054781958460808, -0.03310633823275566, 0.011528952978551388, 0.07343379408121109, 0.06166604533791542, -0.01015350129455328, 0.04783512279391289, 0.011385676451027393, 0.044969599694013596, 0.07901200652122498, -0.016772858798503876, -0.024643493816256523, -0.004147843923419714, -0.0010327821364626288, 0.027528120204806328, -0.009212655015289783, 0.05348975583910942, 0.005960287060588598, -0.004047550726681948, -0.04332670196890831, 0.0051770443096756935, -0.023726526647806168, 0.0008799542556516826, -0.05517086014151573, 0.028368674218654633, -0.027585430070757866, 0.10109563916921616, -0.023191628977656364, -0.03025991842150688, -0.041836630553007126, 0.046574294567108154, 0.0005128091434016824, 0.023287147283554077, 0.029190123081207275, -0.07091213017702103, 0.029553089290857315, -0.010354088619351387, 0.014098371379077435, -0.06021418049931526, -0.0417984239757061, 0.019753001630306244, 0.017813999205827713, 0.033927787095308304, 0.026859497651457787, -0.012149815447628498, 0.07431255280971527, 0.018740518018603325, 0.05035678297281265, -0.0008298075990751386, -0.04794974625110626, 0.0020452667959034443, -0.046421464532613754, -0.09337782859802246, -0.01069795060902834, -0.009184000082314014, -0.00087219342822209, -0.01917034573853016, -0.058418452739715576, 0.0021491418592631817, 0.013496611267328262, -0.04909595474600792, -0.02498735673725605, -0.013506162911653519, 0.044816773384809494, 0.028139431029558182, -0.039926283061504364, -0.0020166116300970316, 0.005821786820888519, -0.004030834883451462, -0.004410516936331987, 0.008276584558188915, 0.006609805393964052, 0.054979827255010605, -0.010296777822077274, 0.0352841354906559, -0.004138292279094458, -0.06946026533842087, -0.0062468391843140125, -0.00876849889755249, -0.07473283261060715, -0.01030632946640253, -0.042256906628608704, -0.0251401849091053, 0.019208552315831184, 0.02842598408460617, 0.019179897382855415, -0.0018661716021597385, -0.04546629264950752, 0.02198811061680317, -0.022981490939855576, 0.07878276705741882, -0.03881828114390373, 0.0016679728869348764, 0.027165153995156288, 0.009432345628738403, 0.012665609829127789, 0.06984233856201172, -0.06220094487071037, 0.042638976126909256, -0.02258031815290451, 0.019772106781601906, -0.06453157216310501, 0.020498039200901985, 0.012302643619477749, -0.08076953142881393, 0.029476676136255264, -0.014394475147128105, 0.001021439442411065, 0.03184550628066063, -0.07033903151750565, -0.05887693911790848, -0.0077989972196519375, 0.010497364215552807, 0.037079863250255585, -0.04023193567991257, -0.08092235773801804, -0.05383361876010895, 0.03039364330470562, -0.009480103850364685, -0.015683960169553757, 0.009523087181150913, -0.00568328658118844, 0.021223969757556915, -0.01034453697502613, -0.012016091495752335, -0.030145296826958656, -0.00724977208301425, 0.021682454273104668, -0.007407376077026129, -0.016639133915305138, -0.00020789963309653103, -0.10942475497722626, -0.01293305866420269, 0.061551425606012344, -0.011681780219078064, -0.010822123847901821, 0.006132218521088362, 0.0012882911833003163, 0.02894177846610546, 0.0038827829994261265, 0.011471642181277275, 0.03981165960431099, -0.003350273473188281, -0.04733843356370926, 0.02586611732840538, -0.038035035133361816, 0.014088819734752178, -0.04363235831260681, -0.02454797737300396, -0.0752677246928215, 0.009121913462877274, -0.041683800518512726, -0.02938115783035755, 0.00871596485376358, 0.017221791669726372, 0.01606602966785431, -0.0007360810996033251, -0.03822607174515724, -0.01883603446185589, 0.00904072355479002, 0.017517894506454468, -0.014146129600703716, -0.04275359585881233, -0.02170155756175518, -0.04198945686221123, 0.038684554398059845, 0.009671138599514961, -0.035627998411655426, -0.023210732266306877, -0.0005823577521368861, -0.03748103603720665, -0.024146804586052895, 0.08222139626741409, 0.07538234442472458, -0.02521659806370735, -0.04882850497961044, -0.024605287238955498, -0.07668138295412064, 0.0006178783369250596, -0.01898886263370514, 0.013620784506201744, 0.029209226369857788, 0.05383361876010895, 0.04550449922680855, -0.03809234872460365, -0.018348896875977516, -0.039849866181612015, -0.013085886836051941, -0.0010172604816034436, 0.02689770609140396, -0.005067199002951384, -0.04749125987291336, 0.014394475147128105, 0.006652788259088993, 0.03274337202310562, 0.05326051265001297, -0.03673600032925606, -0.0016178262885659933, 0.04011731594800949, -0.0230196975171566, -0.010860330425202847, -0.025082875043153763, 0.1346413493156433, 0.0033884805161505938, -0.0829855352640152, 0.014575958251953125, -0.017632516101002693, 0.00426724087446928, -0.017995482310652733, 0.040308352559804916, 0.01800503395497799, -0.03194102644920349, 0.03748103603720665, 0.03146343678236008, 0.027585430070757866, -0.031004954129457474, 0.05685196816921234, -0.047376640141010284, 0.03474923595786095, -0.021567832678556442, -0.0010566614801064134, -0.0010441248305141926, -0.01694479025900364, 0.01950465701520443, 0.06197170168161392, 0.0716380625963211, 0.009933811612427235, 0.07400690019130707, 0.01193967740982771, -0.042409732937812805, 0.04630684480071068, -0.019132139161229134, -0.006036701146513224, -0.009876500815153122, 0.05582037940621376, 0.03660227358341217, 0.023172525689005852, 0.036793310195207596, 0.000966516905464232, -0.026286393404006958, 0.045619118958711624, -0.05100630223751068, 0.002310327487066388, 0.028215846046805382, -0.026267290115356445, 0.02529301308095455, -0.04749125987291336, -0.013124093413352966, -0.004981233272701502, -0.03184550628066063, 0.0017348350957036018, -0.029495779424905777, 0.026133565232157707, 0.013133645057678223, -0.009981570765376091, 0.0034768341574817896, -0.08466663956642151, -0.05524727702140808, -0.08604209125041962, -0.011137330904603004, -0.07190551608800888, 0.006485632620751858, -0.043364908546209335, -0.008047342300415039, -0.024910943582654, 0.014690578915178776, 0.0036177223082631826, -0.006280270405113697, 0.003018350573256612, -0.015569339506328106, -0.018635448068380356, -0.09322500228881836, 0.003240428399294615, -0.018874242901802063, -0.02710784412920475, 0.014872062020003796, 0.024509770795702934, -0.049860093742609024, -0.024146804586052895, -0.0502803698182106, 0.05494162067770958, -0.05142657831311226, -0.08084594458341599, 0.07939407974481583, 0.008739843964576721, 0.05150299146771431, 0.016104236245155334, 0.009184000082314014, 0.03215116262435913, 0.032915301620960236, 0.043364908546209335, -0.022198248654603958, 0.005616424139589071, 0.07297530770301819, -0.01619020290672779, -0.022198248654603958, -0.025522254407405853, -0.036850620061159134, 0.013783163391053677, -0.0019569131545722485, -0.015445167198777199, -0.01015350129455328, -0.09024485945701599, 0.02519749477505684, -0.0012381445849314332, 0.027852879837155342, -0.008085549809038639, -0.04523704946041107, 0.024643493816256523, 0.01172953937202692, 0.05532369017601013, -0.0013026187662035227, 0.010182157158851624, 0.011318814009428024, -0.037805795669555664, -0.03238040581345558, 0.009059826843440533, -0.04355594515800476, -0.07381585985422134, -0.012675161473453045, 0.03402330353856087, -0.026630256325006485, 0.00774646271020174, 0.013066782616078854, -0.022618524730205536, -0.02235107682645321, 0.02592342719435692, -0.009704570285975933, -0.01055467501282692, 0.05582037940621376, 0.022083627060055733, -0.010965399444103241, -0.02162514440715313, 0.03098585084080696, -0.038398001343011856, 0.010984503664076328, -0.016620030626654625, -0.06720605492591858, -0.023439975455403328, 0.024376045912504196, 0.030584678053855896, 0.019074829295277596, -0.028177639469504356, -0.024662597104907036, 0.03673600032925606, 0.04355594515800476, -0.021434109658002853, -0.01673465222120285, -0.007092168554663658, 0.04531346261501312, -0.050891682505607605, 0.021319488063454628, 0.03281978517770767, 0.017517894506454468, 0.03322095796465874, 0.027012325823307037, -0.00844374019652605, -0.04405263438820839, 0.09574665874242783, -0.03772938251495361, -0.00648085679858923, 0.035990964621305466, 0.045848362147808075, -0.012312195263803005, -0.059946734458208084, 0.03853172808885574, 0.04420546069741249, 0.014079268090426922, -0.03799682855606079, 0.024719908833503723, 0.02273314632475376, -0.03173088654875755, -0.00865387823432684, 0.012398160994052887, 0.0290755033493042, -0.029018191620707512, 0.08145725727081299, 0.00781332515180111, -0.03516951575875282, -0.0537572056055069, -0.022026317194104195, 0.027489913627505302, -0.06659474223852158, 0.03266695886850357, -0.0050385440699756145, -0.015235028229653835, 0.015292339026927948, 0.02733708545565605, 0.048408228904008865, -0.016858825460076332, -0.0026219531428068876, -0.006872478406876326, -0.023860251531004906, 0.05631707236170769, -0.02739439532160759, 0.01979121007025242, 0.022446593269705772, 0.03872276097536087, 0.016591375693678856, 0.0458865687251091, -0.035093098878860474, 0.07855352759361267, 0.002132426481693983, -0.00387323135510087, 0.016161547973752022, 0.03579992800951004, -0.018167413771152496, -0.01955241523683071, -0.013200507499277592, 0.027241569012403488, 0.00135992921423167, 0.028215846046805382, 0.004900043830275536, -0.036353930830955505, 0.00790406670421362, -0.010812572203576565, 0.01299992110580206, -0.030813919380307198, 0.07415972650051117, -0.034004200249910355, -0.010430501773953438, -0.0009163702488876879, 0.02009686455130577, 0.0493634007871151, 0.016304822638630867, 0.049707263708114624, -0.03799682855606079, 0.015617097727954388, 0.0004784825723618269, -0.02521659806370735, 0.017030755057930946, -0.017088066786527634, 0.06021418049931526, -0.0007116047781892121, -0.005859993863850832, 0.04420546069741249, 0.04882850497961044, 0.009671138599514961, -0.053527962416410446, -0.08711189031600952, -0.02475811541080475, 0.057386863976716995, 0.019227657467126846, -0.07171447575092316, 0.009924259968101978, -0.05348975583910942, 0.015970513224601746, 0.07977614551782608, -0.03388958051800728, 0.03293440490961075, -0.07297530770301819, 0.019829416647553444, 0.03358392417430878, 0.007736911065876484, -0.04053759202361107, 0.0352841354906559, -0.044014427810907364, -0.01971479505300522, -0.00330729060806334, 0.014919821172952652, -0.0027174705173820257, -0.09490610659122467, -0.0019712408538907766, -0.023439975455403328, 0.04011731594800949, 0.018692759796977043, -0.07427434623241425, -0.07114137709140778, 0.021930798888206482, 0.007015754468739033, -0.04294463247060776, 0.031520746648311615, -0.00919355172663927, -0.021567832678556442, 0.01782355085015297, 0.04615401849150658, -0.01501533854752779, 0.07129420340061188, -0.014738338068127632, 0.03750013932585716, 0.009905156679451466, 0.07595545053482056, 0.006648012436926365, 0.005444493144750595, 0.039047520607709885, 0.019753001630306244, -0.0022948060650378466, -0.06762633472681046, 0.004343654494732618, -0.038035035133361816, -0.025522254407405853, 0.05612603574991226, -0.010974951088428497, 0.024930046871304512, -0.012837541289627552, 0.023172525689005852, -0.022465696558356285, -0.013897784985601902, -0.006328029092401266, -0.01979121007025242, 0.004386637359857559, -0.032265786081552505, 0.03142523020505905, -0.004463051445782185, 0.016438547521829605, -0.05895335227251053, -0.004947802517563105, -0.0030040228739380836, -0.006648012436926365, 0.017909515649080276, 0.014776544645428658, -0.002786720637232065, 0.04042297229170799, 0.011490745469927788, 0.044893186539411545, -0.031234195455908775, -0.04879029840230942, -0.0038374122232198715, 0.021453212946653366, -0.007646169513463974, -0.03950600326061249, 0.016935238614678383, 0.00790406670421362, 0.02775736153125763, 0.06273584067821503, 0.06342356652021408, -0.01052602007985115, -0.016362134367227554, 0.023287147283554077, 0.02630549669265747, -0.03287709504365921, -0.05960287153720856, 0.0290755033493042, 0.0452752560377121, -0.010268122889101505, 0.05429210141301155, -0.02468170039355755, 0.0269550159573555, 0.011099124327301979, -0.01465237233787775, 0.024586183950304985, 0.07431255280971527, 0.06835226714611053, -0.03453909978270531, -0.0028440312016755342, 0.057539694011211395, -0.050165750086307526, -0.020421624183654785, -0.034233443439006805, -0.05108271539211273, 0.04065221548080444, -0.0002740155905485153, -0.018358448520302773, -0.02850239723920822, -0.0311195757240057, -0.00964725948870182, -0.01994403637945652, -0.034309856593608856, -0.011624470353126526, -0.0622391514480114, -0.02351638861000538, -0.10254750400781631, 0.010764813050627708, 0.030412746593356133, -0.006791288498789072, 0.00958517286926508, -0.02410859614610672, -0.0053155445493757725, 0.08588926494121552, -0.0036965240724384785, -0.02592342719435692, 0.04367056488990784, -0.008639550767838955, 0.04084324836730957, 0.05742507427930832, 0.036067377775907516, 0.014241646975278854, 0.021682454273104668, 0.04523704946041107, -0.0461922250688076, -0.013888232409954071, 0.024872737005352974, -0.015235028229653835, 0.046345051378011703, -0.005420613568276167, 0.03257143869996071, 0.03835979476571083, 0.023057905957102776, 0.016696445643901825, -0.015531131997704506, 0.037003450095653534, -0.03581903129816055, 0.03553248196840286, -0.0006895163678564131, -0.03553248196840286, 0.03549427166581154, -0.010621537454426289, 0.0337749607861042, 0.03629662096500397, -0.005692838225513697, 0.015235028229653835, 0.032972611486911774, 0.009661586955189705, 0.03062288463115692, 0.005979390349239111, -0.013563473708927631, 0.02475811541080475, -0.007598410826176405, 0.017212238162755966, 0.012866196222603321, 0.01413657795637846, 0.015473822131752968, 0.0068056159652769566, -0.04279180243611336, 0.010440054349601269, -0.04042297229170799, 0.030336331576108932, 0.014509095810353756, -0.007684376556426287, 0.00979053508490324, 0.04332670196890831, -0.07286068797111511, -0.02857881225645542, 0.012474575079977512, 0.029839642345905304, 0.03031722828745842, -0.02227466180920601, -0.005516130942851305, 0.03266695886850357, -0.07068289071321487, -0.0025885221548378468, 0.03031722828745842, 0.040575798600912094, 0.008438964374363422, -0.006676667835563421, 0.037156276404857635, -0.03461551293730736, 0.014872062020003796 ]
39,424
pyspark.sql.dataframe
tail
Returns the last ``num`` rows as a :class:`list` of :class:`Row`. Running tail requires moving data into the application's driver process, and doing so with a very large ``num`` can crash the driver process with OutOfMemoryError. .. versionadded:: 3.0.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Parameters ---------- num : int Number of records to return. Will return this number of records or all records if the DataFrame contains less than this number of records. Returns ------- list List of rows Examples -------- >>> df = spark.createDataFrame( ... [(14, "Tom"), (23, "Alice"), (16, "Bob")], ["age", "name"]) >>> df.tail(2) [Row(age=23, name='Alice'), Row(age=16, name='Bob')]
def tail(self, num: int) -> List[Row]: """ Returns the last ``num`` rows as a :class:`list` of :class:`Row`. Running tail requires moving data into the application's driver process, and doing so with a very large ``num`` can crash the driver process with OutOfMemoryError. .. versionadded:: 3.0.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Parameters ---------- num : int Number of records to return. Will return this number of records or all records if the DataFrame contains less than this number of records. Returns ------- list List of rows Examples -------- >>> df = spark.createDataFrame( ... [(14, "Tom"), (23, "Alice"), (16, "Bob")], ["age", "name"]) >>> df.tail(2) [Row(age=23, name='Alice'), Row(age=16, name='Bob')] """ with SCCallSiteSync(self._sc): sock_info = self._jdf.tailToPython(num) return list(_load_from_socket(sock_info, BatchedSerializer(CPickleSerializer())))
(self, num: int) -> List[pyspark.sql.types.Row]
[ 0.025523871183395386, -0.021710580214858055, -0.03784511983394623, 0.024750420823693275, -0.00632250914350152, 0.037413425743579865, -0.028185980394482613, 0.02730460651218891, -0.00003249644942115992, -0.06367477029561996, -0.00983901135623455, -0.021980388090014458, -0.037521351128816605, -0.02385105937719345, 0.013472430408000946, 0.02734057977795601, 0.007828939706087112, -0.020415499806404114, 0.024318726733326912, 0.02512815222144127, -0.007015017326921225, 0.002671102760359645, 0.026872912421822548, 0.037269528955221176, -0.040615152567625046, 0.054105568677186966, 0.0014097486855462193, 0.00030072391382418573, 0.03507508710026741, 0.016458310186862946, -0.033762019127607346, -0.005391670390963554, -0.0500764325261116, -0.020325563848018646, -0.03280869498848915, 0.05777496472001076, -0.008611383847892284, -0.04270166903734207, 0.03917617350816727, 0.02091914229094982, 0.019498150795698166, 0.011808612383902073, 0.04698262736201286, -0.02358125150203705, -0.0026036507915705442, -0.002311358228325844, 0.026908887550234795, -0.009281408041715622, 0.008179689757525921, -0.029265213757753372, 0.04352908208966255, 0.05586831644177437, -0.023563263937830925, -0.018832623958587646, -0.04917706921696663, -0.052450746297836304, -0.032736748456954956, -0.009695113636553288, -0.019552111625671387, 0.003655903274193406, -0.007024011109024286, -0.03502112627029419, -0.004784601740539074, 0.029678920283913612, 0.09964922070503235, 0.00669574411585927, -0.010432589799165726, -0.009020593017339706, -0.031189845874905586, -0.02064933255314827, 0.00983901135623455, 0.02235811948776245, -0.03430163487792015, 0.057703014463186264, -0.09813829511404037, -0.07684142142534256, 0.030416395515203476, 0.035093072801828384, -0.05511285364627838, -0.035866525024175644, 0.040291380137205124, 0.02951703406870365, 0.017933262512087822, 0.007765984162688255, 0.024858344346284866, -0.011008180677890778, 0.07662557065486908, 0.01769043505191803, -0.11382315307855606, 0.04521987959742546, -0.03917617350816727, 0.014956376515328884, -0.040866974741220474, -0.011583772487938404, 0.05820665508508682, -0.0847558006644249, -0.04608326777815819, 0.00588182220235467, -0.021296873688697815, -0.022232208400964737, -0.011610752902925014, 0.04104684665799141, -0.018616776913404465, -0.020667320117354393, -0.01199747808277607, -0.024966266006231308, -0.018005210906267166, -0.0027250645216554403, -0.026171410456299782, 0.06302723288536072, -0.003217464778572321, 0.08223758637905121, 0.00031702482374385, -0.0265311561524868, 0.0241568423807621, 0.03126179426908493, -0.014920402318239212, 0.011340945027768612, -0.02225019596517086, -0.019498150795698166, 0.056515857577323914, 0.008647358044981956, -0.005310727749019861, -0.04978863522410393, -0.07209279388189316, 0.07083369046449661, 0.02584764175117016, -0.051731254905462265, 0.0358305498957634, -0.009020593017339706, 0.015657879412174225, -0.0116377342492342, 0.023617224767804146, 0.057451192289590836, 0.0013422966003417969, -0.03975176438689232, 0.011466855183243752, 0.02280779927968979, -0.043852850794792175, -0.03653205186128616, 0.0029813824221491814, -0.0015446528559550643, 0.04928499460220337, 0.062091898173093796, -0.017150817438960075, -0.06511375308036804, 0.02219623513519764, 0.0006666514673270285, 0.0028644653502851725, -0.011799618601799011, -0.02761038951575756, 0.03225109353661537, -0.011826599948108196, -0.046227164566516876, -0.03949994221329689, 0.02910332754254341, -0.003487273119390011, -0.028545724228024483, 0.009578196331858635, -0.09396525472402573, -0.05831458047032356, 0.03217914327979088, 0.00889917928725481, -0.046119242906570435, -0.08849713951349258, 0.0501483790576458, 0.004861047491431236, -0.005567045882344246, -0.06788378208875656, 0.06572531908750534, 0.049105122685432434, 0.044104672968387604, 0.08957637846469879, -0.01926431618630886, -0.038132913410663605, 0.10317471623420715, 0.012303261086344719, 0.03593847528100014, 0.048997197300195694, 0.01796923764050007, -0.031909335404634476, -0.04104684665799141, -0.02518211305141449, -0.023653199896216393, 0.042773619294166565, 0.0019212603801861405, -0.051011767238378525, -0.0596456341445446, 0.0554366260766983, 0.019390227273106575, -0.022016361355781555, -0.004182029515504837, 0.0375932976603508, 0.002779026050120592, -0.014758517034351826, -0.0346074178814888, 0.013976072892546654, 0.07921573519706726, -0.021926425397396088, 0.04579547047615051, 0.012357222847640514, -0.017933262512087822, 0.043601032346487045, -0.07648167759180069, 0.0011017174692824483, -0.009407318197190762, -0.051983077079057693, -0.007397246081382036, -0.04219802841544151, 0.02888748236000538, -0.0003796990495175123, 0.00960517767816782, -0.021099014207720757, 0.02946307323873043, 0.050652023404836655, -0.03642413020133972, -0.03165751323103905, -0.027520453557372093, 0.048997197300195694, -0.04590339586138725, 0.050759945064783096, -0.047306399792432785, -0.06342295557260513, 0.016710130497813225, -0.007095959968864918, -0.006371974013745785, 0.01758251152932644, -0.03212518244981766, 0.05644390732049942, -0.01068441104143858, -0.012087414972484112, -0.006551846396178007, 0.02136882208287716, -0.015199203975498676, 0.020325563848018646, 0.06191202625632286, -0.048745378851890564, 0.0034580437932163477, 0.0561201386153698, 0.0023293455597013235, -0.04896122217178345, 0.04763016849756241, 0.03322240337729454, -0.03266479820013046, -0.019965818151831627, 0.033923905342817307, 0.007496175821870565, 0.08453994989395142, 0.006335999816656113, -0.008539434522390366, 0.017420627176761627, -0.038096942007541656, 0.041442565619945526, -0.002792516490444541, 0.015055306255817413, -0.03985968977212906, -0.0069790431298315525, -0.03496716171503067, -0.014200913719832897, 0.022789813578128815, 0.04568754881620407, -0.0232754684984684, -0.008125727996230125, 0.019030483439564705, -0.0649338811635971, -0.007451207377016544, -0.06727221608161926, 0.002875707345083356, -0.0014816975453868508, 0.10662826150655746, -0.019965818151831627, -0.012698980048298836, -0.0560481883585453, -0.050184354186058044, 0.006745208986103535, -0.04629911482334137, -0.03404981642961502, -0.02554185874760151, -0.010405609384179115, -0.0298228170722723, -0.05263061821460724, -0.028096044436097145, -0.014425753615796566, -0.0429534912109375, -0.019480163231492043, -0.03903227671980858, -0.004784601740539074, -0.028923455625772476, -0.03018256276845932, -0.004269717261195183, 0.002274259692057967, -0.002792516490444541, -0.0382048636674881, -0.02100907824933529, 0.00855292472988367, -0.020127704367041588, 0.0017897287616506219, -0.005935783963650465, -0.017726410180330276, -0.0019819673616439104, 0.017312703654170036, -0.08274123072624207, 0.008809243328869343, 0.0548970066010952, -0.027736298739910126, -0.050867870450019836, 0.0005609765648841858, -0.01351739838719368, -0.030776141211390495, 0.02775428630411625, 0.006470903754234314, 0.009317382238805294, 0.013607335276901722, -0.02280779927968979, -0.08338876813650131, -0.016125546768307686, -0.04244984686374664, 0.054717134684324265, -0.022160260006785393, 0.027178695425391197, -0.03631620481610298, -0.004161793738603592, 0.030416395515203476, -0.022520003840327263, -0.019749971106648445, 0.029732881113886833, 0.004575500264763832, 0.011268995702266693, -0.021099014207720757, 0.017474588006734848, 0.03048834390938282, -0.004793595056980848, 0.010405609384179115, 0.03570463880896568, 0.01976795867085457, -0.007293819449841976, 0.0016492035938426852, 0.01594567485153675, -0.023761123418807983, -0.01926431618630886, -0.004420360084623098, -0.061768125742673874, 0.05705547332763672, 0.0081931808963418, 0.02689089998602867, 0.03178342431783676, 0.05799081176519394, -0.014920402318239212, 0.020829206332564354, 0.0555085726082325, 0.05104774236679077, 0.010738372802734375, -0.06360282748937607, 0.06932276487350464, -0.016934972256422043, 0.041694384068250656, -0.003239948768168688, 0.01514524221420288, 0.022520003840327263, 0.003781813895329833, 0.006898100487887859, -0.021494733169674873, -0.011529810726642609, 0.0019313781522214413, 0.00981203094124794, 0.033402275294065475, -0.02385105937719345, -0.0003552476700861007, -0.00018057486158795655, 0.02816799283027649, -0.032107193022966385, -0.0060077328234910965, 0.04367297887802124, 0.023653199896216393, 0.008337078616023064, -0.02996671572327614, -0.036082372069358826, 0.005153339821845293, 0.011925529688596725, 0.039068251848220825, 0.006434929557144642, -0.07140927761793137, 0.04806186258792877, -0.052810490131378174, 0.008615880273282528, 0.0668405219912529, -0.07655362784862518, -0.07482685148715973, -0.0342656634747982, -0.02358125150203705, 0.0055130841210484505, 0.015307127498090267, -0.022052336484193802, -0.057810936123132706, -0.03178342431783676, -0.012752941809594631, 0.04626313969492912, 0.041478537023067474, 0.07928768545389175, -0.02399495616555214, -0.033096492290496826, 0.049320969730615616, -0.006556343287229538, 0.043744929134845734, -0.019246330484747887, -0.01603561080992222, 0.020901154726743698, -0.07533049583435059, -0.01807715930044651, -0.044680263847112656, 0.06011330336332321, -0.0470905527472496, -0.014875434339046478, 0.023869046941399574, 0.06237969174981117, 0.07482685148715973, 0.016548246145248413, 0.043601032346487045, 0.04223400354385376, 0.059825506061315536, 0.025020228698849678, 0.019048471003770828, -0.01962406188249588, 0.0774889588356018, -0.015594922937452793, -0.0031275285873562098, -0.025577832013368607, 0.009416311979293823, -0.04870940372347832, 0.02277182601392269, 0.009281408041715622, -0.07712921500205994, -0.07202084362506866, 0.039068251848220825, -0.010279698297381401, 0.0304343830794096, 0.04475221410393715, -0.03408578783273697, -0.0388164296746254, 0.01992984488606453, 0.04442844167351723, 0.04680275544524193, 0.019749971106648445, 0.000603696214966476, 0.08029496669769287, -0.01774439588189125, 0.005355695728212595, -0.02957099676132202, -0.03151361644268036, 0.016098566353321075, -0.015370083041489124, -0.04806186258792877, 0.0265311561524868, 0.02091914229094982, -0.04140659049153328, -0.027052784338593483, -0.007716519292443991, -0.04043528065085411, -0.01758251152932644, 0.022789813578128815, 0.052091002464294434, 0.019857894629240036, 0.04101087152957916, -0.047558221966028214, 0.004242736380547285, -0.03985968977212906, -0.023059621453285217, -0.02662109211087227, -0.04129866510629654, -0.019138406962156296, 0.04554365202784538, 0.01769043505191803, -0.04460831731557846, -0.07727311551570892, 0.07076174020767212, 0.04798991233110428, 0.006920584477484226, 0.007001527119427919, 0.028455788269639015, -0.01583775132894516, -0.08058276027441025, -0.035416845232248306, 0.000503642251715064, -0.01722276769578457, -0.03225109353661537, 0.007397246081382036, -0.014290849678218365, -0.04500403627753258, 0.05424946919083595, -0.011781631968915462, 0.004739633295685053, 0.04367297887802124, -0.010630449280142784, 0.02827591635286808, 0.02858169935643673, 0.006565336603671312, 0.03683783486485481, 0.024192815646529198, 0.052198924124240875, 0.043133363127708435, 0.001923508825711906, -0.00326468120329082, -0.022627927362918854, 0.02698083594441414, -0.02559581957757473, -0.007280328776687384, 0.058170683681964874, 0.06417841464281082, -0.01868872530758381, -0.03892435133457184, 0.015127255581319332, 0.04996850714087486, -0.049464866518974304, 0.07112148404121399, -0.0656893402338028, -0.01675509847700596, -0.007406239397823811, 0.029840804636478424, 0.06475400924682617, 0.03660400211811066, 0.022430067881941795, 0.005661478731781244, 0.007086966186761856, 0.011502829380333424, -0.02271786332130432, 0.023815084248781204, -0.024948280304670334, 0.016845034435391426, 0.03297058120369911, 0.11029765754938126, -0.055400650948286057, 0.039427995681762695, 0.03563269227743149, -0.05939381197094917, 0.0012692235177382827, -0.03838473558425903, -0.027826234698295593, 0.007613092660903931, 0.004557512700557709, -0.04971668869256973, -0.03795304149389267, -0.009434298612177372, 0.0217825286090374, 0.014893421903252602, -0.10108819603919983, -0.04453636705875397, 0.0035322410985827446, 0.01946217566728592, 0.025164125487208366, -0.0316215381026268, 0.02318553254008293, 0.013040737248957157, 0.07561828941106796, -0.033348314464092255, -0.006309018936008215, 0.008723803795874119, 0.015460018999874592, -0.02050543576478958, -0.014839460141956806, -0.0471625030040741, 0.009946934878826141, -0.025739718228578568, 0.022825786843895912, -0.012806903570890427, -0.010837302543222904, 0.05320620909333229, 0.009650145657360554, 0.03687380999326706, -0.0021697089541703463, -0.023095594719052315, 0.018346969038248062, 0.05514882877469063, 0.03462540730834007, -0.03773719444870949, 0.06155228242278099, -0.004708155989646912, 0.034535471349954605, 0.03791706636548042, -0.00895763747394085, -0.033708058297634125, 0.03203524649143219, 0.02960697002708912, 0.010153788141906261, -0.032574862241744995, -0.004762117750942707, 0.041334640234708786, -0.09195069223642349, 0.017987223342061043, 0.008260632865130901, 0.012815897352993488, 0.06101266294717789, 0.04162243753671646, -0.006956558674573898, -0.0342656634747982, 0.0471625030040741, 0.03065023012459278, -0.030614254996180534, 0.004146055318415165, -0.03248492628335953, 0.08302902430295944, -0.04557962715625763, 0.06489790230989456, -0.007230863906443119, -0.03527294471859932, -0.015073293820023537, -0.04288154095411301, -0.07065381854772568, 0.01982192136347294, 0.0007593980990350246, 0.03770122304558754, -0.005333211738616228, 0.022699877619743347, -0.010576487518846989, -0.04773809388279915, -0.007968340069055557, -0.0021056293044239283, -0.018140114843845367, 0.0008982369909062982, 0.04712652787566185, -0.006385464686900377, 0.02255597896873951, 0.04255777224898338, 0.045651573687791824, 0.014497702941298485, -0.05500493198633194, 0.026243360713124275, -0.048997197300195694, 0.001858305069617927, -0.02394099533557892, 0.06752403825521469, 0.00015190773410722613, -0.07263240963220596, 0.04917706921696663, 0.045867420732975006, -0.03737745061516762, -0.045399755239486694, -0.026495181024074554, -0.03457144275307655, 0.024894317612051964, -0.012501120567321777, -0.011475848965346813, 0.02620738558471203, -0.05871029943227768, -0.05644390732049942, 0.002601402346044779, -0.020055754110217094, -0.002695835195481777, 0.025919590145349503, 0.017600499093532562, 0.010360641404986382, 0.011826599948108196, 0.003035343950614333, 0.016818054020404816, 0.035668663680553436, -0.0065023815259337425, 0.031603552401065826, -0.0006351738702505827, 0.05155138298869133, 0.01061246171593666, -0.005450129043310881, -0.010549507103860378, -0.04806186258792877, 0.0020741517655551434, -0.027574414387345314, 0.03038042224943638, -0.02435470186173916, -0.027106747031211853, 0.047306399792432785, 0.02280779927968979, -0.0025991539005190134, 0.024606522172689438, -0.017402639612555504, -0.030110612511634827, -0.008148212917149067, 0.021458758041262627, -0.013229602947831154, -0.07655362784862518, -0.02421080321073532, -0.0036671452689915895, -0.000961754412855953, 0.048853300511837006, -0.003768323455005884, -0.046011317521333694, 0.023203518241643906, -0.05104774236679077, 0.00435965321958065, 0.0331144779920578, 0.0632430762052536, -0.013679283671081066, -0.02086517959833145, 0.02993074059486389, -0.013022750616073608, 0.005895312875509262, 0.06658869981765747, -0.03975176438689232, -0.004575500264763832, -0.019642049446702003, -0.007896391674876213, 0.015909699723124504, 0.03048834390938282, -0.024642497301101685, 0.04414064809679985, -0.004658691119402647, 0.03246694058179855, 0.028779558837413788, 0.01669214479625225, -0.03120783343911171, -0.026944860816001892, -0.026998823508620262, -0.00910603255033493, -0.010756360366940498, 0.05701950192451477, 0.023167544975876808, -0.016602206975221634, -0.04450039193034172, 0.0608687661588192, 0.002853223355486989, 0.01998380571603775, -0.03214316815137863, 0.06119253486394882, -0.008026798255741596, 0.013562367297708988, 0.05676767975091934, 0.03985968977212906, -0.015693852677941322, 0.06040109694004059, -0.00496897054836154, 0.03766524791717529, -0.014812478795647621, 0.026081474497914314, -0.009515241719782352, -0.011583772487938404, 0.0035030117724090815, -0.003352368948981166, 0.052198924124240875, -0.030344447121024132, 0.018230050802230835, -0.024732433259487152, 0.028815532103180885, -0.03552476689219475, -0.05227087438106537, -0.040039561688899994, -0.03297058120369911, -0.0012366216396912932, 0.024696458131074905, -0.0441766232252121, 0.01921035535633564, -0.006457413546741009, 0.01992984488606453, 0.0035682155285030603, 0.04209010303020477, -0.020613359287381172, -0.04392480105161667, -0.021548693999648094, 0.005854841321706772, 0.019138406962156296, -0.008422517217695713, -0.015486999414861202, -0.015469012781977654, 0.003487273119390011, 0.032215118408203125, 0.054357390850782394, -0.0327727235853672, 0.06504180282354355, -0.02498425357043743, -0.010333660058677197, -0.0010859786998480558, -0.004492309410125017 ]
39,425
pyspark.sql.dataframe
take
Returns the first ``num`` rows as a :class:`list` of :class:`Row`. .. versionadded:: 1.3.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Parameters ---------- num : int Number of records to return. Will return this number of records or all records if the DataFrame contains less than this number of records.. Returns ------- list List of rows Examples -------- >>> df = spark.createDataFrame( ... [(14, "Tom"), (23, "Alice"), (16, "Bob")], ["age", "name"]) Return the first 2 rows of the :class:`DataFrame`. >>> df.take(2) [Row(age=14, name='Tom'), Row(age=23, name='Alice')]
def take(self, num: int) -> List[Row]: """Returns the first ``num`` rows as a :class:`list` of :class:`Row`. .. versionadded:: 1.3.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Parameters ---------- num : int Number of records to return. Will return this number of records or all records if the DataFrame contains less than this number of records.. Returns ------- list List of rows Examples -------- >>> df = spark.createDataFrame( ... [(14, "Tom"), (23, "Alice"), (16, "Bob")], ["age", "name"]) Return the first 2 rows of the :class:`DataFrame`. >>> df.take(2) [Row(age=14, name='Tom'), Row(age=23, name='Alice')] """ return self.limit(num).collect()
(self, num: int) -> List[pyspark.sql.types.Row]
[ 0.021175917237997055, -0.0309776421636343, -0.027762815356254578, 0.015820786356925964, 0.010352088138461113, 0.07118043303489685, 0.01801350712776184, -0.015523764304816723, 0.02194467931985855, -0.024879956617951393, -0.006342292297631502, 0.005307083483785391, -0.014615226536989212, -0.014886041171848774, 0.004713039379566908, -0.020180020481348038, 0.028758713975548744, -0.007530380040407181, -0.0025771022774279118, 0.05356878042221069, 0.004247850738465786, 0.021962152794003487, 0.037040382623672485, 0.03197353705763817, -0.06995740532875061, 0.07072616368532181, -0.006910128053277731, 0.016344942152500153, 0.021001199260354042, 0.008329718373715878, -0.032689884305000305, 0.01723600924015045, -0.045461829751729965, -0.004103707615286112, -0.06482066959142685, 0.04238677769899368, 0.004778558854013681, -0.05832113325595856, 0.0756881833076477, 0.0325675830245018, -0.008858243003487587, 0.0034266721922904253, 0.06674257665872574, -0.030907753854990005, -0.07240346819162369, -0.016519661992788315, 0.03532813861966133, -0.032357919961214066, -0.014056126587092876, 0.0026164138689637184, 0.03784409165382385, 0.0891764685511589, -0.023971417918801308, -0.01254480890929699, -0.051786649972200394, -0.060906969010829926, -0.034559376537799835, -0.0438893586397171, -0.0009625913226045668, 0.02330748736858368, 0.009583326056599617, -0.027815232053399086, -0.02236400544643402, 0.023377373814582825, 0.07491941750049591, -0.033912915736436844, 0.004564528353512287, -0.0040469239465892315, -0.034227412194013596, -0.02096625417470932, 0.03274230286478996, 0.044273741543293, -0.0028828601352870464, 0.06583403795957565, -0.07960188388824463, -0.02699405327439308, 0.006019062362611294, 0.01745440810918808, 0.01843283325433731, -0.04413396492600441, 0.06995740532875061, 0.010981076397001743, -0.02306288108229637, 0.014353148639202118, 0.0018389152828603983, 0.009792988188564777, 0.046859581023454666, -0.011618799529969692, -0.037739258259534836, 0.024914899840950966, -0.03508353233337402, 0.06782583147287369, -0.018520191311836243, -0.011365457437932491, 0.03592218458652496, -0.04542688652873039, -0.031239720061421394, -0.008425814099609852, -0.05440743267536163, -0.00503190141171217, -0.027762815356254578, 0.01890457235276699, -0.022818274796009064, -0.00655195489525795, -0.024320855736732483, -0.05765720084309578, -0.013619329780340195, -0.006962543819099665, -0.017585447058081627, 0.08889692276716232, -0.009827932342886925, 0.0452871099114418, -0.0189569890499115, 0.02030232362449169, -0.01698266714811325, 0.015532500110566616, 0.02349967695772648, -0.002579286228865385, -0.04196745529770851, -0.008434549905359745, 0.03725004568696022, 0.029405172914266586, 0.0013780944282189012, -0.043784528970718384, -0.05957910791039467, 0.07673649489879608, 0.051122717559337616, -0.08225760608911514, 0.022713443264365196, -0.002788948593661189, 0.07687626779079437, -0.021455466747283936, 0.028374331071972847, 0.02049451507627964, -0.0009254636242985725, -0.04322542995214462, 0.04521722346544266, 0.028793657198548317, 0.017725221812725067, -0.0008954338263720274, -0.0013879224425181746, -0.019201595336198807, 0.022538723424077034, 0.08253715932369232, -0.03538055345416069, -0.07408076524734497, 0.03183376416563988, 0.0007714926614426076, 0.024268440902233124, 0.020232435315847397, -0.017113706097006798, 0.01608286425471306, 0.019061820581555367, -0.04095408320426941, -0.03658611327409744, 0.019428730010986328, 0.03153674304485321, -0.05231080576777458, 0.013418403454124928, -0.06660280376672745, -0.011950765736401081, 0.03655117005109787, 0.0011302122147753835, 0.006888288538902998, -0.06401696801185608, 0.04553171619772911, -0.03158915787935257, 0.006757249124348164, -0.042002398520708084, -0.006993119604885578, 0.08351558446884155, 0.04081431031227112, 0.09190208464860916, -0.01424831710755825, -0.03903217986226082, 0.1290123611688614, 0.02157776989042759, 0.02475765347480774, 0.03693555295467377, -0.0021457651164382696, 0.024443158879876137, -0.05213608592748642, -0.022521251812577248, -0.022905632853507996, 0.0293877013027668, -0.031851235777139664, -0.036341506987810135, -0.040919139981269836, 0.0389273464679718, 0.006905760150402784, 0.004029452335089445, -0.01834547333419323, 0.013365987688302994, 0.03627162054181099, -0.03534561023116112, -0.02409372106194496, -0.01024725753813982, 0.06401696801185608, -0.05804158374667168, 0.03934667259454727, 0.007211518008261919, -0.0021752489265054464, 0.03253263980150223, -0.074290432035923, 0.03426235541701317, -0.017026346176862717, -0.05671371892094612, -0.026242762804031372, -0.009845403954386711, -0.0003529865643940866, 0.006945071741938591, -0.013112645596265793, 0.02676691859960556, 0.037599485367536545, 0.020319795235991478, -0.031047528609633446, 0.0025836541317403316, -0.0609419159591198, 0.0587754026055336, -0.05611967667937279, 0.0662883073091507, -0.04441351816058159, -0.05297473818063736, 0.006254932843148708, 0.05157698690891266, 0.00016980482905637473, 0.012466185726225376, -0.07184436917304993, 0.01333977933973074, 0.00802832841873169, 0.003837261348962784, -0.042002398520708084, 0.03284713253378868, -0.039800941944122314, -0.00015574542339891195, 0.045182280242443085, -0.016607021912932396, 0.009085376746952534, 0.059404388070106506, -0.04787294939160347, -0.03440212830901146, 0.052066199481487274, -0.004660623613744974, 0.016178959980607033, -0.05957910791039467, 0.033056795597076416, -0.08952590823173523, 0.06656786054372787, -0.029125623404979706, 0.006285508628934622, 0.004365785978734493, -0.002684117527678609, 0.05199631303548813, 0.0064558591693639755, 0.0002811880549415946, -0.045042503625154495, -0.00885387510061264, -0.05922967195510864, -0.045601606369018555, 0.03377314284443855, 0.057342708110809326, -0.033476121723651886, -0.013531970791518688, -0.0014457979705184698, -0.040080491453409195, 0.0023521517869085073, -0.08903669565916061, 0.005403178744018078, 0.020669233053922653, 0.06960796564817429, 0.02573607861995697, 0.047523509711027145, -0.025980684906244278, -0.04902609437704086, 0.023377373814582825, -0.06779088824987411, -0.03609690070152283, 0.005307083483785391, -0.03609690070152283, -0.0146938506513834, -0.08680029213428497, -0.010518071241676807, -0.03934667259454727, 0.009557117708027363, -0.02302793599665165, -0.03370325639843941, 0.017795108258724213, 0.03214825689792633, -0.032357919961214066, -0.0022538723424077034, -0.01200318057090044, 0.029772082343697548, 0.004201986826956272, -0.06240955367684364, -0.00954838190227747, -0.003064130898565054, -0.004407281521707773, -0.009233888238668442, -0.02676691859960556, 0.0032082737889140844, 0.056364282965660095, -0.06517010927200317, -0.004734879359602928, 0.0591597817838192, -0.027203716337680817, -0.033528536558151245, -0.012134220451116562, -0.03176387771964073, -0.017358312383294106, 0.0028719401452690363, -0.002345599699765444, 0.02657472901046276, 0.018887100741267204, -0.003503111656755209, -0.039940714836120605, -0.04811755567789078, -0.05269518867135048, 0.04402913525700569, -0.03019140660762787, -0.014021183364093304, -0.005748248193413019, -0.01867743954062462, -0.004695567302405834, -0.029073206707835197, -0.022206759080290794, 0.060906969010829926, -0.026592200621962547, -0.005254667717963457, -0.04472801089286804, 0.01656334102153778, -0.0031733301002532244, 0.0382983572781086, 0.02082647942006588, 0.025631247088313103, -0.04333025962114334, 0.008556853048503399, 0.018642494454979897, 0.05500147491693497, -0.03508353233337402, 0.02241642028093338, 0.0035795513540506363, -0.08798838406801224, 0.05199631303548813, -0.007351293228566647, 0.01993541419506073, 0.02718624472618103, 0.05115766078233719, -0.04630047827959061, 0.04731385037302971, -0.02161271497607231, 0.05783192068338394, 0.001323494827374816, -0.006298612337559462, 0.04871159791946411, 0.024373270571231842, 0.063353031873703, -0.01767280511558056, 0.04137340933084488, -0.006123893428593874, -0.004787294659763575, 0.060767196118831635, -0.01974322274327278, -0.008120056241750717, -0.006464595440775156, 0.020459569990634918, 0.059404388070106506, -0.026662087067961693, -0.0009412975050508976, -0.051961369812488556, 0.0541977696120739, -0.0002525232557673007, 0.017000138759613037, 0.009286304004490376, 0.022206759080290794, 0.024792596697807312, -0.05147215723991394, -0.03139696642756462, 0.014781209640204906, 0.0007840505568310618, 0.050563618540763855, 0.006770353298634291, -0.040360040962696075, 0.03448949009180069, -0.017113706097006798, -0.010264729149639606, 0.02143799513578415, -0.06139618158340454, -0.0728926807641983, -0.013348516076803207, -0.045566659420728683, -0.0009347455343231559, 0.024530518800020218, -0.01575089991092682, -0.020110132172703743, -0.004341762047261, -0.04909598082304001, 0.01960344798862934, 0.016598286107182503, 0.06440134346485138, -0.017113706097006798, -0.04333025962114334, 0.022730914875864983, -0.01881721429526806, 0.01909676380455494, -0.04308565333485603, -0.001027564867399633, -0.01190708577632904, -0.05989360064268112, -0.028182141482830048, -0.05709810182452202, 0.029003320261836052, -0.02367439679801464, 0.0005402632523328066, 0.013837728649377823, 0.08784861117601395, 0.055106308311223984, 0.023709340021014214, 0.07331200689077377, 0.006765985395759344, 0.030523372814059258, 0.014982135966420174, -0.02147294022142887, -0.05199631303548813, 0.09371916204690933, -0.0006000498542562127, -0.000889427843503654, 0.007823034189641476, 0.0375295951962471, 0.01647598296403885, -0.018991932272911072, -0.03962622210383415, -0.06419168412685394, -0.06915369629859924, 0.004042556043714285, -0.005927335005253553, 0.012597224675118923, -0.007609003223478794, -0.022171813994646072, -0.06265415996313095, -0.004647519905120134, 0.0639820247888565, 0.03389544412493706, -0.0013398746959865093, -0.02554388716816902, 0.08645085990428925, -0.027413377538323402, -0.006543218623846769, 0.01672932505607605, -0.05517619475722313, -0.013042758218944073, 0.0034397761337459087, -0.0283044446259737, 0.06153595820069313, -0.007058639079332352, 0.0044094654731452465, 0.018310530111193657, -0.052765075117349625, -0.037879034876823425, -0.01041323971003294, 0.014117278158664703, 0.07827401906251907, 0.01767280511558056, 0.004387625493109226, -0.02835685946047306, 0.020197492092847824, -0.013112645596265793, -0.05367361381649971, -0.018659966066479683, -0.04682463780045509, -0.023150239139795303, 0.05398810654878616, 0.017166120931506157, -0.011810990050435066, -0.07100571691989899, 0.09777263551950455, 0.026697032153606415, -0.025805965065956116, -0.010631638579070568, 0.037983864545822144, -0.007526012137532234, -0.032270561903715134, -0.0024766388814896345, 0.020739121362566948, 0.008080744184553623, -0.04811755567789078, 0.03780914470553398, -0.024408215656876564, -0.02129822038114071, 0.027360962703824043, 0.0012667112750932574, 0.010535542853176594, 0.031466852873563766, 0.015768371522426605, 0.03850802034139633, -0.009225152432918549, 0.015008344314992428, 0.045566659420728683, 0.049305643886327744, 0.014501660130918026, 0.06611359119415283, 0.010605430230498314, -0.007176574319601059, -0.013016549870371819, 0.03541550040245056, -0.022398948669433594, 0.032497696578502655, 0.021892264485359192, 0.029737139120697975, 0.010823829099535942, -0.05489664524793625, 0.028985846787691116, 0.06384224444627762, -0.04004554823040962, 0.052485525608062744, -0.007421180605888367, -0.007954073138535023, 0.030121520161628723, 0.037879034876823425, 0.028933431953191757, 0.008242359384894371, 0.033056795597076416, 0.005184780340641737, -0.0210536140948534, 0.042142171412706375, -0.002764924895018339, 0.019620919600129128, -0.020878896117210388, -0.01113832276314497, 0.04119868949055672, 0.09434814751148224, -0.03941655904054642, 0.04941047355532646, -0.004835342522710562, -0.031659044325351715, 0.007543483749032021, -0.022678500041365623, -0.03211331367492676, 0.003741166088730097, 0.061605844646692276, -0.005739512387663126, -0.030034160241484642, -0.003957380540668964, -0.001183719839900732, 0.06359764188528061, -0.06122146546840668, -0.0339653342962265, -0.021490411832928658, 0.010587958618998528, 0.012431241571903229, -0.052240919321775436, 0.036481283605098724, 0.008124424144625664, 0.06380730122327805, -0.051122717559337616, 0.014012446627020836, -0.019393784925341606, 0.02381417155265808, -0.0235346220433712, -0.03181629255414009, -0.05437248945236206, 0.024233495816588402, -0.06712695956230164, 0.014187165535986423, 0.00814189575612545, -0.01647598296403885, 0.010850036516785622, 0.022992992773652077, 0.02255619689822197, -0.012649640440940857, -0.0552111379802227, 0.0293877013027668, 0.0295798908919096, -0.00579192815348506, 0.012204107828438282, 0.030086575075984, -0.008609268814325333, 0.03480398282408714, 0.02994680032134056, -0.06199022755026817, -0.011216946877539158, 0.03069809079170227, 0.019917942583560944, 0.005669625010341406, -0.0132000045850873, -0.06915369629859924, 0.019428730010986328, -0.07023695111274719, -0.026137931272387505, -0.007001855410635471, 0.004970749840140343, 0.07006223499774933, -0.015209270641207695, -0.030348654836416245, 0.0051760440692305565, 0.024775125086307526, 0.021403051912784576, -0.026731975376605988, -0.0329519659280777, -0.03403522074222565, 0.0693284198641777, -0.04102397337555885, 0.043120596557855606, 0.031082473695278168, 0.010509335435926914, -0.01237882673740387, -0.005464330315589905, -0.0662883073091507, 0.03209584206342697, 0.007770618423819542, 0.03962622210383415, -0.011426609009504318, -0.0014512579655274749, -0.02194467931985855, -0.061605844646692276, -0.02110603079199791, 0.013549442403018475, -0.019288955256342888, -0.0064340196549892426, 0.03541550040245056, -0.017332104966044426, -0.017812579870224, 0.017559237778186798, 0.023080352693796158, 0.014589019119739532, -0.0348563976585865, -0.011959501542150974, -0.01853766292333603, -0.011531440541148186, -0.0024875588715076447, 0.03555527329444885, 0.029702194035053253, -0.07456997781991959, 0.06384224444627762, 0.008565588854253292, -0.02246883697807789, -0.023726811632514, -0.025631247088313103, -0.010107481852173805, 0.03225309029221535, -0.04598598554730415, 0.012946662493050098, 0.0435049794614315, -0.05629439279437065, -0.035031117498874664, 0.04951530694961548, -0.05003946274518967, -0.04277116060256958, 0.024967314675450325, 0.04623059183359146, 0.0037127742543816566, -0.0035708153154700994, -0.006674258038401604, 0.030016688629984856, 0.05073833838105202, -0.005604105070233345, 0.020372211933135986, -0.007102319039404392, 0.018223170191049576, 0.008622372522950172, 0.01984805427491665, -0.00010203304555034265, -0.03314415365457535, 0.03459431976079941, -0.031327079981565475, 0.010072538629174232, -0.01909676380455494, -0.04277116060256958, -0.0006082397885620594, -0.03005163185298443, 0.023796699941158295, 0.027203716337680817, 0.011942028999328613, 0.01174983847886324, -0.005957910791039467, 0.043260373175144196, 0.019970357418060303, -0.06139618158340454, -0.052345748990774155, -0.02297552116215229, 0.005189148243516684, -0.024443158879876137, -0.021175917237997055, -0.035677578300237656, -0.009880348108708858, -0.06841988116502762, -0.01881721429526806, -0.026033099740743637, 0.016353677958250046, 0.0019896102603524923, 0.01825811341404915, 0.04151318594813347, -0.03913700953125954, 0.018887100741267204, 0.04409902170300484, -0.07960188388824463, 0.014274525456130505, -0.021542826667428017, -0.004638784099370241, 0.01734084077179432, 0.059124838560819626, 0.00833845417946577, 0.041757792234420776, -0.002570550190284848, 0.02835685946047306, 0.00506684510037303, -0.020739121362566948, -0.03672588989138603, -0.002788948593661189, 0.015532500110566616, -0.008382134139537811, -0.020581873133778572, 0.02681933529675007, 0.010614166967570782, 0.007285773754119873, -0.03644634038209915, 0.04839710518717766, 0.0006988751702010632, 0.026050571352243423, -0.02503720298409462, 0.04664991796016693, -0.004586368333548307, -0.055525630712509155, 0.045042503625154495, 0.060243040323257446, -0.021735018119215965, 0.10455172508955002, -0.000772038649301976, 0.018642494454979897, -0.01885215751826763, -0.008430182002484798, -0.01923653855919838, -0.01410854235291481, -0.0077618821524083614, -0.0038962289690971375, 0.05730776488780975, -0.0015910329530015588, 0.033056795597076416, -0.0022364004980772734, 0.05447731912136078, -0.05587507039308548, -0.05818135663866997, -0.020791536197066307, -0.007788090035319328, -0.04734879359602928, 0.006888288538902998, -0.043644752353429794, 0.05405799299478531, -0.023621980100870132, 0.001552813220769167, 0.022381477057933807, -0.006040902342647314, -0.006840240675956011, -0.005560425575822592, -0.014239581301808357, -0.04941047355532646, 0.03260252624750137, -0.03078545071184635, -0.021420523524284363, -0.029510004445910454, -0.03552033007144928, 0.021088557317852974, 0.08037064224481583, -0.03452443331480026, 0.06209505721926689, -0.05003946274518967, 0.0005722040659748018, 0.060906969010829926, 0.007788090035319328 ]
39,426
pyspark.sql.dataframe
to
Returns a new :class:`DataFrame` where each row is reconciled to match the specified schema. .. versionadded:: 3.4.0 Parameters ---------- schema : :class:`StructType` Specified schema. Returns ------- :class:`DataFrame` Reconciled DataFrame. Notes ----- * Reorder columns and/or inner fields by name to match the specified schema. * Project away columns and/or inner fields that are not needed by the specified schema. Missing columns and/or inner fields (present in the specified schema but not input DataFrame) lead to failures. * Cast the columns and/or inner fields to match the data types in the specified schema, if the types are compatible, e.g., numeric to numeric (error if overflows), but not string to int. * Carry over the metadata from the specified schema, while the columns and/or inner fields still keep their own metadata if not overwritten by the specified schema. * Fail if the nullability is not compatible. For example, the column and/or inner field is nullable but the specified schema requires them to be not nullable. Supports Spark Connect. Examples -------- >>> from pyspark.sql.types import StructField, StringType >>> df = spark.createDataFrame([("a", 1)], ["i", "j"]) >>> df.schema StructType([StructField('i', StringType(), True), StructField('j', LongType(), True)]) >>> schema = StructType([StructField("j", StringType()), StructField("i", StringType())]) >>> df2 = df.to(schema) >>> df2.schema StructType([StructField('j', StringType(), True), StructField('i', StringType(), True)]) >>> df2.show() +---+---+ | j| i| +---+---+ | 1| a| +---+---+
def to(self, schema: StructType) -> "DataFrame": """ Returns a new :class:`DataFrame` where each row is reconciled to match the specified schema. .. versionadded:: 3.4.0 Parameters ---------- schema : :class:`StructType` Specified schema. Returns ------- :class:`DataFrame` Reconciled DataFrame. Notes ----- * Reorder columns and/or inner fields by name to match the specified schema. * Project away columns and/or inner fields that are not needed by the specified schema. Missing columns and/or inner fields (present in the specified schema but not input DataFrame) lead to failures. * Cast the columns and/or inner fields to match the data types in the specified schema, if the types are compatible, e.g., numeric to numeric (error if overflows), but not string to int. * Carry over the metadata from the specified schema, while the columns and/or inner fields still keep their own metadata if not overwritten by the specified schema. * Fail if the nullability is not compatible. For example, the column and/or inner field is nullable but the specified schema requires them to be not nullable. Supports Spark Connect. Examples -------- >>> from pyspark.sql.types import StructField, StringType >>> df = spark.createDataFrame([("a", 1)], ["i", "j"]) >>> df.schema StructType([StructField('i', StringType(), True), StructField('j', LongType(), True)]) >>> schema = StructType([StructField("j", StringType()), StructField("i", StringType())]) >>> df2 = df.to(schema) >>> df2.schema StructType([StructField('j', StringType(), True), StructField('i', StringType(), True)]) >>> df2.show() +---+---+ | j| i| +---+---+ | 1| a| +---+---+ """ assert schema is not None jschema = self._jdf.sparkSession().parseDataType(schema.json()) return DataFrame(self._jdf.to(jschema), self.sparkSession)
(self, schema: pyspark.sql.types.StructType) -> pyspark.sql.dataframe.DataFrame
[ 0.01185927540063858, -0.02548382803797722, 0.0325637124478817, -0.05618836730718613, -0.025127016007900238, 0.0011179691646248102, -0.005863909609615803, 0.006718378514051437, -0.009610426612198353, 0.003664356656372547, -0.006225415505468845, -0.00047418323811143637, -0.013352248817682266, 0.023624654859304428, 0.00647424440830946, 0.024732647463679314, 0.02878902666270733, -0.007370966952294111, 0.07688341289758682, 0.08601026982069016, 0.021746700629591942, -0.0558127760887146, -0.00472774775698781, 0.024000244215130806, -0.015793588012456894, 0.02067626640200615, -0.019605834037065506, -0.013906245119869709, 0.008000081405043602, 0.02516457624733448, 0.025671623647212982, -0.030986230820417404, 0.0348735935986042, 0.012150358408689499, -0.044995762407779694, -0.014666816219687462, -0.027812490239739418, 0.00920197181403637, 0.07673317939043045, -0.01663866639137268, -0.029446309432387352, 0.00491084810346365, -0.02465752884745598, -0.06283631920814514, -0.0019741985015571117, 0.025934536010026932, 0.020244337618350983, -0.0050047459080815315, -0.005647944752126932, -0.05513671413064003, 0.02687351405620575, 0.036563754081726074, -0.04150277003645897, 0.014619867317378521, -0.05021647363901138, -0.012910929508507252, -0.04706151410937309, 0.038160014897584915, -0.014582308009266853, -0.03158717602491379, -0.020244337618350983, -0.004605680704116821, -0.05156860128045082, 0.0630616769194603, -0.005098643712699413, 0.02005654200911522, 0.0073850518092513084, -0.06317435204982758, -0.048338521271944046, -0.021540125831961632, -0.0286763496696949, -0.008169097825884819, -0.020319456234574318, 0.0878882184624672, -0.0423666276037693, -0.03194398805499077, 0.01852601021528244, -0.030760876834392548, -0.020995520055294037, -0.0353994220495224, 0.01436634361743927, -0.007201951462775469, -0.0769960880279541, -0.023023709654808044, 0.020394574850797653, 0.03705202043056488, 0.023136386647820473, 0.059193093329668045, -0.06272364407777786, -0.026291348040103912, 0.010394472628831863, -0.016676226630806923, -0.011089314706623554, -0.0047653065994381905, 0.018591739237308502, -0.005831045564264059, -0.014629256911575794, -0.03269517049193382, -0.011023586615920067, 0.0232490636408329, -0.03601914644241333, 0.046272773295640945, -0.07601955533027649, 0.03384071961045265, -0.0017558864783495665, -0.01864807680249214, 0.001984762027859688, -0.02144622802734375, 0.011061145924031734, -0.02200961485505104, -0.05431041121482849, 0.07481766492128372, -0.00845079030841589, -0.02961532585322857, 0.02351197600364685, -0.006723073311150074, 0.0174367967993021, -0.006352177355438471, -0.05513671413064003, 0.012150358408689499, 0.00016300048446282744, 0.05618836730718613, 0.05085497722029686, -0.08570979535579681, 0.0008673797128722072, 0.030272608622908592, 0.018281877040863037, -0.04247930645942688, 0.010497760027647018, 0.018047131597995758, -0.025596505030989647, 0.007873320020735264, -0.018460283055901527, 0.06970962882041931, -0.005511793307960033, 0.011887445114552975, -0.011089314706623554, -0.00803764071315527, -0.011849885806441307, 0.02129599265754223, -0.0045869010500609875, -0.03834781050682068, 0.05776584893465042, -0.02940875105559826, -0.024920441210269928, -0.004286428913474083, 0.01873258501291275, 0.0010674991644918919, -0.04123985767364502, 0.020807724446058273, 0.022028394043445587, -0.007849845103919506, 0.042554423213005066, -0.002137345727533102, -0.006324008107185364, -0.032882966101169586, 0.04796293005347252, -0.03064819984138012, 0.040075525641441345, -0.03344634920358658, -0.009859255515038967, 0.028507333248853683, 0.00256340648047626, 0.05126812681555748, -0.06783168017864227, 0.03419753164052963, 0.05859214812517166, -0.01286398060619831, -0.05179395526647568, -0.032939303666353226, 0.04946529492735863, 0.054385531693696976, 0.0646016001701355, -0.007939048111438751, -0.09141877293586731, 0.10426397621631622, 0.04578450322151184, 0.0012699660146608949, 0.010967248119413853, -0.018826482817530632, -0.011755988001823425, -0.011868665926158428, -0.04563426971435547, 0.06809458881616592, 0.022028394043445587, -0.013324079103767872, -0.10817011445760727, -0.0286763496696949, 0.04386899247765541, 0.024563631042838097, 0.007896794006228447, -0.009690240025520325, -0.00202466850169003, 0.03742761164903641, -0.013136284425854683, -0.08210412412881851, 0.03466701880097389, 0.005145592149347067, -0.07827309519052505, 0.09307137131690979, 0.05577521771192551, -0.025202134624123573, 0.048338521271944046, 0.011558803729712963, 0.018094081431627274, -0.013915634714066982, -0.03571867570281029, -0.040488675236701965, 0.04056379571557045, -0.03633840009570122, 0.011493074707686901, -0.032432254403829575, -0.0558127760887146, -0.03153083845973015, 0.007530593313276768, -0.01557762362062931, -0.03560599684715271, -0.010629216209053993, 0.05303340405225754, 0.009755968116223812, 0.0328078456223011, -0.01849784143269062, -0.06880821287631989, 0.024507291615009308, -0.02439461462199688, -0.004706620704382658, 0.03590646758675575, -0.030460404232144356, 0.04706151410937309, -0.08255483210086823, -0.011070535518229008, -0.06170954927802086, -0.019812408834695816, -0.050629623234272, 0.024976780638098717, 0.04890190809965134, -0.01519264280796051, -0.019812408834695816, 0.020188000053167343, -0.030159931629896164, -0.004068116657435894, 0.012000122107565403, 0.017014257609844208, 0.0008198440191335976, -0.01023484580218792, -0.004046989604830742, 0.011586972512304783, 0.0026784311048686504, -0.001516447402536869, -0.000404933700338006, -0.02878902666270733, -0.04293001443147659, 0.03720225766301155, 0.008380367420613766, 0.004591596312820911, -0.045033324509859085, 0.016159789636731148, 0.009915594011545181, -0.030253829434514046, -0.0009448453201912344, 0.0098216962069273, -0.054648444056510925, 0.005737147759646177, 0.04987844452261925, -0.007375662215054035, -0.06107104569673538, -0.057803407311439514, -0.01761520281434059, 0.04375631362199783, 0.03519284725189209, 0.03705202043056488, 0.0012652711011469364, -0.001562222489155829, -0.0009665591642260551, 0.04567182809114456, -0.03477969765663147, -0.061258841305971146, 0.00572306290268898, 0.009159717708826065, -0.029183397069573402, -0.019080007448792458, -0.044883087277412415, -0.006399126257747412, -0.05194419249892235, -0.03207544609904289, -0.010432031005620956, -0.024206819012761116, -0.017718490213155746, 0.001262923702597618, -0.03468579798936844, 0.0065681422129273415, 0.03534308448433876, -0.021220874041318893, 0.02336174063384533, -0.029784340411424637, 0.03519284725189209, -0.003492993302643299, -0.04634789004921913, 0.012075240723788738, -0.009507139213383198, -0.013812347315251827, -0.02200961485505104, 0.020751385018229485, 0.09254554659128189, 0.019286582246422768, -0.00018339388770982623, -0.058479469269514084, -0.06077057123184204, 0.00014143336738925427, 0.0516812764108181, 0.002692515728995204, 0.010929688811302185, -0.03727737441658974, 0.007352187763899565, -0.030347727239131927, -0.035793792456388474, 0.0013861643383279443, -0.039399463683366776, 0.03012237325310707, 0.007211341056972742, -0.026328906416893005, -0.01829126663506031, -0.013962583616375923, -0.015915654599666595, -0.0001094494728022255, 0.016450872644782066, -0.008525908924639225, 0.01449780073016882, 0.02262933924794197, -0.026385245844721794, 0.04480796679854393, 0.024995559826493263, 0.074930340051651, 0.0031807837076485157, -0.04071402922272682, -0.04646056890487671, 0.0031854785047471523, -0.05442309007048607, 0.006201941054314375, 0.030066033825278282, 0.03761540725827217, -0.011558803729712963, 0.04454505443572998, -0.049991119652986526, -0.007225425913929939, 0.004805213306099176, 0.02103307843208313, -0.04837607964873314, -0.007319323252886534, 0.018385164439678192, -0.004507088102400303, -0.006544667761772871, -0.023643434047698975, 0.047925371676683426, -0.022497881203889847, 0.01601894199848175, -0.04169056564569473, 0.013784178532660007, -0.005131507758051157, -0.022159850224852562, 0.045709386467933655, -0.01914573460817337, 0.012704354710876942, -0.04706151410937309, 0.03307075798511505, 0.04011308401823044, -0.03504261001944542, -0.029840679839253426, -0.014084650203585625, -0.013042386621236801, 0.049577970057725906, -0.015624572522938251, 0.012854591012001038, -0.0032300797756761312, -0.023436859250068665, 0.05622592568397522, -0.06144663691520691, 0.014554139226675034, -0.045296236872673035, -0.005985976662486792, 0.02067626640200615, -0.09442349523305893, 0.03301442041993141, -0.0025657538790255785, 0.03262005001306534, -0.02345563843846321, -0.022854693233966827, -0.058066319674253464, -0.040638912469148636, -0.00592963770031929, -0.06452647596597672, 0.031549617648124695, -0.000682518701069057, 0.021408669650554657, 0.001600955263711512, 0.04537135362625122, -0.019812408834695816, 0.026291348040103912, 0.06471427530050278, -0.010178507305681705, -0.018009573221206665, -0.05911797285079956, 0.043080251663923264, -0.0019049489637836814, -0.026441583409905434, 0.022084731608629227, 0.04477040842175484, -0.014413292519748211, -0.005427285563200712, 0.017126934602856636, 0.04912726208567619, 0.0035657640546560287, -0.044732850044965744, 0.05254513770341873, 0.038986314088106155, 0.05641372129321098, 0.06377530097961426, 0.03130548447370529, 0.018281877040863037, 0.09464885294437408, -0.00008194038673536852, 0.0033357148058712482, 0.006610395852476358, 0.04398166760802269, 0.004389716312289238, -0.0012347543379291892, -0.005056389607489109, -0.0037324323784559965, 0.026854733005166054, 0.04368119686841965, -0.002363873878493905, -0.000060299909819150344, -0.03772808238863945, 0.00940854661166668, 0.005962502211332321, 0.03872339800000191, 0.05908041447401047, -0.007530593313276768, 0.02563406340777874, 0.06753120571374893, 0.06279876083135605, -0.01286398060619831, 0.0019049489637836814, -0.046836160123348236, 0.002363873878493905, -0.011305280029773712, 0.01245083101093769, 0.008469569496810436, -0.07357821613550186, 0.009145633317530155, 0.0950995609164238, 0.023230284452438354, 0.012826422229409218, 0.015652742236852646, -0.07729656249284744, -0.031136468052864075, 0.051080331206321716, -0.03158717602491379, -0.018957938998937607, 0.030986230820417404, 0.0490897037088871, -0.04011308401823044, -0.00851182360202074, -0.012798252515494823, -0.003152614226564765, -0.010563488118350506, -0.04262954369187355, -0.0490897037088871, -0.03575623407959938, 0.013925024308264256, 0.050366710871458054, -0.027042528614401817, 0.017831167206168175, -0.04416946321725845, 0.07380356639623642, 0.017981404438614845, -0.05802876129746437, -0.0418408028781414, -0.03147450089454651, 0.01938048005104065, -0.10418885946273804, -0.023831229656934738, 0.010103389620780945, 0.004427275154739618, 0.044732850044965744, -0.013474315404891968, -0.028563670814037323, -0.018422722816467285, 0.038216352462768555, 0.006446075160056353, -0.03804733604192734, 0.0599442720413208, 0.020601149648427963, -0.017558865249156952, 0.01968095265328884, 0.03554965928196907, 0.021878156810998917, 0.040751587599515915, -0.05431041121482849, 0.03701446205377579, 0.03902387246489525, -0.006234805565327406, -0.05776584893465042, 0.04634789004921913, -0.029840679839253426, -0.045296236872673035, 0.04991600289940834, 0.0003509425441734493, -0.06948427855968475, -0.009356902912259102, -0.060282304883003235, 0.07106176018714905, -0.01212218962609768, 0.02775615081191063, -0.0408267080783844, -0.014657426625490189, -0.004523520357906818, 0.038986314088106155, 0.029014380648732185, -0.031042570248246193, -0.03849804401397705, -0.005605691112577915, 0.02366221323609352, 0.041052062064409256, -0.051493484526872635, 0.027192765846848488, 0.038685839623212814, 0.03171863406896591, 0.06542789936065674, 0.012629237025976181, -0.06050765886902809, 0.020375793799757957, 0.04206615686416626, 0.0012652711011469364, 0.010140948928892612, -0.015183253213763237, 0.027399340644478798, 0.029033159837126732, -0.015155084431171417, -0.02035701461136341, -0.021408669650554657, 0.022967370226979256, -0.06674246490001678, -0.059718918055295944, -0.03509894758462906, 0.006234805565327406, -0.016000162810087204, 0.011915614828467369, 0.05126812681555748, -0.03725859522819519, -0.04863899201154709, 0.009690240025520325, 0.0718505010008812, 0.046836160123348236, 0.003586891107261181, 0.0027253800071775913, 0.03312709927558899, 0.011925004422664642, 0.032995641231536865, -0.03115524724125862, -0.015004848130047321, -0.055362068116664886, 0.04232906922698021, -0.038066115230321884, 0.0012265383265912533, 0.05461088567972183, 0.04056379571557045, 0.05761561170220375, -0.02976556122303009, -0.05461088567972183, 0.044883087277412415, 0.006309923715889454, 0.013925024308264256, -0.09930617362260818, 0.04150277003645897, -0.03194398805499077, -0.038272690027952194, 0.07162514328956604, -0.03695812448859215, -0.02392512746155262, -0.02439461462199688, 0.04537135362625122, 0.036826666444540024, 0.028450993821024895, -0.02268567681312561, -0.0037981607019901276, -0.07301482558250427, 0.005225405562669039, 0.05817899852991104, -0.04796293005347252, 0.02433827705681324, -0.0067747170105576515, -0.0025657538790255785, -0.03115524724125862, 0.05235734209418297, 0.0004548168508335948, -0.05705222487449646, -0.02418803982436657, 0.05524938926100731, -0.03372804448008537, -0.04041355848312378, 0.02407536283135414, -0.049277499318122864, -0.0204133540391922, -0.01740862801671028, -0.011511854827404022, 0.004948407411575317, 0.04537135362625122, 0.06805703043937683, 0.005507098510861397, 0.04011308401823044, 0.04139009490609169, -0.002239459427073598, -0.04619765281677246, 0.006056399550288916, -0.02351197600364685, -0.048188284039497375, -0.05310852453112602, -0.004716010298579931, -0.060958366841077805, 0.016732564195990562, 0.014187938533723354, 0.046948835253715515, -0.014967288821935654, -0.030742097645998, 0.040225762873888016, -0.025803079828619957, -0.05746537446975708, -0.02026311680674553, -0.004589248448610306, 0.030742097645998, -0.07402892410755157, 0.027455678209662437, -0.027474459260702133, -0.0008239520830102265, -0.056714192032814026, -0.037540290504693985, -0.035117730498313904, 0.024019023403525352, 0.051343247294425964, -0.01116443332284689, 0.013474315404891968, 0.017418017610907555, -0.04631033167243004, -0.024732647463679314, -0.08548443764448166, 0.049014583230018616, -0.04800048843026161, -0.04480796679854393, -0.019549494609236717, -0.007821676321327686, 0.023943906649947166, 0.019662171602249146, -0.0027253800071775913, 0.07613223046064377, 0.09675215929746628, 0.00036062573781237006, 0.023436859250068665, 0.05089253932237625, 0.04522112011909485, 0.036094263195991516, -0.023850008845329285, 0.04578450322151184, 0.004403800703585148, 0.04691127687692642, 0.04277977719902992, 0.0035798486787825823, 0.0020270159002393484, 0.03226323798298836, 0.03906143084168434, -0.020807724446058273, 0.0516812764108181, -0.00608456926420331, 0.004774696659296751, 0.03678910806775093, -0.004863899201154709, -0.03171863406896591, -0.013756008818745613, 0.013305299915373325, -0.05209442973136902, 0.023380519822239876, 0.06077057123184204, 0.004678451456129551, -0.004129149951040745, -0.04800048843026161, -0.0501413568854332, 0.05750293284654617, 0.011389787308871746, -0.008385062217712402, -0.09262066334486008, 0.031230365857481956, -0.017530694603919983, -0.025709182024002075, 0.03663887083530426, -0.012694965116679668, 0.0271364264190197, -0.007887404412031174, -0.03372804448008537, -0.01116443332284689, 0.05855458602309227, 0.01923024281859398, 0.02702374942600727, 0.015587013214826584, 0.04893946647644043, 0.09630145132541656, 0.054948918521404266, 0.03879851847887039, -0.017540084198117256, 0.0062395003624260426, -0.05130568891763687, -0.032432254403829575, 0.07406648248434067, -0.0033944007009267807, 0.00123358063865453, 0.020526031032204628, 0.018986109644174576, -0.027624694630503654, 0.011352228000760078, -0.01004705112427473, 0.026272568851709366, 0.018479062244296074, -0.050930097699165344, 0.019220853224396706, 0.00891088880598545, 0.0006514150882139802, 0.0017547127790749073, -0.01613161899149418, 0.039662376046180725, 0.05791608244180679, -0.02631012722849846, -0.01994386501610279, 0.0333336740732193, 0.029652884230017662, 0.03205666318535805, 0.0299721360206604, -0.03605670481920242, 0.0016643361886963248, -0.015568234026432037, 0.012009511701762676, 0.012309984304010868, -0.013549434021115303, 0.03601914644241333, -0.017765440046787262, 0.004523520357906818, -0.0044084955006837845, -0.039098989218473434, 0.013727839104831219, 0.026779616251587868, -0.01861051842570305, 0.02604721486568451, -0.0015011889627203345, -0.03188765048980713, -0.015821756795048714, -0.05949356406927109, 0.05618836730718613, 0.03906143084168434, -0.013342859223484993, 0.05145592242479324, -0.016178568825125694, -0.061409078538417816, -0.026535481214523315, 0.011408567428588867, 0.01625368744134903, 0.05310852453112602, 0.007690219208598137, 0.0032441646326333284, 0.027211545035243034, 0.009220751002430916 ]
39,427
pyspark.sql.dataframe
toDF
Returns a new :class:`DataFrame` that with new specified column names .. versionadded:: 1.6.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Parameters ---------- *cols : tuple a tuple of string new column name. The length of the list needs to be the same as the number of columns in the initial :class:`DataFrame` Returns ------- :class:`DataFrame` DataFrame with new column names. Examples -------- >>> df = spark.createDataFrame([(14, "Tom"), (23, "Alice"), ... (16, "Bob")], ["age", "name"]) >>> df.toDF('f1', 'f2').show() +---+-----+ | f1| f2| +---+-----+ | 14| Tom| | 23|Alice| | 16| Bob| +---+-----+
def toDF(self, *cols: str) -> "DataFrame": """Returns a new :class:`DataFrame` that with new specified column names .. versionadded:: 1.6.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Parameters ---------- *cols : tuple a tuple of string new column name. The length of the list needs to be the same as the number of columns in the initial :class:`DataFrame` Returns ------- :class:`DataFrame` DataFrame with new column names. Examples -------- >>> df = spark.createDataFrame([(14, "Tom"), (23, "Alice"), ... (16, "Bob")], ["age", "name"]) >>> df.toDF('f1', 'f2').show() +---+-----+ | f1| f2| +---+-----+ | 14| Tom| | 23|Alice| | 16| Bob| +---+-----+ """ for col in cols: if not isinstance(col, str): raise PySparkTypeError( error_class="NOT_LIST_OF_STR", message_parameters={"arg_name": "cols", "arg_type": type(col).__name__}, ) jdf = self._jdf.toDF(self._jseq(cols)) return DataFrame(jdf, self.sparkSession)
(self, *cols: str) -> pyspark.sql.dataframe.DataFrame
[ 0.014420288614928722, -0.007982488721609116, 0.006341856904327869, -0.005459177773445845, -0.023985842242836952, 0.009584742598235607, 0.03104727528989315, 0.05806493014097214, -0.014420288614928722, 0.04881598800420761, -0.008054446429014206, 0.03173806890845299, -0.010026082396507263, 0.0171834584325552, 0.04221508279442787, 0.008174375630915165, 0.057335760444402695, -0.002402182202786207, 0.07533473521471024, 0.03246723860502243, -0.009997298941016197, -0.026115786284208298, 0.013038704171776772, 0.05652983486652374, -0.047357648611068726, 0.007593917660415173, 0.002998230280354619, -0.03287019953131676, 0.02603903040289879, 0.03196833282709122, -0.015581203624606133, -0.009824601002037525, 0.003389199497178197, 0.006624890025705099, -0.02976163476705551, 0.019553259015083313, -0.021932654082775116, 0.00772344134747982, 0.018708957359194756, -0.06631606072187424, 0.004559708759188652, -0.028380049392580986, 0.01890084333717823, -0.07130511105060577, -0.02250831574201584, 0.005559918470680714, 0.011158213950693607, -0.019217457622289658, 0.02099240943789482, -0.054495833814144135, 0.030183784663677216, -0.0206278245896101, -0.037091705948114395, -0.015849845483899117, -0.04037297144532204, 0.038300592452287674, -0.012952354736626148, 0.0400659516453743, -0.00325248041190207, -0.0005111983045935631, 0.016780495643615723, -0.013787062838673592, -0.01133091188967228, 0.048624102026224136, 0.016674958169460297, 0.06650794297456741, 0.01249182689934969, -0.0171834584325552, -0.06455069780349731, -0.020359182730317116, -0.04989055171608925, -0.049468401819467545, -0.03968217968940735, 0.10853113979101181, 0.014708118513226509, 0.008687672205269337, -0.04747277870774269, -0.044594477862119675, -0.04087187722325325, 0.00929691269993782, 0.009815006516873837, -0.061019983142614365, -0.0558006651699543, -0.04094862937927246, 0.037321969866752625, 0.0367463119328022, -0.0222012959420681, 0.015053515322506428, -0.007656280882656574, 0.023007219657301903, -0.06290047615766525, 0.009464813396334648, -0.03613227233290672, -0.0020016185007989407, -0.007517163176089525, -0.05510987341403961, -0.004816357046365738, 0.012184808030724525, 0.024580691009759903, 0.047664668411016464, 0.04102538526058197, 0.020148107782006264, -0.022623447701334953, 0.014497043564915657, -0.011868194676935673, -0.044210705906152725, -0.03713008388876915, -0.025463370606303215, -0.00151470594573766, -0.06382153183221817, -0.042099952697753906, 0.06765926629304886, 0.046321459114551544, -0.006951097398996353, -0.030241351574659348, 0.03501933068037033, 0.007641889620572329, -0.021798333153128624, -0.028456803411245346, -0.00541600352153182, -0.010534582659602165, 0.06359126418828964, -0.024254484102129936, -0.044210705906152725, -0.028111407533288002, 0.03599795326590538, 0.008615714497864246, -0.027478180825710297, 0.07084458321332932, 0.04866247996687889, 0.06336100399494171, -0.027286294847726822, 0.010400261729955673, 0.04497825354337692, 0.039490289986133575, 0.0002968248154502362, 0.02189427800476551, 0.0343669168651104, 0.01808532513678074, -0.0021863095462322235, -0.011071865446865559, -0.037763312458992004, 0.050658099353313446, 0.04659010097384453, -0.015840250998735428, 0.012088865041732788, 0.025923898443579674, -0.0039192866533994675, -0.05990704149007797, 0.0655868873000145, -0.04079512134194374, 0.026365239173173904, -0.01285641174763441, -0.04843221232295036, -0.013134647160768509, -0.02129942923784256, 0.00425508851185441, -0.006380234379321337, 0.005118578672409058, -0.031757257878780365, 0.030241351574659348, -0.009997298941016197, -0.024580691009759903, 0.08159024268388748, -0.00485953176394105, 0.03308127447962761, 0.01651185378432274, 0.019687579944729805, -0.014669741503894329, 0.015609986148774624, 0.05990704149007797, 0.04835546016693115, 0.06462745368480682, -0.01544688269495964, -0.08350910991430283, 0.03494257479906082, 0.027478180825710297, 0.03091295436024666, 0.03770574554800987, -0.04179293289780617, 0.005118578672409058, -0.03141186013817787, -0.059139493852853775, 0.01245344989001751, 0.04785655438899994, 0.012549392879009247, -0.08688631653785706, 0.010169997811317444, 0.034980952739715576, 0.016319967806339264, -0.0589476078748703, -0.02511797472834587, 0.043021008372306824, 0.07483582943677902, -0.011407666839659214, -0.04520851746201515, 0.004816357046365738, -0.005454380530864, -0.00903306808322668, 0.0609048530459404, 0.06336100399494171, 0.047280892729759216, 0.047664668411016464, -0.03369531035423279, 0.03651604801416397, 0.007071026600897312, -0.02565525844693184, -0.0273054838180542, 0.04052647948265076, -0.08750035613775253, 0.07214941829442978, -0.026288483291864395, -0.020205674692988396, -0.028591124340891838, 0.026537936180830002, 0.033560991287231445, -0.011599553748965263, -0.015466071665287018, 0.02266182377934456, -0.028552748262882233, 0.09563635289669037, 0.01620483584702015, -0.0613270029425621, 0.044287461787462234, 0.020359182730317116, -0.04010432958602905, 0.04708900675177574, -0.0273054838180542, -0.01643509976565838, -0.028380049392580986, -0.03743710368871689, -0.02571282349526882, 0.04447934776544571, -0.04589930921792984, 0.010956733487546444, 0.0589476078748703, -0.023007219657301903, -0.003382003866136074, 0.03104727528989315, -0.033944763243198395, -0.024312051013112068, 0.06451231986284256, 0.02055107057094574, -0.009786223992705345, 0.08304858207702637, 0.01499594934284687, -0.005392017308622599, 0.018181268125772476, -0.03292776644229889, 0.04693549871444702, 0.02175995707511902, -0.05603092908859253, -0.006265101954340935, 0.026192540302872658, -0.0011711088009178638, 0.030107030645012856, 0.029876766726374626, 0.03388720005750656, -0.0093784648925066, -0.0030150203965604305, -0.02003297582268715, -0.017663175240159035, -0.03975893184542656, 0.08320209383964539, -0.027401426807045937, -0.032966144382953644, -0.03202589601278305, -0.019246241077780724, 0.018766524270176888, 0.0030893764924257994, 0.08941922336816788, 0.037379536777734756, 0.013959760777652264, -0.01633915677666664, 0.04183131083846092, -0.03231372684240341, -0.0035930792801082134, -0.03398314118385315, -0.06785115599632263, -0.011743469163775444, 0.019553259015083313, -0.06604741513729095, -0.030337294563651085, 0.055378515273332596, -0.020339995622634888, 0.03824302926659584, -0.011359695345163345, -0.03444366902112961, -0.0011369289131835103, -0.039048951119184494, 0.02932029403746128, 0.03741791471838951, 0.005219319369643927, 0.027804389595985413, -0.013825439848005772, 0.060866475105285645, 0.04497825354337692, -0.03975893184542656, -0.0003951667749788612, 0.024638257920742035, 0.010342695750296116, -0.02550174854695797, 0.017413722351193428, 0.04762629047036171, 0.02026323974132538, -0.0895727351307869, -0.07418341189622879, -0.042483724653720856, -0.007406828459352255, 0.015293373726308346, -0.023486938327550888, 0.026960087940096855, -0.010217969305813313, -0.015917005017399788, -0.04490149766206741, -0.006418611388653517, -0.03517283871769905, -0.013211402110755444, -0.002573681063950062, 0.029301105067133904, 0.004926692228764296, -0.022546691820025444, -0.03594038635492325, 0.0008706860826350749, 0.005622281692922115, 0.0848906934261322, 0.02872544527053833, -0.019092731177806854, 0.025079596787691116, -0.004715616814792156, 0.023007219657301903, -0.016252806410193443, 0.03166131302714348, -0.021932654082775116, -0.01964920200407505, -0.025770390406250954, 0.0018984794151037931, 0.008231941610574722, 0.02243155986070633, 0.05165591090917587, 0.030202973634004593, -0.07284020632505417, -0.000015169172002060805, -0.013144241645932198, -0.01597457192838192, -0.027842765673995018, 0.011225374415516853, -0.01204089354723692, 0.010716875083744526, 0.06224805861711502, -0.009536771103739738, -0.046321459114551544, -0.002712798770517111, -0.00847180001437664, 0.040987007319927216, -0.0007795398705638945, -0.01881449483335018, 0.055532023310661316, 0.016540637239813805, -0.06301560997962952, 0.05841032415628433, -0.02488771080970764, 0.016156863421201706, -0.01964920200407505, -0.011580364778637886, 0.02341018244624138, -0.013556797988712788, -0.022009409964084625, -0.02108835242688656, -0.01346085499972105, 0.05361315608024597, 0.013480043970048428, 0.025386616587638855, 0.024715011939406395, -0.03856923431158066, 0.01327856257557869, -0.038588423281908035, 0.03260155767202377, -0.022393183782696724, 0.008903545327484608, -0.06339938193559647, -0.11129431426525116, 0.06785115599632263, -0.0071477810852229595, 0.023352617397904396, 0.007627497892826796, -0.04010432958602905, -0.06282372027635574, 0.000515395775437355, 0.01342247799038887, -0.04094862937927246, 0.03150780498981476, -0.030567558482289314, 0.027689257636666298, -0.019332589581608772, -0.02467663586139679, -0.015715524554252625, 0.018478693440556526, 0.0671987384557724, -0.02250831574201584, -0.04555391147732735, -0.03058674745261669, -0.016291184350848198, 0.002200701041147113, -0.02909003011882305, 0.06059783324599266, 0.07099809497594833, -0.01980271190404892, -0.004463765304535627, 0.0027871548663824797, 0.06769764423370361, -0.016310373321175575, -0.03112402930855751, 0.03526878356933594, 0.02743980474770069, 0.06432043761014938, -0.026441993191838264, -0.016991570591926575, 0.04843221232295036, 0.04478636756539345, 0.016991570591926575, -0.046551723033189774, 0.04094862937927246, 0.0727250725030899, 0.0043606264516711235, 0.023083975538611412, -0.04325127229094505, 0.02406259812414646, 0.033637747168540955, 0.010755252093076706, -0.03952866792678833, -0.018545852974057198, -0.017567232251167297, 0.0042071170173585415, 0.010179591365158558, 0.02932029403746128, 0.008016068488359451, -0.03417503088712692, 0.0120792705565691, 0.009431233629584312, 0.028092218562960625, -0.045477159321308136, 0.025002842769026756, -0.02243155986070633, -0.027957897633314133, -0.054112061858177185, -0.024024220183491707, -0.016262400895357132, -0.05453421175479889, -0.01838275045156479, 0.05549364537000656, 0.047511156648397446, 0.00650496082380414, 0.015523637644946575, -0.015322156250476837, 0.0017857459606602788, 0.006562526803463697, -0.015542826615273952, -0.004427786450833082, 0.05207806080579758, 0.042099952697753906, -0.03344586119055748, 0.016415910795331, 0.01481365691870451, -0.01324018556624651, -0.0006398223340511322, -0.02467663586139679, -0.06174915283918381, 0.02333342842757702, -0.038300592452287674, 0.05510987341403961, 0.016243211925029755, 0.006927111651748419, -0.07122836261987686, 0.0035091289319097996, -0.009546365588903427, -0.04708900675177574, -0.019898654893040657, -0.005152158904820681, -0.003991244360804558, -0.05345964804291725, -0.03388720005750656, 0.029454614967107773, 0.0011591158108785748, 0.02774682268500328, -0.04355829209089279, -0.06155726686120033, -0.036861442029476166, 0.01447785459458828, -0.005641470197588205, -0.028840577229857445, -0.019898654893040657, 0.028533559292554855, -0.034309349954128265, 0.025309860706329346, 0.022527502849698067, 0.031546179205179214, 0.01702035404741764, -0.06121187284588814, 0.018804900348186493, 0.006054026540368795, -0.0190543532371521, -0.02018648572266102, 0.029492992907762527, -0.03705333173274994, -0.08028541505336761, 0.07974813133478165, 0.027785200625658035, -0.06861869990825653, -0.0625167042016983, -0.04808681830763817, 0.010438638739287853, -0.010534582659602165, 0.013000327162444592, 0.009287318214774132, -0.0073012905195355415, -0.001657421700656414, 0.02836086042225361, -0.011148619465529919, 0.014640958979725838, -0.03532635048031807, 0.00915299728512764, 0.0025137162301689386, 0.014055703766644001, -0.04229183867573738, 0.005958083551377058, 0.027113595977425575, -0.007886544801294804, 0.06075134128332138, 0.07122836261987686, -0.05668334290385246, 0.06009892746806145, 0.06808141618967056, -0.01143645029515028, 0.014381911605596542, 0.029128408059477806, 0.027785200625658035, 0.011494016274809837, -0.039797309786081314, -0.023083975538611412, 0.004135159309953451, -0.0004161543620284647, -0.029358671978116035, -0.02580876648426056, -0.05779628828167915, -0.06547175347805023, -0.017682364210486412, -0.026154162362217903, 0.1069192960858345, -0.021261051297187805, -0.034079086035490036, -0.013806250877678394, -0.0041927252896130085, 0.04536202549934387, -0.0009486401104368269, -0.005248102359473705, 0.0074883801862597466, 0.027689257636666298, -0.0010481813224032521, -0.008054446429014206, -0.054342325776815414, -0.05000568553805351, 0.10584472864866257, -0.024734200909733772, -0.014804062433540821, 0.0648193433880806, 0.013268968090415001, -0.021932654082775116, -0.009383262135088444, -0.09648065268993378, 0.051118627190589905, 0.017759118229150772, 0.0367463119328022, -0.05150240287184715, 0.00201600999571383, -0.03628578409552574, -0.008658889681100845, 0.044364213943481445, -0.02978082187473774, 0.007920125499367714, -0.042637232691049576, 0.08005514740943909, -0.059139493852853775, 0.034462857991456985, -0.05100349709391594, 0.025022031739354134, -0.038953009992837906, -0.02137618325650692, 0.031066464260220528, -0.001974034821614623, -0.021318616345524788, -0.03991244360804558, -0.00478037865832448, -0.02446555905044079, 0.0284951813519001, -0.0008952716016210616, -0.06977002322673798, -0.008433422073721886, -0.013911789283156395, -0.057182248681783676, -0.05510987341403961, 0.033637747168540955, -0.0025281079579144716, -0.03862680122256279, 0.036650367081165314, -0.010112431831657887, -0.033791255205869675, 0.06746737658977509, -0.013144241645932198, 0.01792222261428833, 0.015533232130110264, 0.06585553288459778, 0.03239048272371292, 0.05664496496319771, 0.009666294790804386, 0.012587770819664001, -0.014612175524234772, -0.060943230986595154, -0.029895953834056854, 0.001308427774347365, -0.06155726686120033, -0.008270318619906902, 0.06911760568618774, 0.003698616987094283, -0.05652983486652374, -0.0002735885209403932, -0.03757142275571823, -0.04935327172279358, -0.05468772351741791, -0.03331153839826584, 0.024619068950414658, -0.03924084082245827, 0.03189157694578171, -0.01702035404741764, 0.008817195892333984, -0.002823133720085025, -0.02820735052227974, -0.07168889045715332, 0.00652414932847023, 0.029665689915418625, -0.00571822514757514, 0.06385990977287292, 0.02421610616147518, -0.06401341408491135, -0.027708446606993675, -0.039260026067495346, -0.02408178709447384, -0.046781986951828, -0.0013887803070247173, -0.0288789551705122, -0.01972595788538456, -0.0013803852489218116, -0.00805924367159605, -0.0009372468339279294, 0.0432128943502903, 0.06021406129002571, -0.046091195195913315, -0.004528527148067951, 0.017490476369857788, 0.029723256826400757, 0.054035305976867676, -0.057028740644454956, 0.07333911210298538, -0.0367463119328022, -0.042790744453668594, 0.06201779469847679, 0.032141029834747314, 0.0026456385385245085, 0.019994597882032394, 0.009997298941016197, 0.0014859229559078813, -0.01222318597137928, 0.03173806890845299, -0.046091195195913315, 0.05211643874645233, 0.013566392473876476, -0.018334778025746346, -0.052308324724435806, 0.03901057317852974, -0.06385990977287292, -0.016607796773314476, 0.03651604801416397, 0.014592986553907394, 0.006490569096058607, -0.041447535157203674, -0.0005180942243896425, 0.04574580118060112, 0.018401939421892166, -0.049238137900829315, -0.07138186693191528, 0.018478693440556526, 0.0026864144019782543, -0.010333101265132427, 0.05242345854640007, 0.007608309388160706, -0.0007549544097855687, -0.028456803411245346, -0.03029891662299633, 0.008802804164588451, 0.023678824305534363, -0.017903033643960953, 0.05092674121260643, 0.008088026195764542, 0.06535662710666656, 0.04002757370471954, 0.04624470695853233, 0.028974898159503937, 0.017893439158797264, -0.03156536817550659, -0.05345964804291725, -0.03432853892445564, 0.027689257636666298, 0.015504448674619198, 0.026134975254535675, -0.015015137381851673, -0.02256588079035282, 0.013739090412855148, -0.011350100859999657, 0.020570259541273117, 0.005392017308622599, 0.052231572568416595, -0.02099240943789482, 0.004300661850720644, -0.00021047577320132405, -0.036477670073509216, -0.04566904529929161, -0.036189839243888855, 0.020589448511600494, 0.051348891109228134, -0.06163402274250984, 0.000310616655042395, 0.005766196642071009, 0.016070514917373657, 0.0067160362377762794, -0.024503936991095543, -0.07103647291660309, 0.04470961168408394, 0.0016634182538837194, -0.014756090939044952, 0.024100974202156067, -0.030701879411935806, 0.04701225087046623, 0.03488501161336899, 0.031219972297549248, -0.031450238078832626, -0.018497882410883904, -0.013883005827665329, -0.01013161987066269, 0.006370639894157648, 0.0190543532371521, 0.04643659293651581, -0.005612687207758427, -0.039413537830114365, -0.004655652213841677, 0.0412556491792202, -0.026384428143501282, -0.002597666811197996, 0.023506125435233116, -0.0006823972216807306, -0.0636296421289444, -0.008625308983027935, 0.04739602655172348, 0.02018648572266102, -0.00029232745873741806, 0.011273345910012722, -0.007992083206772804, 0.05940813571214676, 0.03231372684240341 ]
39,428
pyspark.sql.dataframe
toJSON
Converts a :class:`DataFrame` into a :class:`RDD` of string. Each row is turned into a JSON document as one element in the returned RDD. .. versionadded:: 1.3.0 Parameters ---------- use_unicode : bool, optional, default True Whether to convert to unicode or not. Returns ------- :class:`RDD` Examples -------- >>> df = spark.createDataFrame([(2, "Alice"), (5, "Bob")], schema=["age", "name"]) >>> df.toJSON().first() '{"age":2,"name":"Alice"}'
def toJSON(self, use_unicode: bool = True) -> RDD[str]: """Converts a :class:`DataFrame` into a :class:`RDD` of string. Each row is turned into a JSON document as one element in the returned RDD. .. versionadded:: 1.3.0 Parameters ---------- use_unicode : bool, optional, default True Whether to convert to unicode or not. Returns ------- :class:`RDD` Examples -------- >>> df = spark.createDataFrame([(2, "Alice"), (5, "Bob")], schema=["age", "name"]) >>> df.toJSON().first() '{"age":2,"name":"Alice"}' """ rdd = self._jdf.toJSON() return RDD(rdd.toJavaRDD(), self._sc, UTF8Deserializer(use_unicode))
(self, use_unicode: bool = True) -> pyspark.rdd.RDD[str]
[ 0.02062983065843582, -0.0517803356051445, 0.04609058424830437, -0.010932199656963348, 0.0073626842349767685, -0.010959038510918617, -0.015709444880485535, 0.06849174946546555, 0.05739852041006088, -0.0358382910490036, -0.0027777806390076876, -0.00893720705062151, 0.005761323031038046, 0.03150835260748863, 0.01894795335829258, 0.015101106837391853, -0.024852415546774864, -0.05410633608698845, 0.06777606159448624, 0.10492049157619476, 0.01777600683271885, -0.03022010624408722, 0.03338704630732536, 0.11737353354692459, -0.046734705567359924, 0.029379168525338173, 0.012882460840046406, 0.0035717517603188753, 0.016613006591796875, 0.03617824614048004, 0.00011049897875636816, -0.022061213850975037, -0.023707307875156403, 0.0038356634322553873, -0.0348542146384716, 0.06849174946546555, -0.03989984467625618, 0.009075872600078583, 0.05442839860916138, -0.06358925998210907, -0.05496516823768616, 0.0016785220941528678, 0.0006368543254211545, -0.0838075652718544, -0.030738983303308487, 0.002003938425332308, -0.04075867682695389, -0.004303100053220987, 0.018912168219685555, -0.03868316859006882, 0.06230101361870766, 0.00941135361790657, -0.025389183312654495, 0.04405086115002632, -0.08201833814382553, -0.03410273790359497, -0.03796747699379921, -0.017248183488845825, -0.010449107736349106, -0.03297552093863487, 0.00857041496783495, 0.011737353168427944, 0.030667414888739586, 0.07199864089488983, 0.006986945867538452, 0.008185730315744877, -0.018375398591160774, -0.0033212595153599977, 0.013115061447024345, 0.009670792147517204, -0.00471909623593092, -0.03864738345146179, -0.006584369111806154, 0.039935629814863205, -0.03022010624408722, 0.06741821020841599, -0.027589937672019005, -0.03161570802330971, -0.06398288905620575, -0.03455004468560219, 0.06931480020284653, -0.00587314972653985, -0.008807487785816193, -0.058686766773462296, 0.0038736844435334206, 0.047199904918670654, 0.016264107078313828, 0.04290575161576271, -0.07135452330112457, 0.01880481466650963, -0.014215437695384026, 0.05038473755121231, -0.005282703787088394, 0.07031676918268204, 0.02794778347015381, -0.06172845885157585, -0.033726997673511505, -0.029772799462080002, 0.016004668548703194, -0.035927753895521164, 0.005036684684455395, 0.02576492168009281, -0.02148866094648838, -0.0033391518518328667, -0.04705676808953285, -0.0272320918738842, -0.0017523277783766389, 0.004866707604378462, 0.02708895318210125, -0.004428346175700426, -0.049418553709983826, 0.08581150323152542, 0.009617115370929241, -0.018572214990854263, 0.009013249538838863, 0.006320457439869642, 0.021005569025874138, -0.03818218410015106, 0.010950092226266861, -0.007698165252804756, -0.0026502979453653097, 0.04591165855526924, 0.02562178298830986, -0.033333368599414825, -0.041545938700437546, 0.012032576836645603, 0.05639655143022537, 0.04898913577198982, 0.0839507058262825, 0.02896764501929283, 0.06083384528756142, -0.010762223042547703, -0.005331907421350479, 0.014734314754605293, 0.01941315270960331, -0.009187699295580387, 0.07253541052341461, 0.061084337532520294, 0.026659537106752396, 0.06548584252595901, 0.04222584515810013, -0.045947443693876266, 0.0087135536596179, 0.0335838608443737, 0.01447487622499466, -0.01867956854403019, 0.004159961361438036, 0.017400268465280533, -0.01772233098745346, -0.014430145733058453, 0.035730935633182526, 0.01894795335829258, 0.014215437695384026, -0.04090181365609169, -0.019663644954562187, -0.03657187521457672, 0.009196645580232143, -0.04211848974227905, 0.06366083025932312, -0.01787441410124302, 0.00001032651744026225, -0.009599222801625729, -0.0247629527002573, 0.014224383980035782, -0.004880126565694809, 0.07074618339538574, -0.004007876850664616, 0.010466999374330044, -0.018062284216284752, -0.0247629527002573, 0.056611258536577225, 0.016577223315835, 0.024852415546774864, 0.030595844611525536, 0.008190203458070755, 0.07865457981824875, 0.07071039825677872, 0.07160501182079315, 0.0019357239361852407, 0.028806613758206367, 0.06727507710456848, -0.03220615163445473, -0.013651830144226551, 0.016827715560793877, 0.06849174946546555, -0.04959747567772865, -0.03211669251322746, -0.024387214332818985, 0.0713903084397316, 0.029880153015255928, 0.04551802948117256, -0.006016288418322802, 0.0009762489935383201, 0.025371290743350983, -0.0234210304915905, -0.0421900600194931, 0.02508501522243023, -0.02909289114177227, -0.11801765859127045, 0.038325320929288864, 0.016317784786224365, 0.020719291642308235, 0.041474368423223495, -0.037860121577978134, -0.011245314963161945, -0.03657187521457672, -0.06802655011415482, -0.05632498115301132, 0.053533781319856644, -0.03422798216342926, 0.06040442734956741, -0.041939567774534225, -0.035605691373348236, -0.0054839919321238995, 0.06344611942768097, -0.0005485110450536013, 0.002491503721103072, -0.0018283701501786709, -0.021005569025874138, -0.06230101361870766, 0.0036343748215585947, 0.007268749643117189, -0.007613176479935646, 0.02202543057501316, -0.022329598665237427, -0.058149997144937515, 0.05793529003858566, -0.044193997979164124, 0.002563073066994548, -0.03421008959412575, -0.027786752209067345, -0.05725538358092308, 0.04584009200334549, -0.0397924929857254, -0.0035046555567532778, 0.04884599894285202, -0.02427986077964306, -0.0179191455245018, 0.00887458398938179, -0.05789950489997864, 0.0014582229778170586, 0.008650930598378181, 0.015458953566849232, -0.06527113914489746, 0.021238168701529503, 0.04616215080022812, 0.015360545367002487, 0.04870285838842392, 0.008986411616206169, -0.02481663040816784, 0.04337095096707344, -0.028001461178064346, 0.013240307569503784, -0.002143722027540207, -0.024780845269560814, -0.07053147256374359, 0.027589937672019005, 0.04694941267371178, -0.029128676280379295, 0.04236898198723793, -0.01271248422563076, 0.004025768954306841, -0.014018622227013111, 0.05543036758899689, -0.017811791971325874, -0.028520338237285614, -0.04805873706936836, 0.021041354164481163, 0.008208096027374268, 0.03376278281211853, 0.06555741280317307, 0.022794799879193306, 0.003008144209161401, -0.0008325513917952776, 0.008123107254505157, -0.07765261083841324, -0.05933089181780815, -0.03009486012160778, -0.00234389235265553, 0.013285038061439991, -0.06577212363481522, -0.03503313660621643, 0.01681876927614212, 0.02055826038122177, -0.0019278960535302758, -0.042333200573921204, 0.006790130399167538, -0.021846506744623184, -0.01171051524579525, -0.01650565303862095, 0.00508588831871748, 0.004616215359419584, -0.05950981378555298, -0.0030260365456342697, 0.026587968692183495, -0.024458784610033035, 0.025192368775606155, -0.07063882797956467, 0.03807482868432999, 0.03850424662232399, 0.006302565336227417, 0.013258199207484722, 0.07103245705366135, 0.07493298500776291, 0.0004724687314592302, -0.0010114745236933231, -0.04762932285666466, -0.0416175052523613, -0.030148537829518318, 0.014823776669800282, -0.024923983961343765, -0.01921633817255497, 0.010726437903940678, 0.011003769002854824, -0.05636076629161835, 0.02122027613222599, -0.0038155345246195793, 0.02623012289404869, 0.01204152312129736, 0.017811791971325874, -0.034406907856464386, -0.014734314754605293, 0.019001631066203117, -0.030076967552304268, 0.0196099691092968, 0.018590107560157776, 0.015208461321890354, 0.008825380355119705, 0.017695492133498192, 0.02075507678091526, 0.09361255168914795, -0.028198275715112686, 0.0002836210187524557, 0.04977639764547348, -0.023725198581814766, -0.02748258411884308, 0.005962611176073551, -0.03775276988744736, -0.04118809103965759, 0.0541779063642025, 0.03268924355506897, -0.0061057498678565025, 0.0495259054005146, -0.019932029768824577, -0.042547907680273056, 0.02002149261534214, -0.012095199897885323, -0.015575253404676914, 0.01774916797876358, -0.01271248422563076, 0.007286642212420702, 0.03735913708806038, -0.03961356729269028, 0.036589767783880234, -0.059151966124773026, -0.015405276790261269, -0.02775096893310547, 0.040007200092077255, 0.006123641971498728, -0.016344621777534485, -0.001235687406733632, -0.03972092270851135, -0.007183761335909367, -0.02368941530585289, 0.035999320447444916, 0.05131513625383377, -0.018715353682637215, -0.03424587473273277, -0.01240831520408392, -0.019126877188682556, -0.0068259150721132755, 0.047808244824409485, 0.009563438594341278, -0.013526584021747112, -0.0058820960111916065, 0.047414615750312805, -0.011674730107188225, 0.00572106521576643, -0.028126707300543785, -0.020969783887267113, -0.014510661363601685, -0.08373599499464035, 0.00840938463807106, 0.004287444055080414, 0.0035784614738076925, -0.010592245496809483, -0.03768119961023331, -0.03818218410015106, -0.038468461483716965, -0.014626961201429367, -0.07657907158136368, 0.02902132272720337, 0.020594045519828796, -0.009357676841318607, -0.02368941530585289, -0.030524276196956635, -0.019448937848210335, 0.02054036781191826, 0.03497945889830589, 0.03828953579068184, -0.05664704367518425, -0.017203453928232193, -0.021238168701529503, -0.01596888341009617, -0.03728756681084633, 0.07185550779104233, 0.01848275400698185, -0.00316246529109776, -0.010789060965180397, -0.02182861417531967, 0.008158892393112183, -0.04390772059559822, -0.0466989204287529, -0.00820362288504839, 0.008382545784115791, 0.08030067384243011, -0.01377707626670599, 0.04558959975838661, 0.02877083048224449, 0.06859910488128662, -0.04709255322813988, 0.04838079959154129, -0.03363753855228424, 0.05084993690252304, -0.01934158429503441, -0.017176615074276924, 0.022633768618106842, 0.0348542146384716, 0.05535879731178284, 0.0836644247174263, -0.02515658363699913, -0.07267855107784271, -0.001756800920702517, -0.058686766773462296, -0.017713384702801704, 0.052281320095062256, 0.05231710523366928, -0.02381466142833233, -0.01948472298681736, 0.045339107513427734, 0.07035255432128906, -0.02361784502863884, -0.02288426086306572, -0.03175884485244751, 0.0066425190307199955, 0.006857226602733135, -0.05278230458498001, 0.041867997497320175, 0.0025004500057548285, 0.0006100158207118511, 0.061155904084444046, 0.006834861356765032, -0.010771169327199459, -0.04244055226445198, -0.08173205703496933, 0.001429148018360138, 0.025138691067695618, -0.09082134813070297, -0.0055242497473955154, 0.03914836794137955, 0.05378427356481552, -0.01314189936965704, 0.03743070736527443, -0.008789596147835255, -0.011003769002854824, 0.00022561081277672201, -0.06473436951637268, -0.011889438144862652, -0.02742890641093254, -0.02036144584417343, 0.08566837012767792, 0.0006849399069324136, -0.0209518913179636, -0.07550553977489471, 0.06824126094579697, 0.03141888976097107, -0.06283777952194214, -0.027589937672019005, 0.02054036781191826, -0.004611742217093706, -0.0833781510591507, -0.022597983479499817, 0.0026502979453653097, -0.01650565303862095, 0.035122599452733994, 0.015485791489481926, 0.0014783518854528666, -0.023599952459335327, 0.01250672247260809, 0.0016103076050058007, -0.01314189936965704, 0.0787261500954628, -0.019001631066203117, -0.01447487622499466, 0.001357578788883984, 0.06874224543571472, 0.028126707300543785, -0.0058820960111916065, -0.08201833814382553, 0.03782433643937111, 0.030864229425787926, -0.01757919229567051, -0.041331227868795395, 0.03961356729269028, -0.026391152292490005, -0.0014861797681078315, 0.030667414888739586, 0.004683311562985182, -0.02882450632750988, -0.03968513756990433, -0.023707307875156403, 0.029146568849682808, 0.013768129982054234, 0.000504618976265192, -0.03914836794137955, 0.03703707456588745, 0.030613737180829048, 0.021721260622143745, 0.009277161210775375, -0.014483822509646416, -0.05704067647457123, 0.014439092017710209, -0.004229294136166573, 0.019520506262779236, -0.05747009068727493, 0.020110953599214554, 0.008011280559003353, 0.026516398414969444, 0.023385245352983475, 0.061477966606616974, -0.0469851978123188, 0.035122599452733994, -0.001154053839854896, -0.018786922097206116, -0.0005775860627181828, 0.01147791463881731, 0.013356607407331467, 0.04991953819990158, 0.043549876660108566, -0.03147256746888161, 0.005372165236622095, 0.014787991531193256, -0.0041845631785690784, -0.04122387617826462, -0.017489729449152946, -0.026444830000400543, 0.04677049070596695, 0.0015320287784561515, 0.05636076629161835, -0.03975670784711838, 0.0013039018958806992, 0.034460581839084625, 0.05950981378555298, 0.031723059713840485, 0.03650030493736267, -0.016317784786224365, 0.022633768618106842, 0.051672983914613724, 0.01534265372902155, -0.0247629527002573, -0.03136521577835083, -0.008208096027374268, 0.020665613934397697, -0.08566837012767792, 0.00844516884535551, 0.058615196496248245, 0.013750238344073296, 0.030542168766260147, 0.015056376345455647, -0.045195966958999634, 0.024387214332818985, -0.00034666346618905663, 0.03750227764248848, -0.02902132272720337, -0.03109682910144329, -0.03807482868432999, 0.01731080748140812, 0.050348952412605286, -0.04329938441514969, -0.0038714478723704815, -0.02529972232878208, 0.059831876307725906, -0.011907330714166164, 0.023868337273597717, -0.019180553033947945, 0.012363584712147713, 0.009393461048603058, 0.049346983432769775, 0.00028907257365062833, -0.0489533506333828, 0.013544476591050625, -0.04931119829416275, 0.04483812302350998, -0.03868316859006882, 0.07643593847751617, -0.0260333064943552, -0.01150475349277258, -0.015235299244523048, 0.033726997673511505, -0.029844367876648903, -0.04183221235871315, 0.04970483109354973, -0.005546615459024906, -0.040007200092077255, 0.025872277095913887, 0.030667414888739586, -0.08967624604701996, 0.033458612859249115, -0.015360545367002487, 0.045732736587524414, -0.029522307217121124, 0.03029167652130127, -0.024870306253433228, -0.06924322992563248, -0.029003430157899857, -0.011334776878356934, -0.02308107540011406, -0.03002329170703888, -0.05918775126338005, -0.05646812170743942, 0.024709276854991913, 0.0069958921521902084, 0.05246024578809738, -0.04197535291314125, -0.0416175052523613, -0.010037584230303764, -0.007742895744740963, -0.007917345501482487, -0.011996791698038578, -0.03925572335720062, 0.01137950737029314, -0.09704787284135818, 0.03365543112158775, -0.029074998572468758, 0.015807854011654854, -0.02755415253341198, -0.046341076493263245, -0.012542507611215115, -0.009581330232322216, 0.0208803229033947, -0.013830753043293953, 0.06398288905620575, -0.029468629509210587, -0.0183396153151989, -0.021864399313926697, -0.013642883859574795, 0.0004456302849575877, -0.04584009200334549, 0.019126877188682556, -0.0348542146384716, -0.06222944334149361, -0.028251953423023224, 0.005636076908558607, -0.012453045696020126, 0.012587238103151321, 0.11035975068807602, -0.061943165957927704, 0.024673491716384888, 0.016371460631489754, 0.022597983479499817, -0.003739492269232869, 0.000851562013849616, -0.013365553691983223, -0.038003262132406235, 0.012157822959125042, -0.0036321382503956556, -0.02062983065843582, 0.002529524965211749, 0.04498125985264778, -0.03957778215408325, -0.03048849105834961, 0.03825375437736511, 0.052674952894449234, -0.01625516079366207, 0.0037752767093479633, 0.009116130881011486, -0.048201873898506165, -0.002166087506338954, 0.02422618307173252, -0.0493827685713768, -0.02995172142982483, 0.057613227516412735, 0.01017177663743496, 0.005738957319408655, -0.06437651813030243, -0.05138670653104782, -0.007438726723194122, 0.010547515004873276, 0.005595819093286991, -0.02721419930458069, 0.0019491432467475533, -0.0027822537813335657, -0.037001289427280426, 0.036070890724658966, 0.014152814634144306, -0.03410273790359497, 0.024065153673291206, 0.016729306429624557, 0.017167668789625168, -0.000928163412027061, 0.038325320929288864, 0.016165699809789658, 0.020987676456570625, 0.036786582320928574, 0.07965654879808426, 0.022043323144316673, -0.030041184276342392, -0.014125976711511612, 0.028126707300543785, -0.009706576354801655, -0.020862430334091187, 0.00505457678809762, 0.012300961650907993, -0.004795138258486986, -0.06809812039136887, 0.01887638494372368, 0.00022029902902431786, -0.02422618307173252, -0.012130984105169773, 0.03911258280277252, -0.027858322486281395, -0.04612636938691139, -0.011397399939596653, 0.014197546057403088, -0.02882450632750988, 0.05199504643678665, -0.030613737180829048, 0.016004668548703194, -0.0002222559996880591, -0.025478646159172058, -0.052424460649490356, -0.0036746326368302107, -0.04043661430478096, -0.021202383562922478, 0.019520506262779236, -0.017122937366366386, 0.012300961650907993, -0.01828593760728836, 0.0034822903107851744, 0.006709615234285593, -0.04963326081633568, 0.03911258280277252, -0.01679193042218685, 0.006244415417313576, 0.012909299694001675, 0.008807487785816193, 0.031257860362529755, 0.012792999856173992, -0.011683676391839981, 0.007939711213111877, 0.03469318524003029, 0.007264276500791311, -0.06412602961063385, 0.010851684026420116, 0.02249062992632389, 0.024315645918250084, -0.027536259964108467, 0.07006627321243286, -0.010341753251850605, -0.041009169071912766, -0.022186461836099625, 0.03957778215408325, -0.024584030732512474, 0.011370561085641384, 0.0010103562381118536, 0.01774916797876358, 0.02843087539076805, 0.016568277031183243 ]
39,429
pyspark.sql.dataframe
toLocalIterator
Returns an iterator that contains all of the rows in this :class:`DataFrame`. The iterator will consume as much memory as the largest partition in this :class:`DataFrame`. With prefetch it may consume up to the memory of the 2 largest partitions. .. versionadded:: 2.0.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Parameters ---------- prefetchPartitions : bool, optional If Spark should pre-fetch the next partition before it is needed. .. versionchanged:: 3.4.0 This argument does not take effect for Spark Connect. Returns ------- Iterator Iterator of rows. Examples -------- >>> df = spark.createDataFrame( ... [(14, "Tom"), (23, "Alice"), (16, "Bob")], ["age", "name"]) >>> list(df.toLocalIterator()) [Row(age=14, name='Tom'), Row(age=23, name='Alice'), Row(age=16, name='Bob')]
def toLocalIterator(self, prefetchPartitions: bool = False) -> Iterator[Row]: """ Returns an iterator that contains all of the rows in this :class:`DataFrame`. The iterator will consume as much memory as the largest partition in this :class:`DataFrame`. With prefetch it may consume up to the memory of the 2 largest partitions. .. versionadded:: 2.0.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Parameters ---------- prefetchPartitions : bool, optional If Spark should pre-fetch the next partition before it is needed. .. versionchanged:: 3.4.0 This argument does not take effect for Spark Connect. Returns ------- Iterator Iterator of rows. Examples -------- >>> df = spark.createDataFrame( ... [(14, "Tom"), (23, "Alice"), (16, "Bob")], ["age", "name"]) >>> list(df.toLocalIterator()) [Row(age=14, name='Tom'), Row(age=23, name='Alice'), Row(age=16, name='Bob')] """ with SCCallSiteSync(self._sc): sock_info = self._jdf.toPythonIterator(prefetchPartitions) return _local_iterator_from_socket(sock_info, BatchedSerializer(CPickleSerializer()))
(self, prefetchPartitions: bool = False) -> Iterator[pyspark.sql.types.Row]
[ 0.039376791566610336, -0.04983904957771301, -0.0439629852771759, 0.0072062392719089985, 0.00027795974165201187, 0.035722166299819946, 0.028824957087635994, 0.039376791566610336, 0.020422903820872307, -0.029523635283112526, -0.010659322142601013, -0.01832686923444271, -0.04055916890501976, 0.06252274662256241, -0.02049456350505352, 0.03398442640900612, -0.04102495312690735, -0.03183464705944061, 0.0013783220201730728, 0.04983904957771301, -0.02864580973982811, -0.01119676697999239, 0.02176651544868946, 0.06048045679926872, -0.04797590896487236, 0.025510713458061218, 0.00958443246781826, -0.0285920649766922, 0.046363573521375656, 0.029953591525554657, 0.027284281328320503, 0.01976005546748638, -0.03955594077706337, -0.007510791532695293, -0.0050116730853915215, 0.018703080713748932, 0.01323905773460865, -0.0048817903734743595, 0.08169161528348923, -0.0375853069126606, -0.018067102879285812, 0.023898379877209663, 0.02907576411962509, -0.025922754779458046, -0.020978262647986412, 0.018174592405557632, 0.03118971548974514, -0.06019382178783417, 0.0767471194267273, -0.027176793664693832, 0.0524187833070755, 0.02737385593354702, -0.021211156621575356, 0.013534652069211006, -0.035077232867479324, -0.006005946081131697, -0.03482642397284508, -0.029057849198579788, -0.052812911570072174, -0.01424228772521019, -0.057219959795475006, -0.041705720126628876, 0.031637586653232574, 0.054568562656641006, 0.04120410233736038, -0.057112470269203186, -0.02685432694852352, -0.010524961166083813, -0.05245461314916611, 0.0021005135495215654, -0.03192422166466713, 0.02826959826052189, -0.011653595604002476, 0.060337137430906296, -0.10842053592205048, -0.00245657074265182, -0.01008604746311903, -0.012226869352161884, -0.020512476563453674, -0.032175030559301376, 0.040738318115472794, 0.01008604746311903, -0.03955594077706337, -0.04034418985247612, 0.0012439608108252287, -0.007071878295391798, 0.04353303089737892, 0.03808692470192909, -0.020100437104701996, 0.050233177840709686, 0.03787194564938545, 0.06596239656209946, -0.02420293167233467, 0.003300806973129511, 0.0529562309384346, -0.05639587715268135, -0.03668956831097603, 0.008007927797734737, -0.013615269213914871, 0.0030365632846951485, -0.01995711773633957, 0.03591923043131828, -0.011770041659474373, -0.00638215709477663, 0.030777674168348312, -0.02101409249007702, -0.00005769834024249576, -0.04808339849114418, 0.047940079122781754, 0.006561305373907089, -0.028950361534953117, 0.05517766997218132, -0.01868516579270363, 0.0074525680392980576, -0.046578552573919296, 0.005643170792609453, 0.0225010234862566, -0.028520405292510986, -0.017135532572865486, 0.005087811034172773, 0.008043757639825344, 0.050376493483781815, 0.007309249602258205, -0.037943605333566666, -0.019939202815294266, 0.005338618531823158, 0.06897208839654922, -0.024525398388504982, -0.0039099110290408134, -0.006059690378606319, 0.06821966171264648, -0.02033332921564579, -0.0056342133320868015, 0.03579382598400116, -0.017601318657398224, 0.006700145546346903, 0.04321056231856346, 0.064600870013237, -0.029792357236146927, 0.004196548368781805, 0.023862550035119057, -0.014394563622772694, 0.012379146181046963, 0.07724873721599579, 0.003822576254606247, -0.044285453855991364, 0.019258439540863037, 0.009754623286426067, -0.03323200345039368, -0.0032873707823455334, -0.006624007597565651, -0.023360934108495712, -0.02796504646539688, 0.0025058365426957607, -0.056467536836862564, -0.013436120934784412, -0.008823052980005741, -0.017708806321024895, 0.04940909519791603, -0.0740957260131836, -0.04768927022814751, 0.01954507641494274, 0.003748677670955658, 0.016195004805922508, -0.059799693524837494, 0.05797238275408745, -0.010220409370958805, -0.02821585349738598, -0.05926224961876869, -0.045611150562763214, 0.05897561088204384, 0.018344784155488014, 0.06323934346437454, -0.01890014298260212, -0.054246097803115845, 0.0990331694483757, 0.022536853328347206, 0.02198149263858795, 0.008411011658608913, 0.01291659101843834, -0.010516003705561161, -0.001823953352868557, -0.047151826322078705, -0.050913941115140915, 0.07169514149427414, -0.0026469158474355936, -0.019616736099123955, -0.06359763443470001, 0.09946312010288239, 0.00484596099704504, 0.006941995583474636, -0.003511306131258607, 0.010095004923641682, 0.020512476563453674, -0.04002172499895096, -0.038516879081726074, 0.004433919675648212, 0.022160641849040985, -0.08118999749422073, 0.09430365264415741, -0.019348014146089554, 0.008697648532688618, 0.025546543300151825, -0.0009500457090325654, -0.0004915380850434303, 0.015084284357726574, -0.0884275883436203, -0.033429067581892014, 0.03034771792590618, 0.021157411858439445, -0.027230538427829742, -0.060014672577381134, 0.004926577676087618, 0.0556076243519783, 0.04364052042365074, 0.06517414003610611, -0.07330747693777084, -0.008455798961222172, 0.06947369873523712, -0.020100437104701996, 0.043389711529016495, -0.028735382482409477, -0.013892948627471924, -0.028896616771817207, 0.04102495312690735, -0.06392010301351547, 0.005266959313303232, -0.03310660272836685, -0.03432480990886688, -0.030258143320679665, -0.006337370257824659, -0.014896178618073463, 0.017601318657398224, -0.06854213029146194, 0.022160641849040985, 0.06478001922369003, -0.00921717844903469, 0.052347127348184586, -0.01291659101843834, 0.010121877305209637, -0.03627752512693405, 0.04887164756655693, 0.05381614342331886, -0.06442172080278397, -0.04546783119440079, 0.024238761514425278, -0.013776502572000027, 0.07352244853973389, 0.00167839543428272, 0.011608808301389217, -0.001266354345716536, -0.02017209492623806, 0.001011627959087491, -0.049050796777009964, 0.05707664042711258, -0.04973156005144119, 0.01922260969877243, -0.0015115635469555855, -0.023217616602778435, 0.06151951849460602, -0.01709970273077488, -0.0007221914711408317, 0.022895149886608124, 0.06635651737451553, -0.02404169924557209, -0.0024162624031305313, -0.07552891224622726, 0.0104533014819026, -0.003544896375387907, 0.023378849029541016, 0.028018789365887642, 0.03581174090504646, 0.0037330021150410175, 0.020046692341566086, 0.027839642018079758, -0.05804404243826866, -0.046363573521375656, -0.016445811837911606, -0.04475123807787895, -0.0026536337099969387, -0.06449338048696518, 0.00002876169492083136, -0.02431042119860649, -0.004089059308171272, -0.051917169243097305, -0.04030836001038551, -0.03373362123966217, -0.054031118750572205, 0.012567251920700073, -0.03461144492030144, -0.014251245185732841, 0.006579220294952393, -0.011725254356861115, -0.03622378036379814, 0.0354713574051857, -0.005159470252692699, 0.02816210873425007, -0.03355447202920914, -0.02171277068555355, 0.044392943382263184, 0.023737145587801933, -0.06872127950191498, -0.00019468378741294146, 0.10648573189973831, 0.027302196249365807, -0.01731467992067337, -0.005777531769126654, 0.006485167425125837, -0.06424257159233093, 0.03776445612311363, 0.0017780466005206108, -0.009987516328692436, 0.014439350925385952, -0.06528162956237793, -0.049050796777009964, -0.10089630633592606, 0.011107193306088448, 0.05829484760761261, -0.014116884209215641, 0.00771681172773242, -0.02837708592414856, 0.03432480990886688, 0.02155153825879097, -0.0024476132821291685, -0.09387369453907013, 0.07925519347190857, 0.045145366340875626, 0.04263728857040405, -0.005661085247993469, -0.01582775078713894, 0.03488016873598099, -0.04367635026574135, -0.03606254607439041, 0.03801526501774788, 0.012773271650075912, 0.02456122823059559, 0.02816210873425007, 0.009378411807119846, 0.010847427882254124, -0.0073540364392101765, 0.04080997779965401, -0.007595886941999197, 0.04156240075826645, -0.037836115807294846, -0.038516879081726074, 0.038839347660541534, 0.011178852058947086, -0.0030791109893471003, 0.05041232332587242, 0.01114302221685648, 0.026890156790614128, 0.01838061213493347, -0.003842730540782213, 0.05163053423166275, -0.012701612897217274, 0.03690454363822937, -0.021641111001372337, 0.021569453179836273, -0.003229147754609585, 0.0534936748445034, 0.016974298283457756, -0.059584714472293854, 0.005302789155393839, -0.05309955030679703, -0.013248015195131302, 0.002676027361303568, -0.05539264529943466, -0.014779732562601566, 0.016123345121741295, -0.007815343327820301, -0.03563259169459343, 0.013570481911301613, 0.03394859656691551, -0.008106459863483906, -0.0169474259018898, -0.04245813935995102, -0.05750659480690956, 0.05797238275408745, -0.020028777420520782, 0.09989307820796967, 0.05840233713388443, -0.04632774367928505, 0.05725578963756561, -0.041168272495269775, 0.007264462299644947, 0.006807634606957436, 0.0011700621107593179, -0.07968515157699585, -0.03575799614191055, -0.01984962821006775, -0.03092099167406559, 0.025922754779458046, 0.009226135909557343, -0.007976576685905457, 0.01337341871112585, -0.0704052746295929, 0.03559676185250282, -0.007457046769559383, 0.04267311841249466, -0.025009099394083023, 0.0060104248113930225, 0.009226135909557343, -0.064600870013237, 0.02880704216659069, -0.021623196080327034, 0.022375619038939476, 0.03722701221704483, -0.053027890622615814, 0.00519082136452198, 0.0025909319519996643, 0.03923347219824791, -0.029631124809384346, 0.014466223306953907, 0.012674740515649319, -0.01657121628522873, 0.04675769805908203, -0.013292801566421986, -0.006570262834429741, 0.0884275883436203, 0.08341144025325775, 0.029451975598931313, -0.008621511049568653, -0.05496269091963768, 0.026281051337718964, -0.03823024034500122, -0.05120057612657547, -0.002534948056563735, 0.013337588869035244, 0.0018597830785438418, -0.00894845649600029, -0.04353303089737892, -0.05460439249873161, 0.013615269213914871, -0.02493743970990181, -0.0045324512757360935, 0.027767982333898544, 0.002920116763561964, 0.030061081051826477, -0.04887164756655693, 0.008146767504513264, 0.0815482959151268, -0.014734945259988308, 0.01790587045252323, -0.04457208886742592, 0.011555063538253307, 0.014143756590783596, -0.04632774367928505, 0.0423506535589695, -0.06291687488555908, 0.033429067581892014, 0.04141908138990402, -0.031960051506757736, 0.0019135274924337864, -0.02810836397111416, -0.05209631845355034, 0.03622378036379814, 0.04912245646119118, -0.012782229110598564, -0.04962407052516937, 0.05797238275408745, 0.0704411044716835, -0.012638910673558712, 0.031046396121382713, -0.044930387288331985, 0.04521702602505684, -0.021085752174258232, -0.04643523320555687, 0.024919524788856506, -0.023343021050095558, -0.04267311841249466, 0.027929216623306274, -0.006897208746522665, -0.01093700248748064, -0.08534623682498932, 0.07083522528409958, 0.022948894649744034, -0.0730566680431366, 0.043497201055288315, 0.03747781738638878, 0.004127128515392542, -0.06789719313383102, -0.03457561880350113, 0.0529562309384346, -0.01360631175339222, 0.013436120934784412, -0.0396992564201355, 0.014233330264687538, -0.004550366196781397, -0.004931056406348944, 0.031745072454214096, 0.011313213966786861, 0.07775034755468369, -0.007291334681212902, 0.0052132150158286095, 0.024901609867811203, 0.03579382598400116, 0.061555348336696625, 0.06108956038951874, 0.03869602829217911, 0.028502490371465683, 0.027732152491807938, 0.030992651358246803, -0.010363727807998657, 0.05130806565284729, 0.003706129966303706, 0.011340085417032242, 0.0852745771408081, 0.01543362345546484, -0.023701317608356476, -0.005893978290259838, 0.008451320230960846, -0.019813798367977142, -0.03769279643893242, 0.017923785373568535, -0.03221086040139198, 0.008800659328699112, 0.026012329384684563, 0.010229366831481457, -0.008805138058960438, -0.02615564875304699, 0.024973269551992416, 0.005334139801561832, 0.014260202646255493, 0.00429060123860836, -0.05163053423166275, 0.021999407559633255, 0.007318207062780857, -0.006722539197653532, 0.026137733832001686, 0.02791130170226097, -0.036187950521707535, 0.029631124809384346, 0.027194708585739136, -0.038194410502910614, 0.0251524168998003, -0.012110423296689987, 0.018255209550261497, -0.011483404785394669, 0.03509514778852463, -0.002669309265911579, -0.02182026021182537, 0.031315118074417114, 0.04080997779965401, 0.0071793668903410435, -0.005177385173738003, -0.048370033502578735, 0.0185239315032959, 0.013534652069211006, 0.028627894818782806, -0.04747429117560387, 0.027821727097034454, -0.01868516579270363, 0.030222313478589058, 0.0008313599391840398, -0.0027835164219141006, 0.0017108659958466887, 0.009199263527989388, -0.012244784273207188, -0.003990527708083391, 0.0027544046752154827, -0.003473237156867981, 0.0006572502315975726, -0.006771804764866829, -0.03314243257045746, 0.000599586870521307, 0.0015653080772608519, 0.005629734601825476, 0.013256972655653954, 0.019867543131113052, -0.03360821679234505, 0.055786773562431335, 0.010820555500686169, 0.02350425347685814, -0.01741321198642254, 0.0029022020753473043, -0.013615269213914871, -0.019258439540863037, -0.01965256594121456, -0.006579220294952393, -0.0370478630065918, -0.025797352194786072, -0.002391629386693239, 0.02393420971930027, -0.010928045026957989, -0.037191182374954224, 0.017135532572865486, -0.03941262140870094, 0.029559465125203133, 0.007864609360694885, -0.044500432908535004, 0.032748304307460785, -0.06040879711508751, -0.021838175132870674, -0.03183464705944061, 0.03694037348031998, -0.013203227892518044, -0.02330719120800495, -0.007810864597558975, -0.009235093370079994, 0.0034911520779132843, -0.028789127245545387, 0.05421026796102524, -0.02769632264971733, -0.020870773121714592, 0.004480946343392134, -0.07158765196800232, -0.07319998741149902, 0.01641893945634365, 0.03837355971336365, 0.06151951849460602, -0.018022315576672554, 0.03199588134884834, -0.019562991335988045, -0.025277821347117424, -0.010578705929219723, -0.021246984601020813, -0.03360821679234505, -0.04245813935995102, 0.0066374437883496284, -0.024059614166617393, -0.039950065314769745, -0.0026290009263902903, 0.0386601984500885, 0.015809835866093636, -0.04729514569044113, -0.0022874996066093445, 0.019186779856681824, -0.04951658472418785, 0.01543362345546484, 0.05965637415647507, -0.01716240495443344, -0.0699036568403244, 0.026890156790614128, 0.027839642018079758, 0.06313185393810272, -0.06180615350604057, -0.006135828327387571, -0.017332594841718674, -0.02393420971930027, -0.017547573894262314, -0.042386483401060104, 0.019724225625395775, -0.04675769805908203, -0.06947369873523712, -0.039376791566610336, -0.014197500422596931, 0.029792357236146927, -0.04543200135231018, 0.04385549575090408, 0.0011723014758899808, -0.011850658804178238, 0.001598898321390152, 0.004543648101389408, 0.04632774367928505, -0.003614316461607814, 0.079398512840271, -0.04080997779965401, 0.02896827645599842, 0.010623492300510406, 0.018398527055978775, -0.013283844105899334, -0.024758292362093925, -0.0008033680496737361, 0.0035919228103011847, 0.057112470269203186, 0.038051094859838486, -0.013301759026944637, 0.050698962062597275, -0.01578296348452568, 0.01180587150156498, -0.03930513188242912, 0.0635618045926094, -0.00963817723095417, -0.04983904957771301, 0.009960643947124481, 0.0026290009263902903, -0.08885754644870758, -0.05338618531823158, 0.002248310949653387, -0.013830246403813362, -0.013937735930085182, 0.032336264848709106, -0.02509867399930954, 0.06474418938159943, -0.051594704389572144, -0.04220733419060707, 0.014493095688521862, -0.043174732476472855, 0.005383405834436417, -0.06503082066774368, 0.04102495312690735, 0.023952124640345573, 0.04192069545388222, 0.02239353395998478, -0.05704081058502197, 0.0070584421046078205, 0.01652642898261547, -0.015254475176334381, -0.000666767475195229, 0.04080997779965401, 0.004527972545474768, 0.05130806565284729, 0.039627596735954285, 0.018918057903647423, 0.04374800994992256, 0.056575026363134384, -0.03959176689386368, 0.014493095688521862, -0.05195299908518791, 0.019688395783305168, 0.006865857634693384, 0.03726284205913544, -0.030885161831974983, -0.024131271988153458, 0.021999407559633255, 0.05173802003264427, 0.009024593979120255, -0.024131271988153458, 0.0022012845147401094, 0.052347127348184586, 0.02319970168173313, -0.01281805895268917, -0.009566517546772957, 0.04414213448762894, -0.0370478630065918, 0.019670480862259865, -0.029362402856349945, 0.0667148157954216, -0.0018967323703691363, 0.031153885647654533, -0.0007675383822061121, 0.00366806099191308, -0.014681201428174973, 0.055464304983615875, 0.03665373846888542, -0.038409389555454254, 0.024077527225017548, 0.019992947578430176, -0.03059852495789528, -0.0288607869297266, -0.027194708585739136, -0.012513507157564163, -0.03149426728487015, 0.023862550035119057, 0.006570262834429741, -0.02393420971930027, 0.026191478595137596, -0.0201183520257473, -0.002570777665823698, 0.04761761054396629, 0.028986191377043724, -0.011716296896338463, -0.0174759142100811, 0.010462258942425251, 0.01683993823826313, -0.013203227892518044, -0.04890747740864754, 0.00756005709990859, -0.052024658769369125, -0.026925984770059586, -0.05908310040831566, 0.023002637550234795, -0.032175030559301376, 0.04761761054396629, -0.03575799614191055, -0.0019146471749991179, 0.05532098561525345, 0.022769745439291 ]
39,430
pyspark.sql.pandas.conversion
toPandas
Returns the contents of this :class:`DataFrame` as Pandas ``pandas.DataFrame``. This is only available if Pandas is installed and available. .. versionadded:: 1.3.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Notes ----- This method should only be used if the resulting Pandas ``pandas.DataFrame`` is expected to be small, as all the data is loaded into the driver's memory. Usage with ``spark.sql.execution.arrow.pyspark.enabled=True`` is experimental. Examples -------- >>> df.toPandas() # doctest: +SKIP age name 0 2 Alice 1 5 Bob
def toPandas(self) -> "PandasDataFrameLike": """ Returns the contents of this :class:`DataFrame` as Pandas ``pandas.DataFrame``. This is only available if Pandas is installed and available. .. versionadded:: 1.3.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Notes ----- This method should only be used if the resulting Pandas ``pandas.DataFrame`` is expected to be small, as all the data is loaded into the driver's memory. Usage with ``spark.sql.execution.arrow.pyspark.enabled=True`` is experimental. Examples -------- >>> df.toPandas() # doctest: +SKIP age name 0 2 Alice 1 5 Bob """ from pyspark.sql.dataframe import DataFrame assert isinstance(self, DataFrame) from pyspark.sql.pandas.types import _create_converter_to_pandas from pyspark.sql.pandas.utils import require_minimum_pandas_version require_minimum_pandas_version() import pandas as pd jconf = self.sparkSession._jconf if jconf.arrowPySparkEnabled(): use_arrow = True try: from pyspark.sql.pandas.types import to_arrow_schema from pyspark.sql.pandas.utils import require_minimum_pyarrow_version require_minimum_pyarrow_version() to_arrow_schema(self.schema) except Exception as e: if jconf.arrowPySparkFallbackEnabled(): msg = ( "toPandas attempted Arrow optimization because " "'spark.sql.execution.arrow.pyspark.enabled' is set to true; however, " "failed by the reason below:\n %s\n" "Attempting non-optimization as " "'spark.sql.execution.arrow.pyspark.fallback.enabled' is set to " "true." % str(e) ) warn(msg) use_arrow = False else: msg = ( "toPandas attempted Arrow optimization because " "'spark.sql.execution.arrow.pyspark.enabled' is set to true, but has " "reached the error below and will not continue because automatic fallback " "with 'spark.sql.execution.arrow.pyspark.fallback.enabled' has been set to " "false.\n %s" % str(e) ) warn(msg) raise # Try to use Arrow optimization when the schema is supported and the required version # of PyArrow is found, if 'spark.sql.execution.arrow.pyspark.enabled' is enabled. if use_arrow: try: import pyarrow self_destruct = jconf.arrowPySparkSelfDestructEnabled() batches = self._collect_as_arrow(split_batches=self_destruct) if len(batches) > 0: table = pyarrow.Table.from_batches(batches) # Ensure only the table has a reference to the batches, so that # self_destruct (if enabled) is effective del batches # Pandas DataFrame created from PyArrow uses datetime64[ns] for date type # values, but we should use datetime.date to match the behavior with when # Arrow optimization is disabled. pandas_options = {"date_as_object": True} if self_destruct: # Configure PyArrow to use as little memory as possible: # self_destruct - free columns as they are converted # split_blocks - create a separate Pandas block for each column # use_threads - convert one column at a time pandas_options.update( { "self_destruct": True, "split_blocks": True, "use_threads": False, } ) # Rename columns to avoid duplicated column names. pdf = table.rename_columns( [f"col_{i}" for i in range(table.num_columns)] ).to_pandas(**pandas_options) # Rename back to the original column names. pdf.columns = self.columns else: pdf = pd.DataFrame(columns=self.columns) if len(pdf.columns) > 0: timezone = jconf.sessionLocalTimeZone() struct_in_pandas = jconf.pandasStructHandlingMode() error_on_duplicated_field_names = False if struct_in_pandas == "legacy": error_on_duplicated_field_names = True struct_in_pandas = "dict" return pd.concat( [ _create_converter_to_pandas( field.dataType, field.nullable, timezone=timezone, struct_in_pandas=struct_in_pandas, error_on_duplicated_field_names=error_on_duplicated_field_names, )(pser) for (_, pser), field in zip(pdf.items(), self.schema.fields) ], axis="columns", ) else: return pdf except Exception as e: # We might have to allow fallback here as well but multiple Spark jobs can # be executed. So, simply fail in this case for now. msg = ( "toPandas attempted Arrow optimization because " "'spark.sql.execution.arrow.pyspark.enabled' is set to true, but has " "reached the error below and can not continue. Note that " "'spark.sql.execution.arrow.pyspark.fallback.enabled' does not have an " "effect on failures in the middle of " "computation.\n %s" % str(e) ) warn(msg) raise # Below is toPandas without Arrow optimization. rows = self.collect() if len(rows) > 0: pdf = pd.DataFrame.from_records( rows, index=range(len(rows)), columns=self.columns # type: ignore[arg-type] ) else: pdf = pd.DataFrame(columns=self.columns) if len(pdf.columns) > 0: timezone = jconf.sessionLocalTimeZone() struct_in_pandas = jconf.pandasStructHandlingMode() return pd.concat( [ _create_converter_to_pandas( field.dataType, field.nullable, timezone=timezone, struct_in_pandas=( "row" if struct_in_pandas == "legacy" else struct_in_pandas ), error_on_duplicated_field_names=False, timestamp_utc_localized=False, )(pser) for (_, pser), field in zip(pdf.items(), self.schema.fields) ], axis="columns", ) else: return pdf
(self) -> 'PandasDataFrameLike'
[ 0.03053855523467064, -0.001989449607208371, 0.015188487246632576, 0.028559204190969467, -0.009144398383796215, -0.028478413820266724, 0.0071549490094184875, 0.019702618941664696, -0.016713395714759827, 0.016885073855519295, 0.011068206280469894, 0.0006134977447800338, 0.020520616322755814, 0.050049297511577606, -0.0147239463403821, 0.010431986302137375, 0.01590549759566784, 0.03057895042002201, 0.050251271575689316, 0.06273330003023148, -0.01496631558984518, -0.04156636819243431, -0.029367102310061455, 0.0348002165555954, -0.026600051671266556, 0.03591107949614525, 0.004274286795407534, -0.018551364541053772, -0.02514583431184292, 0.028094662353396416, 0.0504128523170948, 0.006720704026520252, -0.036214038729667664, 0.030700134113430977, -0.018359487876296043, 0.012532521970570087, -0.009078756906092167, -0.02969026193022728, -0.003080112161114812, -0.02880157344043255, -0.03318442031741142, 0.011138897389173508, -0.022479768842458725, -0.06984280794858932, -0.06414712220430374, 0.00033231129054911435, -0.012391139753162861, -0.02112654037773609, 0.031144479289650917, 0.003037192625924945, 0.04237426444888115, 0.036900755017995834, 0.009381718933582306, 0.04883744940161705, -0.033467184752225876, 0.023954184725880623, -0.051947858184576035, 0.03395192697644234, -0.01890482008457184, -0.030821319669485092, 0.02451971359550953, 0.010149221867322922, -0.029872039332985878, 0.013310124166309834, 0.03780964016914368, 0.012956668622791767, 0.044192034751176834, -0.03978899121284485, -0.047867972403764725, -0.024863069877028465, -0.07303400337696075, -0.015612633898854256, -0.012532521970570087, 0.08450616151094437, -0.0653589740395546, 0.0009215089958161116, -0.020106568932533264, -0.05772433057427406, -0.017723267897963524, -0.009608940221369267, 0.038011614233255386, -0.020571110770106316, -0.043990060687065125, -0.03657759353518486, 0.018379686400294304, 0.01700625941157341, 0.05162470042705536, 0.06362199038267136, -0.02191423997282982, 0.013855455443263054, 0.021651674062013626, 0.045525066554546356, 0.030275987461209297, 0.04609059542417526, 0.007816416211426258, -0.04677731171250343, -0.0067762467078864574, -0.015531844459474087, -0.034335676580667496, 0.01699616014957428, -0.03164941444993019, 0.03952642157673836, 0.032134152948856354, 0.013421210460364819, 0.011835710145533085, -0.01870284602046013, -0.0030624393839389086, -0.0213285144418478, 0.06107711046934128, -0.03952642157673836, -0.09072697907686234, 0.0537252351641655, -0.03372975438833237, -0.03902148827910423, -0.006215767469257116, 0.027670515701174736, -0.020258048549294472, -0.03362876549363136, -0.06754029542207718, 0.041404787451028824, -0.00020465704437810928, 0.057764727622270584, 0.011199490167200565, -0.0766291543841362, -0.04241465777158737, -0.020106568932533264, 0.048110343515872955, -0.019955087453126907, 0.02688281610608101, 0.07808336615562439, 0.05837064981460571, 0.0009139349567703903, -0.017087047919631004, 0.047908369451761246, 0.03247750923037529, -0.010305752046406269, 0.07166057825088501, 0.032356325536966324, -0.04605020210146904, 0.009901802986860275, 0.008952522650361061, -0.022903915494680405, 0.04964534938335419, -0.016238754615187645, 0.04362650588154793, 0.01281528640538454, 0.03684016317129135, 0.0029816494788974524, -0.08385983854532242, 0.018672548234462738, 0.03364896401762962, -0.0252064261585474, 0.007922452874481678, -0.052149832248687744, -0.010714750736951828, -0.041000839322805405, 0.01787474937736988, -0.02191423997282982, 0.004690859466791153, -0.007568996865302324, 0.011956894770264626, -0.00533212861046195, -0.03720371425151825, 0.04116241633892059, -0.05614893138408661, 0.01939965784549713, 0.00683178985491395, -0.014501773752272129, -0.010482479818165302, -0.01407762710005045, 0.07913363724946976, 0.06047118455171585, -0.021005354821681976, -0.0271453820168972, -0.07889126986265182, 0.06867135316133499, 0.05655287951231003, 0.02797347865998745, 0.010997515171766281, -0.035204168409109116, 0.007159998640418053, 0.009316077455878258, -0.0873338058590889, 0.0417279452085495, 0.027428146451711655, 0.02476208284497261, -0.04903942719101906, -0.010411788709461689, 0.04907982051372528, 0.029548879712820053, -0.023166483268141747, 0.003655739827081561, 0.03964760899543762, 0.05481589958071709, 0.0034739626571536064, -0.06180422008037567, 0.03096270188689232, -0.03653720021247864, -0.06285448372364044, 0.06899451464414597, 0.03869832679629326, 0.0026206199545413256, 0.04039491340517998, -0.010785441845655441, -0.040354520082473755, -0.024418724700808525, -0.06790385395288467, -0.005029166582971811, 0.01184580847620964, -0.024398528039455414, 0.008599067106842995, -0.05315970629453659, 0.010886428877711296, -0.017602084204554558, 0.03576969727873802, 0.006796444300562143, 0.025307413190603256, -0.014996611513197422, 0.06043079122900963, 0.025489190593361855, 0.050493642687797546, -0.009088855236768723, -0.0670151636004448, 0.017723267897963524, 0.039930373430252075, -0.034780021756887436, 0.029387298971414566, 0.04128360375761986, 0.04932219162583351, -0.09444330632686615, 0.026115311309695244, -0.06632845103740692, -0.019328966736793518, -0.04021313786506653, 0.028942955657839775, 0.004451014567166567, -0.04750441759824753, -0.002827643882483244, -0.005640139803290367, -0.0555834025144577, 0.0001631575869396329, 0.029367102310061455, 0.0412634052336216, 0.0009473869577050209, -0.0174506027251482, -0.013350519351661205, 0.014936019666492939, 0.054331161081790924, 0.008508178405463696, -0.011007614433765411, 0.040960442274808884, -0.038435760885477066, -0.014027133584022522, 0.00505946297198534, 0.004809519276022911, -0.04237426444888115, 0.042091500014066696, 0.015784312039613724, 0.021873846650123596, 0.05534103140234947, -0.043990060687065125, -0.04285900294780731, -0.02472168765962124, 0.0010067169787362218, 0.017581885680556297, -0.005826966371387243, -0.029367102310061455, -0.019066398963332176, 0.011734722182154655, 0.042091500014066696, 0.08757617324590683, 0.00204499252140522, -0.002031106734648347, 0.011552945710718632, 0.020964959636330605, -0.030275987461209297, -0.029528681188821793, -0.031083885580301285, -0.006952974479645491, -0.005082184914499521, 0.0032719881273806095, -0.02108614519238472, -0.021671870723366737, -0.020702393725514412, -0.029528681188821793, 0.019116893410682678, -0.02041962929069996, -0.03116467595100403, 0.013077853247523308, 0.00019582065579015762, -0.01548135094344616, -0.009316077455878258, -0.00794264953583479, 0.016299348324537277, -0.03298244625329971, 0.025549782440066338, 0.029387298971414566, -0.06802503764629364, -0.04495953768491745, -0.03675937280058861, -0.009750322438776493, 0.009295879863202572, 0.08434458076953888, 0.11140917241573334, -0.01849077269434929, 0.01746070198714733, -0.011653932742774487, -0.024418724700808525, 0.05707801505923271, -0.005478559993207455, -0.016450827941298485, 0.011128799058496952, 0.016026681289076805, 0.05315970629453659, -0.05881499499082565, -0.05311931297183037, -0.009714976884424686, 0.02217680774629116, 0.010265357792377472, 0.011775117367506027, -0.06192540377378464, 0.020924566313624382, -0.007998192682862282, 0.0013140970841050148, 0.03641601651906967, 0.042535845190286636, 0.010442085564136505, -0.023631025105714798, 0.02342904917895794, 0.0022191954776644707, 0.040758468210697174, 0.0023757258895784616, 0.05360405147075653, -0.0070792087353765965, -0.018440278246998787, -0.008952522650361061, -0.009078756906092167, -0.031144479289650917, 0.013562592677772045, 0.048958636820316315, 0.03419429436326027, 0.002782199764624238, 0.04047570377588272, -0.04754481464624405, 0.0036734123714268208, -0.0349012054502964, -0.022924114018678665, 0.005614893045276403, -0.005534103140234947, -0.0033780247904360294, 0.0015362690901383758, 0.02431773766875267, -0.03995056822896004, 0.08103219419717789, -0.0001343604235444218, -0.04859508201479912, -0.012391139753162861, 0.05231141299009323, -0.017753563821315765, 0.006291507743299007, 0.06394515186548233, -0.01913709007203579, -0.017541490495204926, -0.006634864490479231, 0.03635542094707489, -0.007407417520880699, -0.0601884201169014, -0.019965186715126038, -0.01020981464534998, -0.023570431396365166, 0.024842871353030205, -0.02880157344043255, 0.023994578048586845, -0.030881911516189575, -0.009336274117231369, 0.02668084017932415, -0.059097759425640106, 0.058007095009088516, -0.002878137631341815, 0.03514357656240463, 0.0292661152780056, -0.09395857155323029, -0.002751903608441353, 0.045525066554546356, 0.03932444751262665, -0.002258328255265951, 0.020268147811293602, -0.059097759425640106, 0.01236084382981062, -0.02217680774629116, -0.0657225251197815, 0.016016583889722824, -0.013047557324171066, 0.0167537909001112, 0.03298244625329971, 0.023732012137770653, -0.06378357112407684, 0.03750667721033096, 0.01213867124170065, -0.014744143933057785, -0.007705329917371273, -0.03813279792666435, -0.02306549623608589, -0.0215102918446064, -0.029367102310061455, 0.04730244353413582, 0.0805070623755455, -0.07319558411836624, -0.01130047719925642, 0.052796151489019394, 0.03265928849577904, -0.03704213723540306, -0.04411124438047409, 0.04479796066880226, -0.009826063178479671, 0.0786488950252533, 0.01978340931236744, -0.03241691738367081, 0.043141767382621765, 0.030619345605373383, 0.0430205836892128, -0.019955087453126907, -0.038779117166996, 0.009805865585803986, 0.00849808007478714, -0.006442988757044077, -0.022742336615920067, 0.02967006340622902, 0.012280053459107876, 0.04197031632065773, 0.015067302621901035, -0.036920949816703796, -0.057764727622270584, -0.0031533280853182077, 0.015582337975502014, 0.05942091718316078, 0.027165580540895462, 0.009245386347174644, -0.012492126785218716, 0.021045750007033348, 0.08418300002813339, -0.04738323390483856, 0.012885977514088154, -0.03894069790840149, 0.007326627615839243, 0.001324195764027536, -0.00725593650713563, 0.0023340685293078423, -0.0899190753698349, -0.035830289125442505, 0.07965876907110214, 0.006700506433844566, 0.024640897288918495, -0.0007687656907364726, -0.07121623307466507, 0.00689238216727972, 0.028700586408376694, -0.04629257321357727, -0.028882363811135292, 0.05307891592383385, 0.04920100420713425, 0.0028730882331728935, -0.02516603097319603, 0.02536800503730774, 0.021469896659255028, 0.008599067106842995, -0.05150351673364639, -0.027832096442580223, -0.04233387112617493, -0.002971550915390253, 0.0504128523170948, -0.04540388286113739, -0.0017079474637284875, -0.06564173847436905, 0.011542846448719501, 0.038839709013700485, -0.04289939999580383, -0.0006475809495896101, 0.01696586422622204, 0.019389558583498, -0.027650319039821625, -0.02451971359550953, 0.03510317951440811, -0.006947925314307213, 0.047464024275541306, -0.04479796066880226, -0.010022987611591816, -0.0013216710649430752, 0.016471026465296745, -0.005195796024054289, -0.03576969727873802, 0.0485546849668026, 0.017056751996278763, 0.02857940085232258, -0.019268373027443886, 0.048918239772319794, 0.019924791529774666, 0.019631927832961082, 0.00424146605655551, -0.03417409583926201, 0.041647154837846756, -0.02603452280163765, -0.04306097701191902, 0.014097824692726135, 0.016430631279945374, -0.05618932470679283, 0.04677731171250343, 0.0408998504281044, -0.06030960753560066, -0.0009688467835076153, -0.049604956060647964, -0.002774625550955534, -0.025751758366823196, -0.00019313818484079093, -0.021005354821681976, 0.017763663083314896, 0.013421210460364819, -0.024459119886159897, 0.009220139123499393, -0.0213285144418478, -0.024863069877028465, 0.03100309707224369, -0.004102608654648066, -0.01679418608546257, -0.04168755188584328, 0.022318189963698387, 0.0012288889847695827, 0.0006602043868042529, 0.0633392259478569, -0.011997289024293423, -0.042091500014066696, 0.0027115086559206247, 0.056674063205718994, -0.04920100420713425, 0.05420997366309166, -0.002299985382705927, -0.005927953403443098, -0.0006188626866787672, 0.03074052929878235, -0.026074916124343872, 0.030659738928079605, 0.007765922229737043, -0.016279149800539017, -0.059097759425640106, -0.0011821824591606855, -0.02213641256093979, 0.007442763075232506, 0.011775117367506027, 0.06608607620000839, 0.023146286606788635, -0.008366796188056469, -0.0262162983417511, 0.07073149085044861, 0.05812828242778778, 0.038233786821365356, -0.014693649485707283, 0.030881911516189575, 0.028276439756155014, 0.03857714310288429, -0.035406142473220825, -0.03896089270710945, -0.07565967738628387, 0.08587958663702011, -0.0917772427201271, -0.019026003777980804, 0.022520164027810097, -0.000015710229490650818, 0.049806930124759674, -0.008801042102277279, -0.08539484441280365, 0.054573528468608856, -0.017531393095850945, -0.031528230756521225, -0.07162018120288849, 0.009088855236768723, -0.03782983869314194, -0.03053855523467064, 0.053442470729351044, -0.0681462213397026, -0.006907530128955841, -0.011825610883533955, 0.04326295107603073, -0.0005636352580040693, 0.011078305542469025, -0.043384138494729996, -0.009341323748230934, -0.016036780551075935, -0.019934890791773796, 0.06879253685474396, -0.0749729573726654, -0.03437606990337372, -0.026196101680397987, 0.02581235021352768, -0.0348002165555954, 0.016733592376112938, 0.043384138494729996, -0.030841516330838203, -0.027165580540895462, 0.03403271362185478, -0.01268400251865387, -0.0361938439309597, 0.07622520625591278, -0.027690714225172997, -0.04083925858139992, 0.03229573369026184, 0.013441408053040504, -0.021611278876662254, 0.04641375690698624, 0.043586112558841705, 0.008886881172657013, -0.024055171757936478, 0.08644511550664902, -0.004009195137768984, -0.040314123034477234, 0.010805639438331127, -0.05578537657856941, -0.0792144238948822, -0.07998193055391312, -0.03827418014407158, 0.006756049580872059, -0.08571800589561462, 0.02688281610608101, 0.045080725103616714, 0.006634864490479231, -0.07307440042495728, -0.0019503169460222125, 0.0349012054502964, -0.08515247702598572, 0.010391592048108578, -0.016632605344057083, 0.045969411730766296, -0.015562140382826328, 0.07501335442066193, 0.0038526649586856365, 0.02752913348376751, -0.05328088998794556, -0.024661095812916756, -0.01980360597372055, 0.020924566313624382, 0.037526875734329224, -0.02106594853103161, -0.023732012137770653, 0.0016915369778871536, -0.016511421650648117, -0.008962621912360191, -0.03894069790840149, -0.028660191223025322, -0.04952416568994522, 0.015137993730604649, 0.022944310680031776, -0.036678582429885864, -0.007503355387598276, -0.010947021655738354, -0.008139574900269508, 0.010149221867322922, 0.07153939455747604, -0.034093309193849564, 0.022075820714235306, -0.0035067833960056305, 0.014501773752272129, 0.01912699267268181, -0.043586112558841705, -0.018460474908351898, 0.006518729031085968, 0.054977476596832275, 0.02239898033440113, -0.029851840808987617, 0.05489668622612953, 0.03354797512292862, 0.04798915609717369, -0.01504710502922535, 0.0666516050696373, -0.03415390104055405, -0.04435361549258232, 0.06414712220430374, 0.020964959636330605, -0.026963604614138603, -0.06301606446504593, -0.01442098431289196, -0.036052461713552475, -0.00403696671128273, 0.06798464059829712, -0.040132347494363785, 0.017117345705628395, -0.07525572180747986, -0.015693424269557, 0.07263005524873734, -0.02213641256093979, 0.0030321432277560234, -0.08555642515420914, 0.025953732430934906, 0.0030220444314181805, -0.03679976612329483, 0.05247299373149872, -0.022257598116993904, -0.01872304268181324, 0.0008811140432953835, -0.04192991927266121, -0.0006867135525681078, 0.020581208169460297, -0.013683777302503586, -0.015037006698548794, 0.02581235021352768, 0.043182164430618286, 0.05126114562153816, 0.05812828242778778, 0.007134751882404089, 0.04459598660469055, -0.02453991025686264, -0.054977476596832275, -0.001358279027044773, 0.03932444751262665, -0.03096270188689232, -0.008220365270972252, -0.003342679236084223, 0.0041833980940282345, -0.008866683579981327, 0.0204499252140522, -0.027508936822414398, 0.013905948959290981, 0.012744595296680927, 0.014037232846021652, 0.025246821343898773, 0.0147239463403821, -0.04576743766665459, 0.024661095812916756, -0.03766825795173645, 0.006872184574604034, 0.02324727363884449, -0.021389106288552284, 0.01451187301427126, 0.00472620502114296, 0.007533651310950518, -0.019116893410682678, 0.03247750923037529, -0.0478275790810585, 0.012714299373328686, 0.031083885580301285, -0.023146286606788635, -0.0010622600093483925, -0.023530038073658943, 0.0028301686979830265, -0.044232431799173355, -0.01703655533492565, -0.006246063392609358, -0.045484673231840134, 0.0007750774384476244, -0.004173299763351679, -0.0005175598198547959, -0.009417064487934113, 0.015026908367872238, -0.02342904917895794, -0.02797347865998745, 0.00630160653963685, 0.03910227492451668, 0.036900755017995834, -0.015794411301612854, 0.06002684310078621, -0.027448343113064766, -0.048514291644096375, -0.05065522342920303, 0.0015829757321625948, 0.005160450469702482, 0.02391378954052925, 0.03635542094707489, -0.035163771361112595, 0.0035799993202090263, 0.03467903286218643 ]
39,431
pyspark.sql.dataframe
to_koalas
null
def to_koalas( self, index_col: Optional[Union[str, List[str]]] = None ) -> "PandasOnSparkDataFrame": return self.pandas_api(index_col)
(self, index_col: Union[str, List[str], NoneType] = None) -> 'PandasOnSparkDataFrame'
[ -0.02730470336973667, -0.021183453500270844, 0.050362009555101395, -0.01895267702639103, -0.013411427848041058, -0.003964089788496494, -0.03374718502163887, 0.026912087574601173, 0.012742195278406143, 0.04051090031862259, -0.010065263137221336, -0.02157606929540634, -0.003589319298043847, -0.014044968411326408, 0.035157036036252975, -0.006670021452009678, 0.016124052926898003, 0.01756959594786167, 0.07759533077478409, 0.07859471440315247, 0.014892663806676865, -0.056608185172080994, 0.007459716405719519, 0.05332447960972786, -0.04250967502593994, -0.003515703836455941, -0.010796958580613136, -0.00014207257481757551, -0.010939727537333965, -0.052860479801893234, 0.029428403824567795, -0.032658565789461136, -0.02530592866241932, 0.032230257987976074, -0.01115388236939907, -0.01671297661960125, -0.01746251806616783, -0.03408626466989517, 0.09230060875415802, -0.040046900510787964, 0.045686300843954086, -0.0212726853787899, -0.023396383970975876, -0.0543595626950264, -0.0458647646009922, 0.01177849993109703, 0.0002715970331337303, 0.006420174613595009, 0.04386598989367485, -0.03378288075327873, -0.03301549330353737, 0.019291754812002182, -0.006687867920845747, 0.04989800974726677, -0.03612073138356209, -0.01947021670639515, -0.046935535967350006, 0.024324387311935425, 0.017257286235690117, -0.010618495754897594, -0.012724349275231361, 0.013679121620953083, -0.004428091458976269, 0.024770541116595268, 0.0679226815700531, 0.024449309334158897, -0.008566182106733322, 0.036406271159648895, 0.008325258269906044, -0.05125432088971138, -0.026519469916820526, -0.0385478176176548, 0.004242937080562115, 0.054109714925289154, -0.056322645395994186, -0.05700080096721649, -0.06071281433105469, 0.010020648129284382, -0.04847031086683273, 0.010395417921245098, -0.03926166519522667, 0.007553409319370985, -0.06299712508916855, 0.03829796984791756, 0.006643252447247505, -0.004840785171836615, 0.028089936822652817, 0.05275340378284454, 0.01914898492395878, -0.03529980778694153, -0.014205584302544594, 0.0223969966173172, -0.022111456841230392, 0.03958289697766304, -0.03654904291033745, -0.04311644658446312, 0.007223254069685936, -0.0027750858571380377, 0.019238216802477837, 0.006571867503225803, -0.05528756231069565, 0.002864317037165165, 0.050469085574150085, 0.07209869474172592, -0.03314041346311569, 0.021718839183449745, -0.0012514656409621239, -0.02020191214978695, 0.012795734219253063, -0.0026122392155230045, -0.05746480077505112, 0.06521005928516388, 0.028785940259695053, -0.09108706563711166, -0.03822658583521843, 0.02312869019806385, 0.012483425438404083, -0.02134406939148903, -0.047756463289260864, 0.0264480859041214, 0.05039770156145096, 0.038797665387392044, -0.0404038242995739, -0.04065367206931114, 0.004202783107757568, 0.0687079131603241, 0.012072962708771229, -0.04176013544201851, 0.01714128628373146, 0.08466242998838425, 0.023146536201238632, 0.04497245326638222, 0.013527428731322289, 0.029749635607004166, 0.002012160373851657, 0.0172483641654253, 0.05303893983364105, 0.004042166750878096, -0.025752084329724312, -0.005148631986230612, -0.018720675259828568, -0.03278348967432976, 0.060248810797929764, -0.022004378959536552, 0.017953289672732353, 0.031177332624793053, 0.01317942701280117, -0.036834582686424255, -0.01968437246978283, -0.013108043000102043, 0.04832754284143448, 0.003292626002803445, -0.01759636402130127, -0.030338559299707413, -0.0010908497497439384, -0.07331223785877228, -0.0026769316755235195, -0.019541602581739426, 0.07009992003440857, -0.017408980056643486, -0.005893711466342211, -0.026019776239991188, -0.008552797138690948, 0.012117577716708183, -0.06835099309682846, -0.008606336079537868, 0.016489898785948753, -0.003966320771723986, 0.0002824720577336848, -0.039939820766448975, 0.019862834364175797, 0.029624711722135544, -0.05243217200040817, 0.014928355813026428, -0.04975523799657822, 0.020398220047354698, -0.013134812004864216, 0.05385986715555191, 0.034942883998155594, -0.048398926854133606, -0.030784714967012405, 0.02241484262049198, -0.07673870772123337, 0.007441870402544737, 0.0293748639523983, -0.010984343476593494, -0.04061797633767128, -0.00453962991014123, -0.01379512157291174, 0.018667137250304222, 0.0025787774939090014, 0.001712120953015983, 0.021647455170750618, 0.059106651693582535, -0.01863144524395466, -0.051218628883361816, 0.018792061135172844, -0.03019579127430916, -0.08644705265760422, -0.01265296433120966, 0.03367580100893974, 0.04076074808835983, 0.015588666312396526, 0.003511242102831602, -0.012938503175973892, -0.036834582686424255, -0.021112069487571716, 0.0128581952303648, -0.009030182845890522, -0.021397607401013374, 0.07366916537284851, -0.03904751315712929, -0.059534963220357895, -0.020772989839315414, 0.0192739088088274, 0.012617271393537521, -0.009351414628326893, -0.010877266526222229, 0.08087903261184692, 0.011653576046228409, 0.02373546175658703, -0.012733272276818752, -0.01834590546786785, 0.025966238230466843, 0.03333672508597374, -0.041938599199056625, 0.018720675259828568, 0.008294027298688889, 0.0033729339484125376, -0.05378848314285278, -0.04572199285030365, -0.04914846643805504, -0.05510910227894783, -0.023057306185364723, -0.06374666839838028, 0.04729245975613594, 0.007477562874555588, -0.025341620668768883, -0.0069421762600541115, -0.05086170509457588, 0.01863144524395466, -0.023896077647805214, 0.01416096929460764, 0.020344682037830353, -0.012019423767924309, 0.046293072402477264, 0.027982860803604126, 0.019523756578564644, -0.009449569508433342, -0.0308382548391819, 0.04700692370533943, -0.020487451925873756, 0.0425453707575798, 0.021022837609052658, 0.041010595858097076, -0.013295427896082401, -0.0036919349804520607, 0.01705205626785755, -0.04258106276392937, -0.015695743262767792, -0.0888027474284172, -0.021022837609052658, -0.01714128628373146, 0.00736602395772934, -0.0063800206407904625, -0.03385426476597786, -0.02237914875149727, 0.026751471683382988, 0.038797665387392044, 0.027982860803604126, -0.04383029788732529, 0.013241888955235481, -0.033033337444067, -0.013982507400214672, 0.03872628137469292, 0.01673082448542118, -0.028464708477258682, -0.024413617327809334, -0.05960634723305702, 0.036495503038167953, -0.01203726977109909, 0.004715861286967993, 0.017533903941512108, 0.0017333133146166801, -0.02980317361652851, 0.04272383078932762, -0.015240664593875408, -0.038797665387392044, -0.0027193166315555573, -0.05111154913902283, 0.012679733335971832, 0.022057916969060898, -0.002340084407478571, 0.02291453629732132, 0.023414229974150658, 0.01683790050446987, 0.00905695278197527, -0.031070254743099213, 0.02543085254728794, -0.038690585643053055, -0.02666223980486393, -0.031177332624793053, 0.06124819815158844, 0.03215887397527695, -0.013331119902431965, -0.015240664593875408, -0.029446249827742577, -0.010600649751722813, 0.04500814527273178, -0.012278193607926369, -0.0172483641654253, 0.05468079447746277, 0.011421575210988522, 0.0041313981637358665, -0.0639251321554184, -0.035585347563028336, -0.010680957697331905, -0.008762490004301071, 0.02666223980486393, 0.05646541342139244, -0.07595347613096237, -0.06581682711839676, -0.026483777910470963, -0.07987964153289795, 0.055787257850170135, 0.0525035560131073, 0.0033327799756079912, -0.07745256274938583, -0.0036986274644732475, -0.05403833091259003, 0.013313273899257183, -0.021504685282707214, 0.0326407216489315, -0.012483425438404083, -0.07809502631425858, -0.01925606280565262, 0.008530489169061184, -0.016382822766900063, -0.017783749848604202, 0.07167038321495056, -0.011528653092682362, -0.028250552713871002, 0.03740565851330757, 0.009984955191612244, -0.03704873472452164, -0.02719762735068798, -0.015856359153985977, -0.03726289048790932, -0.009547723457217216, 0.0334259532392025, 0.01640959084033966, 0.03428257256746292, -0.008646490052342415, 0.05896388366818428, 0.05564448982477188, 0.021522531285881996, -0.006098942831158638, 0.07049253582954407, -0.055680181831121445, -0.018809907138347626, 0.06396082043647766, -0.0466499961912632, -0.015008663758635521, -0.01171603798866272, -0.004372322000563145, 0.030053021386265755, 0.01642743870615959, -0.011707114987075329, 0.039939820766448975, -0.008588489145040512, 0.0012737733777612448, -0.012099731713533401, 0.051504168659448624, 0.01968437246978283, 0.01474097091704607, 0.04764938727021217, -0.03624565526843071, -0.013000965118408203, -0.02876809425652027, -0.06153373792767525, 0.029107172042131424, -0.06317558884620667, 0.06935037672519684, 0.05189678445458412, 0.022664688527584076, -0.008084333501756191, -0.013670198619365692, -0.052646324038505554, -0.05207524448633194, 0.00023701999452896416, -0.008606336079537868, -0.006670021452009678, -0.0034710881300270557, 0.022432688623666763, 0.012938503175973892, 0.003468857379630208, -0.0414745956659317, 0.02803639881312847, 0.04033244028687477, -0.005197708960622549, 0.009833262301981449, -0.05532325804233551, -0.008057564496994019, -0.013955737464129925, -0.04907708242535591, 0.004448168445378542, 0.056108489632606506, -0.05696510896086693, -0.021522531285881996, -0.01959514059126377, 0.039939820766448975, 0.031177332624793053, 0.012197885662317276, 0.04211705923080444, 0.021629609167575836, 0.050790317356586456, 0.0628543570637703, -0.0014109661569818854, 0.02928563393652439, 0.021522531285881996, 0.038583509624004364, -0.02364622987806797, -0.0031230871099978685, 0.024734849110245705, 0.08844582736492157, -0.0009374837973155081, -0.016382822766900063, -0.04325921833515167, 0.013081273064017296, 0.035763807594776154, 0.006206020247191191, -0.07067099958658218, -0.012126500718295574, -0.03114163875579834, -0.011287729255855083, 0.040475208312273026, 0.005434171296656132, -0.03847643360495567, 0.004385706502944231, 0.03542473167181015, 0.08087903261184692, -0.03231948986649513, -0.005706326104700565, 0.041081979870796204, 0.023824693635106087, -0.03253364562988281, 0.0006943291518837214, 0.03199825808405876, -0.03392564877867699, -0.01744467206299305, 0.06049865856766701, 0.025752084329724312, 0.02498469687998295, -0.004653399810194969, -0.007830025628209114, 0.05642972141504288, 0.00723663903772831, -0.03811950981616974, -0.0016530053690075874, 0.04418722167611122, 0.056322645395994186, -0.010395417921245098, 0.02791147492825985, -0.038369353860616684, 0.0638180524110794, 0.024717003107070923, -0.060677118599414825, -0.07566794008016586, -0.0005663383635692298, 0.0005395690677687526, 0.012733272276818752, -0.017953289672732353, -0.02635885402560234, -0.06956453621387482, 0.05439525470137596, -0.00324131827801466, -0.017176978290081024, -0.012644041329622269, -0.02905363216996193, -0.021932994946837425, -0.08623289316892624, -0.008972182869911194, 0.02739393524825573, -0.019006215035915375, 0.025591468438506126, 0.021486839279532433, -0.012849272228777409, -0.05896388366818428, -0.009761878289282322, -0.050362009555101395, -0.007241100538522005, 0.056001413613557816, 0.01914898492395878, 0.04475829750299454, 0.04550784081220627, 0.08844582736492157, 0.03403272479772568, 0.008021872490644455, -0.05971342325210571, 0.02437792532145977, 0.03206964209675789, -0.0037499351892620325, -0.10400772094726562, -0.020291142165660858, 0.020398220047354698, -0.07431162893772125, 0.012019423767924309, -0.018809907138347626, -0.07759533077478409, -0.01968437246978283, -0.03542473167181015, 0.020059142261743546, -0.008994490839540958, 0.016034821048378944, 0.024145925417542458, 0.07452578097581863, -0.01228711660951376, -0.007482024375349283, 0.028571784496307373, 0.04229552298784256, -0.04800631105899811, 0.020683759823441505, -0.013108043000102043, -0.01359881367534399, -0.00857064314186573, 0.05553741008043289, 0.01052926480770111, 0.020540989935398102, 0.01959514059126377, 0.03467518836259842, -0.0333724170923233, -0.0024337770882993937, -0.001186773064546287, 0.06781560182571411, -0.012536963447928429, 0.007303562015295029, -0.01171603798866272, 0.05300324782729149, 0.13862937688827515, -0.0319625660777092, -0.023182228207588196, 0.01819421350955963, -0.014892663806676865, -0.06692329794168472, 0.02866101637482643, 0.00014060862304177135, -0.028803786262869835, 0.024342233315110207, 0.014803432859480381, 0.028785940259695053, -0.027161933481693268, -0.009824339300394058, 0.08965937048196793, 0.08980213850736618, 0.0192739088088274, 0.005309247877448797, 0.021950840950012207, 0.007825563661754131, -0.025912700220942497, -0.025466544553637505, -0.0033327799756079912, -0.06117681413888931, 0.10193756222724915, -0.04126043990254402, 0.021932994946837425, 0.05236078426241875, 0.024038847535848618, 0.010279417969286442, 0.00905695278197527, -0.06849376112222672, -0.02791147492825985, -0.06335405260324478, -0.024324387311935425, -0.07452578097581863, -0.002792932093143463, -0.01563328132033348, -0.0065004825592041016, 0.002663547173142433, -0.07830917835235596, -0.00422062911093235, -0.031088100746273994, 0.09244337677955627, 0.02311084419488907, 0.02543085254728794, 0.02668008580803871, -0.014241277240216732, 0.03092748485505581, -0.0168825164437294, 0.01135019026696682, 0.013215119950473309, 0.010734496638178825, -0.04961246997117996, 0.031070254743099213, 0.025359466671943665, 0.03105240873992443, 0.006241712719202042, -0.06849376112222672, -0.02105852961540222, 0.10193756222724915, 0.00018111115787178278, -0.006504944059997797, 0.02498469687998295, -0.039440128952264786, -0.006268481723964214, 0.03574596345424652, 0.053395867347717285, 0.014410816133022308, 0.048291850835084915, 0.009619108401238918, 0.003292626002803445, -0.008035256527364254, 0.06560267508029938, -0.05967773124575615, 0.008316334336996078, 0.017239440232515335, -0.015811743214726448, -0.02741178125143051, -0.038190893828868866, -0.019630832597613335, 0.003355087712407112, -0.028072090819478035, 0.0019430062966421247, 0.04457983747124672, 0.007995102554559708, -0.04989800974726677, -0.007084946148097515, 0.03364010900259018, -0.00837879627943039, -0.012412040494382381, -0.03645981103181839, 0.03954720497131348, -0.04700692370533943, 0.014964048750698566, 0.009699416346848011, -0.023717615753412247, -0.005215555429458618, -0.0023289306554943323, -0.024395771324634552, 0.026912087574601173, 0.049826622009277344, -0.025537928566336632, -0.0030606254003942013, 0.04864877462387085, 0.0045373993925750256, 0.021647455170750618, -0.022129302844405174, -0.03387210890650749, -0.02803639881312847, -0.06956453621387482, -0.014598201029002666, -0.03540688380599022, -0.04358045011758804, -0.05696510896086693, -0.022004378959536552, -0.005452017765492201, 0.05460940673947334, -0.009877878241240978, -0.008062026463449001, 0.011162805370986462, 0.009164029732346535, -0.004102397710084915, -0.03811950981616974, -0.003020471427589655, -0.015838513150811195, 0.06653067469596863, 0.03645981103181839, -0.01759636402130127, 0.01947021670639515, 0.02416377142071724, 0.05960634723305702, 0.010957574471831322, 0.04229552298784256, -0.02407453954219818, -0.012938503175973892, 0.07381193339824677, 0.03305118530988693, -0.005746480077505112, -0.015918821096420288, 0.007000176701694727, -0.09094429761171341, -0.05928511545062065, 0.036834582686424255, -0.01354527473449707, 0.019844988361001015, -0.0451866090297699, -0.023574845865368843, 0.033265337347984314, 0.008490335196256638, 0.044437065720558167, -0.09572707861661911, 0.007722948212176561, -0.00869110506027937, -0.05418109893798828, 0.06556697934865952, 0.006018634885549545, -0.0021627377718687057, 0.015963437035679817, -0.019809294492006302, -0.02218284085392952, 0.05771464854478836, 0.030784714967012405, 0.015597589313983917, 0.021647455170750618, 0.03549611568450928, 0.07067099958658218, 0.016998516395688057, 0.05500202625989914, 0.023164382204413414, -0.03469303622841835, -0.043509066104888916, -0.012331732548773289, 0.06106973811984062, -0.011840961873531342, 0.028089936822652817, 0.03231948986649513, 0.01697174832224846, -0.011216344311833382, 0.019559448584914207, -0.03926166519522667, -0.02123699150979519, 0.01668620854616165, -0.03697735071182251, -0.0024984695482999086, 0.030766868963837624, 0.0192739088088274, -0.020059142261743546, -0.024966850876808167, 0.05664387717843056, -0.015187126584351063, -0.010796958580613136, 0.03228379786014557, -0.04279521480202675, 0.03665611892938614, -0.041010595858097076, 0.03426472842693329, -0.019559448584914207, 0.004684630781412125, 0.036495503038167953, 0.00046372265205718577, 0.0031119331251829863, -0.026126854121685028, 0.048398926854133606, -0.029142864048480988, -0.017471441999077797, 0.045257993042469025, -0.011573268100619316, 0.02676931768655777, 0.02616254612803459, -0.004118013195693493, -0.003977474290877581, 0.001982044894248247, -0.003633934771642089, 0.006705713924020529, 0.0073481774888932705, 0.0026903164107352495, 0.016793284565210342, 0.026091162115335464, 0.08016518503427505, -0.03403272479772568, -0.0679226815700531, -0.002601085463538766, 0.009172952733933926, 0.014446508139371872, -0.002864317037165165, 0.02991025149822235, -0.037120118737220764, 0.04793492332100868, -0.024949004873633385 ]
39,432
sparkypandy._dataframe
to_pandas
PEP8-compliant alias to toPandas()
def to_pandas(self) -> pd.DataFrame: """PEP8-compliant alias to toPandas()""" # noinspection PyTypeChecker return super().toPandas()
(self) -> pandas.core.frame.DataFrame
[ -0.01949688233435154, 0.0015264346729964018, 0.017353607341647148, -0.0037010370288044214, -0.036746781319379807, -0.008547170087695122, -0.022089552134275436, 0.03202812001109123, 0.008361361920833588, -0.02376614511013031, 0.023161189630627632, -0.020931491628289223, 0.021761147305369377, 0.012842360883951187, 0.027758857235312462, -0.017275827005505562, 0.013300399295985699, 0.02063765563070774, 0.027292177081108093, 0.06920701265335083, 0.01458809245377779, -0.01646345667541027, -0.006127344444394112, -0.012591736391186714, -0.02357601560652256, 0.05648564547300339, -0.03564057499170303, -0.04317660629749298, -0.02813911624252796, 0.043280310928821564, 0.0012325986754149199, -0.02248709462583065, 0.009316328912973404, 0.04642608389258385, -0.017517808824777603, 0.008780510164797306, -0.04995211586356163, 0.019151192158460617, -0.03360100835561752, -0.00837432499974966, -0.06751313805580139, -0.023938989266753197, -0.021415457129478455, -0.05403125286102295, -0.02703290991485119, -0.023455025628209114, 0.024440240114927292, 0.002951323054730892, 0.04891504719853401, -0.021501880139112473, 0.028398383408784866, 0.06350313872098923, 0.017284469678997993, 0.051300305873155594, -0.04321117326617241, 0.026911918073892593, 0.004697054624557495, 0.03985798731446266, -0.02722303941845894, 0.03418868035078049, -0.004519888665527105, 0.017854856327176094, -0.003074475098401308, -0.04663349688053131, 0.043003760278224945, 0.01361151970922947, 0.021847568452358246, -0.048016257584095, -0.02570200525224209, -0.0014972671633586287, -0.02656622976064682, -0.0373690240085125, -0.016679512336850166, 0.07328615337610245, -0.0748763233423233, 0.012712727300822735, -0.034084971994161606, -0.02466493844985962, -0.00420012604445219, -0.007233550306409597, -0.02068950980901718, 0.002979410346597433, -0.03341088071465492, 0.043280310928821564, -0.002421986311674118, -0.028813211247324944, -0.010145983658730984, 0.06657977402210236, -0.017258543521165848, 0.006330437026917934, 0.01427697204053402, 0.045803844928741455, 0.006572419311851263, 0.02585756592452526, 0.02053394913673401, -0.0438334159553051, -0.003484981134533882, 0.03882091864943504, -0.016299255192279816, 0.01826968416571617, -0.04884590953588486, 0.06132529675960541, 0.009618807584047318, 0.028536658734083176, -0.037783849984407425, -0.010820077732205391, 0.028968770056962967, -0.03913203999400139, 0.0019023718778043985, -0.013983136042952538, -0.0899483785033226, 0.10128699243068695, -0.0031198468059301376, -0.030818209052085876, -0.0014356912579387426, 0.007976782508194447, -0.007812580093741417, -0.028865063562989235, -0.0491570308804512, 0.01963515765964985, -0.019082054495811462, 0.09962768107652664, 0.02053394913673401, -0.0358479879796505, 0.00218864600174129, 0.034136828035116196, 0.006460070610046387, -0.048603929579257965, 0.031907130032777786, 0.04227781295776367, 0.044524792581796646, -0.002385256811976433, -0.015097984112799168, 0.034084971994161606, 0.08075304329395294, -0.003126328345388174, 0.09444233775138855, 0.029867563396692276, -0.0011321327183395624, 0.006931072100996971, -0.007177375722676516, -0.022608086466789246, 0.046322379261255264, 0.010725012980401516, 0.021035199984908104, 0.027240322902798653, 0.006218087859451771, 0.034413378685712814, -0.08116786926984787, -0.02272907644510269, 0.02542545460164547, -0.020810501649975777, 0.01736225001513958, -0.028709502890706062, 0.030956484377384186, 0.0005514826043508947, 0.01688692718744278, -0.04753229022026062, 0.038025833666324615, -0.04469763860106468, -0.032287389039993286, -0.015270828269422054, -0.03233924135565758, 0.0001114713231800124, -0.03007497638463974, 0.01565108634531498, -0.015616518445312977, -0.050124961882829666, 0.001037068199366331, -0.019514165818691254, 0.01050895731896162, 0.0499175488948822, 0.010016350075602531, -0.005414360202848911, -0.03837152197957039, 0.04106789827346802, 0.05541400983929634, 0.05157685652375221, -0.010241048410534859, -0.008019994013011456, 0.05385840684175491, -0.01022376399487257, -0.06889589875936508, 0.009921285323798656, 0.0562436617910862, 0.0025559409987181425, -0.026669936254620552, 0.01565108634531498, 0.008192838169634342, 0.06920701265335083, 0.001267167623154819, -0.00794221367686987, 0.03481092303991318, 0.03386027738451958, 0.008413215167820454, -0.0958942398428917, 0.025304462760686874, -0.012695442885160446, -0.048085395246744156, -0.001535076997242868, 0.06260434538125992, 0.01958330348134041, 0.023731576278805733, -0.008884217590093613, -0.009549668990075588, -0.0012293579056859016, -0.05748814344406128, -0.06025366112589836, -0.0017911031609401107, -0.04943358153104782, 0.028588512912392616, -0.0661303773522377, 0.0035606008023023605, -0.05416952818632126, 0.025961272418498993, -0.01363744679838419, 0.031907130032777786, -0.05289047583937645, 0.052544787526130676, 0.0036621468607336283, 0.09928198903799057, -0.021899422630667686, -0.06533529609441757, -0.003904129611328244, 0.0142510449513793, -0.008149627596139908, 0.0027655151207000017, -0.0019855534192174673, 0.040099967271089554, -0.05033237487077713, 0.016489384695887566, -0.07155770063400269, -0.05645107850432396, -0.059078317135572433, 0.04092962294816971, 0.030230537056922913, 0.003013979410752654, -0.01660173200070858, 0.0023766146041452885, -0.019980845972895622, -0.017232615500688553, 0.022971060127019882, 0.047843411564826965, 0.08676803857088089, -0.048880480229854584, -0.03382570669054985, 0.013222618959844112, 0.03467264398932457, 0.029487304389476776, 0.0065940250642597675, 0.033704716712236404, -0.06893046200275421, -0.006386611610651016, 0.02813911624252796, 0.053443580865859985, -0.020862353965640068, -0.004035923629999161, 0.02542545460164547, 0.00485261483117938, 0.0002402271202299744, -0.03418868035078049, -0.003917092923074961, 0.0068619344383478165, -0.017440030351281166, -0.010776866227388382, -0.013715226203203201, -0.050021253526210785, -0.006032279692590237, 0.01233246922492981, 0.060564782470464706, 0.03301333636045456, -0.012626305222511292, -0.0017025201814249158, -0.004904468078166246, -0.0020222829189151525, -0.051542289555072784, -0.015409104526042938, -0.014406605623662472, -0.04597668722271919, -0.005012495908886194, -0.020240113139152527, -0.053339872509241104, -0.006637236103415489, -0.026497092097997665, -0.02020554430782795, 0.009618807584047318, -0.012816433794796467, 0.003327260259538889, 0.01802770234644413, -0.02656622976064682, -0.01764744333922863, 0.023852568119764328, -0.019324036315083504, 0.009480531327426434, -0.0008399171638302505, 0.048085395246744156, 0.014959707856178284, -0.06419452279806137, 0.013689300045371056, -0.02865765057504177, -0.016852358356118202, -0.008797794580459595, 0.06288089603185654, 0.11310956627130508, -0.010241048410534859, 0.01911662332713604, 0.0053322589956223965, -0.019721578806638718, -0.010120056569576263, -0.030662648379802704, -0.021640155464410782, 0.05275220051407814, 0.012522597797214985, -0.00690082460641861, 0.01588442735373974, -0.06429822742938995, -0.03145773336291313, -0.024785928428173065, 0.02727489359676838, 0.040583934634923935, -0.09333613514900208, -0.00972251407802105, -0.004515567794442177, -0.0445939302444458, 0.06436736136674881, 0.05900917947292328, 0.036504797637462616, -0.003739926964044571, 0.060979608446359634, 0.04563099890947342, 0.01664494350552559, -0.005258799996227026, 0.09264475852251053, -0.009817578829824924, -0.030351528897881508, -0.016480742022395134, 0.020170975476503372, 0.0017986651510000229, 0.006585382856428623, 0.05161142721772194, -0.0006913787801750004, 0.0072465138509869576, 0.045285310596227646, -0.029487304389476776, -0.015780720859766006, -0.03519117832183838, -0.05520659685134888, -0.025079764425754547, 0.007786653470247984, -0.030334243550896645, -0.014614018611609936, 0.03059351071715355, -0.04013453796505928, 0.06215495243668556, 0.008361361920833588, -0.026981057599186897, 0.01960058882832527, 0.1124873235821724, -0.034551654011011124, -0.009411393664777279, 0.05959685146808624, -0.01750916801393032, 0.01954873465001583, -0.01209912821650505, 0.008996566757559776, 0.007635414134711027, -0.055621422827243805, -0.028018124401569366, -0.01680050417780876, 0.0014000419760122895, -0.006002032198011875, -0.00832679308950901, -0.0019391013775020838, -0.02461308427155018, -0.03605540469288826, 0.041102468967437744, -0.06543900072574615, 0.0008318150648847222, -0.025771144777536392, -0.030334243550896645, 0.05849064514040947, -0.052544787526130676, 0.009852147661149502, 0.04061850160360336, 0.045803844928741455, -0.025010626763105392, 0.03207997605204582, -0.041102468967437744, 0.02760329842567444, -0.01278186496347189, -0.07294046133756638, -0.031803425401449203, -0.05382383614778519, 0.06530072540044785, -0.014380678534507751, -0.022452525794506073, -0.018477097153663635, 0.025010626763105392, -0.006390932481735945, -0.01712026633322239, 0.016247401013970375, -0.045423585921525955, 0.026963772252202034, -0.04939901456236839, -0.05627823248505592, 0.01031882781535387, 0.06868848204612732, -0.07307873666286469, -0.009134842082858086, -0.01359423529356718, 0.035606008023023605, 0.009117557667195797, 0.006779833231121302, 0.026825496926903725, 0.030818209052085876, 0.04780884087085724, 0.012937425635755062, -0.030610796064138412, 0.038025833666324615, 0.004254139959812164, 0.045700136572122574, -0.022850068286061287, -0.016351107507944107, 0.03054165653884411, 0.035986267030239105, 0.031751569360494614, -0.03501833602786064, 0.05043608322739601, 0.02291920594871044, 0.01603134535253048, 0.02893420122563839, -0.043660569936037064, -0.04521617293357849, 0.017958562821149826, 0.059078317135572433, 0.020084554329514503, 0.004567421041429043, -0.00767430430278182, 0.017085697501897812, 0.0846247598528862, 0.0589054711163044, -0.030334243550896645, 0.0285020899027586, -0.018909210339188576, 0.03999626263976097, -0.06982925534248352, -0.02053394913673401, 0.023161189630627632, -0.034033119678497314, -0.02642795443534851, 0.07695046067237854, 0.013507813215255737, 0.09416578710079193, -0.01963515765964985, -0.08075304329395294, 0.035606008023023605, 0.007678625639528036, -0.03282320871949196, 0.011589236557483673, -0.0003154415753670037, 0.018909210339188576, -0.002743909601122141, -0.026030410081148148, -0.0070088524371385574, 0.005747085902839899, 0.022262396290898323, -0.0570041798055172, -0.09561768174171448, -0.012712727300822735, 0.01579800434410572, 0.05275220051407814, -0.03303062170743942, -0.012427533976733685, -0.07826407998800278, -0.02566743642091751, 0.07287131994962692, -0.047255739569664, -0.011684301309287548, -0.00028060254408046603, 0.031665146350860596, -0.10930698364973068, 0.0007707793265581131, 0.02352416329085827, 0.009886716492474079, 0.026203256100416183, -0.04756686091423035, -0.007587882224470377, 0.01911662332713604, 0.010759581811726093, -0.006727979518473148, 0.0226772241294384, 0.008797794580459595, -0.0184943825006485, 0.03899376466870308, 0.03007497638463974, 0.08185924589633942, 0.03920117765665054, -0.02053394913673401, -0.02106976881623268, -0.0207759328186512, 0.020654940977692604, -0.016783220693469048, -0.040825918316841125, 0.00813666358590126, 0.02575385943055153, -0.06740943342447281, 0.03543316200375557, 0.05707331746816635, -0.060080815106630325, -0.016100483015179634, -0.04241608828306198, 0.036988765001297, -0.04901875555515289, 0.025978557765483856, -0.00939410924911499, 0.02286735363304615, -0.04805082455277443, -0.050643496215343475, -0.021138906478881836, -0.022504379972815514, -0.012107770889997482, 0.04407539591193199, 0.004809403792023659, 0.008218765258789062, -0.013905355706810951, 0.027551444247364998, 0.00013564257824327797, 0.03882091864943504, 0.04867306724190712, 0.00024697885964997113, 0.0241982564330101, -0.013326326385140419, 0.032702215015888214, -0.021277181804180145, 0.017232615500688553, 0.025079764425754547, 0.008296545594930649, 0.0009085149504244328, 0.03947772830724716, -0.025822997093200684, 0.02471679076552391, -0.008214443922042847, 0.017543736845254898, -0.05835236981511116, 0.005098918452858925, -0.02011912316083908, -0.04863849654793739, 0.022400671616196632, 0.03947772830724716, 0.0407913476228714, -0.0014292096020653844, -0.02656622976064682, 0.018131408840417862, 0.042865484952926636, 0.02300562895834446, 0.001952064805664122, 0.027482306584715843, 0.06440193206071854, 0.020948776975274086, -0.02034381963312626, -0.014674514532089233, -0.07300959527492523, 0.07086632400751114, -0.032754071056842804, -0.05475720018148422, 0.05174970254302025, 0.0207759328186512, 0.03916660696268082, -0.06713288277387619, -0.08151356130838394, 0.030351528897881508, -0.024820497259497643, -0.0059156096540391445, -0.05019409954547882, 0.04635694622993469, -0.010068203322589397, -0.021311750635504723, 0.02300562895834446, -0.05866348743438721, 0.004856935702264309, -0.04217410460114479, 0.028640365228056908, 0.011753438971936703, -0.019341321662068367, -0.04469763860106468, -0.0407913476228714, -0.02357601560652256, -0.01660173200070858, 0.040964193642139435, -0.054480645805597305, -0.029919415712356567, -0.027171185240149498, 0.04449022561311722, -0.05043608322739601, 0.043280310928821564, -0.005228552035987377, -0.0733552873134613, -0.03430967032909393, 0.03709246963262558, -0.022798215970396996, -0.009852147661149502, 0.04587298259139061, -0.02234881930053234, -0.04473220556974411, 0.0468754805624485, -0.021951276808977127, 0.026255108416080475, 0.02613411843776703, 0.014121411368250847, -0.017258543521165848, -0.019842570647597313, 0.050539787858724594, -0.015089341439306736, -0.02452666126191616, 0.024371102452278137, -0.033186182379722595, -0.07058977335691452, -0.007639735471457243, -0.059078317135572433, 0.0032041084486991167, -0.012557166628539562, -0.007756405510008335, 0.030870063230395317, 0.03857893496751785, -0.06844650208950043, -0.0442136712372303, 0.03553687036037445, -0.036262817680835724, 0.010725012980401516, -0.05748814344406128, 0.02737860009074211, -0.01788942515850067, 0.03757643699645996, -0.023472309112548828, -0.024059981107711792, -0.05710788816213608, -0.01311891246587038, -0.010897858068346977, 0.032615792006254196, 0.06678719073534012, 0.03539859503507614, -0.04818909987807274, 0.006014995276927948, -0.01588442735373974, -0.03937401995062828, -0.0920916497707367, -0.03975427895784378, -0.03225281834602356, -0.018338821828365326, -0.02329946495592594, -0.018062271177768707, 0.010068203322589397, -0.02817368507385254, -0.032183680683374405, 0.006926751229912043, 0.06492047011852264, 0.012073202058672905, 0.028069978579878807, -0.00559584703296423, 0.00744960643351078, 0.040065400302410126, -0.02528717927634716, -0.0392703153192997, 0.03233924135565758, 0.11165767163038254, 0.06028822809457779, -0.0366085059940815, 0.04891504719853401, 0.013455959036946297, 0.01712026633322239, 0.022037697955965996, 0.07812580466270447, -0.0600462481379509, -0.02120804414153099, -0.0006006353069096804, 0.01935860514640808, -0.022711792960762978, -0.028588512912392616, 0.04642608389258385, -0.01826968416571617, -0.04200126230716705, 0.04901875555515289, -0.04054936394095421, 0.01963515765964985, -0.03325532004237175, 0.006732300855219364, 0.004357846919447184, -0.012444818392395973, 0.00922990683466196, -0.12092214822769165, 0.047601427882909775, -0.020948776975274086, -0.04601125791668892, 0.045803844928741455, 0.034603506326675415, 0.01973886415362358, -0.04663349688053131, -0.021087052300572395, 0.0005568839842453599, 0.0457347072660923, -0.027344031259417534, -0.020793216302990913, 0.026497092097997665, 0.050297804176807404, 0.07570597529411316, -0.004826688207685947, 0.02528717927634716, 0.028294676914811134, 0.00013165904965717345, -0.047739703208208084, -0.01551281102001667, 0.06343400478363037, -0.0043600075878202915, -0.0019563857931643724, 0.017483239993453026, -0.01868451200425625, 0.012876929715275764, -0.03296148404479027, -0.02566743642091751, -0.0027655151207000017, 0.003806904423981905, -0.017146194353699684, 0.002212412189692259, 0.05900917947292328, -0.014959707856178284, 0.016912853345274925, -0.012963351793587208, 0.028813211247324944, -0.005120524205267429, -0.00798974558711052, 0.014441174454987049, 0.010949711315333843, 0.029539158567786217, -0.01195221021771431, 0.021951276808977127, -0.0028497769962996244, 0.005392754450440407, 0.0457347072660923, -0.005755728110671043, 0.00837432499974966, -0.012150982394814491, 0.0037269636522978544, -0.011917641386389732, -0.026721790432929993, 0.036746781319379807, -0.05109289288520813, 0.03567514568567276, 0.0017489722231402993, -0.017465956509113312, 0.0025321748107671738, 0.026497092097997665, -0.0190647691488266, -0.011494171805679798, -0.0009355219081044197, 0.0285020899027586, 0.030092261731624603, 0.02632424607872963, 0.05233737453818321, -0.005535351112484932, -0.030852777883410454, -0.040722209960222244, 0.010776866227388382, 0.01451895385980606, 0.004597669001668692, -0.03475906699895859, -0.022331533953547478, 0.030749071389436722, 0.026531660929322243 ]
39,433
pyspark.sql.dataframe
to_pandas_on_spark
null
def to_pandas_on_spark( self, index_col: Optional[Union[str, List[str]]] = None ) -> "PandasOnSparkDataFrame": warnings.warn( "DataFrame.to_pandas_on_spark is deprecated. Use DataFrame.pandas_api instead.", FutureWarning, ) return self.pandas_api(index_col)
(self, index_col: Union[str, List[str], NoneType] = None) -> 'PandasOnSparkDataFrame'
[ -0.007968553341925144, 0.013142270967364311, -0.008141477592289448, 0.0236859992146492, 0.013628329150378704, 0.004631575662642717, 0.023368190973997116, 0.05043790489435196, 0.004194590263068676, 0.01957319676876068, -0.01944233477115631, -0.02316255122423172, 0.012525350786745548, -0.031201209872961044, 0.051036130636930466, -0.012375794351100922, 0.029313059523701668, 0.0003998881729785353, 0.04965273290872574, 0.05570976808667183, -0.022826049476861954, -0.049503177404403687, -0.005818679928779602, 0.03256591036915779, -0.03632351756095886, 0.03050951100885868, -0.021966099739074707, -0.029051335528492928, -0.02882700227200985, -0.01970405876636505, 0.03037864901125431, 0.005659776274114847, -0.03914639353752136, 0.04912928491830826, -0.013712454587221146, 0.041763633489608765, -0.028789611533284187, -0.02572370506823063, 0.06587960571050644, -0.05877567455172539, 0.033762361854314804, -0.02792966365814209, -0.02237738110125065, -0.07623638957738876, -0.010188532061874866, 0.029032642021775246, 0.007818996906280518, 0.0026055534835904837, 0.05081179738044739, -0.03329499810934067, 0.029032642021775246, 0.03228549286723137, -0.0543263740837574, 0.06423448771238327, -0.006874922197312117, -0.017142904922366142, -0.01120738498866558, 0.03540748357772827, 0.01363767683506012, -0.01363767683506012, 0.03501489758491516, -0.010758715681731701, -0.005257843062281609, 0.03422972559928894, 0.055410657078027725, 0.02729404717683792, 0.028340943157672882, -0.003820699406787753, -0.05496198683977127, -0.03449144959449768, -0.022321296855807304, -0.059000011533498764, -0.006613198202103376, 0.06830989569425583, -0.07470343261957169, -0.04927884414792061, -0.0033930614590644836, -0.027088407427072525, -0.05380292609333992, 0.00816951971501112, -0.013656371273100376, -0.032509829849004745, -0.04026806727051735, 0.026695823296904564, -0.02009664475917816, -0.009379992261528969, 0.020937899127602577, 0.03234157711267471, -0.07002979516983032, 0.00893599633127451, -0.006346800830215216, 0.0473719984292984, -0.01279642153531313, 0.06008429452776909, -0.002836898434907198, -0.07627377659082413, -0.004360504448413849, -0.009711820632219315, -0.02497592382133007, 0.03654785081744194, -0.03851078078150749, 0.03127598762512207, 0.03903422877192497, -0.0015002379659563303, -0.02561153843998909, -0.013497467152774334, -0.009954850189387798, -0.019330168142914772, -0.014039609581232071, -0.007552599534392357, -0.011347593739628792, 0.04722244292497635, 0.02766793966293335, -0.04804500192403793, -0.03406147658824921, 0.02370469458401203, -0.011618665419518948, 0.007332938723266125, -0.047820668667554855, 0.01878802664577961, 0.034154947847127914, 0.017554186284542084, -0.04494170844554901, -0.06625349819660187, -0.06176680326461792, 0.039707232266664505, -0.011871041730046272, -0.022601714357733727, 0.016563374549150467, 0.1066337302327156, 0.0015855318633839488, 0.020545314997434616, 0.02213435061275959, 0.01572212018072605, 0.055410657078027725, -0.035856153815984726, 0.038697727024555206, 0.05316730961203575, -0.04785805568099022, 0.012039292603731155, -0.02445247583091259, -0.03522053733468056, 0.03589354455471039, 0.0037903208285570145, 0.035070981830358505, 0.018974971026182175, -0.015535173937678337, -0.01585298217833042, -0.05144741013646126, -0.016385776922106743, 0.04980229213833809, 0.021423958241939545, -0.02458333782851696, -0.036790881305933, -0.004804500378668308, -0.04905450716614723, 0.029425228014588356, -0.0024653442669659853, 0.036622628569602966, -0.04565209895372391, 0.014908906072378159, -0.03858555853366852, 0.009637041948735714, 0.01048764493316412, -0.0225269366055727, 0.00919772032648325, 0.025555454194545746, 0.03937073051929474, -0.02961217239499092, -0.00946411769837141, 0.016834445297718048, 0.0401185117661953, -0.013862011022865772, 0.016423165798187256, -0.039707232266664505, 0.03138815611600876, 0.03877250477671623, 0.017030738294124603, 0.05316730961203575, -0.026826683431863785, 0.013020756654441357, 0.01158127561211586, -0.05855134129524231, -0.0173859354108572, 0.022040879353880882, 0.023872945457696915, -0.0357813760638237, -0.004152527544647455, 0.041651464998722076, 0.03271546959877014, 0.007800302468240261, 0.01178691629320383, 0.010973703116178513, 0.05828961730003357, 0.012263626791536808, -0.07747022807598114, 0.004453977569937706, -0.04460520297288895, -0.07380609959363937, 0.005150349345058203, 0.12338405102491379, 0.07432954758405685, 0.010450255125761032, -0.006360821891576052, -0.01775982603430748, 0.0005567471962422132, -0.03138815611600876, -0.011319552548229694, 0.04221230000257492, -0.022302601486444473, 0.04262358322739601, -0.046025991439819336, 0.012179501354694366, -0.02097528986632824, 0.01593710668385029, 0.0023122825659811497, 0.057728782296180725, -0.016030579805374146, 0.09392143785953522, -0.009487485513091087, 0.06285108625888824, 0.003173400415107608, -0.022882133722305298, 0.03978201001882553, 0.005935520865023136, -0.04232446849346161, 0.017787868157029152, -0.017311155796051025, 0.007580641657114029, -0.05223258212208748, -0.002972434042021632, -0.04000634327530861, -0.016563374549150467, -0.008150825276970863, -0.022433463484048843, 0.008903280831873417, -0.003930530045181513, -0.026976240798830986, 0.011067175306379795, -0.05062485113739967, -0.0007507031550630927, 0.036117877811193466, -0.0023087773006409407, 0.04325919598340988, -0.002212967723608017, 0.013618982397019863, 0.014039609581232071, 0.026602350175380707, 0.010786757804453373, -0.024545948952436447, 0.056569717824459076, -0.008015289902687073, -0.03310805559158325, 0.027873579412698746, 0.025144174695014954, -0.02174176648259163, -0.028490498661994934, 0.021050067618489265, -0.03993156552314758, 0.01332921627908945, -0.10581117123365402, -0.013488120399415493, -0.017086822539567947, -0.009319234639406204, 0.012590781785547733, -0.04553993046283722, -0.023779472336173058, 0.0015271113952621818, 0.033893223851919174, 0.0630006417632103, 0.06453359872102737, -0.007141319569200277, -0.010440908372402191, -0.0011882726103067398, 0.02148004248738289, -0.05458809435367584, -0.055672381073236465, -0.027368826791644096, -0.014852822758257389, -0.000052943560149287805, 0.03127598762512207, -0.02536850981414318, -0.011347593739628792, 0.028266165405511856, -0.006258001551032066, 0.03333238884806633, 0.020040560513734818, -0.0026429425925016403, 0.015217366628348827, 0.00440256716683507, -0.028228776529431343, 0.018498260527849197, 0.021928710862994194, 0.029705645516514778, -0.034154947847127914, 0.028415720909833908, 0.03170596435666084, -0.0324537456035614, -0.025761093944311142, -0.07739545404911041, -0.023461664095520973, -0.016273608431220055, 0.006945026572793722, 0.08225603401660919, 0.03948289528489113, -0.022713882848620415, 0.00014473673945758492, -0.03948289528489113, 0.018217843025922775, -0.03178074210882187, -0.012282321229577065, 0.03189290687441826, 0.012188849039375782, 0.000029794444344588555, -0.07616160809993744, -0.045876435935497284, -0.028658751398324966, -0.024658115580677986, 0.006664608139544725, 0.03228549286723137, -0.07077758014202118, -0.04894234240055084, -0.041614074259996414, -0.03473448008298874, 0.033388473093509674, 0.09900635480880737, -0.027873579412698746, -0.061579860746860504, 0.025387203320860863, 0.00951552763581276, -0.00039492244832217693, 0.0008500179974362254, 0.028752222657203674, -0.032229408621788025, -0.06580483168363571, -0.03335108235478401, -0.021928710862994194, -0.032117243856191635, 0.0069824159145355225, 0.06412231922149658, -0.005575650371611118, -0.026434099301695824, 0.030060842633247375, -0.005762596148997545, -0.03217332810163498, -0.020134033635258675, -0.04516604170203209, -0.017918730154633522, -0.0163296926766634, -0.01877867989242077, 0.030173009261488914, -0.011777568608522415, -0.06307542324066162, 0.08464893698692322, 0.04711027443408966, -0.014469584450125694, 0.01957319676876068, 0.0927249863743782, -0.017806561663746834, -0.04696071892976761, 0.04153929650783539, -0.05556021258234978, 0.014329375699162483, -0.00901077501475811, 0.00038323833723552525, 0.03181812912225723, -0.018358051776885986, -0.029144808650016785, 0.036790881305933, -0.020769648253917694, -0.009207068011164665, 0.0004588928713928908, 0.034154947847127914, 0.01593710668385029, -0.02804183028638363, 0.0173859354108572, -0.010926966555416584, -0.01049699168652296, 0.0023613558150827885, -0.055784545838832855, 0.028752222657203674, -0.0682351216673851, 0.06109379976987839, 0.04101584851741791, 0.03226679936051369, 0.0014686908107250929, 0.00784703902900219, -0.08173258602619171, 0.0021416947711259127, 0.009506180882453918, -0.04912928491830826, 0.017217684537172318, -0.04262358322739601, 0.04288530722260475, 0.008557431399822235, -0.0064683156087994576, -0.025966735556721687, 0.021274402737617493, 0.053615979850292206, -0.0034351241774857044, -0.012413183227181435, -0.02353644371032715, -0.05342903360724449, -0.04568948969244957, -0.02447117120027542, 0.03254721686244011, 0.028097914531826973, -0.04026806727051735, -0.0226764939725399, -0.01216080691665411, 0.05350381135940552, -0.034678395837545395, 0.013095534406602383, 0.05724272131919861, 0.016806403174996376, 0.04307224974036217, 0.041875798255205154, 0.017722437158226967, 0.0316498801112175, -0.00790312234312296, 0.02948131039738655, -0.04127757251262665, -0.022751271724700928, 0.017993507906794548, 0.0130020622164011, 0.013198355212807655, 0.0000393242844438646, -0.004729722160845995, 0.018330009654164314, 0.05828961730003357, 0.012076681479811668, -0.051522187888622284, -0.03138815611600876, 0.005304579623043537, 0.028602667152881622, 0.03847339004278183, 0.020040560513734818, -0.014768697321414948, -0.03125729411840439, 0.033126749098300934, 0.06277631223201752, -0.056569717824459076, -0.010777410119771957, 0.04030545800924301, 0.02635931968688965, -0.026564961299300194, -0.030154313892126083, 0.05653233081102371, -0.047932833433151245, -0.03460361808538437, 0.03718346729874611, 0.0008389180875383317, 0.0079872477799654, 0.02370469458401203, -0.053615979850292206, 0.04901712015271187, 0.03422972559928894, -0.03136946260929108, 0.014834128320217133, 0.025648927316069603, 0.02755577117204666, -0.01544170081615448, -0.03615526482462883, -0.030060842633247375, 0.040866293013095856, 0.032509829849004745, -0.0808352530002594, -0.0857706144452095, -0.01178691629320383, -0.009225762449204922, 0.058626119047403336, -0.02086312137544155, -0.010506339371204376, -0.09923069179058075, -0.009365971200168133, 0.025125479325652122, -0.04912928491830826, 0.008057352155447006, 0.03772560879588127, 0.006192571017891169, -0.07571294158697128, 0.031107736751437187, 0.010375477373600006, 0.003187421476468444, 0.04056718200445175, -0.03617396205663681, -0.007912470027804375, -0.028172692283988, 0.045876435935497284, -0.01968536525964737, -0.002038874663412571, -0.006987089291214943, 0.026564961299300194, 0.02174176648259163, 0.015666035935282707, 0.06524398922920227, 0.0015434690285474062, 0.006234633736312389, -0.027387520298361778, 0.023199940100312233, 0.02626584842801094, -0.03400539234280586, -0.06468315422534943, -0.032883718609809875, -0.005412073340266943, -0.07231052964925766, 0.019517114385962486, 0.052569083869457245, -0.03933333978056908, 0.006543093826621771, -0.018245883285999298, 0.04217491298913956, 0.002383555518463254, 0.024041196331381798, 0.07032891362905502, 0.04995184764266014, -0.046512048691511154, -0.01825523190200329, 0.021330485120415688, 0.02961217239499092, -0.03626743331551552, 0.04094107076525688, -0.010777410119771957, 0.021779155358672142, 0.00193021260201931, 0.0016112368321046233, -0.017582228407263756, 0.008417222648859024, 0.016058621928095818, 0.01448827888816595, -0.015105199068784714, 0.037893861532211304, 0.003916508983820677, -0.045502543449401855, 0.026826683431863785, -0.005711186211556196, 0.02316255122423172, 0.03933333978056908, 0.08150825649499893, -0.06655260920524597, 0.008468632586300373, -0.01686248742043972, 0.014273291453719139, -0.056569717824459076, -0.01892823539674282, -0.01789068803191185, -0.05144741013646126, -0.000739603245165199, 0.01583428680896759, -0.004339473322033882, -0.0181430634111166, 0.031051652505993843, 0.03884728252887726, 0.05484981834888458, 0.07492776960134506, -0.048306725919246674, 0.013590940274298191, 0.053204700350761414, -0.041763633489608765, -0.010300698690116405, -0.038286443799734116, -0.07290875911712646, 0.07732067257165909, -0.07014196366071701, 0.0028041829355061054, 0.02460203319787979, 0.016161441802978516, -0.056307993829250336, -0.005327947903424501, -0.09167809039354324, 0.03050951100885868, -0.07148797065019608, -0.003350998740643263, -0.058738287538290024, 0.032995887100696564, -0.0013366605853661895, 0.028864391148090363, 0.053092531859874725, -0.05021357163786888, 0.012310363352298737, -0.02009664475917816, 0.06113119050860405, 0.037912555038928986, 0.0589626207947731, -0.01711486279964447, -0.014198513701558113, 0.03406147658824921, -0.05458809435367584, 0.03593093156814575, -0.013020756654441357, 0.009730515070259571, -0.0424366369843483, 0.07500255107879639, -0.014974337071180344, 0.018086981028318405, 0.005150349345058203, -0.058102671056985855, -0.03318283334374428, 0.08382637798786163, 0.027611855417490005, -0.013011408969759941, 0.05279342085123062, -0.002334482269361615, -0.06352408975362778, 0.028153996914625168, 0.015609952621161938, -0.043408751487731934, 0.04991445690393448, -0.023368190973997116, 0.0016860150499269366, -0.027051018550992012, 0.05159696936607361, -0.056831441819667816, 0.01646990142762661, 0.04688594117760658, 0.024882450699806213, -0.043932199478149414, -0.02893916890025139, -0.03523923456668854, 0.013160965405404568, -0.04232446849346161, 0.042399246245622635, 0.063299760222435, 0.030958181247115135, -0.05417681485414505, 0.002682668389752507, -0.008543411269783974, -0.03009823150932789, 0.000035052289604209363, 0.0022807354107499123, 0.024751588702201843, -0.05395248159766197, 0.046549439430236816, 0.024863755330443382, -0.02263910509645939, -0.03615526482462883, 0.006295390892773867, -0.025667622685432434, 0.003584680613130331, 0.028471805155277252, 0.007230118382722139, -0.011441066861152649, 0.0334632508456707, -0.002787825185805559, 0.004159538075327873, -0.08906085044145584, -0.03267807886004448, -0.018722595646977425, -0.019115181639790535, 0.0130020622164011, -0.04157668724656105, -0.06909506767988205, -0.04965273290872574, -0.008080720901489258, 0.035463567823171616, 0.07160013914108276, -0.048306725919246674, 0.024620726704597473, 0.02635931968688965, 0.021910017356276512, 0.018330009654164314, -0.029649561271071434, 0.025761093944311142, 0.03656654804944992, -0.0026639739517122507, 0.04905450716614723, -0.046549439430236816, 0.040978461503982544, 0.012114070355892181, 0.02200348861515522, 0.028266165405511856, 0.05084918439388275, -0.033893223851919174, -0.02060139738023281, 0.059897348284721375, 0.036603935062885284, -0.022583020851016045, -0.07470343261957169, 0.00136703928001225, -0.07638594508171082, -0.04224969074130058, 0.03796863928437233, -0.009099573828279972, 0.011599970050156116, -0.07290875911712646, -0.007524557877331972, 0.05556021258234978, -0.003463166067376733, 0.03333238884806633, -0.08599494397640228, 0.02318124659359455, -0.012805769219994545, -0.07492776960134506, 0.05985996127128601, 0.024938534945249557, 0.0029934654012322426, 0.031107736751437187, -0.008501348085701466, 0.031332071870565414, 0.021517431363463402, 0.005767269525676966, 0.009417381137609482, 0.026583654806017876, 0.06576743721961975, 0.05544804409146309, 0.015002379193902016, 0.015282797627151012, 0.027350131422281265, -0.027724022045731544, -0.06202852725982666, -0.009211741387844086, -0.015909064561128616, -0.030995570123195648, 0.023125162348151207, 0.002500396454706788, -0.0020657482091337442, -0.0020867795683443546, -0.046661604195833206, -0.003715542610734701, 0.0004895636229775846, 0.008085394278168678, -0.025555454194545746, -0.00901077501475811, 0.030060842633247375, 0.007945185527205467, -0.06524398922920227, 0.02574240043759346, 0.03710868954658508, 0.014712614007294178, 0.01968536525964737, 0.035949625074863434, -0.01918061263859272, 0.0076647670939564705, 0.0007518715574406087, 0.04426870122551918, -0.026845378801226616, 0.01891888864338398, 0.04995184764266014, -0.021853933110833168, -0.0044866930693387985, 0.0013191343750804663, 0.03535139933228493, -0.0450538732111454, -0.01968536525964737, 0.04516604170203209, -0.035463567823171616, 0.002713046967983246, -0.010300698690116405, -0.031201209872961044, -0.0016883518546819687, 0.016666194424033165, -0.022339992225170135, -0.01970405876636505, 0.0311451256275177, 0.019872309640049934, 0.01580624468624592, 0.021872628480196, 0.09466921538114548, -0.006870248354971409, -0.09107986092567444, -0.0076647670939564705, 0.016367081552743912, 0.03462231159210205, -0.03310805559158325, 0.005832700524479151, -0.028602667152881622, 0.023723388090729713, -0.007875080220401287 ]
39,434
pyspark.sql.dataframe
transform
Returns a new :class:`DataFrame`. Concise syntax for chaining custom transformations. .. versionadded:: 3.0.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Parameters ---------- func : function a function that takes and returns a :class:`DataFrame`. *args Positional arguments to pass to func. .. versionadded:: 3.3.0 **kwargs Keyword arguments to pass to func. .. versionadded:: 3.3.0 Returns ------- :class:`DataFrame` Transformed DataFrame. Examples -------- >>> from pyspark.sql.functions import col >>> df = spark.createDataFrame([(1, 1.0), (2, 2.0)], ["int", "float"]) >>> def cast_all_to_int(input_df): ... return input_df.select([col(col_name).cast("int") for col_name in input_df.columns]) ... >>> def sort_columns_asc(input_df): ... return input_df.select(*sorted(input_df.columns)) ... >>> df.transform(cast_all_to_int).transform(sort_columns_asc).show() +-----+---+ |float|int| +-----+---+ | 1| 1| | 2| 2| +-----+---+ >>> def add_n(input_df, n): ... return input_df.select([(col(col_name) + n).alias(col_name) ... for col_name in input_df.columns]) >>> df.transform(add_n, 1).transform(add_n, n=10).show() +---+-----+ |int|float| +---+-----+ | 12| 12.0| | 13| 13.0| +---+-----+
def transform(self, func: Callable[..., "DataFrame"], *args: Any, **kwargs: Any) -> "DataFrame": """Returns a new :class:`DataFrame`. Concise syntax for chaining custom transformations. .. versionadded:: 3.0.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Parameters ---------- func : function a function that takes and returns a :class:`DataFrame`. *args Positional arguments to pass to func. .. versionadded:: 3.3.0 **kwargs Keyword arguments to pass to func. .. versionadded:: 3.3.0 Returns ------- :class:`DataFrame` Transformed DataFrame. Examples -------- >>> from pyspark.sql.functions import col >>> df = spark.createDataFrame([(1, 1.0), (2, 2.0)], ["int", "float"]) >>> def cast_all_to_int(input_df): ... return input_df.select([col(col_name).cast("int") for col_name in input_df.columns]) ... >>> def sort_columns_asc(input_df): ... return input_df.select(*sorted(input_df.columns)) ... >>> df.transform(cast_all_to_int).transform(sort_columns_asc).show() +-----+---+ |float|int| +-----+---+ | 1| 1| | 2| 2| +-----+---+ >>> def add_n(input_df, n): ... return input_df.select([(col(col_name) + n).alias(col_name) ... for col_name in input_df.columns]) >>> df.transform(add_n, 1).transform(add_n, n=10).show() +---+-----+ |int|float| +---+-----+ | 12| 12.0| | 13| 13.0| +---+-----+ """ result = func(self, *args, **kwargs) assert isinstance( result, DataFrame ), "Func returned an instance of type [%s], " "should have been DataFrame." % type(result) return result
(self, func: Callable[..., pyspark.sql.dataframe.DataFrame], *args: Any, **kwargs: Any) -> pyspark.sql.dataframe.DataFrame
[ -0.009923065081238747, -0.06046326085925102, 0.04231272265315056, -0.001663076807744801, -0.025067782029509544, 0.019412599503993988, -0.029595782980322838, 0.014874964021146297, 0.0034899325110018253, -0.004017396364361048, -0.007211082149296999, -0.005236102733761072, 0.025491680949926376, 0.050944823771715164, 0.004990434739738703, 0.011936580762267113, 0.01978832669556141, 0.010549277998507023, 0.06497199088335037, 0.03373842313885689, -0.009542521089315414, -0.06165788322687149, 0.012264138087630272, 0.022524394094944, -0.030944550409913063, 0.07880648225545883, 0.005409515928477049, -0.03192722052335739, -0.0016919790068641305, -0.006088715977966785, -0.014190946705639362, -0.004159498494118452, -0.031406983733177185, -0.024123646318912506, -0.0645095556974411, 0.00717254588380456, -0.07487578690052032, -0.0340467132627964, 0.06289103627204895, -0.031869418919086456, 0.009441363625228405, -0.0036681622732430696, 0.0030154557898640633, -0.023179510608315468, -0.04570390656590462, 0.01447033416479826, 0.012582061812281609, -0.0038704772014170885, 0.011801703833043575, -0.05703354254364967, 0.026262404397130013, -0.011329635977745056, 0.04404684901237488, -0.01279401034116745, -0.0008261192706413567, 0.004877234809100628, -0.023044632747769356, 0.01821797713637352, 0.040270302444696426, 0.0000664222170598805, 0.03516425937414169, 0.03159966319799423, -0.0847025141119957, 0.01475935522466898, -0.0055395751260221004, 0.010366231203079224, -0.014354725368320942, 0.00865618884563446, -0.07953866571187973, -0.013285346329212189, -0.03433573246002197, 0.020809534937143326, 0.015751661732792854, 0.0630837231874466, -0.024740224704146385, -0.015472275204956532, -0.05938424915075302, -0.003388775046914816, 0.014383628033101559, 0.03578083962202072, 0.055376484990119934, -0.04061713069677353, -0.03870958834886551, -0.0210792887955904, -0.0022603876423090696, -0.023911697790026665, 0.004894094541668892, 0.008892222307622433, -0.05853645130991936, -0.01635860651731491, -0.015462640672922134, -0.02616606280207634, -0.010982810519635677, 0.0045255920849740505, -0.009624410420656204, -0.018497364595532417, -0.006445175502449274, 0.003933098632842302, 0.030289433896541595, -0.007793941535055637, 0.012158163823187351, 0.11283392459154129, -0.05271748825907707, -0.021927084773778915, 0.0338732972741127, -0.028728719800710678, -0.025414608418941498, -0.02003881148993969, 0.01252425741404295, 0.015558981336653233, -0.023237314075231552, 0.03175380825996399, 0.011917312629520893, -0.0027408855967223644, 0.006676392629742622, -0.06828610599040985, -0.02050124667584896, -0.019923202693462372, -0.0724480077624321, 0.030944550409913063, 0.028709450736641884, 0.04177321493625641, 0.04292929917573929, -0.06686026602983475, -0.06219738721847534, 0.05133018642663956, 0.04782339558005333, -0.033353060483932495, 0.015183253213763237, 0.021175628527998924, 0.05460576340556145, -0.05159993842244148, 0.010732324793934822, 0.082159124314785, 0.03269794583320618, -0.0027649705298244953, 0.053603820502758026, 0.056879397481679916, -0.043121982365846634, 0.04404684901237488, -0.002632502466440201, 0.02302536554634571, 0.07772746682167053, 0.030250897631049156, -0.0023073535412549973, -0.01817944087088108, 0.06836317479610443, 0.011368172243237495, -0.06662905216217041, -0.017668837681412697, 0.026801910251379013, 0.008916308172047138, 0.0141427768394351, -0.008699541911482811, 0.0006472873501479626, 0.03969226032495499, 0.05429747328162193, -0.03768838196992874, 0.005149396602064371, -0.024894369766116142, -0.0016149065922945738, 0.05379650369286537, -0.016676530241966248, 0.05344967544078827, -0.032235510647296906, -0.01648384891450405, 0.04231272265315056, -0.016618726775050163, -0.040771275758743286, -0.0067245629616081715, 0.027418488636612892, 0.006459626369178295, 0.036667171865701675, 0.002904664259403944, -0.009287218563258648, 0.09156195819377899, 0.015086912550032139, 0.03125283867120743, -0.015366300009191036, 0.005072324071079493, 0.04050152003765106, -0.020058080554008484, -0.04709120839834213, 0.03601205721497536, 0.007832477800548077, -0.013795951381325722, -0.05934571102261543, 0.005688902921974659, 0.004060749430209398, -0.014171678572893143, -0.003959591966122389, 0.0007761426968500018, 0.032312583178281784, -0.005221651867032051, -0.036204736679792404, -0.027437757700681686, -0.041927359998226166, 0.03106015734374523, 0.019229551777243614, 0.014171678572893143, 0.04265954717993736, 0.024297058582305908, 0.11106126010417938, 0.00462674954906106, -0.02281341701745987, -0.02526046335697174, -0.040231768041849136, 0.018535900861024857, -0.048671189695596695, -0.041464924812316895, 0.06393151730298996, -0.06212031468749046, -0.010163916274905205, -0.017370181158185005, 0.02140684612095356, 0.02554948441684246, 0.030713332816958427, -0.01800602860748768, 0.05217798426747322, -0.007740954402834177, 0.07479871809482574, -0.0014101831475272775, -0.039846405386924744, -0.009788189083337784, 0.06959633529186249, -0.03707180172204971, 0.04327612742781639, -0.04770778492093086, 0.02641654945909977, -0.03487524017691612, -0.0030274982564151287, -0.07861380279064178, -0.037900328636169434, -0.04882533475756645, -0.001918378984555602, 0.006984681822359562, 0.04836289957165718, -0.01589617319405079, -0.0011464512208476663, -0.06504906713962555, -0.01490386575460434, 0.032775018364191055, 0.027591902762651443, 0.006604137364774942, -0.034971579909324646, 0.0014908682787790895, 0.022119764238595963, 0.04096395522356033, -0.04662877321243286, 0.006483711767941713, -0.0024085110053420067, -0.024374131113290787, -0.015221789479255676, 0.02454754337668419, -0.032852090895175934, -0.009311303496360779, -0.014518504031002522, 0.011348904110491276, -0.013497295789420605, 0.01643567904829979, 0.022967560216784477, -0.07560797780752182, -0.05133018642663956, -0.012408648617565632, -0.022620735689997673, -0.052447736263275146, -0.05429747328162193, -0.02310243807733059, 0.04007762297987938, 0.027591902762651443, 0.05156140401959419, 0.011252563446760178, 0.006141703110188246, 0.00708102248609066, 0.04150346294045448, -0.01023135520517826, -0.05395064502954483, -0.047052670270204544, -0.006276579573750496, -0.0684787854552269, -0.00031611707527190447, -0.01908504217863083, -0.07075241953134537, -0.021522454917430878, -0.028844328597187996, -0.00030859047546982765, -0.026108259335160255, 0.028786523267626762, 0.006238043308258057, -0.03788106143474579, -0.02666703425347805, 0.011792070232331753, -0.011262197047472, -0.0007014788570813835, -0.019942471757531166, -0.0018629832193255424, -0.04666730761528015, -0.03317964822053909, 0.002748111030086875, -0.0346054844558239, -0.03423939272761345, -0.03630107641220093, 0.013468394055962563, 0.06724562495946884, 0.034952312707901, -0.004961532540619373, -0.046474628150463104, -0.06231299787759781, -0.0019075407180935144, 0.01974979043006897, 0.03622400388121605, 0.03705253452062607, -0.024817297235131264, -0.03799666836857796, -0.013805584982037544, -0.030405042693018913, 0.004670103080570698, 0.03127210587263107, 0.030212361365556717, 0.04285222664475441, -0.0023326429072767496, -0.04208150506019592, -0.03181161358952522, 0.027148736640810966, 0.07256361842155457, 0.08871027827262878, 0.03258233517408371, -0.0601935088634491, 0.020308565348386765, -0.012909619137644768, 0.020559050142765045, 0.06620515137910843, 0.08701468259096146, 0.00014315587759483606, -0.0767640620470047, -0.06015497073531151, -0.010019405744969845, 0.02529899962246418, -0.011869141831994057, 0.04493318125605583, 0.02025076001882553, -0.004361813422292471, 0.026108259335160255, -0.028266284614801407, 0.004397941287606955, 0.011907678097486496, 0.004149864427745342, 0.008487592451274395, 0.004289558157324791, 0.03464402258396149, 0.042004432529211044, -0.0677465945482254, 0.0020243534818291664, 0.0018798428354784846, -0.009243865497410297, 0.02418144978582859, 0.006608954165130854, 0.017832616344094276, 0.003916238900274038, -0.07237093895673752, 0.09842139482498169, -0.08370057493448257, 0.007822844199836254, -0.033025503158569336, 0.08077182620763779, 0.03953811526298523, 0.011724631302058697, -0.021175628527998924, 0.001967753516510129, 0.029171885922551155, 0.08670639991760254, -0.02612752839922905, 0.0055877454578876495, -0.008603201247751713, 0.011040614917874336, -0.025433875620365143, -0.044779036194086075, 0.0288250595331192, -0.02836262620985508, 0.03481743484735489, 0.03391183540225029, -0.024990709498524666, 0.033931102603673935, -0.018564803525805473, 0.048093147575855255, 0.014229482971131802, 0.007962536998093128, -0.03055918775498867, -0.02364194393157959, -0.046359021216630936, -0.07337287813425064, 0.05568477511405945, -0.008487592451274395, -0.05791987106204033, -0.0461278036236763, -0.031657468527555466, -0.01933552697300911, 0.026185331866145134, 0.036994729191064835, -0.06982754915952682, -0.07815136760473251, 0.007476018276065588, 0.04547268897294998, -0.019923202693462372, -0.01248572114855051, 0.028381893411278725, 0.01776517741382122, -0.019268088042736053, 0.004764034878462553, -0.017283475026488304, 0.02260146662592888, 0.006262128707021475, -0.04269808158278465, -0.003061217488721013, 0.015260325744748116, 0.05291017144918442, 0.013246810995042324, -0.005024154204875231, -0.011291099712252617, 0.007702418137341738, 0.0021218981128185987, 0.02687898278236389, -0.0453956164419651, 0.045318543910980225, 0.020636122673749924, -0.02260146662592888, -0.005024154204875231, -0.019769057631492615, -0.006777550093829632, 0.030828941613435745, -0.004251021891832352, -0.08370057493448257, -0.053565286099910736, 0.048594117164611816, 0.04111810028553009, 0.02244732342660427, 0.00919087789952755, 0.03506791964173317, 0.00010710347123676911, 0.07695674151182175, 0.06339201331138611, -0.006536698900163174, 0.013054129667580128, -0.039730798453092575, -0.021541722118854523, -0.06709147989749908, -0.007191814016550779, 0.020212223753333092, -0.09433656185865402, -0.00873807817697525, 0.10111892968416214, 0.0612725205719471, -0.0009947150247171521, 0.010366231203079224, -0.004833881743252277, 0.047052670270204544, 0.009137891232967377, -0.030790405347943306, -0.04790046811103821, 0.07792014628648758, 0.008815150707960129, -0.030713332816958427, 0.01025062333792448, 0.004031847231090069, -0.020848071202635765, 0.0066908434964716434, -0.06000082567334175, -0.06836317479610443, -0.025202659890055656, 0.00710029061883688, 0.055260878056287766, -0.03362281247973442, -0.023237314075231552, -0.050328247249126434, 0.051946766674518585, 0.05610867217183113, -0.07240947335958481, -0.05163847655057907, -0.0022110131103545427, 0.05464429780840874, -0.028015799820423126, 0.005818962585180998, 0.08015524595975876, -0.0024229621049016714, 0.028593841940164566, -0.0013957321643829346, 0.023738283663988113, -0.027630439028143883, 0.044200994074344635, 0.022717075422406197, -0.02393096499145031, 0.052447736263275146, 0.058151088654994965, 0.0022748387418687344, -0.04327612742781639, -0.021445382386446, 0.027148736640810966, 0.03237038850784302, -0.06620515137910843, -0.013266079127788544, 0.021098555997014046, -0.010077210143208504, -0.07406652718782425, 0.01714859902858734, 0.03063626028597355, -0.03570376709103584, 0.02115636132657528, 0.01888272725045681, -0.06805488467216492, -0.03911421820521355, -0.08454836905002594, 0.0014547406462952495, -0.03903714567422867, 0.0017377407057210803, -0.026763373985886574, 0.008222656324505806, 0.010770861059427261, 0.07464457303285599, 0.05317992344498634, -0.027071664109826088, 0.03851690888404846, -0.002914298325777054, 0.011425976641476154, 0.020058080554008484, 0.018853824585676193, 0.03709106892347336, 0.015539713203907013, 0.003725966438651085, 0.06628222018480301, 0.03298696503043175, -0.08292984962463379, 0.030501384288072586, 0.026763373985886574, 0.031329911202192307, 0.010067575611174107, 0.02612752839922905, -0.03142625093460083, -0.0011037001386284828, -0.02998114563524723, -0.0012289427686482668, -0.02894066832959652, 0.0652032122015953, -0.011811338365077972, 0.007610894739627838, -0.009036733768880367, -0.045780979096889496, 0.005375796463340521, 0.013747780583798885, 0.07545383274555206, -0.010077210143208504, -0.056455496698617935, -0.018661143258213997, 0.056532569229602814, 0.04601219296455383, 0.049788739532232285, -0.012158163823187351, -0.01217743195593357, 0.039769332855939865, -0.048170220106840134, -0.03416232019662857, -0.020732462406158447, 0.0014306555967777967, 0.07264069467782974, -0.06177349016070366, -0.016907747834920883, 0.0338732972741127, 0.020848071202635765, 0.036956194788217545, -0.014605211094021797, -0.10697642713785172, 0.026532158255577087, -0.020154420286417007, 0.006922060623764992, -0.07102217525243759, 0.0019930428825318813, 0.0020592769142240286, -0.0019557110499590635, 0.01705225743353367, -0.04797754064202309, -0.025896310806274414, -0.060964230448007584, 0.00047658412950113416, -0.03907568380236626, 0.003528468543663621, -0.05630135536193848, -0.049172159284353256, -0.020443441346287727, 0.018044564872980118, -0.0013343150494620204, -0.010626350529491901, -0.029326030984520912, -0.028747987002134323, -0.03712960705161095, 0.007606077939271927, 0.06350761651992798, -0.011454878374934196, -0.07572358846664429, 0.0005777415935881436, 0.023198777809739113, -0.04096395522356033, -0.045935120433568954, 0.014364359900355339, 0.0034008175134658813, -0.009205329231917858, -0.021560991182923317, -0.0033815493807196617, -0.03215843811631203, 0.01043367013335228, 0.03581937402486801, 0.020982947200536728, 0.0014005491975694895, 0.03932616859674454, 0.025202659890055656, -0.026185331866145134, 0.02260146662592888, -0.020559050142765045, -0.0612725205719471, -0.02302536554634571, -0.02132977358996868, -0.048632655292749405, -0.041927359998226166, 0.024451203644275665, -0.01043367013335228, -0.0071821799501776695, -0.007268886081874371, 0.01254352554678917, 0.01850699819624424, -0.007668699137866497, -0.00902709923684597, -0.0010820236057043076, 0.03599279001355171, -0.04100249335169792, 0.08393178880214691, -0.030732600018382072, 0.038651783019304276, -0.06639783084392548, -0.02695605531334877, 0.03672497719526291, 0.0051301284693181515, -0.010857568122446537, 0.04662877321243286, 0.035761572420597076, 0.015260325744748116, -0.05791987106204033, 0.05491404980421066, -0.0890185683965683, -0.02915261685848236, -0.006416273303329945, 0.01428728736937046, -0.04269808158278465, -0.00008881384565029293, 0.011657193303108215, 0.011994385160505772, 0.03878666087985039, 0.03689838945865631, 0.05283309891819954, 0.0086947251111269, 0.0074712010100483894, 0.027938727289438248, 0.0003549543034750968, -0.003976451698690653, -0.008463507518172264, 0.03325672075152397, 0.010761227458715439, 0.001990634249523282, 0.009874895215034485, -0.015472275204956532, 0.017408717423677444, 0.009080086834728718, 0.007972171530127525, 0.031907953321933746, 0.0007598852389492095, -0.05167701095342636, -0.0019195833010599017, 0.013767048716545105, 0.004397941287606955, -0.006575235165655613, -0.06397005170583725, -0.03470182791352272, -0.037861794233322144, -0.013372053392231464, 0.038863733410835266, -0.013198640197515488, 0.04516439884901047, -0.056494034826755524, -0.049673132598400116, 0.007760222535580397, -0.013959730044007301, -0.006950962822884321, -0.05233212560415268, 0.044663429260253906, -0.00929203536361456, -0.033141110092401505, 0.0027192088309675455, -0.03516425937414169, 0.02464388497173786, -0.033064037561416626, -0.015549346804618835, 0.0030780769884586334, 0.030289433896541595, 0.005236102733761072, -0.0014354725135490298, 0.0019834088161587715, 0.030963817611336708, 0.05884474143385887, -0.005240919999778271, 0.0021833153441548347, -0.0179289560765028, 0.040193233639001846, -0.02104075253009796, -0.01967271789908409, 0.005688902921974659, 0.02248585969209671, 0.0601935088634491, 0.02339145913720131, 0.001071185222826898, -0.008815150707960129, 0.062004707753658295, 0.005794877652078867, 0.015838367864489555, 0.028227748349308968, -0.0680934265255928, 0.03308330848813057, 0.005048239137977362, 0.0288250595331192, 0.02699459157884121, 0.03383476287126541, 0.023661212995648384, 0.02529899962246418, -0.030906014144420624, 0.017919322475790977, 0.02994260936975479, 0.07329580932855606, -0.012167797423899174, 0.010067575611174107, -0.02335292287170887, -0.0018930896185338497, 0.0001392420381307602, -0.03321818262338638, -0.062004707753658295, 0.013362418860197067, -0.0016064768424257636, 0.03520279750227928, -0.03743789345026016, 0.03348793834447861, -0.030289433896541595, 0.04782339558005333, 0.017399083822965622, 0.040886882692575455, 0.029672855511307716, -0.0004979596706107259, -0.004443702753633261, -0.01771700754761696, -0.03934543579816818, 0.03870958834886551, 0.01817944087088108, 0.002002676948904991, 0.020481977611780167, 0.007620528806000948, -0.043044909834861755, -0.02260146662592888, 0.0011301938211545348, 0.02227390930056572, -0.01842029206454754, 0.04508732631802559, -0.010645618662238121, 0.05553063005208969, 0.07040559500455856 ]
39,435
pyspark.sql.dataframe
union
Return a new :class:`DataFrame` containing the union of rows in this and another :class:`DataFrame`. .. versionadded:: 2.0.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Parameters ---------- other : :class:`DataFrame` Another :class:`DataFrame` that needs to be unioned. Returns ------- :class:`DataFrame` A new :class:`DataFrame` containing the combined rows with corresponding columns. See Also -------- DataFrame.unionAll Notes ----- This method performs a SQL-style set union of the rows from both `DataFrame` objects, with no automatic deduplication of elements. Use the `distinct()` method to perform deduplication of rows. The method resolves columns by position (not by name), following the standard behavior in SQL. Examples -------- Example 1: Combining two DataFrames with the same schema >>> df1 = spark.createDataFrame([(1, 'A'), (2, 'B')], ['id', 'value']) >>> df2 = spark.createDataFrame([(3, 'C'), (4, 'D')], ['id', 'value']) >>> df3 = df1.union(df2) >>> df3.show() +---+-----+ | id|value| +---+-----+ | 1| A| | 2| B| | 3| C| | 4| D| +---+-----+ Example 2: Combining two DataFrames with different schemas >>> from pyspark.sql.functions import lit >>> df1 = spark.createDataFrame([("Alice", 1), ("Bob", 2)], ["name", "id"]) >>> df2 = spark.createDataFrame([(3, "Charlie"), (4, "Dave")], ["id", "name"]) >>> df1 = df1.withColumn("age", lit(30)) >>> df2 = df2.withColumn("age", lit(40)) >>> df3 = df1.union(df2) >>> df3.show() +-----+-------+---+ | name| id|age| +-----+-------+---+ |Alice| 1| 30| | Bob| 2| 30| | 3|Charlie| 40| | 4| Dave| 40| +-----+-------+---+ Example 3: Combining two DataFrames with mismatched columns >>> df1 = spark.createDataFrame([(1, 2)], ["A", "B"]) >>> df2 = spark.createDataFrame([(3, 4)], ["C", "D"]) >>> df3 = df1.union(df2) >>> df3.show() +---+---+ | A| B| +---+---+ | 1| 2| | 3| 4| +---+---+ Example 4: Combining duplicate rows from two different DataFrames >>> df1 = spark.createDataFrame([(1, 'A'), (2, 'B'), (3, 'C')], ['id', 'value']) >>> df2 = spark.createDataFrame([(3, 'C'), (4, 'D')], ['id', 'value']) >>> df3 = df1.union(df2).distinct().sort("id") >>> df3.show() +---+-----+ | id|value| +---+-----+ | 1| A| | 2| B| | 3| C| | 4| D| +---+-----+
def union(self, other: "DataFrame") -> "DataFrame": """Return a new :class:`DataFrame` containing the union of rows in this and another :class:`DataFrame`. .. versionadded:: 2.0.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Parameters ---------- other : :class:`DataFrame` Another :class:`DataFrame` that needs to be unioned. Returns ------- :class:`DataFrame` A new :class:`DataFrame` containing the combined rows with corresponding columns. See Also -------- DataFrame.unionAll Notes ----- This method performs a SQL-style set union of the rows from both `DataFrame` objects, with no automatic deduplication of elements. Use the `distinct()` method to perform deduplication of rows. The method resolves columns by position (not by name), following the standard behavior in SQL. Examples -------- Example 1: Combining two DataFrames with the same schema >>> df1 = spark.createDataFrame([(1, 'A'), (2, 'B')], ['id', 'value']) >>> df2 = spark.createDataFrame([(3, 'C'), (4, 'D')], ['id', 'value']) >>> df3 = df1.union(df2) >>> df3.show() +---+-----+ | id|value| +---+-----+ | 1| A| | 2| B| | 3| C| | 4| D| +---+-----+ Example 2: Combining two DataFrames with different schemas >>> from pyspark.sql.functions import lit >>> df1 = spark.createDataFrame([("Alice", 1), ("Bob", 2)], ["name", "id"]) >>> df2 = spark.createDataFrame([(3, "Charlie"), (4, "Dave")], ["id", "name"]) >>> df1 = df1.withColumn("age", lit(30)) >>> df2 = df2.withColumn("age", lit(40)) >>> df3 = df1.union(df2) >>> df3.show() +-----+-------+---+ | name| id|age| +-----+-------+---+ |Alice| 1| 30| | Bob| 2| 30| | 3|Charlie| 40| | 4| Dave| 40| +-----+-------+---+ Example 3: Combining two DataFrames with mismatched columns >>> df1 = spark.createDataFrame([(1, 2)], ["A", "B"]) >>> df2 = spark.createDataFrame([(3, 4)], ["C", "D"]) >>> df3 = df1.union(df2) >>> df3.show() +---+---+ | A| B| +---+---+ | 1| 2| | 3| 4| +---+---+ Example 4: Combining duplicate rows from two different DataFrames >>> df1 = spark.createDataFrame([(1, 'A'), (2, 'B'), (3, 'C')], ['id', 'value']) >>> df2 = spark.createDataFrame([(3, 'C'), (4, 'D')], ['id', 'value']) >>> df3 = df1.union(df2).distinct().sort("id") >>> df3.show() +---+-----+ | id|value| +---+-----+ | 1| A| | 2| B| | 3| C| | 4| D| +---+-----+ """ return DataFrame(self._jdf.union(other._jdf), self.sparkSession)
(self, other: pyspark.sql.dataframe.DataFrame) -> pyspark.sql.dataframe.DataFrame
[ -0.03131154552102089, -0.06420944631099701, 0.0310471560806036, 0.04528654366731644, -0.0320669524371624, -0.025683777406811714, -0.03705262765288353, -0.025211649015545845, -0.03269015997648239, 0.0163828507065773, 0.012558612041175365, -0.03676934912800789, -0.02436181902885437, 0.1228288933634758, 0.005679703317582607, -0.008144212886691093, 0.016694456338882446, 0.030593913048505783, 0.08158376812934875, 0.01774257980287075, -0.034427594393491745, -0.008828798308968544, 0.014494338072836399, 0.05306721851229668, -0.05197187885642052, 0.005863833241164684, -0.0450599230825901, -0.03501303121447563, -0.010226298123598099, 0.03622168302536011, -0.00556167121976614, -0.06243424490094185, 0.0006190782296471298, -0.027213474735617638, -0.06031910702586174, -0.018120283260941505, 0.030669452622532845, 0.03289789706468582, 0.05280282720923424, -0.028610972687602043, 0.0011832715244963765, -0.02088695578277111, 0.05170748755335808, -0.07924201339483261, 0.011293308809399605, 0.040225330740213394, -0.03567401319742203, -0.03083941899240017, -0.02300208993256092, -0.008418046869337559, 0.06885518878698349, 0.03943215310573578, -0.03992316871881485, 0.03591952100396156, -0.03950769454240799, 0.01643950678408146, -0.0443422868847847, -0.010566230863332748, -0.020754758268594742, 0.04048972204327583, -0.01286077406257391, -0.022907663136720657, -0.049365732818841934, 0.027685601264238358, -0.0015816297382116318, 0.012539726682007313, -0.010972261428833008, -0.034352052956819534, -0.03491860628128052, -0.003774665528908372, -0.05378485471010208, 0.061036743223667145, -0.019961584359407425, 0.06968613713979721, -0.008876011706888676, -0.0076059866696596146, 0.01800697296857834, 0.016477277502417564, -0.03185921534895897, -0.049025800079107285, 0.07686248421669006, -0.041736140847206116, -0.009102633222937584, -0.03506968915462494, 0.048836950212717056, 0.03157594054937363, -0.0052264598198235035, 0.011246095411479473, -0.07395417243242264, -0.08483200520277023, 0.030253980308771133, -0.013899456709623337, -0.03144374489784241, 0.004237351473420858, 0.04041418060660362, -0.03671269491314888, -0.05336938053369522, -0.00839444063603878, -0.027119047939777374, -0.009716399945318699, -0.00393991032615304, 0.05030998960137367, -0.013125166296958923, -0.002139921300113201, 0.01617511548101902, -0.0368448905646801, -0.030386175960302353, -0.01986715756356716, -0.016146786510944366, -0.01596737839281559, -0.007199956104159355, 0.007129136938601732, 0.05280282720923424, -0.0006350125186145306, 0.03423874080181122, -0.04317140951752663, -0.005075378809124231, 0.023285366594791412, -0.009055420756340027, 0.056617621332407, 0.022888779640197754, 0.08505862951278687, 0.055862218141555786, -0.09389687329530716, 0.03167036548256874, 0.009333975613117218, 0.0197916179895401, -0.03535296395421028, -0.018110841512680054, 0.06016802787780762, 0.020773643627762794, -0.015448037534952164, -0.01644894853234291, 0.014173290692269802, 0.03656161203980446, -0.028441008180379868, 0.005826062988489866, 0.031972527503967285, 0.006132946349680424, 0.07312322407960892, 0.012539726682007313, -0.0262692179530859, 0.07735349982976913, 0.009886366315186024, -0.07550275325775146, 0.029517460614442825, 0.024852832779288292, -0.019678305834531784, -0.009168731048703194, 0.009980792179703712, 0.012228121981024742, 0.019055096432566643, -0.005604162812232971, -0.0008350769057869911, -0.046381883323192596, -0.038393471390008926, 0.02742120996117592, -0.015060892328619957, 0.018941786140203476, -0.0716879591345787, 0.012898544780910015, 0.017629269510507584, 0.01897955685853958, 0.019262833520770073, -0.06447383761405945, 0.010179085657000542, 0.02088695578277111, 0.02653360925614834, -0.04532431438565254, -0.021812327206134796, 0.05684424564242363, 0.00883824098855257, 0.07648477703332901, -0.031896986067295074, -0.032236918807029724, 0.05144309625029564, 0.0017421533120796084, -0.006307633593678474, 0.007011104840785265, -0.026873541995882988, 0.02585374377667904, -0.03187810257077217, -0.013408442959189415, 0.006038520485162735, 0.02653360925614834, -0.034484248608350754, -0.01630731113255024, -0.04286924749612808, 0.0914040356874466, -0.02987627685070038, 0.019904928281903267, -0.022756582126021385, -0.007856214419007301, 0.04524877294898033, -0.0057694073766469955, -0.03293566778302193, 0.01930060423910618, 0.019489455968141556, -0.03225580230355263, 0.045550934970378876, 0.005656096618622541, 0.02060367725789547, 0.05903492122888565, -0.010896720923483372, 0.01801641471683979, -0.041736140847206116, -0.04668404534459114, -0.010282954201102257, 0.00034553889418020844, -0.04634411260485649, 0.04925242066383362, -0.05861944705247879, -0.0008822897216305137, -0.01679832488298416, 0.02054702304303646, 0.0010351412929594517, -0.02498502843081951, -0.04687289521098137, 0.019206177443265915, 0.0010363215114921331, 0.03316228836774826, 0.000392751710023731, -0.00815365556627512, 0.021717900410294533, -0.0027784749399870634, -0.037222594022750854, 0.01389001403003931, -0.0032718488946557045, 0.022888779640197754, -0.036939315497875214, 0.007346315775066614, -0.081885926425457, 0.038790058344602585, -0.03540962189435959, -0.04324695095419884, 0.050536610186100006, -0.005207574926316738, -0.023984115570783615, 0.022511076182127, -0.06666450947523117, -0.06058350205421448, 0.019697191193699837, 0.07214120030403137, 0.004242072347551584, -0.029045332223176956, -0.016212884336709976, 0.021189117804169655, 0.036939315497875214, -0.015806853771209717, -0.007261333055794239, 0.015542462468147278, -0.023663070052862167, 0.016807766631245613, 0.02443736046552658, 0.010311281308531761, -0.030688337981700897, -0.03716593608260155, -0.0070630391128361225, -0.02415408194065094, 0.03029175102710724, 0.015476364642381668, -0.0191117525100708, -0.029630770906805992, 0.04362465441226959, -0.08415214717388153, -0.024815062060952187, -0.022964319214224815, 0.014381026849150658, -0.050801001489162445, 0.010131873190402985, 0.09087525308132172, -0.028138846158981323, 0.023417562246322632, -0.002464509569108486, 0.022001177072525024, -0.004867642652243376, -0.028780939057469368, -0.010991145856678486, -0.010613443329930305, -0.06375620514154434, 0.028346581384539604, -0.02475840598344803, -0.019395029172301292, -0.02859208919107914, -0.04475776106119156, 0.020018238574266434, -0.015023121610283852, -0.06840194761753082, -0.025891514495015144, -0.04494661092758179, -0.004938461817800999, 0.012766348198056221, 0.02504168450832367, 0.02422962337732315, -0.05234958231449127, 0.0310471560806036, 0.008167819119989872, -0.0033780778758227825, -0.003968238364905119, -0.012747463770210743, -0.04468221962451935, 0.00672310683876276, 0.055031273514032364, 0.09155511856079102, -0.0018141529290005565, -0.09442565590143204, 0.03669381141662598, -0.0457020178437233, -0.00937646720558405, 0.03758141025900841, -0.015240300446748734, 0.015872953459620476, -0.0009961907053366303, 0.020528137683868408, -0.04959235340356827, -0.009456729516386986, -0.021604590117931366, 0.01801641471683979, 0.009980792179703712, 0.003470142837613821, -0.0009696334600448608, -0.02122688665986061, -0.027723371982574463, -0.007081924006342888, -0.005386983510106802, 0.021170232445001602, -0.002064380794763565, -0.008876011706888676, 0.018734050914645195, -0.0028965070378035307, -0.0009188796393573284, -0.02804441936314106, 0.0477416105568409, 0.026042595505714417, -0.022775467485189438, -0.04067857190966606, 0.011359406635165215, -0.036467187106609344, 0.03178367391228676, 0.05574890598654747, 0.03157594054937363, -0.03431428223848343, 0.023228710517287254, -0.047666069120168686, 0.0015568429371342063, -0.013087395578622818, 0.001043403521180153, 0.04532431438565254, -0.03969654440879822, -0.010188528336584568, 0.0033025373704731464, 0.03692043200135231, -0.009886366315186024, -0.023172056302428246, 0.01583518274128437, 0.03712816908955574, -0.07633370161056519, 0.06587133556604385, 0.007124415598809719, 0.0008787487749941647, 0.03658049926161766, -0.05484241992235184, 0.012331990525126457, -0.03153816983103752, 0.004985674750059843, 0.04018756002187729, 0.0051461984403431416, -0.04086742177605629, -0.0859651193022728, -0.08173484355211258, 0.0028020814061164856, -0.01570298708975315, 0.04653296247124672, -0.016326196491718292, 0.004584365524351597, 0.04426674544811249, -0.03295455500483513, 0.01197317335754633, -0.004501743242144585, -0.02122688665986061, 0.025230534374713898, -0.018507428467273712, 0.0100657744333148, -0.01549525000154972, 0.0007807821384631097, -0.012095926329493523, -0.07659809291362762, -0.050121136009693146, -0.02375749498605728, 0.01473984494805336, -0.003661354770883918, 0.00008911421173252165, -0.0041759745217859745, 0.032104723155498505, -0.0757293775677681, 0.00873437337577343, -0.03461644425988197, 0.0007973066531121731, 0.03397434949874878, -0.015986263751983643, 0.03969654440879822, -0.02470175176858902, 0.02422962337732315, -0.01272857841104269, 0.017109928652644157, 0.027213474735617638, 0.036070600152015686, -0.07656031847000122, -0.03384215384721756, -0.03321894630789757, -0.020773643627762794, -0.0566553920507431, -0.05197187885642052, 0.09155511856079102, 0.018110841512680054, 0.039281073957681656, 0.049781206995248795, -0.0003083587798755616, 0.061187826097011566, 0.09359470754861832, 0.0072093987837433815, 0.028233271092176437, -0.02258661761879921, 0.0716879591345787, -0.014305486343801022, -0.009971349500119686, 0.01794087514281273, 0.00859745591878891, -0.0069261216558516026, 0.038317929953336716, 0.03369107469916344, -0.022888779640197754, -0.026231447234749794, 0.010622886009514332, 0.001154943834990263, 0.026250332593917847, 0.06284971535205841, -0.02264327183365822, 0.008200868032872677, 0.07999741286039352, 0.036334991455078125, -0.021585704758763313, -0.021113576367497444, -0.0020773643627762794, -0.02742120996117592, -0.05533343553543091, -0.0238896906375885, -0.006534255109727383, -0.06632457673549652, 0.018800148740410805, 0.0736897811293602, 0.0018259561620652676, -0.059677012264728546, 0.01194484531879425, -0.06148998811841011, 0.026495838537812233, 0.020433710888028145, -0.04426674544811249, -0.07674917578697205, 0.02647695317864418, 0.03786468878388405, -0.0163828507065773, 0.026495838537812233, 0.030423946678638458, -0.0122847780585289, 0.027685601264238358, -0.012473628856241703, -0.08294349908828735, -0.0389033704996109, 0.01524974312633276, 0.00016229409084189683, -0.055711135268211365, -0.023908575996756554, -0.058657217770814896, 0.008857126347720623, 0.02530607581138611, -0.041509516537189484, -0.005811898969113827, -0.007610708009451628, 0.009603088721632957, -0.08656944334506989, 0.0016300228890031576, -0.01732710748910904, -0.015920165926218033, 0.06058350205421448, -0.00795064028352499, 0.0045654806308448315, -0.0045654806308448315, 0.0627741739153862, -0.002995654009282589, -0.01842244528234005, -0.007407692726701498, -0.05355823040008545, -0.037562526762485504, -0.022359995171427727, 0.04687289521098137, -0.023323137313127518, 0.01698717474937439, -0.026798000559210777, -0.00232759234495461, 0.017969202250242233, -0.03438982367515564, -0.030121784657239914, -0.012851331382989883, 0.020037123933434486, -0.05793958157300949, 0.0552578940987587, 0.005533343181014061, -0.0155235780403018, -0.013880571350455284, -0.04441782832145691, 0.028138846158981323, -0.0011744190705940127, 0.009083747863769531, 0.044719990342855453, -0.010311281308531761, 0.003817157121375203, 0.03916776180267334, 0.07667363435029984, 0.0057221949100494385, -0.029800737276673317, 0.0022095602471381426, 0.004924297798424959, 0.01487204059958458, -0.03559847176074982, -0.0007111431914381683, -0.025211649015545845, 0.028478777036070824, 0.00781372282654047, 0.002342936582863331, -0.10016673803329468, 0.021850096061825752, -0.02339867688715458, -0.0375058688223362, -0.0007683887961320579, 0.0034607001580297947, -0.018054185435175896, 0.031236005946993828, -0.006010192912071943, -0.01150104496628046, -0.007742903660982847, 0.052236273884773254, -0.0074643478728830814, -0.06175437942147255, -0.052236273884773254, -0.018743492662906647, -0.043700192123651505, 0.0033285042736679316, 0.05767519026994705, -0.0033355862833559513, -0.053407151252031326, 0.0006350125186145306, 0.08437876403331757, 0.049781206995248795, 0.03692043200135231, -0.06613572686910629, -0.019158964976668358, 0.026590265333652496, -0.006468157283961773, 0.015296956524252892, 0.034691985696554184, -0.019413914531469345, 0.04770383983850479, -0.0436624214053154, -0.010216855444014072, 0.009678629226982594, 0.020716989412903786, -0.011302750557661057, 0.0022732976358383894, -0.02511722408235073, 0.0023452972527593374, 0.022133372724056244, 0.000668651657178998, -0.07795782387256622, 0.009291484020650387, 0.0184318870306015, -0.006402059458196163, 0.09978903084993362, -0.04082965478301048, -0.009017650038003922, -0.03433316946029663, 0.051065392792224884, 0.016977733001112938, -0.007459626533091068, 0.01882847584784031, 0.027968879789114, -0.050876542925834656, -0.003033424261957407, 0.06779762357473373, -0.024663981050252914, -0.023587528616189957, -0.037562526762485504, 0.006010192912071943, -0.01644894853234291, 0.013701162301003933, 0.07112140208482742, -0.057221945375204086, -0.016694456338882446, 0.04120735451579094, -0.000783732917625457, 0.055937759578228, 0.00510370684787631, -0.01439991220831871, -0.04196276143193245, 0.014532108791172504, 0.01292687188833952, -0.043435800820589066, 0.032104723155498505, 0.0038478453643620014, 0.02825215645134449, 0.03999870643019676, 0.057561878114938736, 0.018460216000676155, -0.058694988489151, 0.03727924823760986, -0.027515636757016182, -0.03119823709130287, -0.06530478596687317, 0.01272857841104269, 0.0036566334310919046, -0.02264327183365822, 0.0654936358332634, 0.020358171314001083, -0.008559685200452805, -0.03008401393890381, 0.07633370161056519, -0.02258661761879921, 0.049781206995248795, 0.0010439936304464936, 0.04751498997211456, 0.07176350057125092, -0.06371843069791794, 0.05284059792757034, -0.011822092346847057, 0.03185921534895897, -0.06730660796165466, -0.03652384504675865, -0.04872363805770874, -0.012511399574577808, 0.011793764308094978, 0.04743944853544235, 0.009820268489420414, -0.0014777615433558822, 0.006147110369056463, -0.027874452993273735, -0.025230534374713898, -0.03984762728214264, -0.0044592516496777534, -0.0018035300308838487, -0.014513223432004452, -0.013672835193574429, -0.0314059741795063, 0.06711775809526443, -0.010490690357983112, 0.023096514865756035, 0.03875228762626648, -0.04388904571533203, 0.01637340895831585, 0.06904403865337372, 0.049025800079107285, -0.007497397251427174, -0.009810825809836388, 0.04362465441226959, 0.025683777406811714, 0.007620150223374367, 0.033200059086084366, 0.021189117804169655, -0.02976296655833721, 0.06723106652498245, 0.0443422868847847, -0.005523900967091322, 0.02757229097187519, -0.005339770577847958, 0.02169901505112648, -0.005165083333849907, -0.04728836938738823, -0.027345670387148857, -0.050801001489162445, -0.0026155905798077583, -0.06194322928786278, 0.02913975715637207, 0.03935661166906357, -0.004688233602792025, -0.04373796284198761, -0.036467187106609344, -0.0005574064562097192, 0.0027666715905070305, 0.013285689987242222, 0.0361650250852108, -0.07886430621147156, 0.025136109441518784, -0.04305809736251831, -0.02995181828737259, 0.05318053066730499, -0.022208914160728455, 0.01869628019630909, 0.017345992848277092, -0.057977352291345596, -0.003222275525331497, 0.04449336975812912, -0.000546488503459841, 0.016014590859413147, 0.014966466464102268, 0.025570467114448547, 0.05302944779396057, 0.0893644392490387, 0.03471086919307709, 0.010424592532217503, 0.031708136200904846, -0.05246289446949959, -0.028478777036070824, 0.009164010174572468, 0.015193087980151176, 0.039809856563806534, 0.036618269979953766, 0.028950905427336693, -0.005471966695040464, 0.05895937979221344, 0.007596543990075588, 0.03433316946029663, -0.04449336975812912, 0.00019873649580404162, 0.04407789558172226, 0.012832446955144405, 0.020018238574266434, 0.034352052956819534, 0.04060303047299385, -0.016335638239979744, -0.007898706011474133, 0.050876542925834656, 0.02742120996117592, 0.07667363435029984, 0.04853478819131851, 0.02156681939959526, 0.03584397956728935, -0.043511342257261276, 0.002046676119789481, -0.02018820494413376, -0.020377056673169136, 0.017563171684741974, 0.006826974917203188, -0.03370995819568634, -0.04993228614330292, -0.007563495077192783, 0.03505080193281174, -0.05034776031970978, 0.03280347213149071, 0.0187529344111681, -0.008536078967154026, 0.07871322333812714, 0.0034984704107046127, -0.02598593942821026, -0.04048972204327583, -0.024210738018155098, 0.05454025790095329, 0.04498438164591789, 0.015750199556350708, 0.020074894651770592, 0.009400074370205402, -0.07486066222190857, -0.012067598290741444, 0.04679735377430916, 0.0160334762185812, 0.014758730307221413, 0.03778914734721184, 0.029328608885407448, -0.013653949834406376, 0.015344168990850449 ]
39,436
pyspark.sql.dataframe
unionAll
Return a new :class:`DataFrame` containing the union of rows in this and another :class:`DataFrame`. .. versionadded:: 1.3.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Parameters ---------- other : :class:`DataFrame` Another :class:`DataFrame` that needs to be combined Returns ------- :class:`DataFrame` A new :class:`DataFrame` containing combined rows from both dataframes. Notes ----- This method combines all rows from both `DataFrame` objects with no automatic deduplication of elements. Use the `distinct()` method to perform deduplication of rows. :func:`unionAll` is an alias to :func:`union` See Also -------- DataFrame.union
def unionAll(self, other: "DataFrame") -> "DataFrame": """Return a new :class:`DataFrame` containing the union of rows in this and another :class:`DataFrame`. .. versionadded:: 1.3.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Parameters ---------- other : :class:`DataFrame` Another :class:`DataFrame` that needs to be combined Returns ------- :class:`DataFrame` A new :class:`DataFrame` containing combined rows from both dataframes. Notes ----- This method combines all rows from both `DataFrame` objects with no automatic deduplication of elements. Use the `distinct()` method to perform deduplication of rows. :func:`unionAll` is an alias to :func:`union` See Also -------- DataFrame.union """ return self.union(other)
(self, other: pyspark.sql.dataframe.DataFrame) -> pyspark.sql.dataframe.DataFrame
[ -0.06066761910915375, -0.05402105301618576, 0.026303444057703018, 0.03450559452176094, -0.06038478761911392, -0.0339929573237896, -0.05745039880275726, -0.02709891088306904, 0.000026532830815995112, 0.012108775787055492, 0.021071039140224457, -0.03411669656634331, 0.0010523366509005427, 0.11942612379789352, 0.01850786618888378, -0.017783107236027718, 0.018331095576286316, 0.01882605440914631, 0.08760743588209152, 0.009810760617256165, -0.057697877287864685, 0.013142883777618408, -0.009236256591975689, 0.022538233548402786, -0.0556119866669178, 0.031253017485141754, -0.07650625705718994, -0.02619738131761551, -0.021990245208144188, 0.06293028593063354, -0.0045606778003275394, -0.055753402411937714, 0.010199655778706074, -0.03747533634305, -0.058475665748119354, -0.0032172224018722773, 0.03275556489825249, 0.03312678262591362, 0.041576411575078964, 0.025932226330041885, -0.015264129266142845, -0.06522829830646515, 0.056566547602415085, -0.07544562965631485, 0.025843840092420578, -0.010482488200068474, -0.008427531458437443, -0.006394671276211739, 0.015838632360100746, -0.011163054034113884, 0.047268420457839966, 0.05649583786725998, -0.04207136854529381, 0.033091429620981216, -0.05119272321462631, 0.042707741260528564, -0.019815968349575996, 0.007132688071578741, -0.026162028312683105, 0.03470003977417946, -0.03719250485301018, -0.02280338853597641, -0.05288971960544586, 0.021194778382778168, 0.023298345506191254, 0.010535519570112228, -0.04843510314822197, -0.04405119642615318, -0.012815858237445354, 0.008409854024648666, -0.06985968351364136, 0.06897582858800888, -0.024906957522034645, 0.09255701303482056, -0.02041698805987835, -0.004640224389731884, -0.0025896872393786907, 0.000857889128383249, -0.0692586675286293, -0.038748085498809814, 0.08796098083257675, -0.03356871008872986, -0.02223772369325161, -0.013461070135235786, 0.03938445821404457, 0.0016284978482872248, -0.04801085591316223, 0.04288451373577118, -0.02994491532444954, -0.09517321735620499, 0.02347511611878872, 0.012833534739911556, -0.044298674911260605, -0.01995738409459591, 0.03167726472020149, -0.028071148321032524, -0.09057718515396118, 0.027364065870642662, -0.04161176458001137, -0.01953313499689102, -0.010995122604072094, 0.03038684092462063, 0.0009429599158465862, -0.0018759764498099685, 0.0031089503318071365, -0.025278175249695778, -0.01635126769542694, -0.03029845654964447, -0.010005207732319832, -0.017058348283171654, -0.02347511611878872, -0.006111838389188051, 0.057803940027952194, 0.001031897496432066, 0.0032592052593827248, -0.04585425555706024, -0.0158828254789114, 0.015467414632439613, -0.044652216136455536, 0.06505152583122253, 0.017659367993474007, 0.11207246780395508, 0.06862229108810425, -0.061339348554611206, 0.025013020262122154, 0.01288656610995531, 0.023192284628748894, -0.018118971958756447, -0.02087659016251564, 0.03687431663274765, 0.020346280187368393, -0.008926908485591412, -0.017058348283171654, 0.022396815940737724, 0.03019239380955696, -0.028230242431163788, 0.048717938363552094, -0.002355466363951564, 0.014406791888177395, 0.023439763113856316, 0.022202368825674057, -0.032737888395786285, 0.07007180899381638, 0.03040451928973198, -0.06034943461418152, 0.032737888395786285, 0.03017471730709076, -0.03917233273386955, -0.010500164702534676, -0.010137785226106644, 0.02734638936817646, 0.016492683440446854, -0.030899476259946823, -0.01600656472146511, -0.03655613213777542, 0.014839880168437958, 0.03360406309366226, 0.00047341338358819485, -0.005391499027609825, -0.03565460070967674, 0.006164869759231806, 0.01129563245922327, -0.005722943693399429, 0.02766457572579384, -0.07615271210670471, -0.016404299065470695, 0.02006344683468342, 0.017562145367264748, -0.03687431663274765, -0.018896762281656265, 0.05971306189894676, -0.005166116636246443, 0.09001151472330093, -0.05370286479592323, -0.033745478838682175, 0.018666960299015045, -0.020381633192300797, -0.0031884971540421247, 0.0035641342401504517, -0.017632853239774704, 0.04673811048269272, -0.04889470711350441, -0.0031509334221482277, -0.01343455445021391, 0.043167345225811005, -0.052005868405103683, -0.02154831774532795, -0.051687680184841156, 0.07275871932506561, -0.015564639121294022, 0.00821982603520155, -0.04528859257698059, -0.018649283796548843, 0.04037437215447426, 0.003612746251747012, -0.032384347170591354, 0.012170646339654922, 0.016421975567936897, -0.014760333113372326, 0.04359159618616104, -0.015723731368780136, 0.03775816783308983, 0.0442279689013958, -0.026639306917786598, 0.029662081971764565, -0.03542479872703552, -0.04263703525066376, -0.017314666882157326, -0.03448791429400444, -0.06508687883615494, 0.0703899934887886, -0.03927839547395706, -0.015007811598479748, -0.01180826686322689, 0.019020501524209976, 0.02494231052696705, -0.03832383453845978, -0.03878343850374222, 0.008029798045754433, -0.002010763855651021, 0.03906626999378204, -0.052182637155056, -0.01723511889576912, 0.015511607751250267, -0.018419481813907623, -0.011985036544501781, 0.0159005019813776, -0.0008595463586971164, 0.021265486255288124, -0.04705629497766495, -0.017084864899516106, -0.049318958073854446, 0.012815858237445354, -0.015829794108867645, -0.046561338007450104, 0.053278613835573196, 0.009687021374702454, -0.032490409910678864, 0.003301188349723816, -0.039879415184259415, -0.060526203364133835, -0.018189679831266403, 0.05660190060734749, -0.008767814375460148, -0.023404408246278763, 0.00045684113865718246, -0.002739942166954279, 0.04825833439826965, -0.002505721291527152, 0.019603842869400978, -0.017951039597392082, -0.03655613213777542, 0.024995341897010803, 0.0020704239141196012, -0.002574219834059477, -0.03832383453845978, -0.0004040862258989364, -0.018702315166592598, -0.026002934202551842, 0.0221139844506979, 0.042142078280448914, -0.01015546265989542, -0.03326819837093353, 0.04755125194787979, -0.07109707593917847, 0.0012871099170297384, -0.026338797062635422, 0.007954670116305351, -0.020275570452213287, -0.008507078513503075, 0.06879906356334686, -0.03130604699254036, 0.02543726935982704, -0.012179484590888023, 0.017995232716202736, 0.011145377531647682, -0.00703546404838562, 0.018879083916544914, -0.026710016652941704, -0.07883962243795395, 0.03611420467495918, -0.028636813163757324, -0.01469846349209547, -0.039525873959064484, -0.03984406217932701, 0.003661358030512929, -0.019462427124381065, -0.07417288422584534, -0.03201312944293022, -0.06151611730456352, 0.006739373784512281, 0.01724395714700222, 0.00885619968175888, 0.03701573237776756, -0.027593867853283882, 0.01027036365121603, 0.003924304153770208, -0.011145377531647682, 0.012630249373614788, 0.015971209853887558, -0.004209346603602171, -0.01168452762067318, 0.05593017116189003, 0.07841537147760391, -0.012073421850800514, -0.07990024983882904, 0.054303884506225586, 0.00007032840221654624, -0.008003282360732555, 0.024217551574110985, -0.026020610705018044, 0.032614149153232574, 0.011030476540327072, 0.01689041778445244, -0.048399750143289566, -0.00754809845238924, 0.013142883777618408, 0.028848938643932343, -0.0021853246726095676, -0.016050757840275764, -0.019886676222085953, -0.008140279911458492, -0.02018718607723713, -0.01668713055551052, 0.0014075348153710365, 0.020964976400136948, -0.013469908386468887, 0.0029520667158067226, 0.0010407360969111323, 0.006288609001785517, 0.012868889607489109, -0.03153584897518158, 0.04889470711350441, 0.011666850186884403, -0.022290755063295364, -0.026603953912854195, 0.01065925881266594, 0.0025123502127826214, 0.045783549547195435, 0.04115216061472893, 0.03719250485301018, -0.010349909774959087, 0.018118971958756447, -0.018808376044034958, -0.01962152123451233, -0.02393472008407116, -0.01611262746155262, 0.021300839260220528, -0.008246341720223427, -0.038748085498809814, -0.01343455445021391, 0.05299578234553337, -0.011216085404157639, -0.0033829445019364357, 0.019232625141739845, 0.04829368740320206, -0.07063747197389603, 0.04217743128538132, 0.003608326893299818, 0.002916712546721101, 0.03892485424876213, -0.0017091493355110288, -0.0035464572720229626, 0.012144130654633045, 0.003983964212238789, 0.039101626724004745, 0.006907305680215359, -0.019321011379361153, -0.0873246043920517, -0.059642352163791656, -0.0062532550655305386, -0.013938350602984428, 0.04454615339636803, -0.005563850048929453, -0.010606227442622185, 0.04482898861169815, -0.05571804940700531, 0.015502768568694592, 0.0006430025096051395, -0.025348883122205734, 0.003944190684705973, -0.01622752845287323, -0.0016119255451485515, -0.02916712500154972, 0.024571092799305916, -0.024447353556752205, -0.052606888115406036, -0.05391499027609825, -0.024924634024500847, 0.024694832041859627, -0.010765320621430874, -0.031005537137389183, -0.022396815940737724, 0.051899805665016174, -0.0772133320569992, -0.005166116636246443, -0.005877617746591568, 0.008374500088393688, 0.027417097240686417, 0.002007449511438608, 0.05628371238708496, -0.022608941420912743, 0.03729856759309769, -0.050662413239479065, 0.00519263232126832, 0.023068545386195183, 0.038535960018634796, -0.11610283702611923, -0.009660505689680576, -0.027629222720861435, 0.002174276625737548, -0.043980490416288376, -0.052147284150123596, 0.08308211714029312, 0.005895294714719057, 0.02939692698419094, 0.0306519977748394, 0.01703183352947235, 0.09559746086597443, 0.10231474041938782, 0.020028091967105865, 0.011498917825520039, -0.012356255203485489, 0.05087453871965408, -0.001713568577542901, -0.0004386116925161332, -0.0013600277015939355, 0.004839091096073389, 0.003482378087937832, -0.002591896802186966, 0.027434775605797768, -0.032490409910678864, -0.0244120005518198, 0.018437158316373825, -0.005851102061569691, 0.02098265290260315, 0.056213006377220154, -0.010455972515046597, 0.02722265012562275, 0.06674852222204208, 0.035000551491975784, -0.049177542328834534, -0.0062532550655305386, -0.03786423057317734, -0.027434775605797768, -0.05080382898449898, -0.014150475151836872, -0.004204927012324333, -0.057697877287864685, 0.015909340232610703, 0.04104610159993172, 0.01118073146790266, -0.035566214472055435, -0.00544894952327013, -0.03687431663274765, 0.03051058016717434, 0.03424043580889702, -0.04207136854529381, -0.055894818156957626, 0.030227748677134514, 0.06437980383634567, -0.018578574061393738, 0.014504016377031803, 0.03158888220787048, 0.0041474769823253155, -0.012020391412079334, -0.012824696488678455, -0.09057718515396118, -0.014327245764434338, 0.006213481537997723, -0.0021278744097799063, -0.0703899934887886, -0.00507773132994771, -0.06766773015260696, 0.00987263023853302, 0.00691614393144846, -0.020399311557412148, -0.0038712730165570974, -0.034099020063877106, -0.0016395460115745664, -0.08442556858062744, 0.003175239311531186, -0.01054435782134533, -0.010615065693855286, 0.0420006588101387, 0.0027465708553791046, 0.014424469321966171, 0.013894157484173775, 0.07389005273580551, -0.00018837102106772363, -0.0024615286383777857, -0.005864359904080629, -0.068091981112957, -0.02506604976952076, 0.00286368140950799, 0.060879744589328766, -0.02688678726553917, -0.00573178194463253, -0.014512854628264904, 0.022891774773597717, 0.010455972515046597, -0.02757619135081768, -0.04062185063958168, -0.0039751254953444, 0.028654491528868675, -0.04716235771775246, 0.0533493235707283, -0.024482708424329758, -0.0215659961104393, -0.030545935034751892, -0.032172221690416336, 0.025949902832508087, -0.028795907273888588, 0.014645432122051716, 0.036945026367902756, -0.02292712777853012, -0.021619027480483055, 0.05154626443982124, 0.0861932709813118, 0.000576161197386682, -0.045217882841825485, 0.0351419672369957, 0.007923735305666924, 0.021018007770180702, -0.06639498472213745, -0.005457787774503231, -0.022396815940737724, 0.04564213007688522, -0.010243847966194153, -0.009793083183467388, -0.08011236786842346, 0.011587303131818771, -0.0003336542285978794, -0.03754604607820511, -0.02142457850277424, 0.0014981295680627227, -0.02644485980272293, 0.024217551574110985, 0.010226170532405376, -0.00397070636972785, 0.007256427314132452, 0.03482377901673317, 0.006160450167953968, -0.05762716755270958, -0.06908189505338669, 0.009139033034443855, -0.06402625888586044, -0.0027819250244647264, 0.07396075874567032, 0.011189569719135761, -0.04673811048269272, -0.00014928817108739167, 0.046031028032302856, 0.04507646709680557, 0.03302071988582611, -0.04592496529221535, -0.039773352444171906, 0.047728024423122406, 0.0022460895124822855, 0.039773352444171906, 0.040232956409454346, -0.048717938363552094, 0.05875850096344948, -0.009094839915633202, -0.023899365216493607, 0.00521914754062891, 0.005855521187186241, 0.023793304339051247, -0.0028990355785936117, 0.0032592052593827248, -0.009695859625935555, 0.03450559452176094, -0.017164411023259163, -0.06593538075685501, 0.039667289704084396, 0.014645432122051716, -0.012418124824762344, 0.08131440728902817, -0.0499553307890892, -0.016059596091508865, -0.028778230771422386, 0.023439763113856316, 0.0029807917308062315, -0.01791568659245968, 0.01780078560113907, 0.042707741260528564, -0.04723306745290756, -0.008975519798696041, 0.08541548252105713, -0.010084754787385464, -0.03270253539085388, -0.004061301238834858, 0.007914897054433823, -0.028848938643932343, -0.021177100017666817, 0.05935952067375183, -0.04479363188147545, -0.015538123436272144, 0.03881879150867462, 0.00344702391885221, 0.05914739519357681, 0.03418740630149841, 0.007309458218514919, -0.04458151012659073, 0.0221139844506979, 0.015582315623760223, -0.03275556489825249, 0.026480214670300484, -0.013284299522638321, 0.016855062916874886, 0.04836439713835716, 0.05299578234553337, 0.025278175249695778, -0.056425128132104874, 0.02414684370160103, -0.014610078185796738, -0.0430966354906559, -0.06738489866256714, -0.010915575549006462, 0.02870752289891243, -0.014406791888177395, 0.039985477924346924, 0.009846114553511143, -0.007985604926943779, -0.035124290734529495, 0.056213006377220154, -0.025596361607313156, 0.05932416394352913, -0.00559036573395133, 0.05239476263523102, 0.035336412489414215, -0.06346059590578079, 0.0363440066576004, 0.01026152539998293, 0.01917959377169609, -0.05398569628596306, -0.03786423057317734, -0.01666945405304432, -0.017199765890836716, 0.011472403071820736, 0.05175838991999626, 0.03312678262591362, -0.011286793276667595, -0.029078740626573563, -0.0317656509578228, -0.025808487087488174, -0.07084959745407104, 0.0019201691029593349, -0.0340636670589447, -0.017526790499687195, -0.024341292679309845, 0.0034691202454268932, 0.0420006588101387, 0.0047595445066690445, -0.024712510406970978, 0.053596802055835724, -0.02358117885887623, 0.004591612610965967, 0.09043576568365097, 0.03641471266746521, 0.015432060696184635, -0.0005220252787694335, 0.07480926066637039, 0.01457472424954176, 0.047268420457839966, 0.03061664290726185, 0.010455972515046597, 0.002518978901207447, 0.05186445266008377, 0.040904682129621506, 0.010102431289851665, 0.03797029331326485, -0.04026830941438675, 0.024323614314198494, -0.007976766675710678, -0.0215659961104393, -0.03051058016717434, -0.0487532913684845, 0.021035684272646904, -0.046702753752470016, 0.01840180531144142, 0.024447353556752205, -0.008657333441078663, -0.028530752286314964, -0.02349279448390007, 0.026497891172766685, -0.009306964464485645, 0.026727693155407906, 0.021495288237929344, -0.07806183397769928, 0.03270253539085388, -0.044864341616630554, 0.007203395944088697, 0.05971306189894676, -0.004182830918580294, 0.06784450262784958, -0.0283539816737175, -0.09340550750494003, -0.015838632360100746, 0.04843510314822197, -0.011030476540327072, 0.0015434270026162267, 0.008489401079714298, 0.03052825853228569, 0.053278613835573196, 0.06667781621217728, 0.03722785785794258, 0.016837386414408684, 0.04019760340452194, -0.05052099749445915, -0.008692687377333641, 0.026568599045276642, 0.017995232716202736, 0.062470678240060806, 0.039313748478889465, 0.010332233272492886, 0.009165547788143158, 0.018631605431437492, 0.007419940084218979, 0.03825312852859497, -0.060314077883958817, -0.0193033330142498, 0.04914218559861183, 0.012073421850800514, 0.014221183024346828, 0.03277324140071869, 0.022396815940737724, -0.010217332281172276, 0.006712858099490404, 0.046808816492557526, 0.02168973535299301, 0.0759405866265297, 0.06590002775192261, 0.011799427680671215, 0.01836645044386387, -0.022856419906020164, 0.0006916144047863781, -0.015847470611333847, 0.0006546031218022108, 0.02667466178536415, 0.013823449611663818, -0.047268420457839966, -0.005966003052890301, 0.002576429396867752, 0.03310910612344742, -0.04514717310667038, 0.0068410164676606655, 0.031730297952890396, -0.0232453141361475, 0.0669606477022171, 0.008639656007289886, 0.01394718885421753, -0.0340636670589447, -0.03924304246902466, 0.040339019149541855, 0.06540507078170776, 0.026338797062635422, 0.0021897440310567617, -0.006094161421060562, -0.06218784675002098, 0.0010595179628580809, 0.04132893308997154, -0.006969175301492214, 0.050662413239479065, 0.022608941420912743, 0.05083918198943138, 0.015582315623760223, 0.02361653372645378 ]
39,437
pyspark.sql.dataframe
unionByName
Returns a new :class:`DataFrame` containing union of rows in this and another :class:`DataFrame`. This method performs a union operation on both input DataFrames, resolving columns by name (rather than position). When `allowMissingColumns` is True, missing columns will be filled with null. .. versionadded:: 2.3.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Parameters ---------- other : :class:`DataFrame` Another :class:`DataFrame` that needs to be combined. allowMissingColumns : bool, optional, default False Specify whether to allow missing columns. .. versionadded:: 3.1.0 Returns ------- :class:`DataFrame` A new :class:`DataFrame` containing the combined rows with corresponding columns of the two given DataFrames. Examples -------- Example 1: Union of two DataFrames with same columns in different order. >>> df1 = spark.createDataFrame([[1, 2, 3]], ["col0", "col1", "col2"]) >>> df2 = spark.createDataFrame([[4, 5, 6]], ["col1", "col2", "col0"]) >>> df1.unionByName(df2).show() +----+----+----+ |col0|col1|col2| +----+----+----+ | 1| 2| 3| | 6| 4| 5| +----+----+----+ Example 2: Union with missing columns and setting `allowMissingColumns=True`. >>> df1 = spark.createDataFrame([[1, 2, 3]], ["col0", "col1", "col2"]) >>> df2 = spark.createDataFrame([[4, 5, 6]], ["col1", "col2", "col3"]) >>> df1.unionByName(df2, allowMissingColumns=True).show() +----+----+----+----+ |col0|col1|col2|col3| +----+----+----+----+ | 1| 2| 3|NULL| |NULL| 4| 5| 6| +----+----+----+----+ Example 3: Union of two DataFrames with few common columns. >>> df1 = spark.createDataFrame([[1, 2, 3]], ["col0", "col1", "col2"]) >>> df2 = spark.createDataFrame([[4, 5, 6, 7]], ["col1", "col2", "col3", "col4"]) >>> df1.unionByName(df2, allowMissingColumns=True).show() +----+----+----+----+----+ |col0|col1|col2|col3|col4| +----+----+----+----+----+ | 1| 2| 3|NULL|NULL| |NULL| 4| 5| 6| 7| +----+----+----+----+----+ Example 4: Union of two DataFrames with completely different columns. >>> df1 = spark.createDataFrame([[0, 1, 2]], ["col0", "col1", "col2"]) >>> df2 = spark.createDataFrame([[3, 4, 5]], ["col3", "col4", "col5"]) >>> df1.unionByName(df2, allowMissingColumns=True).show() +----+----+----+----+----+----+ |col0|col1|col2|col3|col4|col5| +----+----+----+----+----+----+ | 0| 1| 2|NULL|NULL|NULL| |NULL|NULL|NULL| 3| 4| 5| +----+----+----+----+----+----+
def unionByName(self, other: "DataFrame", allowMissingColumns: bool = False) -> "DataFrame": """Returns a new :class:`DataFrame` containing union of rows in this and another :class:`DataFrame`. This method performs a union operation on both input DataFrames, resolving columns by name (rather than position). When `allowMissingColumns` is True, missing columns will be filled with null. .. versionadded:: 2.3.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Parameters ---------- other : :class:`DataFrame` Another :class:`DataFrame` that needs to be combined. allowMissingColumns : bool, optional, default False Specify whether to allow missing columns. .. versionadded:: 3.1.0 Returns ------- :class:`DataFrame` A new :class:`DataFrame` containing the combined rows with corresponding columns of the two given DataFrames. Examples -------- Example 1: Union of two DataFrames with same columns in different order. >>> df1 = spark.createDataFrame([[1, 2, 3]], ["col0", "col1", "col2"]) >>> df2 = spark.createDataFrame([[4, 5, 6]], ["col1", "col2", "col0"]) >>> df1.unionByName(df2).show() +----+----+----+ |col0|col1|col2| +----+----+----+ | 1| 2| 3| | 6| 4| 5| +----+----+----+ Example 2: Union with missing columns and setting `allowMissingColumns=True`. >>> df1 = spark.createDataFrame([[1, 2, 3]], ["col0", "col1", "col2"]) >>> df2 = spark.createDataFrame([[4, 5, 6]], ["col1", "col2", "col3"]) >>> df1.unionByName(df2, allowMissingColumns=True).show() +----+----+----+----+ |col0|col1|col2|col3| +----+----+----+----+ | 1| 2| 3|NULL| |NULL| 4| 5| 6| +----+----+----+----+ Example 3: Union of two DataFrames with few common columns. >>> df1 = spark.createDataFrame([[1, 2, 3]], ["col0", "col1", "col2"]) >>> df2 = spark.createDataFrame([[4, 5, 6, 7]], ["col1", "col2", "col3", "col4"]) >>> df1.unionByName(df2, allowMissingColumns=True).show() +----+----+----+----+----+ |col0|col1|col2|col3|col4| +----+----+----+----+----+ | 1| 2| 3|NULL|NULL| |NULL| 4| 5| 6| 7| +----+----+----+----+----+ Example 4: Union of two DataFrames with completely different columns. >>> df1 = spark.createDataFrame([[0, 1, 2]], ["col0", "col1", "col2"]) >>> df2 = spark.createDataFrame([[3, 4, 5]], ["col3", "col4", "col5"]) >>> df1.unionByName(df2, allowMissingColumns=True).show() +----+----+----+----+----+----+ |col0|col1|col2|col3|col4|col5| +----+----+----+----+----+----+ | 0| 1| 2|NULL|NULL|NULL| |NULL|NULL|NULL| 3| 4| 5| +----+----+----+----+----+----+ """ return DataFrame(self._jdf.unionByName(other._jdf, allowMissingColumns), self.sparkSession)
(self, other: pyspark.sql.dataframe.DataFrame, allowMissingColumns: bool = False) -> pyspark.sql.dataframe.DataFrame
[ -0.017449546605348587, -0.06724147498607635, 0.026443686336278915, 0.04050559177994728, -0.06358902901411057, -0.01567811146378517, -0.0320136621594429, -0.005734335631132126, -0.030297014862298965, 0.03594003990292549, 0.026955028995871544, -0.034844305366277695, -0.021951181814074516, 0.08407923579216003, 0.007638171315193176, 0.004481091164052486, 0.0475182831287384, 0.039555955678224564, 0.059753965586423874, -0.004348689690232277, -0.01970493048429489, -0.01616206020116806, 0.00991638284176588, 0.03743753954768181, -0.04945407807826996, 0.009788546711206436, -0.058913905173540115, -0.031045764684677124, -0.02421569637954235, 0.023558257147669792, -0.0030680519994348288, -0.05646676942706108, -0.015312867239117622, -0.025567101314663887, -0.04799310117959976, -0.017431283369660378, 0.03546522185206413, 0.01966840587556362, 0.04992889612913132, -0.022097280248999596, 0.02388697676360607, -0.05409267917275429, 0.04160132631659508, -0.08619765192270279, 0.004453697707504034, 0.02903692051768303, -0.03791235759854317, -0.0156872421503067, 0.007482942659407854, 0.022152066230773926, 0.06143409013748169, 0.03625049442052841, -0.031191863119602203, 0.03667052835226059, -0.055699754506349564, 0.023339109495282173, -0.014591509476304054, 0.018453968688845634, -0.029822196811437607, 0.030114391818642616, -0.026060180738568306, -0.018472230061888695, -0.046641696244478226, 0.034424275159835815, -0.026370638981461525, 0.009651580825448036, 0.012765288352966309, -0.038423698395490646, -0.031155338510870934, 0.0061315386556088924, -0.04923493042588234, 0.0484313927590847, -0.014299314469099045, 0.07918496429920197, 0.01431757677346468, 0.004766438156366348, -0.003946921322494745, -0.01424452755600214, -0.01452759187668562, -0.039373334497213364, 0.04496157169342041, -0.026626309379935265, -0.039482906460762024, -0.034935615956783295, 0.03729144111275673, 0.02045368030667305, -0.050257615745067596, -0.0035086281131953, -0.026900243014097214, -0.10635913908481598, 0.018417444080114365, -0.021732036024332047, -0.01609814167022705, 0.03197713941335678, 0.026078442111611366, -0.02396002598106861, -0.03783930838108063, 0.014691951684653759, -0.03221454843878746, -0.0025384477339684963, -0.013861021026968956, 0.029968295246362686, -0.023357372730970383, 0.0321962833404541, 0.021038072183728218, -0.01411669235676527, -0.01627163402736187, -0.022937342524528503, -0.014509329572319984, -0.0038213683292269707, -0.0025841034948825836, -0.03665226325392723, 0.03250674158334732, -0.009615056216716766, 0.03798540681600571, -0.04930797964334488, -0.00022599491057917476, 0.042003095149993896, -0.013742316514253616, 0.050659384578466415, 0.047554805874824524, 0.06764324009418488, 0.05748945102095604, -0.10782011598348618, 0.038314126431941986, -0.005236689932644367, 0.026626309379935265, -0.03126491233706474, -0.0020556405652314425, 0.06903117150068283, 0.04642254859209061, 0.0013331416994333267, -0.007291189394891262, 0.012728763744235039, 0.007715785875916481, -0.0006637173937633634, 0.03323723003268242, 0.0044856565073132515, 0.014938491396605968, 0.030863143503665924, 0.01016292255371809, -0.034259915351867676, 0.05274127796292305, 0.01994233764708042, -0.055334512144327164, 0.034533847123384476, 0.03665226325392723, -0.030534423887729645, 0.006715929601341486, -0.007414459250867367, 0.010582953691482544, 0.01605248637497425, -0.042624007910490036, -0.013221843168139458, -0.0394463837146759, -0.0396290048956871, 0.03736449033021927, -0.02490966022014618, -0.04079778864979744, -0.051572494208812714, 0.034679945558309555, -0.02089197374880314, -0.02379566617310047, 0.019777977839112282, -0.05193774029612541, -0.013094007968902588, 0.03791235759854317, 0.029365641996264458, -0.00844627432525158, 0.009943775832653046, 0.05409267917275429, 0.02405133657157421, 0.0651230588555336, -0.00526408338919282, 0.000993007910437882, 0.050440236926078796, -0.026498474180698395, -0.034442536532878876, -0.004670561291277409, -0.03718186914920807, 0.043281447142362595, -0.018499623984098434, -0.03710881993174553, -0.013897545635700226, 0.01649077981710434, -0.029365641996264458, -0.018097855150699615, -0.025548838078975677, 0.058950427919626236, -0.000616349745541811, 0.00014459964586421847, -0.017696086317300797, 0.01586073264479637, 0.05617457255721092, 0.018298739567399025, -0.029438689351081848, 0.014262789860367775, 0.05277780070900917, -0.01661861501634121, 0.018271345645189285, 0.003147949231788516, 0.013413596898317337, 0.025329692289233208, 0.02909170836210251, 0.023412158712744713, -0.059206098318099976, -0.010948197916150093, 0.005218427628278732, 0.012911385856568813, -0.07184354960918427, 0.05745292827486992, -0.042185716331005096, -0.027539419010281563, -0.014600641094148159, 0.009377647191286087, 0.0333833284676075, -0.02085544914007187, -0.04445023089647293, 0.03336506709456444, 0.009058058261871338, 0.021805085241794586, 0.026315851137042046, 0.021092858165502548, -0.01236351951956749, 0.01679210737347603, -0.03765668720006943, 0.0014701082836836576, -0.010902542620897293, 0.042843155562877655, -0.030625734478235245, -0.0014347252435982227, -0.051353346556425095, 0.012025668285787106, -0.050988104194402695, -0.030717045068740845, 0.04507114738225937, 0.0043281447142362595, -0.057599026709795, 0.029456952586770058, -0.08985009789466858, -0.04938102886080742, 0.021458102390170097, 0.03676183894276619, -0.002682262798771262, 0.0009810233023017645, -0.04481547325849533, 0.006040227599442005, 0.0245809406042099, -0.021622462198138237, 0.0037665818817913532, 0.03175799176096916, -0.0050677647814154625, 0.011450408957898617, 0.03562958166003227, 0.003446992952376604, -0.05971744284033775, -0.03632354363799095, 0.004971887916326523, -0.025676673278212547, 0.042258765548467636, 0.007665564771741629, -0.05679548904299736, -0.018773557618260384, 0.043025776743888855, -0.07345062494277954, -0.04609382897615433, -0.010884280316531658, -0.006145235151052475, -0.06260287016630173, -0.02080066315829754, 0.02500097267329693, -0.05054980888962746, 0.029456952586770058, -0.017906101420521736, 0.04941755160689354, 0.0022371213417500257, -0.007756875827908516, -0.011477801948785782, -0.009405040182173252, -0.046860843896865845, 0.03743753954768181, -0.029475213959813118, -0.01605248637497425, 0.011149082332849503, -0.059644393622875214, 0.015285473316907883, 0.007875580340623856, -0.058658234775066376, -0.02837948128581047, -0.05624762177467346, 0.004177481401711702, 0.025220118463039398, 0.034752994775772095, 0.015102851204574108, -0.055297985672950745, 0.02041715569794178, -0.00622284971177578, 0.007446418050676584, -0.0021149928215891123, -0.002805532654747367, -0.05387353524565697, 0.006542438641190529, 0.03634180873632431, 0.07450983673334122, 0.00103238585870713, -0.10044217854738235, 0.006241112016141415, -0.0164177305996418, -0.03977510333061218, 0.02454441599547863, -0.022316426038742065, 0.0007561698439531028, 0.004515332635492086, 0.0021149928215891123, -0.017285186797380447, -0.005391919054090977, 0.008610634133219719, 0.06114189326763153, 0.03504519164562225, 0.010692526586353779, 0.010665133595466614, -0.03951943293213844, -0.06472128629684448, -0.02859862893819809, -0.010893411003053188, 0.0324702188372612, -0.02865341491997242, -0.013386202976107597, -0.008135817013680935, 0.004912535659968853, -0.003741471329703927, -0.02111111953854561, 0.035264335572719574, 0.018937917426228523, -0.05328914150595665, -0.03709055855870247, -0.009135672822594643, -0.025366216897964478, 0.029548263177275658, 0.08305655419826508, 0.02470877580344677, -0.02098328433930874, 0.0055608442053198814, -0.04781047999858856, 0.008619765751063824, -0.008049070835113525, 0.003392206272110343, 0.05054980888962746, -0.017312578856945038, -0.003627332393079996, -0.01057382207363844, 0.04039601981639862, -0.011359097436070442, -0.03214149922132492, 0.02405133657157421, 0.05679548904299736, -0.04565553739666939, 0.07670129835605621, 0.021640723571181297, -0.006277636159211397, 0.014673689380288124, -0.06716842949390411, -0.0030863143038004637, -0.04466937854886055, 0.017504332587122917, 0.01229047030210495, 0.013806234113872051, -0.018134379759430885, -0.10314498841762543, -0.10358328372240067, -0.010820361785590649, -0.008537585847079754, 0.04923493042588234, -0.03604961186647415, -0.01690167933702469, 0.03299982100725174, 0.0042939032427966595, 0.009304597973823547, -0.0328354611992836, -0.05011151731014252, 0.01585160195827484, -0.005528885405510664, -0.004134108778089285, -0.00500384671613574, 0.021823346614837646, -0.007679261267185211, -0.08400619029998779, -0.046495597809553146, -0.018691375851631165, 0.005889564286917448, -0.012217422015964985, -0.0018604631768539548, -0.026388900354504585, 0.05328914150595665, -0.06150713935494423, 0.006355250719934702, -0.055517133325338364, 0.017148219048976898, -0.01236351951956749, -0.0118795707821846, 0.03988467529416084, -0.03721839189529419, 0.013431859202682972, 0.006592659745365381, -0.0003429872158449143, 0.03175799176096916, 0.046751268208026886, -0.05785469710826874, -0.017011253163218498, -0.006574397440999746, -0.04452328011393547, -0.04404846206307411, -0.04930797964334488, 0.05789121985435486, -0.013934070244431496, 0.043171875178813934, 0.047627855092287064, 0.006012834142893553, 0.055297985672950745, 0.06775281578302383, -0.00036124943289905787, -0.005245821084827185, -0.043317973613739014, 0.07220879942178726, -0.0030064170714467764, 0.00720444368198514, 0.02050846628844738, 0.013742316514253616, 0.004300751723349094, 0.035099975764751434, 0.01578768528997898, -0.013450121507048607, -0.02476356364786625, 0.009208722040057182, 0.018216559663414955, 0.02905518375337124, 0.059315674006938934, -0.06607269495725632, -0.01236351951956749, 0.07275666296482086, 0.04865054041147232, -0.0018307870486751199, -0.029621312394738197, 0.02859862893819809, -0.051061153411865234, -0.05792774632573128, -0.021001547574996948, -0.012664846144616604, -0.06070360168814659, 0.0042870547622442245, 0.06935989111661911, 0.026735883206129074, -0.05683201178908348, -0.011852177791297436, -0.03758363798260689, 0.03369378671050072, 0.042770106345415115, -0.02454441599547863, -0.07202617824077606, 0.03541043400764465, 0.02058151550590992, -0.006597225088626146, 0.042404863983392715, 0.05277780070900917, 0.013806234113872051, 0.05628414452075958, -0.018536148592829704, -0.10066132992506027, -0.02779509127140045, 0.0030543555039912462, 0.025658411905169487, -0.07286623865365982, -0.017750872299075127, -0.07494813203811646, 0.0005084885633550584, -0.002125265309587121, -0.03743753954768181, 0.021275479346513748, 0.01607988029718399, 0.006391775328665972, -0.09335643798112869, 0.0018775839125737548, 0.003351116320118308, -0.002896843710914254, 0.06187238171696663, -0.0006077893194742501, 0.008300176821649075, -0.030077867209911346, 0.05332566797733307, -0.03141101077198982, -0.017129957675933838, -0.005222993437200785, -0.03141101077198982, -0.021092858165502548, -0.0282516460865736, 0.042003095149993896, -0.022444261237978935, 0.0032575225923210382, -0.01420800294727087, -0.011313442140817642, 0.007359672337770462, -0.02912823297083378, -0.019339686259627342, -0.01670079492032528, 0.0012132958509027958, -0.06895812600851059, 0.05365438759326935, -0.011505194939672947, -0.022499049082398415, -0.009770285338163376, -0.050586335361003876, 0.04203961789608002, -0.017449546605348587, 0.0035565663129091263, 0.04550943896174431, 0.008574109524488449, 0.018773557618260384, 0.02874472551047802, 0.06819111108779907, 0.010509904474020004, -0.012062192894518375, -0.008345832116901875, -0.013450121507048607, -0.011505194939672947, -0.026443686336278915, 0.023594781756401062, -0.010756444185972214, 0.02111111953854561, -0.0004896556492894888, 0.004608926363289356, -0.08765862882137299, 0.012463961727917194, -0.03769320994615555, -0.017330842092633247, 0.038715895265340805, 0.010464249178767204, -0.02432527020573616, 0.034661684185266495, -0.03175799176096916, 0.0012635169550776482, 0.005643024574965239, 0.030534423887729645, -0.007419024594128132, -0.06216457858681679, -0.034679945558309555, -0.02859862893819809, -0.05222993344068527, -0.00031102835782803595, 0.06702233105897903, 0.005866736639291048, -0.07874666899442673, -0.02819686010479927, 0.06008268520236015, 0.05785469710826874, 0.03531912341713905, -0.03352942690253258, -0.030004817992448807, 0.029329117387533188, -0.0070629115216434, 0.025220118463039398, 0.051572494208812714, -0.006816371809691191, 0.051134202629327774, -0.039555955678224564, -0.04094388708472252, 0.017769135534763336, 0.015121113508939743, -0.0035634145606309175, 0.021585937589406967, -0.00612697284668684, 0.0040953014977276325, 0.0030908798798918724, 0.005245821084827185, -0.07308538258075714, 0.01992407627403736, 0.011349966749548912, 0.0199058149009943, 0.09708193689584732, -0.03590351343154907, -0.015605062246322632, -0.01647251844406128, 0.033839885145425797, 0.004866880364716053, -0.014381494373083115, -0.003750602249056101, -0.002154941437765956, -0.04583815857768059, -0.0016972445882856846, 0.07253751903772354, -0.021567676216363907, -0.03743753954768181, -0.06910421699285507, 0.042003095149993896, 0.0024676816537976265, 0.004426304250955582, 0.07297580689191818, -0.06786239147186279, 0.004307599738240242, 0.05836603790521622, -0.013313154689967632, 0.058402564376592636, -0.03572089225053787, 0.006295898463577032, -0.04430413246154785, 0.017394758760929108, 0.05405615642666817, -0.0722818449139595, 0.02812381088733673, 0.004006273578852415, 0.03197713941335678, 0.058950427919626236, 0.03966553136706352, 0.018490493297576904, -0.025366216897964478, 0.022407736629247665, -0.005186468828469515, -0.027375059202313423, -0.07487507909536362, 0.038314126431941986, 0.022900817915797234, -0.02463572844862938, 0.03802192956209183, 0.01691081002354622, -0.006213718559592962, -0.04196656867861748, 0.03351116552948952, -0.005716073326766491, 0.07220879942178726, -0.0037003811448812485, 0.06278549134731293, 0.05405615642666817, -0.06647446006536484, 0.04065169021487236, -0.021951181814074516, 0.006738757248967886, -0.050513286143541336, -0.04846791923046112, -0.05807384103536606, -0.021987706422805786, 0.02114764414727688, 0.0473356619477272, 0.019102277234196663, 0.021622462198138237, 0.011012115515768528, -0.03791235759854317, -0.0157328974455595, -0.027813352644443512, 0.0007584526319988072, 0.011706079356372356, -0.008679118007421494, -0.022243376821279526, -0.03230585902929306, 0.08042679727077484, -0.009158500470221043, 0.02505575865507126, -0.018663983792066574, -0.0708208680152893, 0.006031096447259188, 0.08802387863397598, 0.05730682983994484, -0.026955028995871544, -0.027119388803839684, 0.04642254859209061, 0.02850731648504734, -0.00036638567689806223, 0.027119388803839684, 0.000885717396158725, -0.043317973613739014, 0.04985584691166878, 0.025987131521105766, -0.009797678329050541, 0.019467521458864212, 0.015650717541575432, 0.008167775347828865, 0.03299982100725174, -0.006085882894694805, -0.0035314557608217, -0.02830643206834793, 0.01220829039812088, -0.047153037041425705, 0.03141101077198982, 0.029603049159049988, 0.025859296321868896, -0.022371213883161545, -0.023229537531733513, 0.014984147623181343, 0.007761441171169281, 0.0008383498061448336, 0.064209945499897, -0.034150343388319016, 0.04459632933139801, -0.05029413849115372, -0.009843333624303341, 0.08123032748699188, -0.013934070244431496, 0.021567676216363907, 0.025548838078975677, -0.0495271272957325, -0.012098717503249645, 0.05599195137619972, 0.030863143503665924, 0.01594291254878044, -0.008510191924870014, -0.012719632126390934, 0.025128807872533798, 0.10139181464910507, 0.04810267314314842, 0.026608046144247055, 0.029201282188296318, -0.06833720952272415, -0.030297014862298965, 0.0015808229800313711, 0.03309113159775734, 0.04010382294654846, 0.04134565591812134, 0.050659384578466415, -0.022206852212548256, 0.04463285207748413, 0.030717045068740845, 0.038679372519254684, -0.01628989540040493, -0.002727918326854706, 0.022170329466462135, 0.027119388803839684, 0.003446992952376604, 0.017997412011027336, -0.01988755166530609, -0.04320840165019035, -0.01673731952905655, 0.08101118355989456, 0.017960887402296066, 0.08722034096717834, 0.04178394749760628, 0.04598425701260567, 0.017376497387886047, -0.042477913200855255, 0.0162351094186306, 0.015367654152214527, -0.021859871223568916, 0.03601308912038803, -0.004789265803992748, -0.007190747186541557, -0.01566898077726364, 0.0018091006204485893, 0.06742409616708755, -0.03272588923573494, 0.029365641996264458, 0.013468383811414242, -0.012582666240632534, 0.09350253641605377, 0.011085164733231068, -0.02441658079624176, -0.03659747913479805, -0.014016250148415565, 0.029730886220932007, 0.02905518375337124, 0.00817234069108963, 0.05171859264373779, 0.008907395415008068, -0.06106884777545929, -0.021585937589406967, 0.03371204808354378, -0.01679210737347603, 0.029329117387533188, 0.010418593883514404, 0.047116514295339584, -0.03170320391654968, 0.030972715467214584 ]
39,438
pyspark.sql.dataframe
unpersist
Marks the :class:`DataFrame` as non-persistent, and remove all blocks for it from memory and disk. .. versionadded:: 1.3.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Notes ----- `blocking` default has changed to ``False`` to match Scala in 2.0. Parameters ---------- blocking : bool Whether to block until all blocks are deleted. Returns ------- :class:`DataFrame` Unpersisted DataFrame. Examples -------- >>> df = spark.range(1) >>> df.persist() DataFrame[id: bigint] >>> df.unpersist() DataFrame[id: bigint] >>> df = spark.range(1) >>> df.unpersist(True) DataFrame[id: bigint]
def unpersist(self, blocking: bool = False) -> "DataFrame": """Marks the :class:`DataFrame` as non-persistent, and remove all blocks for it from memory and disk. .. versionadded:: 1.3.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Notes ----- `blocking` default has changed to ``False`` to match Scala in 2.0. Parameters ---------- blocking : bool Whether to block until all blocks are deleted. Returns ------- :class:`DataFrame` Unpersisted DataFrame. Examples -------- >>> df = spark.range(1) >>> df.persist() DataFrame[id: bigint] >>> df.unpersist() DataFrame[id: bigint] >>> df = spark.range(1) >>> df.unpersist(True) DataFrame[id: bigint] """ self.is_cached = False self._jdf.unpersist(blocking) return self
(self, blocking: bool = False) -> pyspark.sql.dataframe.DataFrame
[ 0.05316390469670296, -0.01068823505192995, 0.08643607050180435, 0.03148333728313446, 0.029318856075406075, -0.03767267242074013, -0.0734134167432785, 0.03899640589952469, -0.07420049607753754, -0.0013975201873108745, -0.024274367839097977, -0.03284284472465515, -0.02128702774643898, 0.07212545722723007, -0.030177492648363113, 0.016179930418729782, -0.05556093156337738, -0.021841563284397125, 0.038531310856342316, -0.008322512730956078, 0.018317576497793198, 0.015392846427857876, -0.019748637452721596, -0.01599210314452648, -0.04582972079515457, -0.03432757034897804, -0.029444074258208275, -0.017351610586047173, -0.008787606842815876, 0.04182275012135506, 0.06243002414703369, -0.011466373689472675, 0.017306890338659286, -0.01590266264975071, -0.023558836430311203, -0.024149149656295776, -0.02185945212841034, 0.023612501099705696, 0.06282356381416321, -0.010670346207916737, -0.012754328548908234, -0.0378873310983181, 0.015383902937173843, -0.01973075047135353, -0.015276572667062283, 0.004548090044409037, 0.023540949448943138, -0.05473807081580162, 0.012208736501634121, 0.000754660926759243, 0.06328865885734558, 0.11598747223615646, -0.04747543856501579, 0.010554072447121143, -0.041035667061805725, -0.046044379472732544, 0.023558836430311203, 0.014319551177322865, 0.020106403157114983, -0.010840284638106823, 0.03180532529950142, 0.005988094490021467, -0.016045767813920975, -0.016385644674301147, 0.05040911212563515, 0.03896062821149826, 0.016841795295476913, 0.007280521560460329, 0.02096503973007202, -0.009100651368498802, -0.024882568046450615, -0.03752956539392471, -0.052949246019124985, 0.09616728127002716, -0.02264653518795967, -0.041357655078172684, -0.0009145372314378619, -0.007696423213928938, -0.05588291957974434, 0.0022617466747760773, 0.02416703850030899, -0.031912654638290405, -0.043504245579242706, 0.04679568484425545, -0.013299920596182346, 0.005116042215377092, 0.03218097612261772, 0.007132943253964186, -0.038531310856342316, -0.016358813270926476, 0.027386924251914024, 0.07327030599117279, 0.010956558398902416, 0.0037811307702213526, -0.010804508812725544, -0.014641540125012398, -0.02999860979616642, 0.03742223605513573, -0.0011705629294738173, -0.08393171429634094, -0.002298641251400113, 0.04840562865138054, -0.0068422588519752026, 0.00882338359951973, -0.06139250472187996, 0.022324547171592712, 0.057099323719739914, -0.05534627288579941, 0.005214427597820759, -0.014945640228688717, -0.033969804644584656, 0.053736329078674316, -0.0425025038421154, 0.028996868059039116, -0.01097444724291563, -0.004843246191740036, -0.016162041574716568, 0.00017762482457328588, -0.026224186643958092, 0.007405739277601242, -0.046080153435468674, 0.035901736468076706, -0.022986412048339844, -0.05248415097594261, -0.030606811866164207, 0.06768917292356491, 0.0011862152023240924, -0.027798354625701904, 0.036885589361190796, 0.07169613987207413, 0.007115054875612259, -0.012879546731710434, 0.011233826167881489, 0.07198235392570496, -0.012584390118718147, 0.001775409677065909, 0.07541690021753311, -0.008962017484009266, 0.007392323110252619, 0.03126867488026619, -0.06167871505022049, -0.01685073971748352, 0.027154376730322838, 0.03615217283368111, -0.003951068967580795, -0.04482797533273697, -0.016367757692933083, -0.043504245579242706, -0.07094483822584152, -0.014802534133195877, 0.005661633796989918, 0.00319081824272871, 0.019140437245368958, -0.04146498441696167, 0.0093466155230999, 0.006864619441330433, -0.03214520215988159, 0.03572285175323486, 0.027583695948123932, -0.03391613811254501, -0.0029426186811178923, 0.05219794064760208, -0.0026988910976797342, 0.042144738137722015, -0.08278686553239822, -0.00649343803524971, 0.09373447299003601, -0.01083134114742279, -0.0644335076212883, 0.012342898175120354, 0.020482055842876434, 0.041894301772117615, 0.03845975548028946, 0.027547918260097504, -0.016108376905322075, 0.055382050573825836, 0.03949727490544319, 0.016984902322292328, -0.0006003747112117708, -0.021555351093411446, -0.02202044613659382, -0.009838541969656944, -0.04597282409667969, -0.023362066596746445, 0.06336021423339844, -0.045471955090761185, -0.028817985206842422, -0.03595539927482605, 0.035078875720500946, 0.001529446104541421, -0.031286563724279404, 0.01761099137365818, 0.011520038358867168, -0.003669329220429063, 0.03710024803876877, 0.004574922379106283, 0.007325241807848215, 0.031411781907081604, -0.05756441876292229, -0.02185945212841034, 0.05137507990002632, -0.01341619435697794, 0.04672413319349289, -0.059317465871572495, -0.003859391901642084, -0.015893718227744102, -0.03706447407603264, -0.010062146000564098, 0.012056686915457249, -0.026689281687140465, -0.007852945476770401, 0.01587582938373089, 0.012244513258337975, -0.025347663089632988, 0.06783227622509003, -0.042967598885297775, 0.027351148426532745, 0.03999814763665199, 0.05387943610548973, 0.01761099137365818, -0.025043562054634094, -0.004959519952535629, -0.02423859015107155, 0.018335465341806412, -0.025794869288802147, -0.014319551177322865, -0.030266933143138885, -0.01278116088360548, 0.006556046660989523, -0.048262521624565125, -0.02223510667681694, 0.014945640228688717, 0.016081545501947403, -0.056491121649742126, 0.03760112076997757, 0.01931932009756565, -0.04593705013394356, 0.02033895067870617, 0.03781577944755554, -0.0061356727965176105, -0.006582879461348057, 0.025168780237436295, 0.0306604765355587, -0.0053172847256064415, -0.0008849098230712116, 0.05058799684047699, 0.045722391456365585, 0.02600952796638012, 0.03538297489285469, -0.007982635870575905, -0.014480545185506344, -0.04443443566560745, -0.008841271512210369, 0.03078569285571575, 0.06461238861083984, -0.016081545501947403, 0.006480021867901087, 0.0781359151005745, -0.016680801287293434, 0.058208394795656204, 0.02518666908144951, -0.06711674481630325, -0.00955233070999384, 0.00436473498120904, 0.00858189258724451, -0.029569292441010475, 0.0012678303755819798, -0.012199793010950089, 0.03370147943496704, 0.00871158204972744, -0.05699199438095093, 0.021680569276213646, 0.030875135213136673, -0.06922756135463715, 0.022449765354394913, 0.014561043120920658, -0.03529353439807892, -0.01522290799766779, 0.04346846789121628, 0.002951562637463212, -0.025293998420238495, -0.01279904879629612, 0.05427297577261925, 0.0022024919744580984, 0.03246719017624855, -0.005572192836552858, -0.037744227796792984, -0.06246580183506012, 0.017280058935284615, -0.015213964506983757, 0.004313306417316198, -0.0008904999122023582, 0.015947382897138596, -0.024023931473493576, -0.01840701885521412, 0.010062146000564098, -0.04593705013394356, -0.02166268229484558, -0.06024765595793724, 0.027565807104110718, -0.005836044438183308, -0.026760835200548172, 0.022074110805988312, 0.10260705649852753, 0.007419155444949865, -0.0341486856341362, -0.014489489607512951, 0.007204496301710606, 0.03475688770413399, 0.050766877830028534, 0.03098246455192566, -0.003139389446005225, 0.027726801112294197, 0.017503662034869194, 0.023827161639928818, -0.017190616577863693, 0.027225930243730545, 0.004481008742004633, 0.012271345593035221, -0.0040069702081382275, 0.0033808809239417315, -0.018585901707410812, -0.0029918113723397255, 0.0453646257519722, -0.031376007944345474, 0.04336113855242729, -0.02202044613659382, 0.049085382372140884, -0.050981536507606506, -0.015696946531534195, -0.008975434117019176, -0.002314293524250388, 0.037958886474370956, -0.017664656043052673, -0.05466651916503906, 0.002757027978077531, -0.0059075974859297276, -0.031340230256319046, 0.060068774968385696, 0.015920549631118774, -0.0039108204655349255, 0.0009542268235236406, 0.024310143664479256, -0.05205483362078667, -0.07158881425857544, 0.03375514596700668, -0.028245560824871063, -0.011886748485267162, 0.029855504631996155, 0.08185667544603348, -0.0015328001463785768, 0.07513068616390228, -0.054630741477012634, 0.006386108230799437, -0.028817985206842422, -0.04336113855242729, 0.035687077790498734, 0.013747126795351505, -0.05398676544427872, -0.04039168730378151, 0.05173284560441971, -0.03057103417813778, -0.048262521624565125, -0.05498850718140602, 0.009185620583593845, -0.014212221838533878, -0.03175165876746178, -0.051589738577604294, -0.017557326704263687, -0.04640214517712593, -0.018237080425024033, -0.020285286009311676, 0.010062146000564098, 0.01795981265604496, 0.03329005092382431, 0.02559809759259224, -0.09294739365577698, 0.013773959130048752, 0.024506915360689163, 0.0448637530207634, 0.022091999650001526, -0.07198235392570496, 0.046259038150310516, 0.010169475339353085, 0.011940413154661655, 0.007115054875612259, -0.053199682384729385, -0.034041356295347214, -0.0022583927493542433, -0.004532437771558762, 0.02309374138712883, -0.0212512519210577, -0.04776165261864662, 0.007548845373094082, 0.02584853395819664, 0.013970729894936085, -0.021716346964240074, -0.010750843212008476, 0.08650761842727661, -0.06693786382675171, 0.04364735260605812, -0.013979674316942692, -0.010196307674050331, -0.028406554833054543, -0.01115332916378975, 0.009042514488101006, 0.02803090214729309, -0.030678363516926765, -0.010554072447121143, -0.04976513609290123, 0.0955948531627655, 0.009865375235676765, 0.011126496829092503, -0.0025736731477081776, 0.08779557794332504, 0.011779418215155602, 0.04554350674152374, -0.009194565005600452, 0.05087420716881752, 0.03674248233437538, -0.007553317118436098, 0.05910280719399452, 0.014310606755316257, -0.030606811866164207, -0.05749286338686943, 0.013809735886752605, -0.04754699394106865, -0.07148148119449615, -0.04565083608031273, 0.08929818868637085, 0.0047359163872897625, -0.047081898897886276, -0.02049994468688965, 0.043253809213638306, -0.005755547434091568, 0.010607737116515636, 0.07462981343269348, -0.04067790135741234, -0.055167391896247864, 0.09029993414878845, 0.07849367707967758, -0.00617592129856348, 0.02366616576910019, 0.004928215406835079, -0.0035016266629099846, -0.02502567507326603, -0.0023813743609935045, 0.034256014972925186, -0.010258916765451431, 0.051017314195632935, 0.06303822249174118, 0.0032377748284488916, 0.03484632819890976, -0.03336160257458687, -0.08292996883392334, 0.032735515385866165, -0.002067212015390396, -0.029766062274575233, -0.003177402075380087, 0.04457754269242287, 0.013112093321979046, 0.003146097529679537, -0.014561043120920658, -0.001475781318731606, 0.02325473725795746, -0.036474160850048065, 0.005048960912972689, -0.035526081919670105, -0.018111862242221832, -0.014078060165047646, -0.010545128956437111, -0.07130260020494461, -0.009239286184310913, -0.04303915053606033, -0.06361065059900284, 0.013380417600274086, -0.05996144562959671, -0.007034557871520519, 0.01304948516190052, -0.019981184974312782, -0.0984569787979126, -0.001982242800295353, -0.04264561086893082, 0.024828903377056122, 0.034703221172094345, -0.04840562865138054, 0.003718521911650896, 0.003991317935287952, 0.0262957401573658, -0.06529214233160019, -0.058995477855205536, 0.0002054354699794203, 0.03752956539392471, -0.011323267593979836, 0.012879546731710434, 0.033307939767837524, 0.006314555183053017, 0.01682390831410885, 0.027351148426532745, -0.07377117872238159, 0.04035591334104538, 0.029515627771615982, -0.007115054875612259, 0.007405739277601242, -0.0306604765355587, -0.030910911038517952, 0.05692043900489807, -0.024882568046450615, -0.0335225984454155, -0.051518186926841736, -0.06310977786779404, 0.034095022827386856, 0.004579394124448299, 0.026116857305169106, -0.08436103165149689, 0.001961000496521592, -0.015634337440133095, -0.022467652335762978, 0.04210896044969559, -0.016197819262742996, -0.005733186844736338, -0.02588430978357792, -0.00631902739405632, 0.006520270369946957, -0.011681033298373222, 0.000045104963646735996, -0.006301139015704393, 0.030803581699728966, 0.04811941459774971, -0.011376932263374329, -0.02182367630302906, 0.006743873469531536, 0.06793960928916931, -0.011654200963675976, 0.030016498640179634, -0.024524802342057228, -0.01678813062608242, -0.035025209188461304, 0.0014154084492474794, 0.01512452308088541, 0.0032735513523221016, 0.008224126882851124, 0.03278917819261551, -0.016645025461912155, -0.03529353439807892, -0.056813109666109085, -0.019283542409539223, 0.04404089227318764, 0.05080265551805496, 0.05473807081580162, 0.02540132775902748, 0.009024626575410366, 0.04278871417045593, -0.07541690021753311, 0.026474623009562492, -0.011663144454360008, 0.0028017484582960606, 0.0492284893989563, 0.032610297203063965, -0.024596355855464935, -0.006220642011612654, -0.03953305259346962, 0.0651848167181015, -0.0342739038169384, 0.006005982868373394, 0.024828903377056122, 0.03831665217876434, -0.00014785764506086707, 0.022324547171592712, -0.014310606755316257, 0.06386108696460724, 0.014596818946301937, 0.1008182242512703, 0.0016099433414638042, 0.001213047537021339, 0.04096411168575287, 0.03393402695655823, 0.0371360257267952, -0.027691025286912918, -0.0064666057005524635, 0.032485079020261765, 0.018237080425024033, -0.05534627288579941, -0.0016937945038080215, -0.08228599280118942, 0.03735068440437317, -0.02597375214099884, 0.05921013653278351, 0.006971948780119419, 0.0027525557670742273, 0.05853038281202316, 0.03559763357043266, 0.05584714561700821, -0.005988094490021467, 0.006274306681007147, 0.016179930418729782, 0.012539669871330261, -0.0006478903815150261, 0.0008021765970624983, 0.02296852506697178, 0.022735977545380592, 0.012369731441140175, -0.0016032352577894926, -0.06089163199067116, -0.007987107150256634, 0.033433154225349426, -0.032771289348602295, 0.029605068266391754, -0.011859915219247341, -0.015052969567477703, -0.013174702413380146, -0.012092462740838528, -0.002893425989896059, 0.02699338272213936, 0.006743873469531536, -0.026242075487971306, -0.011904636397957802, -0.07470136880874634, -0.03135811910033226, -0.04804786294698715, -0.056276462972164154, 0.00017049747111741453, -0.008125741966068745, -0.005442502908408642, -0.03185898810625076, 0.004112063441425562, -0.022181440144777298, 0.0011174571700394154, -0.031054018065333366, 0.022700199857354164, -0.0342739038169384, -0.059281688183546066, -0.02724381908774376, 0.057385534048080444, 0.04042746499180794, -0.06658010184764862, -0.02917575091123581, -0.024632131680846214, -0.002862121444195509, 0.025043562054634094, 0.0009777051163837314, -0.0010403140913695097, 0.002410442801192403, -0.016993846744298935, -0.03350470960140228, -0.06328865885734558, 0.023433618247509003, 0.03956883028149605, -0.012754328548908234, 0.018800560384988785, -0.026939718052744865, 0.0006702506798319519, 0.06919178366661072, -0.07026508450508118, 0.022986412048339844, 0.036921367049217224, -0.014292718842625618, 0.005017656832933426, 0.021143922582268715, 0.01235184259712696, -0.026868164539337158, -0.014945640228688717, -0.05641956999897957, 0.06572145968675613, 0.0677964985370636, 0.011287491768598557, -0.06711674481630325, 0.05087420716881752, 0.03633105382323265, -0.03472111001610756, 0.014122780412435532, 0.04472064599394798, -0.021072369068861008, -0.007468347903341055, 0.03727913275361061, -0.05008712410926819, -0.04232361912727356, -0.018997330218553543, -0.0028174007311463356, 0.04829829931259155, 0.029730286449193954, 0.037458013743162155, 0.051518186926841736, -0.04840562865138054, -0.016895459964871407, 0.025544432923197746, 0.018818449229002, -0.02933674491941929, -0.012011965736746788, -0.07734882831573486, -0.005379893817007542, 0.0015339181991294026, -0.029909169301390648, 0.08979906141757965, -0.008434314280748367, -0.012065630406141281, 0.042466726154088974, -0.0034010051749646664, -0.010053201578557491, 0.043540023267269135, -0.04418399930000305, 0.04675990715622902, 0.007875305600464344, 0.04375468194484711, 0.029694510623812675, 0.014543154276907444, 0.015070858411490917, 0.033182721585035324, -0.036509934812784195, -0.008926240727305412, 0.03953305259346962, 0.03205576166510582, 0.03436334431171417, 0.025759093463420868, 0.05030178278684616, 0.05992566794157028, -0.039926592260599136, -0.06940644234418869, -0.02330840192735195, 0.06919178366661072, -0.022127775475382805, -0.02407759614288807, -0.014373215846717358, 0.041071441024541855, -0.049872465431690216, -0.01637670025229454, -0.02733325958251953, 0.010518296621739864, 0.022879082709550858, -0.030714141204953194, -0.024131260812282562, -0.01533023826777935, 0.016895459964871407, -0.024918343871831894, 0.05362899973988533, -0.03878174349665642, 0.021054480224847794, -0.005174179095774889, -0.009453944861888885, 0.02198467031121254, -0.01931932009756565, -0.010366246104240417, -0.06725985556840897, 0.005040016956627369, -0.042144738137722015, -0.006234058178961277, -0.031465448439121246, 0.0226823128759861, 0.025490768253803253, 0.01119805034250021, -0.001229817746207118, 0.000527703610714525, -0.029533514752984047, 0.0371360257267952, 0.07513068616390228, 0.049622029066085815, 0.03185898810625076, 0.04443443566560745, -0.023558836430311203, -0.01294215489178896, -0.00406957883387804, 0.034095022827386856, -0.04450598731637001, 0.025902198627591133, -0.05473807081580162, -0.03724335506558418, 0.00823307130485773, -0.009838541969656944 ]
39,439
pyspark.sql.dataframe
unpivot
Unpivot a DataFrame from wide format to long format, optionally leaving identifier columns set. This is the reverse to `groupBy(...).pivot(...).agg(...)`, except for the aggregation, which cannot be reversed. This function is useful to massage a DataFrame into a format where some columns are identifier columns ("ids"), while all other columns ("values") are "unpivoted" to the rows, leaving just two non-id columns, named as given by `variableColumnName` and `valueColumnName`. When no "id" columns are given, the unpivoted DataFrame consists of only the "variable" and "value" columns. The `values` columns must not be empty so at least one value must be given to be unpivoted. When `values` is `None`, all non-id columns will be unpivoted. All "value" columns must share a least common data type. Unless they are the same data type, all "value" columns are cast to the nearest common data type. For instance, types `IntegerType` and `LongType` are cast to `LongType`, while `IntegerType` and `StringType` do not have a common data type and `unpivot` fails. .. versionadded:: 3.4.0 Parameters ---------- ids : str, Column, tuple, list Column(s) to use as identifiers. Can be a single column or column name, or a list or tuple for multiple columns. values : str, Column, tuple, list, optional Column(s) to unpivot. Can be a single column or column name, or a list or tuple for multiple columns. If specified, must not be empty. If not specified, uses all columns that are not set as `ids`. variableColumnName : str Name of the variable column. valueColumnName : str Name of the value column. Returns ------- :class:`DataFrame` Unpivoted DataFrame. Notes ----- Supports Spark Connect. Examples -------- >>> df = spark.createDataFrame( ... [(1, 11, 1.1), (2, 12, 1.2)], ... ["id", "int", "double"], ... ) >>> df.show() +---+---+------+ | id|int|double| +---+---+------+ | 1| 11| 1.1| | 2| 12| 1.2| +---+---+------+ >>> df.unpivot("id", ["int", "double"], "var", "val").show() +---+------+----+ | id| var| val| +---+------+----+ | 1| int|11.0| | 1|double| 1.1| | 2| int|12.0| | 2|double| 1.2| +---+------+----+ See Also -------- DataFrame.melt
def unpivot( self, ids: Union["ColumnOrName", List["ColumnOrName"], Tuple["ColumnOrName", ...]], values: Optional[Union["ColumnOrName", List["ColumnOrName"], Tuple["ColumnOrName", ...]]], variableColumnName: str, valueColumnName: str, ) -> "DataFrame": """ Unpivot a DataFrame from wide format to long format, optionally leaving identifier columns set. This is the reverse to `groupBy(...).pivot(...).agg(...)`, except for the aggregation, which cannot be reversed. This function is useful to massage a DataFrame into a format where some columns are identifier columns ("ids"), while all other columns ("values") are "unpivoted" to the rows, leaving just two non-id columns, named as given by `variableColumnName` and `valueColumnName`. When no "id" columns are given, the unpivoted DataFrame consists of only the "variable" and "value" columns. The `values` columns must not be empty so at least one value must be given to be unpivoted. When `values` is `None`, all non-id columns will be unpivoted. All "value" columns must share a least common data type. Unless they are the same data type, all "value" columns are cast to the nearest common data type. For instance, types `IntegerType` and `LongType` are cast to `LongType`, while `IntegerType` and `StringType` do not have a common data type and `unpivot` fails. .. versionadded:: 3.4.0 Parameters ---------- ids : str, Column, tuple, list Column(s) to use as identifiers. Can be a single column or column name, or a list or tuple for multiple columns. values : str, Column, tuple, list, optional Column(s) to unpivot. Can be a single column or column name, or a list or tuple for multiple columns. If specified, must not be empty. If not specified, uses all columns that are not set as `ids`. variableColumnName : str Name of the variable column. valueColumnName : str Name of the value column. Returns ------- :class:`DataFrame` Unpivoted DataFrame. Notes ----- Supports Spark Connect. Examples -------- >>> df = spark.createDataFrame( ... [(1, 11, 1.1), (2, 12, 1.2)], ... ["id", "int", "double"], ... ) >>> df.show() +---+---+------+ | id|int|double| +---+---+------+ | 1| 11| 1.1| | 2| 12| 1.2| +---+---+------+ >>> df.unpivot("id", ["int", "double"], "var", "val").show() +---+------+----+ | id| var| val| +---+------+----+ | 1| int|11.0| | 1|double| 1.1| | 2| int|12.0| | 2|double| 1.2| +---+------+----+ See Also -------- DataFrame.melt """ assert ids is not None, "ids must not be None" def to_jcols( cols: Union["ColumnOrName", List["ColumnOrName"], Tuple["ColumnOrName", ...]] ) -> JavaObject: if isinstance(cols, list): return self._jcols(*cols) if isinstance(cols, tuple): return self._jcols(*list(cols)) return self._jcols(cols) jids = to_jcols(ids) if values is None: jdf = self._jdf.unpivotWithSeq(jids, variableColumnName, valueColumnName) else: jvals = to_jcols(values) jdf = self._jdf.unpivotWithSeq(jids, jvals, variableColumnName, valueColumnName) return DataFrame(jdf, self.sparkSession)
(self, ids: Union[ForwardRef('ColumnOrName'), List[ForwardRef('ColumnOrName')], Tuple[ForwardRef('ColumnOrName'), ...]], values: Union[ForwardRef('ColumnOrName'), List[ForwardRef('ColumnOrName')], Tuple[ForwardRef('ColumnOrName'), ...], NoneType], variableColumnName: str, valueColumnName: str) -> 'DataFrame'
[ 0.023704081773757935, -0.02955029159784317, 0.029390668496489525, -0.04509362578392029, -0.036633580923080444, 0.0028457867447286844, 0.009427759796380997, 0.04249974340200424, -0.06899723410606384, 0.008325360715389252, -0.008350301533937454, 0.053473856300115585, -0.025479894131422043, 0.05770387873053551, -0.005975903011858463, 0.04900439828634262, 0.011283382773399353, 0.08068965375423431, 0.08104880899190903, 0.029510386288166046, 0.01576281525194645, -0.017728179693222046, -0.007592090405523777, 0.052156962454319, -0.008544842712581158, -0.05247620865702629, 0.04130256921052933, -0.030527984723448753, -0.0035092218313366175, 0.024262765422463417, -0.026258056983351707, 0.04716872796416283, -0.0029580220580101013, -0.004728844854980707, -0.05323442071676254, -0.05594801902770996, 0.02577918767929077, -0.01598229818046093, 0.035057298839092255, -0.04080374538898468, 0.05143865570425987, -0.026038575917482376, 0.06524608284235, -0.05016167089343071, -0.05606773868203163, -0.0037461628671735525, -0.007237925659865141, -0.10638903081417084, 0.014445922337472439, 0.005876138340681791, 0.020042719319462776, 0.04501381143927574, -0.033281490206718445, 0.043058425188064575, -0.00962728913873434, 0.10032334178686142, -0.021589072421193123, -0.01711961440742016, 0.02093062549829483, 0.0018917872803285718, -0.03994577005505562, -0.0006671761511825025, -0.045173436403274536, 0.02142944745719433, 0.001957881497219205, 0.009502583183348179, 0.06424844264984131, 0.0024941163137555122, -0.1289757490158081, -0.020032742992043495, -0.0858774185180664, 0.014116698876023293, 0.004437033087015152, 0.06404890865087509, 0.04509362578392029, -0.0077068195678293705, 0.014366110786795616, -0.010006395168602467, -0.02597871609032154, -0.04289880394935608, 0.015573263168334961, -0.01630154438316822, -0.04289880394935608, 0.003591527696698904, 0.03216412663459778, 0.05123912915587425, 0.04457484930753708, 0.06185408681631088, 0.006539573427289724, -0.007412514183670282, -0.0030602808110415936, -0.016780415549874306, -0.01978333108127117, 0.004217551089823246, 0.002319528255611658, -0.021329684183001518, 0.014186534099280834, 0.010874347761273384, -0.0702742263674736, 0.007966208271682262, 0.011722346767783165, -0.09840785712003708, -0.043896447867155075, -0.010485265403985977, 0.01246060524135828, -0.055788397789001465, -0.010106159374117851, 0.025160646066069603, 0.0033346335403621197, -0.0737859383225441, 0.0306876078248024, -0.0009309289744123816, -0.010295712389051914, 0.05582830309867859, -0.053793102502822876, -0.02154916524887085, -0.05419216305017471, -0.004733833018690348, -0.04940345883369446, 0.026577305048704147, -0.0645676851272583, 0.007442443165928125, 0.0011429288424551487, -0.08188682794570923, -0.018655991181731224, -0.0024130577221512794, 0.01199171133339405, -0.036214571446180344, -0.0219681765884161, 0.0538330078125, -0.024841399863362312, -0.027076127007603645, -0.02010257914662361, 0.027056174352765083, -0.012640181928873062, -0.01578276790678501, 0.048525530844926834, 0.010804512538015842, 0.07083290815353394, 0.005073032807558775, -0.03617466613650322, 0.013328557834029198, 0.0058312444016337395, 0.008085925132036209, -0.005162821151316166, -0.02364422380924225, 0.09992428123950958, 0.04381663724780083, -0.06325079500675201, 0.015413639135658741, -0.06752072274684906, -0.023943517357110977, -0.011852040886878967, 0.007003478705883026, 0.0005848702858202159, -0.0446147546172142, 0.01339839305728674, 0.0002472292981110513, 0.02565946988761425, -0.026936456561088562, -0.0014179052086547017, -0.020771002396941185, -0.003441880689933896, 0.03461833670735359, -0.03188478574156761, 0.021090248599648476, 0.07394556701183319, 0.0013854816788807511, -0.012111429125070572, 0.01871584914624691, 0.022367235273122787, 0.02575923502445221, 0.03174511343240738, -0.02851273864507675, -0.04868515208363533, -0.0087842782959342, 0.024961117655038834, -0.0202921312302351, -0.005626726429909468, 0.04469456523656845, -0.04605136439204216, -0.041701626032590866, -0.045891743153333664, -0.029091373085975647, 0.023724036291241646, -0.023265117779374123, -0.023265117779374123, -0.012350864708423615, 0.052835363894701004, 0.0068239024840295315, -0.055987924337387085, -0.08356287330389023, 0.0380701944231987, 0.08795252442359924, -0.023803846910595894, -0.028552643954753876, 0.0489644929766655, -0.03216412663459778, -0.021329684183001518, -0.028013914823532104, 0.04150209575891495, -0.036334287375211716, 0.07685869187116623, 0.013069169595837593, -0.03599508851766586, 0.0029355750884860754, -0.028412973508238792, -0.08388212323188782, 0.05407244339585304, -0.03787066414952278, 0.02154916524887085, -0.037052594125270844, 0.010475289076566696, 0.012799805030226707, -0.01434615720063448, 0.012729969806969166, -0.03435894846916199, -0.024322623386979103, 0.05267573893070221, 0.01392714586108923, 0.05419216305017471, 0.01902512088418007, -0.03515706583857536, 0.028353115543723106, 0.007906349375844002, -0.05012176185846329, -0.005182773806154728, 0.021409494802355766, 0.02617824636399746, -0.021948223933577538, 0.025400081649422646, -0.07438452541828156, 0.03008902072906494, -0.04090350866317749, -0.04633070528507233, 0.016141921281814575, -0.020950578153133392, -0.0622132383286953, 0.055987924337387085, 0.011552747339010239, -0.008973831310868263, 0.0014041875256225467, 0.0734666958451271, -0.011832088232040405, 0.008749360218644142, 0.009991430677473545, -0.03561598062515259, 0.08260513842105865, -0.04617108404636383, -0.03469814732670784, 0.019703520461916924, -0.01214135903865099, 0.041581910103559494, 0.018745778128504753, 0.023324977606534958, -0.0044320449233055115, 0.01488488633185625, -0.0009801877895370126, -0.008794254623353481, 0.004975762218236923, 0.024841399863362312, -0.05323442071676254, 0.02041184902191162, 0.06181418150663376, -0.03376036137342453, -0.041382379829883575, -0.006938631646335125, -0.0211301539093256, -0.010784558951854706, 0.01550342794507742, -0.019643660634756088, 0.011901923455297947, 0.007367619778960943, 0.02587895281612873, 0.04397626221179962, 0.04186125099658966, 0.022327329963445663, -0.05151847004890442, 0.0022235047072172165, -0.0184065792709589, 0.02051161415874958, -0.048206280916929245, 0.003399480599910021, 0.004529315512627363, 0.00873439572751522, 0.0011884464183822274, -0.02627801150083542, -0.02250690571963787, 0.0007488584378734231, 0.002576422179117799, 0.0184065792709589, 0.0077068195678293705, -0.02711603417992592, 0.02671697549521923, -0.05890105292201042, 0.01199171133339405, -0.06400900334119797, -0.010006395168602467, -0.025479894131422043, -0.04828609526157379, -0.011941829696297646, -0.0006746585131622851, -0.003040327923372388, 0.049802515655756, -0.020870765671133995, -0.03912770003080368, -0.022945871576666832, -0.02041184902191162, 0.022447047755122185, -0.01509439293295145, 0.05223677307367325, 0.02302568219602108, -0.033700499683618546, -0.042220402508974075, -0.00027669104747474194, -0.03816995769739151, -0.007118208333849907, -0.015443569049239159, 0.024362528696656227, 0.03393993526697159, 0.007627008017152548, -0.05155837535858154, -0.0007457408355548978, 0.011163664981722832, 0.002928092610090971, 0.0744643434882164, 0.014525733888149261, -0.014076792635023594, -0.008988795801997185, -0.06105596944689751, 0.016660697758197784, 0.017079709097743034, 0.023065589368343353, -0.05582830309867859, 0.036314334720373154, -0.08308400958776474, -0.044934000819921494, 0.0032623042352497578, 0.038748592138290405, 0.0260784812271595, 0.027096081525087357, -0.04361710697412491, -0.010305688716471195, -0.04206077754497528, 0.033081959933042526, 0.05459121987223625, 0.027415327727794647, -0.001856869668699801, 0.05072035267949104, 0.0297697726637125, 0.008579760789871216, 0.01923462562263012, -0.009138442575931549, -0.016062110662460327, -0.008714443072676659, -0.03050803206861019, -0.041262660175561905, 0.02334493026137352, 0.003706257091835141, -0.017179474234580994, 0.0026113397907465696, -0.044215694069862366, 0.006719149649143219, -0.0025015987921506166, 0.055149901658296585, -0.0587015226483345, -0.016550956293940544, -0.041701626032590866, -0.032243937253952026, -0.010405453853309155, 0.01829683780670166, -0.0076968432404100895, 0.042539648711681366, -0.003032845677807927, -0.022586718201637268, 0.041382379829883575, -0.014316228218376637, 0.003150068921968341, 0.014854957349598408, -0.0024579516611993313, 0.0761403888463974, -0.08412155508995056, 0.04218049719929695, 0.019633684307336807, -0.0051054563373327255, -0.005020656157284975, -0.018556226044893265, -0.03914765268564224, -0.044095978140830994, 0.04174153134226799, 0.018246956169605255, 0.050002045929431915, -0.010545124299824238, -0.0290115624666214, 0.06648316979408264, -0.004496891982853413, -0.010634912177920341, -0.0038733629044145346, 0.05758415907621384, -0.026138339191675186, 0.001644869800657034, 0.004003056790679693, -0.010874347761273384, 0.03725212439894676, -0.007357643451541662, 0.0009764465503394604, 0.07494320720434189, -0.059778980910778046, -0.03006906807422638, -0.027714621275663376, 0.10255806893110275, -0.01788780279457569, -0.04166172072291374, -0.018955284729599953, 0.059539545327425, 0.03090709075331688, -0.015144274570047855, 0.011303335428237915, 0.03543640673160553, 0.016151897609233856, 0.004102821461856365, 0.016550956293940544, -0.02595876343548298, 0.013258722610771656, -0.07410518825054169, -0.007896372117102146, -0.04764759913086891, -0.03503734618425369, 0.0016062109498307109, 0.032842524349689484, 0.007532231509685516, -0.029290903359651566, -0.0011659994488582015, -0.01004131231456995, 0.01339839305728674, 0.0340397022664547, 0.019114907830953598, 0.03028854914009571, 0.0002411498862784356, 0.029929397627711296, 0.02186841331422329, 0.0022733870428055525, -0.013627852313220501, -0.013288652524352074, -0.012161311693489552, -0.017508696764707565, 0.004299856722354889, 0.02839302085340023, -0.11157679557800293, 0.004591668490320444, 0.07749718427658081, 0.025499846786260605, 0.018576178699731827, -0.004676468204706907, -0.019065026193857193, -0.03405965492129326, -0.060936253517866135, 0.05247620865702629, -0.006345032248646021, 0.0174388624727726, 0.053473856300115585, -0.07733756303787231, 0.005412232596427202, 0.007617031689733267, -0.007961219176650047, 0.02532026916742325, -0.0231453999876976, -0.07075309753417969, -0.031485725194215775, 0.013428322970867157, -0.006803949363529682, -0.008963854052126408, 0.04900439828634262, 0.014176557771861553, -0.028253350406885147, 0.023484600707888603, -0.056825947016477585, -0.009377878159284592, -0.04289880394935608, 0.007128184661269188, -0.019394248723983765, 0.02555970475077629, -0.008115855045616627, -0.004933362361043692, 0.012909546494483948, 0.011752276681363583, -0.0024492223747074604, -0.012330911122262478, 0.05562877282500267, 0.012769876047968864, -0.022247519344091415, -0.011303335428237915, 0.011822111904621124, -0.0018618579488247633, 0.0044794329442083836, -0.0186160858720541, -0.01966361328959465, 0.03693287447094917, -0.005980891175568104, -0.006265220232307911, 0.007846490480005741, -0.023165352642536163, 0.0011896935757249594, 0.0012526699574664235, 0.010136089287698269, -0.030428219586610794, 0.10606978088617325, 0.021190013736486435, -0.07115215063095093, -0.05554896220564842, -0.06544561684131622, -0.038868311792612076, -0.05479075014591217, 0.007437455002218485, 0.031904738396406174, -0.003955668769776821, 0.011891947127878666, 0.040025580674409866, -0.0003181557112839073, -0.03431904315948486, -0.0034668217413127422, -0.005302491597831249, -0.0026736927684396505, 0.07282819598913193, -0.04114294424653053, 0.03731198236346245, -0.051877621561288834, 0.0361347571015358, 0.02661721035838127, 0.017428886145353317, -0.059140488505363464, -0.03439885377883911, 0.00036881747655570507, -0.03828967362642288, 0.013228793628513813, -0.04577202349901199, -0.022546812891960144, -0.015702957287430763, -0.017498720437288284, 0.004923386033624411, -0.01576281525194645, 0.092900849878788, -0.07813567668199539, -0.04808656498789787, -0.028951702639460564, -0.04613117873668671, -0.0376511812210083, 0.031206384301185608, 0.06237286329269409, 0.009347948245704174, -0.022227564826607704, -0.014006957411766052, 0.07135168462991714, 0.05207715183496475, -0.047807224094867706, -0.058621712028980255, 0.020551519468426704, 0.01987311989068985, -0.04449503868818283, -0.011313311755657196, 0.01850634440779686, 0.018855519592761993, 0.07909341901540756, -0.05267573893070221, -0.007572137285023928, 0.06883761286735535, 0.04154200479388237, -0.03282257169485092, -0.0026587280444800854, -0.011303335428237915, -0.01355801708996296, -0.018755756318569183, 0.005347385536879301, -0.020012790337204933, 0.0105650769546628, -0.0011298346798866987, 0.023803846910595894, 0.020012790337204933, -0.026098433881998062, -0.004294868558645248, -0.019903048872947693, 0.04469456523656845, -0.015633121132850647, -0.0018892931984737515, 0.008345313370227814, 0.03615470975637436, 0.001967857824638486, 0.038848359137773514, 0.09417783468961716, 0.02144940197467804, -0.008634630590677261, -0.0024853870272636414, -0.009981454350054264, 0.008080936968326569, -0.00767689011991024, 0.027614856138825417, -0.03757137060165405, -0.01663076877593994, 0.0513189397752285, -0.028133632615208626, -0.009452701546251774, 0.015293922275304794, -0.015363757498562336, 0.00815077219158411, -0.016441214829683304, -0.045692212879657745, 0.00486602121964097, 0.030468126758933067, 0.0186160858720541, 0.0211301539093256, 0.039686381816864014, -0.026956411078572273, 0.018905403092503548, 0.022347282618284225, 0.026756880804896355, 0.026637163013219833, 0.01173232402652502, -0.04008543863892555, -0.013797451741993427, -0.0605371929705143, -0.0472884476184845, -0.01350813452154398, 0.012121405452489853, 0.016341451555490494, 0.023265117779374123, 0.05155837535858154, 0.0054321857169270515, -0.007063337601721287, -0.059898700565099716, 0.042739178985357285, 0.05191752687096596, -0.01498465146869421, 0.04437531903386116, 0.02396347001194954, -0.00525260902941227, 0.014116698876023293, -0.01965363696217537, -0.03354087844491005, -0.013907193206250668, -0.007641972508281469, 0.04381663724780083, -0.0174388624727726, 0.05606773868203163, 0.03497748821973801, 0.008899006992578506, -0.0330420546233654, -0.027894198894500732, -0.016770439222455025, -0.044215694069862366, 0.013947099447250366, -0.008340325206518173, 0.010555100627243519, -0.014894863590598106, -0.02134963683784008, 0.049164023250341415, 0.07582113891839981, -0.02585899829864502, 0.004060421604663134, 0.00039095274405553937, 0.04617108404636383, 0.020252225920557976, -0.017708227038383484, 0.02134963683784008, 0.004262445028871298, 0.06233295798301697, 0.04214059188961983, 0.008894018828868866, 0.02059142477810383, 0.0570254772901535, 0.05447150394320488, 0.00364141003228724, 0.005127903539687395, 0.01393712218850851, -0.002828327938914299, 0.03573570027947426, -0.06548552215099335, -0.019084978848695755, -0.06045738235116005, -0.00814079586416483, 0.007826536893844604, -0.024422388523817062, 0.013488181866705418, 0.013338534161448479, 0.0010250818450003862, -0.03198454901576042, -0.07083290815353394, 0.018426531925797462, 0.00029913807520642877, -0.02186841331422329, -0.08228588849306107, 0.05155837535858154, 0.022766293957829475, -0.03669343888759613, 0.03900798037648201, -0.052955079823732376, 0.012101452797651291, 0.03008902072906494, -0.05080016329884529, 0.03731198236346245, 0.05930011346936226, -0.044415224343538284, -0.038229815661907196, 0.0173590499907732, -0.0005094232619740069, 0.06281182914972305, 0.10144070535898209, 0.054830655455589294, 0.02753504551947117, 0.030368361622095108, -0.034438759088516235, -0.0037835745606571436, 0.017817968502640724, -0.02797400951385498, 0.01339839305728674, 0.06484702974557877, -0.018586155027151108, -0.05890105292201042, 0.01712959073483944, 0.003549127606675029, 0.03954670950770378, 0.05255602300167084, 0.02753504551947117, 0.007133172824978828, -0.030787372961640358, -0.005427197553217411, 0.0116126062348485, 0.006270208861678839, 0.07003478705883026, 0.011881970800459385, 0.008360277861356735, 0.0446147546172142, 0.0687578022480011, 0.007103243377059698, 0.025719327852129936, 0.005791338160634041, -0.040125343948602676, 0.018057402223348618, -0.0017620932776480913, 0.017528649419546127, 0.04465465992689133, -0.014386063441634178, -0.05606773868203163, -0.023584363982081413, 0.006973549723625183, -0.004185127560049295, 0.00021371460752561688, 0.043178144842386246, -0.01498465146869421, -0.024522151798009872, 0.018107285723090172, 0.0004539291840046644, 0.03844929859042168, -0.105989970266819, -0.023923564702272415, 0.0794924795627594, -0.015303898602724075, 0.023305023089051247, 0.01298935804516077, -0.022467000409960747, -0.08883044868707657, -0.06847845762968063, 0.04573211818933487, 0.007552184630185366, 0.005561879836022854, 0.003666351083666086, 0.04848562180995941, 0.046849481761455536, 0.018636038526892662 ]
39,440
pyspark.sql.dataframe
filter
:func:`where` is an alias for :func:`filter`. .. versionadded:: 1.3
def filter(self, condition: "ColumnOrName") -> "DataFrame": """Filters rows using the given condition. :func:`where` is an alias for :func:`filter`. .. versionadded:: 1.3.0 .. versionchanged:: 3.4.0 Supports Spark Connect. Parameters ---------- condition : :class:`Column` or str a :class:`Column` of :class:`types.BooleanType` or a string of SQL expressions. Returns ------- :class:`DataFrame` Filtered DataFrame. Examples -------- >>> df = spark.createDataFrame([ ... (2, "Alice"), (5, "Bob")], schema=["age", "name"]) Filter by :class:`Column` instances. >>> df.filter(df.age > 3).show() +---+----+ |age|name| +---+----+ | 5| Bob| +---+----+ >>> df.where(df.age == 2).show() +---+-----+ |age| name| +---+-----+ | 2|Alice| +---+-----+ Filter by SQL expression in a string. >>> df.filter("age > 3").show() +---+----+ |age|name| +---+----+ | 5| Bob| +---+----+ >>> df.where("age = 2").show() +---+-----+ |age| name| +---+-----+ | 2|Alice| +---+-----+ """ if isinstance(condition, str): jdf = self._jdf.filter(condition) elif isinstance(condition, Column): jdf = self._jdf.filter(condition._jc) else: raise PySparkTypeError( error_class="NOT_COLUMN_OR_STR", message_parameters={"arg_name": "condition", "arg_type": type(condition).__name__}, ) return DataFrame(jdf, self.sparkSession)
(self, condition)
[ 0.05611981451511383, -0.03943652659654617, 0.08047232031822205, 0.015047670342028141, 0.010795067995786667, -0.02400721237063408, -0.04288949444890022, 0.09333917498588562, -0.00809630099684, -0.026787761598825455, -0.0006905935588292778, -0.034220729023218155, 0.00239663221873343, 0.00947748776525259, -0.037092145532369614, 0.04059963300824165, 0.017928171902894974, 0.011185798794031143, 0.0305315051227808, 0.044997621327638626, -0.011676483787596226, -0.048886753618717194, 0.03078593499958515, 0.07531104236841202, 0.002523846924304962, 0.010949542745947838, -0.044634152203798294, 0.018037213012576103, 0.020299816504120827, -0.01014082133769989, -0.0012074029073119164, -0.01229438278824091, -0.00505678029730916, -0.038418810814619064, -0.054702278226614, 0.051903557032346725, 0.023389313369989395, -0.031349312514066696, 0.03776456415653229, 0.005751917604357004, -0.04965004324913025, 0.00009328124724561349, 0.018600592389702797, -0.012812327593564987, -0.04132657125592232, -0.0009904565522447228, -0.0039209360256791115, -0.08570629358291626, 0.009422967210412025, 0.03296675533056259, 0.006219885312020779, 0.03551104664802551, 0.0054475110955536366, 0.018864108249545097, -0.030077166855335236, -0.05313935875892639, -0.02144474722445011, -0.001716261263936758, 0.044525112956762314, 0.01181278470903635, 0.040708672255277634, -0.02713305689394474, -0.0035438353661447763, 0.02320757880806923, -0.015747351571917534, 0.06967725604772568, 0.029441094025969505, 0.04666958749294281, -0.07287579774856567, -0.021263012662529945, -0.04172639176249504, -0.007151278201490641, 0.004520661663264036, 0.06876858323812485, -0.07269406318664551, -0.004897762089967728, -0.03700127452611923, 0.01634707674384117, -0.011140364222228527, -0.0594637393951416, 0.12030866742134094, -0.009459314867854118, -0.04045424237847328, 0.01011356059461832, -0.00214447476901114, 0.030077166855335236, -0.021862737834453583, 0.028968581929802895, -0.005197625141590834, -0.007605616003274918, -0.04917753115296364, 0.013802784495055676, -0.008809611201286316, 0.005161278415471315, 0.0748748779296875, 0.007355730049312115, 0.011294839903712273, -0.0038936755154281855, 0.06549734622240067, 0.04979543015360832, 0.0136755695566535, 0.016592418774962425, 0.04772365093231201, 0.015011323615908623, 0.023934518918395042, -0.03420255333185196, -0.039799999445676804, -0.0241526011377573, -0.0012289839796721935, -0.047396525740623474, 0.0021910443902015686, 0.08875944465398788, -0.05266684666275978, -0.04539744183421135, 0.009604702703654766, 0.041653696447610855, 0.00961378961801529, -0.0509585365653038, -0.05761004239320755, -0.0018116722349077463, -0.003248515771701932, 0.005820068065077066, 0.049250226467847824, -0.05757369473576546, 0.01040433719754219, 0.022171687334775925, -0.038527850061655045, -0.06658776104450226, 0.005924565717577934, 0.013902738690376282, 0.013611963018774986, -0.030549678951501846, 0.024461550638079643, 0.009868218563497066, 0.006260775960981846, 0.018564244732260704, 0.01385730504989624, 0.07196711748838425, -0.005969999823719263, 0.06495214253664017, -0.017074016854166985, -0.007619245909154415, -0.02262602560222149, -0.0005639469018206, -0.02113579772412777, -0.07069497555494308, 0.03376638889312744, -0.018718719482421875, -0.019391139969229698, 0.005915479268878698, -0.05488401651382446, 0.02144474722445011, 0.011076757684350014, -0.011676483787596226, 0.007246688939630985, 0.0034893148113042116, 0.025406572967767715, -0.019790958613157272, 0.04597899317741394, -0.0047342004254460335, 0.001314172288402915, 0.0049431961961090565, -0.05059506371617317, 0.03600173443555832, -0.04645150527358055, 0.029768217355012894, -0.008677853271365166, 0.018809588626027107, -0.01181278470903635, -0.01614716835319996, 0.0722215473651886, 0.0249522365629673, 0.03696493059396744, 0.01784639246761799, -0.05931835249066353, 0.08003616333007812, 0.05175817012786865, 0.012357990257441998, 0.043943557888269424, -0.06589716672897339, 0.03462054580450058, -0.02840520441532135, -0.04528839886188507, 0.06433424353599548, 0.05219433456659317, -0.054302461445331573, -0.03194903954863548, -0.013257578946650028, 0.038418810814619064, 0.01412082090973854, -0.033003102988004684, -0.022208034992218018, 0.037201184779405594, 0.030676893889904022, -0.03994538635015488, -0.03492949530482292, 0.040708672255277634, -0.005306666251271963, -0.0584096759557724, 0.0177827849984169, 0.03914575278759003, 0.023989040404558182, 0.04601534083485603, -0.006869588512927294, -0.01948200725018978, -0.005320296622812748, 0.012803241610527039, 0.04270775988698006, -0.033203013241291046, -0.07236693799495697, -0.015638310462236404, -0.044088948518037796, 0.02458876557648182, -0.02691497467458248, 0.03787360340356827, 0.05499305576086044, -0.033530134707689285, -0.020517898723483086, 0.03420255333185196, -0.021044930443167686, 0.004561552312225103, 0.03276684880256653, -0.02611534111201763, 0.018200775608420372, 0.01614716835319996, -0.06229880824685097, 0.013866391964256763, -0.04550648108124733, 0.04125387966632843, -0.05299396812915802, 0.024770500138401985, -0.01141296699643135, 0.08061771094799042, -0.07047688961029053, -0.04517935961484909, -0.00576100405305624, -0.0014186700573191047, 0.03420255333185196, 0.00913219153881073, -0.05611981451511383, -0.003977728076279163, -0.01308493036776781, 0.03460237383842468, 0.005783721338957548, 0.018627852201461792, -0.03465689346194267, 0.0033711870200932026, 0.04158100113272667, 0.011531095020473003, -0.056737713515758514, -0.05197625234723091, -0.02856876514852047, 0.0061381044797599316, 0.00024591037072241306, 0.022644199430942535, 0.010313469916582108, 0.026260729879140854, -0.00025655890931375325, -0.034002646803855896, 0.055829036980867386, -0.02638794295489788, -0.041762735694646835, -0.023189404979348183, -0.016428858041763306, -0.018455203622579575, -0.06080858036875725, -0.0366378054022789, 0.02616986073553562, 0.0398363433778286, 0.03747378662228584, 0.05215798690915108, 0.02320757880806923, 0.007151278201490641, -0.004123116377741098, 0.022098993882536888, -0.03696493059396744, -0.05695579573512077, -0.005524748470634222, -0.03356648236513138, -0.0584096759557724, -0.0038596002850681543, -0.00622442876920104, -0.01104041002690792, 0.028714153915643692, -0.027314793318510056, -0.036401551216840744, -0.015465660952031612, -0.02569735050201416, 0.0012789610773324966, -0.016846848651766777, -0.025024930015206337, -0.013820958323776722, -0.02887771464884281, 0.015329360030591488, -0.05601077154278755, 0.020372509956359863, -0.013148537836968899, -0.06884127110242844, 0.01602903939783573, -0.05055871978402138, 0.029168492183089256, -0.025297531858086586, 0.04230794310569763, 0.06313478946685791, -0.02224438264966011, -0.0014004964614287019, -0.023443834856152534, -0.01922757923603058, -0.031349312514066696, -0.0024238924961537123, 0.03696493059396744, -0.05172182247042656, -0.007810067851096392, -0.048450589179992676, -0.015847304835915565, 0.005992716643959284, -0.02818712219595909, -0.001866192789748311, -0.02149926871061325, 0.043616436421871185, 0.030658720061182976, -0.01953652873635292, -0.008328013122081757, 0.008391620591282845, -0.018282556906342506, 0.022662373259663582, 0.025515614077448845, -0.010004520416259766, -0.002689680317416787, 0.03925479203462601, 0.028532417491078377, 0.10598793625831604, 0.06989534199237823, -0.01735570654273033, 0.0074102506041526794, -0.02198995277285576, 0.0014413868775591254, 0.03527479246258736, 0.004102671053260565, 0.0177827849984169, 0.03972730413079262, -0.035074882209300995, 0.07894574850797653, -0.010504291392862797, -0.01303949672728777, -0.0077918944880366325, -0.004593356046825647, -0.02489771507680416, 0.03998173400759697, 0.02389817126095295, 0.04656054452061653, 0.033003102988004684, -0.036619633436203, 0.0028577852062880993, -0.0065015750005841255, -0.03367552161216736, -0.041181184351444244, 0.0843978002667427, -0.0461970753967762, -0.01624712161719799, 0.09064949303865433, 0.000728076440282166, 0.0029350225813686848, -0.038673240691423416, 0.019936345517635345, 0.051322005689144135, 0.025024930015206337, 0.0073193833231925964, -0.05688310042023659, -0.03194903954863548, 0.002405719133093953, -0.04278045520186424, 0.05026794224977493, -0.012248949147760868, 0.024170774966478348, -0.015293012373149395, -0.019936345517635345, 0.0027192120905965567, 0.02262602560222149, 0.04328931123018265, 0.034493330866098404, -0.02447972446680069, -0.013902738690376282, -0.05164913088083267, -0.0071694515645504, -0.014584246091544628, -0.09108565747737885, -0.02686045505106449, -0.01810082048177719, -0.047759998589754105, -0.0584096759557724, -0.019445661455392838, -0.0034416094422340393, -0.008986802771687508, -0.030458811670541763, 0.009304839186370373, -0.04703305661678314, 0.02729661948978901, -0.02575187012553215, -0.04274410754442215, -0.05012255534529686, -0.013493834994733334, -0.005969999823719263, -0.04041789844632149, 0.006774177774786949, 0.009704656898975372, 0.04554282873868942, -0.009522921405732632, -0.02644246444106102, -0.023480180650949478, 0.07596529275178909, -0.008164451457560062, -0.10613332688808441, 0.059027574956417084, 0.02049972489476204, 0.05139470100402832, 0.08258045464754105, -0.02616986073553562, 0.023443834856152534, 0.024043560028076172, -0.021372053772211075, -0.005288492888212204, 0.03138566017150879, 0.029332052916288376, -0.008537008427083492, 0.04125387966632843, 0.000051964892918476835, 0.00440934905782342, -0.015029496513307095, 0.03318483754992485, -0.06829606741666794, -0.025297531858086586, -0.0886867493391037, 0.017855478450655937, -0.015202145092189312, 0.04852328449487686, 0.04045424237847328, -0.07229424268007278, 0.0011971802450716496, 0.030022647231817245, 0.044634152203798294, -0.020536072552204132, -0.005661049857735634, -0.0009614925365895033, -0.10126282274723053, -0.0076783099211752415, -0.0006673087482340634, 0.024079907685518265, -0.050158899277448654, -0.032585110515356064, 0.09355725347995758, 0.026097167283296585, 0.04427068307995796, 0.019554702565073967, -0.03711031749844551, 0.024352509528398514, -0.03903670981526375, -0.014856848865747452, -0.00442070746794343, 0.018191687762737274, -0.005020433571189642, 0.04968639090657234, -0.0212448388338089, -0.05688310042023659, -0.018137168139219284, 0.017955433577299118, -0.03418438136577606, -0.08141734451055527, 0.017909998074173927, 0.03091314807534218, 0.025024930015206337, -0.008655136451125145, -0.0652792677283287, 0.007837328128516674, 0.08003616333007812, 0.05746465548872948, -0.09253954142332077, -0.020572418347001076, 0.01088593527674675, 0.05622885376214981, -0.07945460826158524, 0.03620164096355438, -0.039218444377183914, -0.00791456550359726, 0.05339378863573074, -0.061353787779808044, 0.008100843988358974, -0.011076757684350014, 0.05277588590979576, -0.010086300782859325, 0.00022816279670223594, 0.0541570745408535, 0.04525205120444298, -0.024661459028720856, 0.015102190896868706, 0.01651972532272339, -0.03892767056822777, 0.06142647936940193, -0.015211232006549835, 0.014475204981863499, -0.041072145104408264, 0.03125844523310661, -0.05851871892809868, 0.018382510170340538, -0.028586938977241516, -0.07560182362794876, 0.07850958406925201, -0.019572876393795013, -0.007873675785958767, -0.01975461095571518, 0.0016640124376863241, 0.012639679946005344, -0.011267579160630703, -0.01508401706814766, 0.007237602490931749, -0.005806438159197569, 0.003616529516875744, 0.08054501563310623, -0.00886413175612688, -0.030713239684700966, 0.0053975339978933334, -0.00130394974257797, -0.0018571061082184315, 0.0007865724619477987, -0.0011778709013015032, -0.01661967858672142, 0.01631072908639908, -0.048923101276159286, 0.03691040724515915, -0.000239521250477992, -0.05059506371617317, 0.059500087052583694, 0.009495661593973637, -0.02064511366188526, 0.01710127666592598, 0.04103579744696617, -0.030349770560860634, 0.02915031835436821, -0.01682867482304573, 0.01837342418730259, -0.016910456120967865, 0.0881052017211914, 0.018936801701784134, 0.007800981402397156, -0.055829036980867386, -0.049359265714883804, 0.009541095234453678, 0.021117623895406723, 0.0009489982039667666, -0.004261689260601997, -0.011694656684994698, -0.04623342305421829, 0.024134427309036255, 0.03625616058707237, 0.026533331722021103, -0.01069511380046606, 0.0063243829645216465, 0.05332109332084656, -0.07353004068136215, -0.019445661455392838, -0.011994520202279091, -0.01953652873635292, 0.06469771265983582, -0.0015140809118747711, 0.007201255299150944, -0.0024670546408742666, 0.06669680029153824, -0.02437068335711956, -0.0076465061865746975, -0.02782365120947361, 0.041653696447610855, 0.05633789673447609, 0.05441150441765785, 0.0035551937762647867, 0.015611049719154835, -0.026787761598825455, 0.056192509829998016, 0.06447963416576385, -0.06873223185539246, 0.030349770560860634, -0.014775067567825317, 0.008432511240243912, -0.07320291548967361, 0.03598355874419212, -0.0849793553352356, -0.025497442111372948, 0.03907305747270584, 0.018518811091780663, -0.018200775608420372, 0.014429770410060883, 0.056301549077034, -0.06073588505387306, 0.0032076253555715084, -0.012467031367123127, 0.017237579450011253, 0.014911369420588017, -0.044525112956762314, -0.035183925181627274, 0.021008582785725594, 0.02069963328540325, -0.06437058746814728, -0.01799177937209606, -0.014566072262823582, -0.04932291805744171, -0.01412082090973854, -0.014311643317341805, -0.03809168562293053, 0.013321186415851116, -0.025733696296811104, -0.00033393834019079804, 0.0017083104467019439, 0.024334335699677467, -0.005193081684410572, 0.03313031792640686, 0.04288949444890022, 0.015502008609473705, -0.0143389031291008, -0.04009077325463295, 0.016955889761447906, -0.04259872063994408, -0.06208072602748871, 0.0217718705534935, 0.042562372982501984, 0.03434794396162033, 0.01303949672728777, -0.014129907824099064, 0.00881869811564684, -0.015256665647029877, -0.043471045792102814, -0.019845478236675262, 0.01693771593272686, -0.0199181716889143, 0.044197987765073776, 0.03111305832862854, -0.030240729451179504, -0.021117623895406723, -0.05844602361321449, -0.01273963414132595, -0.007787351030856371, 0.021226665005087852, 0.03940017893910408, 0.041653696447610855, 0.02638794295489788, -0.027896344661712646, 0.01758287474513054, -0.028841368854045868, 0.02182639203965664, -0.0030735956970602274, 0.013657396659255028, -0.049359265714883804, -0.039690956473350525, 0.01937296614050865, 0.002053607255220413, 0.02213534153997898, -0.007178538478910923, 0.021808218210935593, -0.047759998589754105, -0.02760556899011135, 0.009750090539455414, -0.00534755690023303, 0.026987669989466667, -0.0018207590328529477, 0.006633332930505276, 0.046851322054862976, -0.0037891778629273176, -0.03196721151471138, 0.01117671187967062, -0.041435614228248596, 0.027841825038194656, 0.03316666558384895, 0.019609222188591957, 0.04150830954313278, -0.008882305584847927, -0.03572912886738777, 0.0244252048432827, -0.02378913015127182, -0.030240729451179504, -0.06229880824685097, -0.001774189411662519, -0.019391139969229698, -0.01784639246761799, -0.0016787784406915307, -0.016210775822401047, -0.009018606506288052, 0.030604198575019836, 0.01462967973202467, -0.03816438093781471, -0.02611534111201763, 0.0043275682255625725, -0.04841424524784088, -0.02129936031997204, -0.01922757923603058, -0.007046780548989773, 0.02564282901585102, 0.013175798580050468, -0.03234885632991791, -0.0156564824283123, 0.010395250283181667, 0.04732383415102959, 0.08243506401777267, 0.016865022480487823, 0.07618337124586105, 0.014302556402981281, -0.000251021672738716, 0.039109405130147934, -0.02776913158595562, -0.01917305774986744, 0.0035733673721551895, 0.08941369503736496, -0.010749634355306625, -0.008364359848201275, 0.028605112805962563, 0.013430227525532246, -0.0155292684212327, -0.0008677853620611131, 0.06655140966176987, -0.07258501648902893, -0.023243926465511322, 0.0148659348487854, 0.04132657125592232, 0.0371830128133297, -0.04761460795998573, 0.012512465007603168, 0.017437487840652466, -0.02086319588124752, 0.027260271832346916, 0.01054063905030489, -0.03265780583024025, 0.0013721003197133541, -0.0038232530932873487, 0.00016498143668286502, 0.06749643385410309, -0.018882282078266144, -0.005411163903772831, 0.03392995148897171, -0.04932291805744171, -0.0027373856864869595, -0.01890045590698719, 0.0001705186878098175, -0.0008604023605585098, 0.03191269189119339, 0.052121639251708984, 0.004522933624684811, -0.05492036044597626, 0.030549678951501846, -0.004865958821028471, 0.010440683923661709, 0.007696483749896288, 0.02351652830839157, 0.07120382785797119, 0.009150364436209202, -0.020263468846678734, -0.011267579160630703, -0.0013209873577579856, 0.004395718686282635, 0.049250226467847824, 0.015029496513307095, 0.04805077239871025, -0.03585634380578995, -0.033530134707689285, -0.06520657241344452, 0.09748273342847824, 0.030985843390226364, -0.0350567102432251, 0.006060867104679346, -0.05059506371617317, -0.001156289828941226, 0.02989543229341507 ]