Hello, when i don't have a column names like in th...
# datascience
u
Hello, when i don't have a column names like in the first row names like - country, region, expenditures, total libraries, etc. and my first row is directly values - like Albania, Europe, 132312, 12312, etc. and I query about first this happens - see image There should be a column names first(title) before the values?
THe first values I put became the title in the kotlin notebook
in using plot can i specify the column like column1 not the string name?
Copy code
x(column = "country")
y(column = "totalLibries")
Anyways - I understand now why there's a column names - Just asking what if there's no column names
Copy code
x(column = 1)
y(column = 2)
a
If you have a dataset like this, where the first row contains data, not a header - just set
firstRowIsHeader = false
in
readExcel
.
And yeah, you can specify a column using index:
Copy code
df.plot { 
    line {
        x(getColumn(0))
        y(getColumn(1))
    }
}
BUT it won't help you if you already read file incorrectly and your first row is used as a header. So, just read your excel with
firstRowIsHeader = false
as I said before. Then you will have column names like "A", "B", etc - you can use them for plotting:
Copy code
df.plot {
   line {
      x(A)
      y(B)
   }
}
But better rename them first 😄.
kodee happy 1
🙌 1
u
tnx alot! very appreciated