# Count number of substrings in dataframe column

**URL:** <https://discourse.julialang.org/t/count-number-of-substrings-in-dataframe-column/9036>\
**Category:** Data\
**Created:** [February 13, 2018, 3:26pm UTC](https://discourse.julialang.org/t/count-number-of-substrings-in-dataframe-column/9036 "2018-02-13T15:26:25Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![piever](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/piever/32/1815_2.png) [@piever](https://discourse.julialang.org/u/piever)\
**Post date:** [February 13, 2018, 4:12pm UTC](https://discourse.julialang.org/t/count-number-of-substrings-in-dataframe-column/9036/4 "2018-02-13T16:12:47Z")

</div>

You cannot pin a package to a version you don’t have yet. You can maybe use [this trick](https://discourse.julialang.org/t/how-to-find-package-preventing-others-from-updating/8235) to figure out what’s holding DataFrames from upgrading, see also [this thread](https://discourse.julialang.org/t/how-to-upgrade-from-dataframes-0-10-1-to-0-11-3/8243). Then if you don’t need them, you could remove the packages that are holding you back and proceed to update DataFrames. Gadfly or ExcelReaders are likely candidates of packages that have not yet become compatible with the new DataFrames, but maybe in your case it’s something else.

As per the problem per se, once you update to DataFrames 0.11, you can do either:

`count(t -> contains(t, "X"), data[:CITY])`

or, if you have missing data you want to skip in the `CITY` column:

`count(t -> contains(t, "X"), skipmissing(data[:CITY]))`

---

_[View the full topic](https://discourse.julialang.org/t/count-number-of-substrings-in-dataframe-column/9036)._
