Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

Sorts this RDD by the given keyfunc

# sortBy(keyfunc, ascending=true, numPartitions=None)

tmp = [('a', 1), ('b', 2), ('1', 3), ('d', 4), ('2', 5)]
sc.parallelize(tmp).sortBy(lambda x: x[0]).collect()
# [('1', 3), ('2', 5), ('a', 1), ('b', 2), ('d', 4)]
sc.parallelize(tmp).sortBy(lambda x: x[1]).collect()
# [('a', 1), ('b', 2), ('1', 3), ('d', 4), ('2', 5)]
Comment

PREVIOUS NEXT
Code Example
Python :: visualizzare csv in pycharm pandas read_csv 
Python :: str = "This article is written in {}" print (str.format("Python")) 
Python :: Build the union of a list of RDDs 
Python :: Applies the f function to all Row of this DataFrame 
Python :: python create adictionary randomly assigning clors to categorical vairables 
Python :: Prints out the schema in the tree format 
Python :: staff user is not restricting permission in django 
Python :: groupby fillna ffill 
Python :: create a dict from variables and give name 
Python :: devu and friendship testing codechef solution 
Python :: mask and then fillnan# 
Python :: por que usar np.log 
Python :: python coule nod import the module virtualenvwrapper.hook_loader 
Python :: connect kaggle to colab 
Python :: remove grid from 3d plots 
Python :: fforeveer loop python 
Python :: urllib.error.HTTPError: HTTP Error 502 docker redis 
Python :: jupyter lab extensions not working 
Python :: autoscrapper installation 
Python :: exercism Phone Number python 
Python :: 12 hr to 24 hour time conversion python 
Python :: pylesson 
Python :: how i rwrite conditon to create 1 or 0 label from two probability column python 
Python :: text image thresholding 
Python :: types of methods in oop python 
Python :: what does - none do in python 
Python :: The Bytearray Type 
Python :: print 2 letter python 
Python :: how to get tomorrow date in python 
Python :: python subtract days from date 
ADD CONTENT
Topic
Content
Source link
Name
1+5 =