Here is my problem, I would like to map a dictionary in a DataFrame but I cannot find a way to do that when the dictionary has several keys. Note that these keys are present in different columns in the DataFrame.

Here is an example: 

this is the dataframe I have at the begining, df:

```
        Index      key 
0          10       k1       
1          12       k2   
2           3       k1    
3          34       k3  

```

here is the dictionary I have, d: 

```
{('k1', 10):v1,('k1', 3):v2,('k2', 12):v3,('k3', 34):v4}

```

I would like to have at the end, df:

```
        Index      key    value
0          10       k1       v1    
1          12       k2       v2
2           3       k1       v3
3          34       k3       v4

```

is there a way to do that the same way that you can do that when you have a one key dictionary :

> 
> df["value"] = df["key"].map(d)
> 
> 
> 

thank you in advance.
['https://Stackoverflow.com/questions/52041232', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/10028348/']
It is explained in the [Java Language Specification](https://docs.oracle.com/javase/specs/jls/se10/html/jls-11.html#jls-11.2.3) (emphasis in bold):

> 
> It is a compile-time error if a `catch` clause *can catch* checked exception class E1 and it is not the case that the `try` block corresponding to the `catch` clause *can throw* a checked exception class that is a subclass or superclass of E1, **unless E1 is `Exception` or a superclass of `Exception`.**
> 
> 
> 

I guess the rationale behind this is that: `MyException` is indeed a checked exception. However, unchecked exceptions also extend `Exception` (transitive inheritance from `RuntimeException`), so having a `catch` include the `Exception` class is excluded from the exception analysis done by the compiler.
Exception extends from `RuntimeException` will considered as uncheched exception, so it's ok:

```
class MyException extends RuntimeException { }

try {
    ...
} catch (MyException e) {

}

```

Your exception extends from `Throwable`, so it is cheched exception. Since the compiler noticed that it is never thrown, so the compile fails.