# How to take the average value for each type in the job title column?

**URL:** <https://discourse.julialang.org/t/how-to-take-the-average-value-for-each-type-in-the-job-title-column/89710>\
**Category:** Data\
**Tags:** question, dataframes, inmemorydatasets\
**Created:** [November 3, 2022, 10:48am UTC](https://discourse.julialang.org/t/how-to-take-the-average-value-for-each-type-in-the-job-title-column/89710 "2022-11-03T10:48:30Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![akshdfyehd](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/akshdfyehd/32/39097_2.png) [@akshdfyehd](https://discourse.julialang.org/u/akshdfyehd)\
**Post date:** [November 3, 2022, 10:48am UTC](https://discourse.julialang.org/t/how-to-take-the-average-value-for-each-type-in-the-job-title-column/89710/1 "2022-11-03T10:48:30Z")

</div>

Hi, I have met the problem that for same employment type, there are different salary coressponding to the same job title, but I only need one salary value for one job title, can someone please give me some advices about how to take the average of those same job titles?

 ![1667472438921](https://global.discourse-cdn.com/julialang/original/3X/6/e/6ea791186d2344cf0a074f8782601a7dda214785.png)  
thanks in advance!

---

<div class="post-metadata">

**Author:** ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)\
**Post date:** [November 3, 2022, 11:07am UTC](https://discourse.julialang.org/t/how-to-take-the-average-value-for-each-type-in-the-job-title-column/89710/2 "2022-11-03T11:07:03Z")

</div>

See:

[https://sl-solution.github.io/InMemoryDatasets.jl/stable/man/aggregation/#combine](https://sl-solution.github.io/InMemoryDatasets.jl/stable/man/aggregation/#combine)

---

<div class="post-metadata">

**Author:** ![akshdfyehd](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/akshdfyehd/32/39097_2.png) [@akshdfyehd](https://discourse.julialang.org/u/akshdfyehd)\
**Post date:** [November 3, 2022, 12:25pm UTC](https://discourse.julialang.org/t/how-to-take-the-average-value-for-each-type-in-the-job-title-column/89710/3 "2022-11-03T12:25:48Z")

</div>

Hi, thanks for the reply! I think I know how to do that step now.  
But the problem is, the graph above comes from a large dataset, which I have used filter from Dataframe package (because I didn’t figure out how to use IMD filter to extract all rows have employment type is FT):

 ![1667478124413](https://global.discourse-cdn.com/julialang/original/3X/3/7/374808cd732e88640b079b0c3a4c1d765a6ab541.png)  
and when I was follow the link you gave me, the error was  
 ![1667478245293](https://global.discourse-cdn.com/julialang/original/3X/e/3/e3a4d6fa54cfca9fdbfcd900f8ea64d1e9bc86b4.png)  
I have googled it but I didn’t find any solutions, can you help me with that please?

---

<div class="post-metadata">

**Author:** ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)\
**Post date:** [November 3, 2022, 12:36pm UTC](https://discourse.julialang.org/t/how-to-take-the-average-value-for-each-type-in-the-job-title-column/89710/4 "2022-11-03T12:36:19Z")

</div>

Exactly as the error says: `DataFrames` and `InMemoryDatasets` both export a function named `groupby`, so you have to make clear which one you want by calling either `DataFrames.groupby` or `InMemoryDatasets`.

I would advise against using these packages at the same time. `DataFrames` has been around for a long time and there are a bunch of excellent learning resources, e.g. here for the type of split/apply/combine stuff you’re looking to do:

> <https://github.com/bkamins/Julia-DataFrames-Tutorial/blob/master/10_transforms.ipynb>
