JuliaAcademy / DataScience

Data Science in Julia course for JuliaAcademy.com, taught by Huda Nassar
https://juliaacademy.com/p/julia-for-data-science
MIT License
488 stars 256 forks source link

Chapter 01 - Data.ipynb error accessing XLSX.DataTable (G) #49

Open PRCervera opened 1 year ago

PRCervera commented 1 year ago

Error while executing G[1]

MethodError: no method matching getindex(::XLSX.DataTable, ::Int64)

Stacktrace: [1] top-level scope @ In[42]:1 or accesing G in with all instructions

Help needed !!!

Thank you !!!

cr00k commented 1 year ago

The output of XLSX.readtable() is no longer a tuple but a class. According to XLSX.jl docs ([https://felipenoris.github.io/XLSX.jl/stable/api/#XLSX.readtable]) one should use this function to create DataFrame with DataFrame.jl, which makes much more sense.

For example: G = DataFrame(XLSX.readtable("data/zillow_data_download_april2020.xlsx","Sale_counts_city"))

Hope it helps.

PRCervera commented 1 year ago

Thank You !!! It works !!!

El dom, 30 abr 2023 a las 22:04, cr00k @.***>) escribió:

The output of XLSX.readtable() is no longer a tuple but a class. According to XLSX.jl docs ([ https://felipenoris.github.io/XLSX.jl/stable/api/#XLSX.readtable]) one should use this function to create DataFrame with DataFrame.jl, which makes much more sense.

For example: G = DataFrame(XLSX.readtable("data/zillow_data_download_april2020.xlsx","Sale_counts_city"))

Hope it helps.

— Reply to this email directly, view it on GitHub https://github.com/JuliaAcademy/DataScience/issues/49#issuecomment-1529128056, or unsubscribe https://github.com/notifications/unsubscribe-auth/A3ZRCDWFJFW62AOSYCGJP63XD3AVHANCNFSM6AAAAAAVU65MKI . You are receiving this because you authored the thread.Message ID: @.***>

--

 Pedro Rodriguez Cervera