# Findfirst ERROR: MethodError: no method matching keys

**URL:** <https://discourse.julialang.org/t/findfirst-error-methoderror-no-method-matching-keys/36292>\
**Category:** General Usage\
**Tags:** question, error\
**Created:** [March 21, 2020, 8:04am UTC](https://discourse.julialang.org/t/findfirst-error-methoderror-no-method-matching-keys/36292 "2020-03-21T08:04:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![yakir12](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yakir12/32/297_2.png) [@yakir12](https://discourse.julialang.org/u/yakir12)\
**Post date:** [March 21, 2020, 8:04am UTC](https://discourse.julialang.org/t/findfirst-error-methoderror-no-method-matching-keys/36292/1 "2020-03-21T08:04:52Z")

</div>

I’m sure this is addressed somewhere, I just can’t (drum-roll) find it.

Given some matrix, I want to find the first row whose sum is odd:

```julia
julia> m = [0 0 0; 1 1 1; 2 2 2]
3×3 Array{Int64,2}:
 0 0 0
 1 1 1
 2 2 2

julia> map(isodd∘sum, eachrow(m))
3-element Array{Bool,1}:
 0
 1
 0

```

But this errors:

```julia
julia> findfirst(isodd∘sum, eachrow(m))
ERROR: MethodError: no method matching keys(::Base.Generator{Base.OneTo{Int64},Base.var"#174#175"{Array{Int64,2}}})
Closest candidates are:
  keys(::Core.SimpleVector) at essentials.jl:602
  keys(::Cmd) at process.jl:639
  keys(::LibGit2.GitTree) at /home/yakir/.julia/packages/Revise/S7mrl/src/git.jl:52
  ...
Stacktrace:
 [1] pairs(::Base.Generator{Base.OneTo{Int64},Base.var"#174#175"{Array{Int64,2}}}) at ./abstractdict.jl:132
 [2] findfirst(::Base.var"#56#57"{typeof(isodd),typeof(sum)}, ::Base.Generator{Base.OneTo{Int64},Base.var"#174#175"{Array{Int64,2}}}) at ./array.jl:1747
 [3] top-level scope at REPL[149]:1

```

---

<div class="post-metadata">

**Author:** ![fredrikekre](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fredrikekre/32/1688_2.png) [@fredrikekre](https://discourse.julialang.org/u/fredrikekre)\
**Post date:** [March 21, 2020, 8:17am UTC](https://discourse.julialang.org/t/findfirst-error-methoderror-no-method-matching-keys/36292/2 "2020-03-21T08:17:57Z")

</div>

See [keys(::Generator) for find\* and arg\* · Issue #34674 · JuliaLang/julia · GitHub](https://github.com/JuliaLang/julia/issues/34674), [keys(::Generator) pass through by rapus95 · Pull Request #34678 · JuliaLang/julia · GitHub](https://github.com/JuliaLang/julia/pull/34678).
