# Hello!, I'm currently trying to merge a set of asset returns from a CSV file, we h

**URL:** <https://discourse.julialang.org/t/hello-im-currently-trying-to-merge-a-set-of-asset-returns-from-a-csv-file-we-h/55022>\
**Category:** General Usage\
**Created:** [February 10, 2021, 8:17pm UTC](https://discourse.julialang.org/t/hello-im-currently-trying-to-merge-a-set-of-asset-returns-from-a-csv-file-we-h/55022 "2021-02-10T20:17:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![BridgeBot](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bridgebot/32/21491_2.png) [@BridgeBot](https://discourse.julialang.org/u/BridgeBot)\
**Post date:** [February 10, 2021, 8:17pm UTC](https://discourse.julialang.org/t/hello-im-currently-trying-to-merge-a-set-of-asset-returns-from-a-csv-file-we-h/55022/1 "2021-02-10T20:17:07Z")

</div>

Hello!, I’m currently trying to merge a set of asset returns from a CSV file, we have two assets and I have got them into a dataframe along with the timestamp, as follows

```julia
Row │ timestamp brka brkb    
     │ Date Float64 Float64 
─────┼───────────────────────────────
   1 │ 2009-12-31 99200.0 3286.0
   2 │ 2010-01-04 99600.0 3311.0
   3 │ 2010-01-05 99710.0 3327.0

```

i’m trying to run this piece of code `diff(log.(asset[:, x]))` where x is the column and put that data into another dataframe with the timestamps (there will be 1 less row in the new dataframe as there will be no theoretical difference between row 0 and row 1)

does anybody have any solutions as to my best approach here, i understand the maths, but i’ve been using julia like 3 days and dont know what it’s capable of

Note that the original poster on Slack cannot see your response here on Discourse. Consider _transcribing the appropriate answer back to Slack_, or pinging the poster here on Discourse so they can _follow this thread_.  
[(Original message :slack:)](https://julialang.slack.com/archives/C6A044SQH/p1612988114491700?thread_ts=1612988114.491700&cid=C6A044SQH) [(More Info)](https://github.com/JuliaCommunity/SlackBridge)

---

<div class="post-metadata">

**Author:** ![mitchellcarey](https://avatars.discourse-cdn.com/v4/letter/m/9fc29f/32.png) [@mitchellcarey](https://discourse.julialang.org/u/mitchellcarey)\
**Post date:** [February 10, 2021, 9:00pm UTC](https://discourse.julialang.org/t/hello-im-currently-trying-to-merge-a-set-of-asset-returns-from-a-csv-file-we-h/55022/2 "2021-02-10T21:00:41Z")

</div>

Solution Courtesy of Peter Deffebach

```julia
df = DataFrame()
nms = [:brka, :brkb]
for x in nms
    df[:, x] = diff(log.(asset[:, x]))
end

```
