# RDataFrame snapshot convert double to float

**URL:** <https://root-forum.cern.ch/t/rdataframe-snapshot-convert-double-to-float/56475>\
**Category:** ROOT\
**Tags:** python, rdataframe, root\
**Created:** [September 25, 2023, 4:16pm UTC](https://root-forum.cern.ch/t/rdataframe-snapshot-convert-double-to-float/56475 "2023-09-25T16:16:16Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kyoon](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/k/e47c2d/32.png) [@kyoon](https://root-forum.cern.ch/u/kyoon)\
**Post date:** [September 25, 2023, 4:16pm UTC](https://root-forum.cern.ch/t/rdataframe-snapshot-convert-double-to-float/56475/1 "2023-09-25T16:16:16Z")

</div>

Hello,

I have a RDataFrame object whose column types are Double\_t. I am trying to apply a TMVA xml file _in Python_ using the [TMVA::Experimental::RReader](https://root-forum.cern.ch/t/rdataframe-and-tmva-in-pyroot/38930/3) method. However, this does not work because the current implementation only supports floats.

My question is, is there an easy, efficient way to convert these columns of doubles to floats? I suppose I can redefine each and every column but just wondering if there might be a less cumbersome method.

_ROOT Version:_ 6.28/00

---

<div class="post-metadata">

**Author:** ![vpadulan](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/vpadulan/32/25315_2.png) [@vpadulan](https://root-forum.cern.ch/u/vpadulan)\
**Post date:** [September 25, 2023, 8:06pm UTC](https://root-forum.cern.ch/t/rdataframe-snapshot-convert-double-to-float/56475/2 "2023-09-25T20:06:33Z")

</div>

> [@kyoon](#):
>
> My question is, is there an easy, efficient way to convert these columns of doubles to floats? I suppose I can redefine each and every column but just wondering if there might be a less cumbersome method.

Dear @kyoon ,

Indeed, as things stand according to your description, it seems that the best option is using `Redefine`. That’s exactly its purpose, to recompute values of an existing column keeping the original name. Then you can `Snapshot` as usual.

I would argue that what you are reporting is a limitation in `RReader` so that’s the part that should be addressed. I will invite @moneta in the conversation to understand if this can be improvede and how feasible it is.

Cheers,  
Vincenzo

---

<div class="post-metadata">

**Author:** ![system](https://root-forum.cern.ch/uploads/default/original/3X/e/f/efe4f24398fd8ffeb76bccb6ecc46d9d9c003376.png) [@system](https://root-forum.cern.ch/u/system)\
**Post date:** [October 9, 2023, 8:07pm UTC](https://root-forum.cern.ch/t/rdataframe-snapshot-convert-double-to-float/56475/3 "2023-10-09T20:07:04Z")

</div>

Closed on October 9, 2023, 8:07pm UTC

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
