# Map function with deep level specs?

**URL:** <https://community.wolfram.com/t/map-function-with-deep-level-specs/13379>\
**Category:** Questions\
**Created:** [November 30, 2018, 6:31pm UTC](https://community.wolfram.com/t/map-function-with-deep-level-specs/13379 "2018-11-30T18:31:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rbackhus](https://avatars.discourse-cdn.com/v4/letter/r/e9bcb4/32.png) [@rbackhus](https://community.wolfram.com/u/rbackhus)\
**Post date:** [November 30, 2018, 6:31pm UTC](https://community.wolfram.com/t/map-function-with-deep-level-specs/13379/1 "2018-11-30T18:31:19Z")

</div>

Hello,

I’m trying to replace the complex coefficients with their real parts in a rational function. So, these coefficients are nested sort of deep in the function. So if the function is, say, dtf, then I’d say something like

```
Map[Re[#]&,dtf, { {1}, {2,1,1}, {2,1,2,1}, ..., {2,1,8,1} } ]

```

But Mathematica says that the statement is in error because the level spec does not conform to the standard level specifications. Those only go to {n1,n2}. So, How does one accomplish a mapping for a deeply nested structure?  
Thanks.

---

<div class="post-metadata">

**Author:** ![rohitnamjoshi](https://avatars.discourse-cdn.com/v4/letter/r/f1d935/32.png) [@rohitnamjoshi](https://community.wolfram.com/u/rohitnamjoshi)\
**Post date:** [November 30, 2018, 7:40pm UTC](https://community.wolfram.com/t/map-function-with-deep-level-specs/13379/2 "2018-11-30T19:40:57Z")

</div>

See [MapAt](https://reference.wolfram.com/language/ref/MapAt.html).

---

<div class="post-metadata">

**Author:** ![rbackhus](https://avatars.discourse-cdn.com/v4/letter/r/e9bcb4/32.png) [@rbackhus](https://community.wolfram.com/u/rbackhus)\
**Post date:** [November 30, 2018, 8:00pm UTC](https://community.wolfram.com/t/map-function-with-deep-level-specs/13379/3 "2018-11-30T20:00:24Z")

</div>

Thank you! That worked. 🙂
