chitralverma / scala-polars Goto Github PK
View Code? Open in Web Editor NEWPolars for Scala & Java projects!
Home Page: https://chitralverma.github.io/scala-polars/
License: Apache License 2.0
Polars for Scala & Java projects!
Home Page: https://chitralverma.github.io/scala-polars/
License: Apache License 2.0
//> using dep "org.polars::scala-polars:0.1.0-SNAPSHOT"
import org.polars.scala.polars.api.{DataFrame, Series}
val sdf = DataFrame.fromSeries(Series.ofInt("i32_col", Array[Int](1, 2, 3, 4, 5, 6, 7, 8, 9, 10)))
val tk = sdf.top_k(4, "i32_col", descending = true, nullLast = true, maintainOrder = false)
tk.show()
val sk = sdf.sort("i32_col", descending = true, nullLast = true, maintainOrder = false).head(4)
sk.show()
$ scala-cli topkbug.sc
Compiling project (Scala 3.4.1, JVM (21))
Compiled project (Scala 3.4.1, JVM (21))
shape: (4, 1)
βββββββββββ
β i32_col β
β --- β
β i32 β
βββββββββββ‘
β 1 β
β 2 β
β 3 β
β 4 β
βββββββββββ
shape: (4, 1)
βββββββββββ
β i32_col β
β --- β
β i32 β
βββββββββββ‘
β 10 β
β 9 β
β 8 β
β 7 β
βββββββββββ
I've been digging through the code and I don't see the problem offhand. Will keep looking.
The maven dependency coordinates given in https://github.com/chitralverma/scala-polars/packages/1795604:
<dependency>
<groupId>org.polars</groupId>
<artifactId>scala-polars_2.12</artifactId>
<version>0.1.0-SNAPSHOT</version>
</dependency>
don't seem to be available. Searching https://mvnrepository.com/search?q=polars doesn't yield anything either.
Hi, Thank you on this awesome work @chitralverma !
I am trying to read from s3 in scala . I can see that writing is pretty simple as you added utility function to pass options in write_utils.rs
write.options(
Map(
"aws_default_region" -> "usβeastβ2",
"aws_access_key_id" -> "ABC",
"aws_secret_access_key" -> "XYZ"
)
I am trying to do the same reading into a df, passing a s3 path to Polars.scan obviously throws
val df = Polars.parquet.scan("s3://test1/myfile.zstd.parquet")
Configuration 'aws' must be provided in order to use s3 cloud urls."))
Is there something I need tweak in the config to be able to read directly from s3 ? Maybe we need a read_utils.rs
. I would be able to contribute, if you have some guidance :)
Wondering if there is any consideration for adding a .rows function to the org.polars.scala.polars.api.DataFrame
implementation.
https://pola-rs.github.io/polars/py-polars/html/reference/dataframe/api/polars.DataFrame.rows.html
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.