How to determine if object is a valid key-value pair in PySpark

If I have a rdd, how do I understand the data is in key:value format? is there a way to find the same – something like type(object) tells me an object’s type. I tried print type(rdd.take(1)), but it just says <type ‘list’>. Let’s say I have a data like (x,1),(x,2),(y,1),(y,3) and I use groupByKey and … Read more