Hello everyone,
I thought I might as well try here first before making an issue. I have a relatively simple question -- what is the simplest way to append rows to DataFrames?
In short what I'm trying to do: I want Pandas' append functionality: https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.append.html
I understand DataFrames are immutable, so I'd ultimately be creating a new DataFrame in the end. However, the only way I've seen so far to create such a DataFrame is to create a row iterable, and feed that into another dataFrameOf like so:
val frame: DataFrame = dataFrameOf("Col1", "Col2") (
"A", "B"
)
val newFrame: DataFrame = dataFrameOf("Col1", "Col2") (
frame.rows.asSequence().map { it.values }.flatten() + sequenceOf("C", "D")
)
/**
* A DataFrame: 2 x 2
* Col1 Col2
* 1 A B
* 2 C D
*/
This seems particularly ugly (not to mention that the items may be in the wrong order...) There must be a better way, surely?
Hello everyone, I'm very new to using Kotlin and Krangl so this might be really obvious, but after implementing Krangl by using implementation "de.mpicbg.scicomp:krangl:0.13"
in build.gradle (Module:app)
, I get a CONFIGURE SUCCESSFUL. But after running the app, I get an error:
Task :app:mergeExtDexDebug FAILED
'Method name '=' in class 'krangl.Extensions' cannot be represented in dex format.
Even after commenting out the function imports and where I've used the functions. The only way to get rid of this error is to remove the implementation... What's happening? Any tips/help is much appreciated!
Where I implemented Krangl: https://github.com/AngieTanesha/viscosity-calculator/blob/master/app/build.gradle
Functions used: https://github.com/AngieTanesha/viscosity-calculator/blob/master/app/src/main/java/com/angiemochie/viscositycalculator/vi.kt
Hello :)
I'm not a Kotlin expert. I started using krangl 2 days ago after using pandas...
So far I was able to replace Python code using Kotlin and krangl but now I'm not sure how can I filter data only e.g. with Id existing in specified set (isin function in pandas).
I found a solution on stackoverflow:
.filter{it["id"].isMatching<String>(it as String in setOf("1","2"))}
but there is an error because it is a context not a value