dataframejuliajulia-dataframe

I can't print the column value or row value of Dataframes in julia. I am getting a not found error?


I searched a lot. I am reading the document. but still could not figure it out. Whichever way I try it says no column name and gives an error. Thank you in advance for your help

print(daf[!,:SPV])

Output:

  ERROR: LoadError: ArgumentError: column name :SPV not found in the data frame

My Dataset:

            12×2 DataFrame
            Row │ valuecols           values
                │ Symbol              Any
            ─────┼───────────────────────────────────────────────────────
            1 │ PointId             Any[5054, 5054, 5054, 5054, 5054…
            2 │ ŞUBE İSİM           Any["EVKUR - ADIYAMAN MERKEZ", "…
            3 │ SPV                 Any["M. SERKAN EKINCI", "M. SERK…
            4 │ Merch               Any["SEMIH AYDOGAN", "SEMIH AYDO…
            5 │ PAZAR PAYI          Any[43.3333, 41.688, 37.0787, 30…
            6 │ Il                  Any["ADIYAMAN", "MALATYA", "MALA…
            7 │ ılce                Any["MERKEZ", "MERKEZ", "MERKEZ"…
            8 │ Adres               Any["HOCA OMER MH. ATATURK CAD. …
            9 │ X Satış Adeti       Any["-", "-", 300, 15, 23, 4, 6,…
            10 │ Toplam Satış Adeti  Any["-", "-", 750, 15, 23, 6, 6,…
            11 │ Xg Ciro             Any["-", "-", 600000.0, 50000.0,…
            12 │ Toplam Ciro         Any["-", "-", 1.3e6, 160000.0, 2…

Solution

  • If that is indeed your DataFrame daf then as you can see there is no column named SPV. There are two columns in your output (valuecols and values) and 12 rows containing what you seem to have intended to be columns. Without seeing the code that created daf I can't tell you exactly what went wrong but you can transform it into the structure that you want by doing:

    DataFrame(map(Pair, daf.valuecols, daf.values))