I have a data frame like the one below.
amplitude -13.125 |-13.125 |-11.875 |-11.875 |-11.25 |-11.25
duration -----------|--------|--------|--------|--------|--------
1 NaN |NaN |NaN |NaN |NaN |NaN
2 NaN |0.008032|NaN |NaN |NaN |NaN
3 0.004016|NaN |NaN |NaN |0.004016|0.004016
4 0.9 |NaN |NaN |NaN |NaN |NaN
5 NaN |NaN |NaN |NaN |NaN |NaN
--------------------|--------|--------|--------|--------|--------
sum 0.904016|0.008032|NaN |NaN |0.004016|0.004016
How do I find the value at the intersection of the row and column in the data frame? Also, I want calculate the density by dividing the value I found by the value in 'sum'. Example:
duration amplitude density
3 -13.125 0.004016/0.904016
2 -13.125 0.008032/0.008032
...