Search snippets
Browse Code Answers
FAQ
Usage docs
Log In
Sign Up
Home
Python
Return the key-value pairs in this RDD to the master as a dictionary.
Micheal Thomson
Programming language:
Python
2021-04-16 05:39:49
0
Q:
Return the key-value pairs in this RDD to the master as a dictionary.
user62442
Code:
Python
2021-07-15 12:32:15
m = sc.parallelize([(1, 2), (3, 4)]).collectAsMap() m[1] # 2 m[3] # 4
0
Tags
key
value
master
turn
pair
return
dict
Related
python dictionary access value by key
dataframe to dictionary using index as key
sort dict of dicts by key
Sorts this RDD, which is assumed to consist of (key, value) pairs
for key value in dict python
python convert dict_keys to list
python return first n key values pairs from dictionary
python dictionary add key-value pair
Return an RDD with the keys of each tuple.
dict to csv keys as rows and subkey as columns in python
New to Communities?
Join the community