Skip to content

Commit

Permalink
add modin to readme
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcoGorelli committed Mar 18, 2024
1 parent 17edb0c commit 099ea40
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
src="https://github.com/MarcoGorelli/narwhals/assets/33491632/26be901e-5383-49f2-9fbd-5c97b7696f27">
</h1>

Extremely lightweight compatibility layer between Polars, pandas, and more.
Extremely lightweight compatibility layer between Polars, pandas, modin, and cuDF (and possibly more?).

Seamlessly support both, without depending on either!
Seamlessly support all, without depending on any!

-**Just use** a subset of **the Polars API**, no need to learn anything new
-**No dependencies** (not even Polars), keep your library lightweight
Expand Down Expand Up @@ -38,7 +38,8 @@ There are three steps to writing dataframe-agnostic code using Narwhals:

- if you started with pandas, you'll get pandas back
- if you started with Polars, you'll get Polars back
- if you started with Polars, you'll get Polars back
- if you started with Modin, you'll get Modin back (and compute will be distributed)
- if you started with cuDF, you'll get cuDF back (and compute will happen on GPU)

## Example

Expand Down
10 changes: 4 additions & 6 deletions tpch/q1.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,9 @@ def q1(df_raw: Any) -> Any:
return nw.to_native(result.collect())


# df = pd.read_parquet("../tpch-data/lineitem.parquet")
# df[["l_quantity", "l_extendedprice", "l_discount", "l_tax"]] = df[
# ["l_quantity", "l_extendedprice", "l_discount", "l_tax"]
# ].astype("float64")
df = pd.read_parquet("../tpch-data/s1/lineitem.parquet", dtype_backend="pyarrow")
breakpoint()
# df["l_shipdate"] = pd.to_datetime(df["l_shipdate"])
# print(q1(df))
df = polars.scan_parquet("../tpch-data/lineitem.parquet")
print(q1(df))
df = polars.scan_parquet("../tpch-data/s1/lineitem.parquet")
print(q1(df))

0 comments on commit 099ea40

Please sign in to comment.