# No method matching getindex for XLSX?

**URL:** <https://discourse.julialang.org/t/no-method-matching-getindex-for-xlsx/92538>\
**Category:** New to Julia\
**Created:** [January 5, 2023, 5:11am UTC](https://discourse.julialang.org/t/no-method-matching-getindex-for-xlsx/92538 "2023-01-05T05:11:57Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![probit2011](https://avatars.discourse-cdn.com/v4/letter/p/919ad9/32.png) [@probit2011](https://discourse.julialang.org/u/probit2011)\
**Post date:** [January 5, 2023, 5:11am UTC](https://discourse.julialang.org/t/no-method-matching-getindex-for-xlsx/92538/1 "2023-01-05T05:11:57Z")

</div>

I have been trying to progress with the tutorials from Julia Academy, this time with the Data Science tutorial ([here](https://juliaacademy.com/courses/937702/lectures/17339299)). I am trying to use the first notebook (Data.ipynb) with the Jupyter facilities within VS Code. I chose VS Code, as I couldn’t (still) build some packages that were meant to be used in the tutorial (see [this topic](https://discourse.julialang.org/t/unable-to-build-pycall-and-rcall/92439/21)).

The notebook appears to correctly load the package `XLSX` and I am able to load the Zillow table:

 ![image](https://global.discourse-cdn.com/julialang/original/3X/c/e/cee46a80fd09f96d49b21e54846c46a0ec748642.png)

G is meant to be a tuple with two elements. When I try to access the first element (G[1]), I am greeted with the following error message:

 ![image](https://global.discourse-cdn.com/julialang/original/3X/b/2/b256894c28e1b500aef868f41e6ac7ae94faba16.png)

What is really going on here???

---

<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:** [January 5, 2023, 6:22am UTC](https://discourse.julialang.org/t/no-method-matching-getindex-for-xlsx/92538/2 "2023-01-05T06:22:34Z")

</div>

What’s going on is that since v0.11 XLSX.jl doesn’t return a tuple any longer but a Tables.jl compatible table. That’s what the error is telling you - the thing you’re indexing into is not a tuple but a `XLSX.DataTable`.

You can turn this table into a DataFrame by just calling `DataFrame(G)`

---

<div class="post-metadata">

**Author:** ![probit2011](https://avatars.discourse-cdn.com/v4/letter/p/919ad9/32.png) [@probit2011](https://discourse.julialang.org/u/probit2011)\
**Post date:** [January 5, 2023, 6:26am UTC](https://discourse.julialang.org/t/no-method-matching-getindex-for-xlsx/92538/3 "2023-01-05T06:26:44Z")

</div>

Thanks @nilshg . In that case, may I suggest that the tutorial(s) get updated, because some of the content is misleading (as shown above).

---

<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:** [January 5, 2023, 6:29am UTC](https://discourse.julialang.org/t/no-method-matching-getindex-for-xlsx/92538/4 "2023-01-05T06:29:48Z")

</div>

That’s tricky of course with video content - normally the best thing to do is to just provide a Manifest file so that people can recreate the tutorial with the same package versions used when the tutorial was made, but I’m not sure whether that’s available in this case.

---

<div class="post-metadata">

**Author:** ![probit2011](https://avatars.discourse-cdn.com/v4/letter/p/919ad9/32.png) [@probit2011](https://discourse.julialang.org/u/probit2011)\
**Post date:** [January 5, 2023, 7:14am UTC](https://discourse.julialang.org/t/no-method-matching-getindex-for-xlsx/92538/5 "2023-01-05T07:14:43Z")

</div>

Looks like the “tutorial” for XLSX.jl also needs some updating (this was correct for version 0.7.2; XLSX is now 0.8.4):

 ![image](https://global.discourse-cdn.com/julialang/original/3X/4/a/4a3f4edfba6f1c864ce4871925ce102b394dcb74.png)

---

<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:** [January 5, 2023, 9:10am UTC](https://discourse.julialang.org/t/no-method-matching-getindex-for-xlsx/92538/6 "2023-01-05T09:10:35Z")

</div>

But you are looking at the documentation for version 0.7.2 (see the URL in your screenshot), for which `DataFrame(XLSX.readtable(...)...)` is the correct way of getting a DataFrame from an Excel file. It clearly wouldn’t be sensible to change the documentation for older versions of a package to match the API of newer versions, which wouldn’t be applicable for the older version.

Here’s the section “Read Tabular Data” for the current (“stable”) version of the package:

[https://felipenoris.github.io/XLSX.jl/stable/tutorial/#Read-Tabular-Data](https://felipenoris.github.io/XLSX.jl/stable/tutorial/#Read-Tabular-Data)

This correctly omits the splatting operator from the call to `DataFrame`, reflecting the new return type of `XLSX.readtable`. The older docs you are looking at are here:

[https://felipenoris.github.io/XLSX.jl/v0.7/tutorial/#Read-Tabular-Data](https://felipenoris.github.io/XLSX.jl/v0.7/tutorial/#Read-Tabular-Data)

and correctly describe how to construct a DataFrame from `XLSX.readtable` with older XLSX versions.
