# This code do not works anymore after julia 1.5.3 update

**URL:** <https://discourse.julialang.org/t/this-code-do-not-works-anymore-after-julia-1-5-3-update/50452>\
**Category:** General Usage\
**Tags:** dataframes\
**Created:** [November 19, 2020, 6:20pm UTC](https://discourse.julialang.org/t/this-code-do-not-works-anymore-after-julia-1-5-3-update/50452 "2020-11-19T18:20:37Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![jcbritobr](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jcbritobr/32/219275_2.png) [@jcbritobr](https://discourse.julialang.org/u/jcbritobr)\
**Post date:** [November 19, 2020, 6:20pm UTC](https://discourse.julialang.org/t/this-code-do-not-works-anymore-after-julia-1-5-3-update/50452/1 "2020-11-19T18:20:37Z")

</div>

Hello, good day. I updated my environment to julia 1.5.3 and a lot of project I had stoped work.  
This code do not works anymore. Someone knows why it stoped work?

```julia
setosa_df = iris[iris[:species] .== "setosa", :]

```

> ERROR: LoadError: MethodError: no method matching getindex(::DataFrame, ::Symbol)

---

<div class="post-metadata">

**Author:** ![jcbritobr](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jcbritobr/32/219275_2.png) [@jcbritobr](https://discourse.julialang.org/u/jcbritobr)\
**Post date:** [November 19, 2020, 6:22pm UTC](https://discourse.julialang.org/t/this-code-do-not-works-anymore-after-julia-1-5-3-update/50452/2 "2020-11-19T18:22:58Z")

</div>

Was some interfaces broked in this update?

---

<div class="post-metadata">

**Author:** ![alejandromerchan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/alejandromerchan/32/10500_2.png) [@alejandromerchan](https://discourse.julialang.org/u/alejandromerchan)\
**Post date:** [November 19, 2020, 6:34pm UTC](https://discourse.julialang.org/t/this-code-do-not-works-anymore-after-julia-1-5-3-update/50452/3 "2020-11-19T18:34:56Z")

</div>

I don’t know the exact answer to your question, but this is probably related to a recent DataFrames update and not to the Julia update. What version of DataFrames are you using? The latest release was 0.22 and was breaking.

---

<div class="post-metadata">

**Author:** ![jcbritobr](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jcbritobr/32/219275_2.png) [@jcbritobr](https://discourse.julialang.org/u/jcbritobr)\
**Post date:** [November 19, 2020, 6:36pm UTC](https://discourse.julialang.org/t/this-code-do-not-works-anymore-after-julia-1-5-3-update/50452/4 "2020-11-19T18:36:48Z")

</div>

I was using that Installed DataFrames v0.22.0. There is a way to workaround tha issue?

---

<div class="post-metadata">

**Author:** ![alejandromerchan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/alejandromerchan/32/10500_2.png) [@alejandromerchan](https://discourse.julialang.org/u/alejandromerchan)\
**Post date:** [November 19, 2020, 6:41pm UTC](https://discourse.julialang.org/t/this-code-do-not-works-anymore-after-julia-1-5-3-update/50452/5 "2020-11-19T18:41:27Z")

</div>

I’ll ping @bkamins, he’ll confirm if this a DataFrames issue or something else. And he can help solving it.

EDIT: also @pdeffebach and @nalimilan could probably help.

---

<div class="post-metadata">

**Author:** ![Skoffer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/skoffer/32/378_2.png) [@Skoffer](https://discourse.julialang.org/u/Skoffer)\
**Post date:** [November 19, 2020, 6:46pm UTC](https://discourse.julialang.org/t/this-code-do-not-works-anymore-after-julia-1-5-3-update/50452/6 "2020-11-19T18:46:56Z")

</div>

Something like this should work, but definitely there were deprecation warnings in previous versions of DataFrames

```julia
setosa_df = iris[iris.species .== "setosa", :]

```

---

<div class="post-metadata">

**Author:** ![jcbritobr](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jcbritobr/32/219275_2.png) [@jcbritobr](https://discourse.julialang.org/u/jcbritobr)\
**Post date:** [November 19, 2020, 6:50pm UTC](https://discourse.julialang.org/t/this-code-do-not-works-anymore-after-julia-1-5-3-update/50452/8 "2020-11-19T18:50:25Z")

</div>

It works. Seems dataframes is not indentifying :column symbols.

---

<div class="post-metadata">

**Author:** ![jcbritobr](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jcbritobr/32/219275_2.png) [@jcbritobr](https://discourse.julialang.org/u/jcbritobr)\
**Post date:** [November 19, 2020, 6:54pm UTC](https://discourse.julialang.org/t/this-code-do-not-works-anymore-after-julia-1-5-3-update/50452/9 "2020-11-19T18:54:31Z")

</div>

Hello Andrei,  
I hadn’t this issue because I did a clean install. Deleted all that folders before install. The only issue was in the libraries.

ERROR: LoadError: MethodError: no method matching getindex(::DataFrame, ::Symbol)  
Closest candidates are:  
getindex(::DataFrame, ::Integer, ::Union{Signed, Unsigned})

---

<div class="post-metadata">

**Author:** ![nalimilan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nalimilan/32/147_2.png) [@nalimilan](https://discourse.julialang.org/u/nalimilan)\
**Post date:** [November 19, 2020, 6:57pm UTC](https://discourse.julialang.org/t/this-code-do-not-works-anymore-after-julia-1-5-3-update/50452/10 "2020-11-19T18:57:33Z")

</div>

Yes this syntax has been deprecated for years. Use `df[rows, :]` instead. You can go back to 0.21 and enable deprecation warnings to help porting your code.

---

<div class="post-metadata">

**Author:** ![jcbritobr](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jcbritobr/32/219275_2.png) [@jcbritobr](https://discourse.julialang.org/u/jcbritobr)\
**Post date:** [November 19, 2020, 7:02pm UTC](https://discourse.julialang.org/t/this-code-do-not-works-anymore-after-julia-1-5-3-update/50452/11 "2020-11-19T19:02:01Z")

</div>

I was thinking that using :symbols was the best option. Did not knew that it was deprecated.

---

<div class="post-metadata">

**Author:** ![bkamins](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bkamins/32/208538_2.png) [@bkamins](https://discourse.julialang.org/u/bkamins)\
**Post date:** [November 19, 2020, 7:05pm UTC](https://discourse.julialang.org/t/this-code-do-not-works-anymore-after-julia-1-5-3-update/50452/12 "2020-11-19T19:05:34Z")

</div>

You can use:

```julia
df.column
df."column"
df[:, :column]
df[:, "column"]
df[!, :column] # no copy version of df[:, :column]
df[!, "column"] # no copy version of df[:, "column"]

```

As @nalimilan commented:

```julia
df[:column]

```

has been deprecated for over a year. `DataFrame` is 2-dimensional not 1-dimensional.

---

<div class="post-metadata">

**Author:** ![bkamins](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bkamins/32/208538_2.png) [@bkamins](https://discourse.julialang.org/u/bkamins)\
**Post date:** [November 19, 2020, 7:08pm UTC](https://discourse.julialang.org/t/this-code-do-not-works-anymore-after-julia-1-5-3-update/50452/13 "2020-11-19T19:08:06Z")

</div>

> [@jcbritobr](#):
>
> `iris[iris[:species] .== "setosa", :]`

An alternative way to write this is:

```julia-auto
filter(:species => ==("setosa"), iris)

```

---

<div class="post-metadata">

**Author:** ![dmolina](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dmolina/32/5246_2.png) [@dmolina](https://discourse.julialang.org/u/dmolina)\
**Post date:** [November 19, 2020, 7:08pm UTC](https://discourse.julialang.org/t/this-code-do-not-works-anymore-after-julia-1-5-3-update/50452/14 "2020-11-19T19:08:28Z")

</div>

The problem cames because that syntax is depredated from a time.

The solution is:

```julia
setosa_df = iris[iris[:, :species] .== "setosa", :]

```

or

```julia
setosa_df = iris[iris[!, :species] .== "setosa", :]

```

You can indicate or _iris[:, :species]_, in that case you are using a copy. Another option is _iris[!, :species]_ if you want to use a view.

Also you can use the new syntax (from 0.21):

```julia
setosa_df = filter(:species => ==("setosa"), iris)

```

it is more different, but it is a bit more readable in my opinion.

---

<div class="post-metadata">

**Author:** ![jcbritobr](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jcbritobr/32/219275_2.png) [@jcbritobr](https://discourse.julialang.org/u/jcbritobr)\
**Post date:** [November 19, 2020, 7:12pm UTC](https://discourse.julialang.org/t/this-code-do-not-works-anymore-after-julia-1-5-3-update/50452/15 "2020-11-19T19:12:24Z")

</div>

I’ll need update my knowlege about julia and dataframes. Thank you guys.
