# \#dataframesmeta

**URL:** https://discourse.julialang.org/tag/dataframesmeta/879.md

[Latest](https://discourse.julialang.org/latest.md) · [Categories](https://discourse.julialang.org/categories.md) · [Tags](https://discourse.julialang.org/tags.md)

---

## [Cannot fix \`nothing\` in summation](https://discourse.julialang.org/t/cannot-fix-nothing-in-summation/132507)

<div class="topic-metadata">

**Author:** [@rgouveiamendes](https://discourse.julialang.org/u/rgouveiamendes)\
**Replies:** 7\
**Last updated:** [September 19, 2025, 2:04pm UTC](https://discourse.julialang.org/t/cannot-fix-nothing-in-summation/132507 "2025-09-19T14:04:40Z")

</div>

Hello, I am trying to perform the following transformation on a DataFrame: @transform! df\_20\_P\_raw\[:data\] begin # Calculate the sum of the relevant columns, replacing missing values with 0 :pensions\_balance\_pro…

---

## [DataFrames: \`@combine\` only if a condition is met](https://discourse.julialang.org/t/dataframes-combine-only-if-a-condition-is-met/127232)

<div class="topic-metadata">

**Author:** [@hendri54](https://discourse.julialang.org/u/hendri54)\
**Replies:** 10\
**Last updated:** [March 23, 2025, 12:44pm UTC](https://discourse.julialang.org/t/dataframes-combine-only-if-a-condition-is-met/127232 "2025-03-23T12:44:20Z")

</div>

How can I compute a variable with @combine only if some condition is met? MWE: using DataFrames, DataFramesMeta dfTmp = DataFrame(y = 1:3, x = 10:12) @combine dfTmp begin # Always compute \`a\` :a = :y \* 2; #…

---

## [If in === ∈, why does .∈ work but .in fails with a ParseError?](https://discourse.julialang.org/t/if-in-why-does-work-but-in-fails-with-a-parseerror/125464)

<div class="topic-metadata">

**Author:** [@Matheus](https://discourse.julialang.org/u/Matheus)\
**Replies:** 5\
**Last updated:** [February 2, 2025, 1:02pm UTC](https://discourse.julialang.org/t/if-in-why-does-work-but-in-fails-with-a-parseerror/125464 "2025-02-02T13:02:59Z")

</div>

Hello everyone, I’m trying to understand the following behavior regarding in and ∈ (I guess they’re called operators?). While they are functionally identical (in === ∈ returns true), they behave differently when used wi…

---

## [Excel's pivot table equivalent with DataFramesMeta](https://discourse.julialang.org/t/excels-pivot-table-equivalent-with-dataframesmeta/123456)

<div class="topic-metadata">

**Author:** [@HenriDeh](https://discourse.julialang.org/u/HenriDeh)\
**Replies:** 2\
**Last updated:** [December 4, 2024, 2:44pm UTC](https://discourse.julialang.org/t/excels-pivot-table-equivalent-with-dataframesmeta/123456 "2024-12-04T14:44:33Z")

</div>

Hello, So I have a table like df = DataFrame(a= \[1,1,2,2\], b = \[1,2,1,2\], c = \[1,2,3,4\]) And I would like to create a table that, if I were to work in Excel, I could obtain with a pivot table with a for the Rows and b …

---

## [Create DataFrame from data in DataFrameRow](https://discourse.julialang.org/t/create-dataframe-from-data-in-dataframerow/122431)

<div class="topic-metadata">

**Author:** [@Nathan\_Boyer](https://discourse.julialang.org/u/Nathan_Boyer)\
**Replies:** 7\
**Last updated:** [November 11, 2024, 4:44pm UTC](https://discourse.julialang.org/t/create-dataframe-from-data-in-dataframerow/122431 "2024-11-11T16:44:18Z")

</div>

I’m stuck on this data transformation. I have a DataFrameRow that I looked up from another table. julia\> using DataFramesMeta julia\> dfrow = DataFrame( "Carbon Min. (%)" =\> 0.1, "Carbon Max. (%)" …

---

## [DataFramesMeta: @rsubset or condition?](https://discourse.julialang.org/t/dataframesmeta-rsubset-or-condition/121763)

<div class="topic-metadata">

**Author:** [@alecStewart1](https://discourse.julialang.org/u/alecStewart1)\
**Replies:** 2\
**Last updated:** [October 25, 2024, 10:39pm UTC](https://discourse.julialang.org/t/dataframesmeta-rsubset-or-condition/121763 "2024-10-25T22:39:08Z")

</div>

Say I have some dataframe where I want to select items by one condition or another that’s a combination. @rsubset df :x == 1 || :x == 2 :y == 3 With the data I’m working with, this returns matches of the 2nd clause and…

---

## [Using Symbolic simplification in DataFramesMeta macros](https://discourse.julialang.org/t/using-symbolic-simplification-in-dataframesmeta-macros/119446)

<div class="topic-metadata">

**Author:** [@s-baumann](https://discourse.julialang.org/u/s-baumann)\
**Replies:** 8\
**Last updated:** [September 15, 2024, 11:28pm UTC](https://discourse.julialang.org/t/using-symbolic-simplification-in-dataframesmeta-macros/119446 "2024-09-15T23:28:30Z")

</div>

In DataFramesMeta it is possible to evaluate algebraic combinations and calculations involving the column names of a DataFrame. Is it possible (in DataFramesMeta or another package that can be placed inside as part of i…

---

## [How to use @byrow inside @chain pipeline?](https://discourse.julialang.org/t/how-to-use-byrow-inside-chain-pipeline/115184)

<div class="topic-metadata">

**Author:** [@Gregstrq](https://discourse.julialang.org/u/Gregstrq)\
**Replies:** 2\
**Last updated:** [June 4, 2024, 5:36pm UTC](https://discourse.julialang.org/t/how-to-use-byrow-inside-chain-pipeline/115184 "2024-06-04T17:36:01Z")

</div>

I am trying to organize a pipeline for data processing using the @chain macro. However, I have a problem with using @byrow macro inside this pipeline. I get an error saying that @byrow is deprecated outside of DataFrames…

---

## [Can DataFramesMeta replace dummy values for all columns of a specific type](https://discourse.julialang.org/t/can-dataframesmeta-replace-dummy-values-for-all-columns-of-a-specific-type/113149)

<div class="topic-metadata">

**Author:** [@jjAtNxtPt](https://discourse.julialang.org/u/jjAtNxtPt)\
**Replies:** 12\
**Last updated:** [April 18, 2024, 7:36pm UTC](https://discourse.julialang.org/t/can-dataframesmeta-replace-dummy-values-for-all-columns-of-a-specific-type/113149 "2024-04-18T19:36:46Z")

</div>

I’ve been trying to figure out a way to have DataFramesMet perform this operation: transform!(df2, names(df2, String) .=\> (t -\> replace(t, ""=\>missing)), renamecols=false) General: Replace dummy value for all columns …

---

## [Programmatically adding multiple colums to a dataframe](https://discourse.julialang.org/t/programmatically-adding-multiple-colums-to-a-dataframe/111983)

<div class="topic-metadata">

**Author:** [@pascal](https://discourse.julialang.org/u/pascal)\
**Replies:** 4\
**Last updated:** [March 22, 2024, 7:10pm UTC](https://discourse.julialang.org/t/programmatically-adding-multiple-colums-to-a-dataframe/111983 "2024-03-22T19:10:39Z")

</div>

Suppose I have the following code: n = \["a\_" \* string(i) for i in 1:3\] v = \[1,2,3\] df = DataFrame(a = \[1, 2\], b = \[3, 4\]) df\_new = @chain df begin @transform $(n\[1\]) = v\[1\] end Can I change the @transform to add 3 …

---

## [\[ANN\] DataFramesMeta.jl v 0.15.0 Release](https://discourse.julialang.org/t/ann-dataframesmeta-jl-v-0-15-0-release/111144)

<div class="topic-metadata">

**Author:** [@pdeffebach](https://discourse.julialang.org/u/pdeffebach)\
**Replies:** 0\
**Last updated:** [March 4, 2024, 6:24pm UTC](https://discourse.julialang.org/t/ann-dataframesmeta-jl-v-0-15-0-release/111144 "2024-03-04T18:24:12Z")

</div>

DataFramesMeta 0.15.0 Announcement I’m happy to announce the version 0.15.0 release of DataFramesmeta.jl! We’ve added three new features that users wil like. Multi-column selection in @select The @groupby macro for ea…

---

## [How can I make this DataFramesMeta operation work?](https://discourse.julialang.org/t/how-can-i-make-this-dataframesmeta-operation-work/109640)

<div class="topic-metadata">

**Author:** [@mthelm85](https://discourse.julialang.org/u/mthelm85)\
**Replies:** 3\
**Last updated:** [February 2, 2024, 8:19pm UTC](https://discourse.julialang.org/t/how-can-i-make-this-dataframesmeta-operation-work/109640 "2024-02-02T20:19:01Z")

</div>

I have a DataFrame that has a PWGTP column, and then 80 additional columns named PWGTP1…PWGTP80. I’m trying to do the following: total = @chain vt18 begin @rsubset( :AGEP in 21:64, :DIS == 1 ) @combine( :total …

---

## [Chain.jl error](https://discourse.julialang.org/t/chain-jl-error/75970)

<div class="topic-metadata">

**Author:** [@Rahul](https://discourse.julialang.org/u/Rahul)\
**Replies:** 4\
**Last updated:** [January 16, 2024, 8:11pm UTC](https://discourse.julialang.org/t/chain-jl-error/75970 "2024-01-16T20:11:42Z")

</div>

@chain throws an error that I cannot understand. Please help. Thanks! Code and error below: julia\> a = DataFrame(x=1:10, y=2:11) 10×2 DataFrame Row │ x y │ Int64 Int64 ─────┼────────────── 1 │ …

---

## [A lagged table-join for finding the last ten rows that meets a criterion, for each row](https://discourse.julialang.org/t/a-lagged-table-join-for-finding-the-last-ten-rows-that-meets-a-criterion-for-each-row/108352)

<div class="topic-metadata">

**Author:** [@Cong](https://discourse.julialang.org/u/Cong)\
**Replies:** 6\
**Last updated:** [January 4, 2024, 10:54pm UTC](https://discourse.julialang.org/t/a-lagged-table-join-for-finding-the-last-ten-rows-that-meets-a-criterion-for-each-row/108352 "2024-01-04T22:54:45Z")

</div>

I have a dataframe like below. I am trying to add 6 columns to it: Out1Bac1, Out1Bac2, Out1Bac3, Out2Bac1, Out2Bac2, Out2Bac3. For each row, find the last row whose abschoice equals the CP1 of the current row, and get t…

---

## [Trouble translating some dplyr code to DataFramesMeta](https://discourse.julialang.org/t/trouble-translating-some-dplyr-code-to-dataframesmeta/107555)

<div class="topic-metadata">

**Author:** [@wasser\_m](https://discourse.julialang.org/u/wasser_m)\
**Replies:** 2\
**Last updated:** [December 13, 2023, 5:28pm UTC](https://discourse.julialang.org/t/trouble-translating-some-dplyr-code-to-dataframesmeta/107555 "2023-12-13T17:28:58Z")

</div>

I’m quite new to DataFrames and tried to translate some of my R code to Julia. Here is my R code: df |\> left\_join(df2, by="customer") |\> left\_join(df3, by="order") |\> left\_join(df4, by="item") |\> group\_by(order…

---

## [Unexpected behavior when using Impute.locf within @by](https://discourse.julialang.org/t/unexpected-behavior-when-using-impute-locf-within-by/105642)

<div class="topic-metadata">

**Author:** [@BeitianMa](https://discourse.julialang.org/u/BeitianMa)\
**Replies:** 2\
**Last updated:** [November 1, 2023, 3:12pm UTC](https://discourse.julialang.org/t/unexpected-behavior-when-using-impute-locf-within-by/105642 "2023-11-01T15:12:24Z")

</div>

As the following code shows, i want to forward fill missing values use Impute.locf function, but just within the same :id using DataFramesMeta, Impute df = DataFrame(id = repeat(1:3, 2), value = \[1,missing,3,4,missing,…

---

## [DataframesMeta track row number](https://discourse.julialang.org/t/dataframesmeta-track-row-number/104441)

<div class="topic-metadata">

**Author:** [@vtomar](https://discourse.julialang.org/u/vtomar)\
**Replies:** 2\
**Last updated:** [October 1, 2023, 1:31pm UTC](https://discourse.julialang.org/t/dataframesmeta-track-row-number/104441 "2023-10-01T13:31:42Z")

</div>

When using each row, you can track row number as shown below for (i, row) in enumerate( eachrow( test\_df ) ) # do something with row and i end but how do I track the row number in each iteration when using DataF…

---

## [Using DataFrames to split overlapping datetime intervals into non overlapping intervals](https://discourse.julialang.org/t/using-dataframes-to-split-overlapping-datetime-intervals-into-non-overlapping-intervals/101149)

<div class="topic-metadata">

**Author:** [@vtomar](https://discourse.julialang.org/u/vtomar)\
**Replies:** 9\
**Last updated:** [July 23, 2023, 7:00am UTC](https://discourse.julialang.org/t/using-dataframes-to-split-overlapping-datetime-intervals-into-non-overlapping-intervals/101149 "2023-07-23T07:00:58Z")

</div>

test = DataFrame(Time1 = \[DateTime(2022, 1, 1, 10, 0, 0), DateTime(2022, 1, 1, 10, 5, 0), DateTime(2022, 1, 1, 10, 14, 0)\], Time2 = \[DateTime(2022, 1, 1, 10, 15, 0), DateTime(2022, 1, 1, 10, 10, 0), DateTime(2022, 1, 1…

---

## [Combining elements from multiple rows by conditionals into columns with DataFramesMeta](https://discourse.julialang.org/t/combining-elements-from-multiple-rows-by-conditionals-into-columns-with-dataframesmeta/101097)

<div class="topic-metadata">

**Author:** [@alequa](https://discourse.julialang.org/u/alequa)\
**Replies:** 10\
**Last updated:** [July 5, 2023, 3:41pm UTC](https://discourse.julialang.org/t/combining-elements-from-multiple-rows-by-conditionals-into-columns-with-dataframesmeta/101097 "2023-07-05T15:41:49Z")

</div>

Hello, I want to create a new dataframe with a column computed from one or more columns of the initial dataframe. using DataFramesMeta df1 = DataFrame(category = \[1,0,1,0\], group=\[1,1,0,0\], measure = \[401, 402, 200, 3…

---

## [Convert code from DataFrames version to DataFramesMeta](https://discourse.julialang.org/t/convert-code-from-dataframes-version-to-dataframesmeta/98824)

<div class="topic-metadata">

**Author:** [@hungpham3112](https://discourse.julialang.org/u/hungpham3112)\
**Replies:** 1\
**Last updated:** [May 14, 2023, 8:15am UTC](https://discourse.julialang.org/t/convert-code-from-dataframes-version-to-dataframesmeta/98824 "2023-05-14T08:15:44Z")

</div>

DataFrames (successful): lst = describe(df)\[(describe(df)."nmissing" .\> 0 .&& describe(df)."variable" .!= :x26), :variable\] DataFramesMeta: lst = @chain describe(df) begin @rsubset :nmissing \> 0 @select :variable …

---

## [Weird behaviour when replace the empty string in row with DataFramesMeta.jl](https://discourse.julialang.org/t/weird-behaviour-when-replace-the-empty-string-in-row-with-dataframesmeta-jl/96165)

<div class="topic-metadata">

**Author:** [@hungpham3112](https://discourse.julialang.org/u/hungpham3112)\
**Replies:** 4\
**Last updated:** [March 16, 2023, 8:20am UTC](https://discourse.julialang.org/t/weird-behaviour-when-replace-the-empty-string-in-row-with-dataframesmeta-jl/96165 "2023-03-16T08:20:28Z")

</div>

I have a snippet string\_number\_df2 = DataFrame( A = \["1", "", "3"\], B = \["4", "5", ""\], ) result = @chain string\_number\_df2 begin @rtransform :B = replace(:B, "" =\> missing) end Expectation: A | B…

---

## [Chain the transformation without @chain macro](https://discourse.julialang.org/t/chain-the-transformation-without-chain-macro/95955)

<div class="topic-metadata">

**Author:** [@hungpham3112](https://discourse.julialang.org/u/hungpham3112)\
**Replies:** 4\
**Last updated:** [March 12, 2023, 10:24pm UTC](https://discourse.julialang.org/t/chain-the-transformation-without-chain-macro/95955 "2023-03-12T22:24:40Z")

</div>

Reading the DataFramesMeta.jl document helps me learn a clean way to chain the transformation with the @chain macro. From its document: @chain msleep begin @select :name :sleep\_total @rsubset :sleep\_total \> 16…

---

## [Struggling to migrate from R (dplyr) to Julia (DataFrameMeta)](https://discourse.julialang.org/t/struggling-to-migrate-from-r-dplyr-to-julia-dataframemeta/94473)

<div class="topic-metadata">

**Author:** [@Philip\_Rhome](https://discourse.julialang.org/u/Philip_Rhome)\
**Replies:** 10\
**Last updated:** [February 13, 2023, 11:16am UTC](https://discourse.julialang.org/t/struggling-to-migrate-from-r-dplyr-to-julia-dataframemeta/94473 "2023-02-13T11:16:32Z")

</div>

hello dear julia developers i’m new to julia and i’m fascinated by the power and performance of this great language i’m trying to convert my notebooks in R to Julia to help me learn it but the issue is that i’m stuck w…

---

## [UndefVarError: .\* not defined when grouping with DataframesMeta](https://discourse.julialang.org/t/undefvarerror-not-defined-when-grouping-with-dataframesmeta/93115)

<div class="topic-metadata">

**Author:** [@a.frist](https://discourse.julialang.org/u/a.frist)\
**Replies:** 5\
**Last updated:** [January 28, 2023, 11:45pm UTC](https://discourse.julialang.org/t/undefvarerror-not-defined-when-grouping-with-dataframesmeta/93115 "2023-01-28T23:45:38Z")

</div>

Hello all, I ran into a problem when running a Julia script. The following code produces an error: UndefVarError: .\* not defined The offending Code: group = groupby(my\_dataframe, \[:COLUMN\_1, :COLUMN\_2\]) bet…

---

## [Confusing/misleading error message for a beginner](https://discourse.julialang.org/t/confusing-misleading-error-message-for-a-beginner/91277)

<div class="topic-metadata">

**Author:** [@einar](https://discourse.julialang.org/u/einar)\
**Replies:** 10\
**Last updated:** [December 13, 2022, 3:42am UTC](https://discourse.julialang.org/t/confusing-misleading-error-message-for-a-beginner/91277 "2022-12-13T03:42:48Z")

</div>

Note: This was originally meant to be a question, but I solved it along the way. However, I want to post it here anyway because it feels as a common beginner mistake and I wonder what could be done to improve the error m…

---

## [Broadcast transformed data from single row to multiple columns](https://discourse.julialang.org/t/broadcast-transformed-data-from-single-row-to-multiple-columns/91275)

<div class="topic-metadata">

**Author:** [@daharn](https://discourse.julialang.org/u/daharn)\
**Replies:** 13\
**Last updated:** [December 7, 2022, 1:27pm UTC](https://discourse.julialang.org/t/broadcast-transformed-data-from-single-row-to-multiple-columns/91275 "2022-12-07T13:27:04Z")

</div>

Suppose I have a DataFrame like this df = DataFrame("a" =\> \[1,2\], "b" =\> \[3,4\]) 2×2 DataFrame Row │ a b │ Int64 Int64 ─────┼────────────── 1 │ 1 3 2 │ 2 4 and I want to calcu…

---

## [Working with multiple columns in DataFramesMeta, programmatically](https://discourse.julialang.org/t/working-with-multiple-columns-in-dataframesmeta-programmatically/91056)

<div class="topic-metadata">

**Author:** [@mthelm85](https://discourse.julialang.org/u/mthelm85)\
**Replies:** 10\
**Last updated:** [November 30, 2022, 7:27pm UTC](https://discourse.julialang.org/t/working-with-multiple-columns-in-dataframesmeta-programmatically/91056 "2022-11-30T19:27:11Z")

</div>

Suppose I have the following DataFrame: test = DataFrame( w = \[10, 13, 5\], a1 = \[12, 9, 6\], a2 = \[9, 10, 8\], a3 = \[14, 10, 12\] ) 3×4 DataFrame Row │ w a1 a2 a3 │ Int64 Int64 Int…

---

## [Summarize all or selected columns in grouped DataFrame](https://discourse.julialang.org/t/summarize-all-or-selected-columns-in-grouped-dataframe/90509)

<div class="topic-metadata">

**Author:** [@mreichMPI-BGC](https://discourse.julialang.org/u/mreichMPI-BGC)\
**Replies:** 8\
**Last updated:** [November 20, 2022, 6:56pm UTC](https://discourse.julialang.org/t/summarize-all-or-selected-columns-in-grouped-dataframe/90509 "2022-11-20T18:56:20Z")

</div>

Dear community, how can I summarize all columns of a GroupedDataFrame with DataFramesMeta? Like this in DataFrames: df = DataFrame(rand(20,5), :auto) df\[!, :gr\] = repeat(1:4; inner=5) dsum=combine(groupby(df, :gr), n…

---

## [How DataFramesMeta @by works if you want to groupby two columns?](https://discourse.julialang.org/t/how-dataframesmeta-by-works-if-you-want-to-groupby-two-columns/89305)

<div class="topic-metadata">

**Author:** [@Juan\_Mac\_Donagh](https://discourse.julialang.org/u/Juan_Mac_Donagh)\
**Replies:** 10\
**Last updated:** [October 31, 2022, 10:33am UTC](https://discourse.julialang.org/t/how-dataframesmeta-by-works-if-you-want-to-groupby-two-columns/89305 "2022-10-31T10:33:14Z")

</div>

Hi all, I was reading the DataFramesMeta docu trying to solve a small issue that I have, but I couldn’t find the answer. Any help is welcome! Basically, I have a df that looks like this: df = DataFrame( a =…

---

## [How does @orderby work with multiple columns?](https://discourse.julialang.org/t/how-does-orderby-work-with-multiple-columns/88155)

<div class="topic-metadata">

**Author:** [@huguesmp](https://discourse.julialang.org/u/huguesmp)\
**Replies:** 3\
**Last updated:** [October 3, 2022, 5:08pm UTC](https://discourse.julialang.org/t/how-does-orderby-work-with-multiple-columns/88155 "2022-10-03T17:08:26Z")

</div>

Hello everyone, I’m a new Julia user coming from an R/dplyr background. I’m going through the “Tutorial for coming from dplyr” on the DataFramesMeta.jl documentation site, specifically the @orderby section using Chain.…

[Next page](https://discourse.julialang.org/tag/dataframesmeta/879.md?match_all_tags=true&page=1&tags%5B%5D=dataframesmeta)
