Skip to content

Commit

Permalink
docs: Fix typo of "Cartesian" product (#14585)
Browse files Browse the repository at this point in the history
  • Loading branch information
stinodego authored Feb 19, 2024
1 parent ae4ea66 commit e283bca
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions crates/polars-compute/src/arity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use arrow::types::NativeType;
///
/// # Safety
/// - arr must point to a readable slice of length len.
/// - out must point to a writeable slice of length len.
/// - out must point to a writable slice of length len.
#[inline(never)]
unsafe fn ptr_apply_unary_kernel<I: Copy, O, F: Fn(I) -> O>(
arr: *const I,
Expand All @@ -25,7 +25,7 @@ unsafe fn ptr_apply_unary_kernel<I: Copy, O, F: Fn(I) -> O>(
/// # Safety
/// - left must point to a readable slice of length len.
/// - right must point to a readable slice of length len.
/// - out must point to a writeable slice of length len.
/// - out must point to a writable slice of length len.
#[inline(never)]
unsafe fn ptr_apply_binary_kernel<L: Copy, R: Copy, O, F: Fn(L, R) -> O>(
left: *const L,
Expand Down
2 changes: 1 addition & 1 deletion crates/polars-lazy/src/frame/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1113,7 +1113,7 @@ impl LazyFrame {
)
}

/// Creates the cartesian product from both frames, preserving the order of the left keys.
/// Creates the Cartesian product from both frames, preserving the order of the left keys.
#[cfg(feature = "cross_join")]
pub fn cross_join(self, other: LazyFrame) -> LazyFrame {
self.join(other, vec![], vec![], JoinArgs::new(JoinType::Cross))
Expand Down
2 changes: 1 addition & 1 deletion crates/polars-ops/src/frame/join/cross_join.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ pub trait CrossJoin: IntoDf {
Ok(l_df)
}

/// Creates the cartesian product from both frames, preserves the order of the left keys.
/// Creates the Cartesian product from both frames, preserves the order of the left keys.
fn cross_join(
&self,
other: &DataFrame,
Expand Down
2 changes: 1 addition & 1 deletion crates/polars/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@
//! - `rows` - Create [`DataFrame`] from rows and extract rows from [`DataFrame`]s.
//! And activates `pivot` and `transpose` operations
//! - `asof_join` - Join ASOF, to join on nearest keys instead of exact equality match.
//! - `cross_join` - Create the cartesian product of two [`DataFrame`]s.
//! - `cross_join` - Create the Cartesian product of two [`DataFrame`]s.
//! - `semi_anti_join` - SEMI and ANTI joins.
//! - `group_by_list` - Allow group_by operation on keys of type List.
//! - `row_hash` - Utility to hash [`DataFrame`] rows to [`UInt64Chunked`]
Expand Down
2 changes: 1 addition & 1 deletion docs/user-guide/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ The opt-in features are:
- `rows` - Create `DataFrame` from rows and extract rows from `DataFrames`.
And activates `pivot` and `transpose` operations
- `join_asof` - Join ASOF, to join on nearest keys instead of exact equality match.
- `cross_join` - Create the cartesian product of two DataFrames.
- `cross_join` - Create the Cartesian product of two DataFrames.
- `semi_anti_join` - SEMI and ANTI joins.
- `group_by_list` - Allow group by operation on keys of type List.
- `row_hash` - Utility to hash DataFrame rows to UInt64Chunked
Expand Down
2 changes: 1 addition & 1 deletion docs/user-guide/transformations/joins.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ The `outer` join produces a `DataFrame` that contains all the rows from both `Da

### Cross join

A `cross` join is a cartesian product of the two `DataFrames`. This means that every row in the left `DataFrame` is joined with every row in the right `DataFrame`. The `cross` join is useful for creating a `DataFrame` with all possible combinations of the columns in two `DataFrames`. Let's take for example the following two `DataFrames`.
A `cross` join is a Cartesian product of the two `DataFrames`. This means that every row in the left `DataFrame` is joined with every row in the right `DataFrame`. The `cross` join is useful for creating a `DataFrame` with all possible combinations of the columns in two `DataFrames`. Let's take for example the following two `DataFrames`.

{{code_block('user-guide/transformations/joins','df3',['DataFrame'])}}

Expand Down
16 changes: 8 additions & 8 deletions py-polars/polars/dataframe/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -2450,7 +2450,7 @@ def write_json(
Parameters
----------
file
File path or writeable file-like object to which the result will be written.
File path or writable file-like object to which the result will be written.
If set to `None` (default), the output is returned as a string instead.
pretty
Pretty serialize json.
Expand Down Expand Up @@ -2506,7 +2506,7 @@ def write_ndjson(self, file: IOBase | str | Path | None = None) -> str | None:
Parameters
----------
file
File path or writeable file-like object to which the result will be written.
File path or writable file-like object to which the result will be written.
If set to `None` (default), the output is returned as a string instead.
Examples
Expand Down Expand Up @@ -2602,7 +2602,7 @@ def write_csv(
Parameters
----------
file
File path or writeable file-like object to which the result will be written.
File path or writable file-like object to which the result will be written.
If set to `None` (default), the output is returned as a string instead.
include_bom
Whether to include UTF-8 BOM in the CSV output.
Expand Down Expand Up @@ -2713,7 +2713,7 @@ def write_avro(
Parameters
----------
file
File path or writeable file-like object to which the data will be written.
File path or writable file-like object to which the data will be written.
compression : {'uncompressed', 'snappy', 'deflate'}
Compression method. Defaults to "uncompressed".
name
Expand Down Expand Up @@ -3281,7 +3281,7 @@ def write_ipc(
Parameters
----------
file
Path or writeable file-like object to which the IPC data will be
Path or writable file-like object to which the IPC data will be
written. If set to `None`, the output is returned as a BytesIO object.
compression : {'uncompressed', 'lz4', 'zstd'}
Compression method. Defaults to "uncompressed".
Expand Down Expand Up @@ -3353,7 +3353,7 @@ def write_ipc_stream(
Parameters
----------
file
Path or writeable file-like object to which the IPC record batch data will
Path or writable file-like object to which the IPC record batch data will
be written. If set to `None`, the output is returned as a BytesIO object.
compression : {'uncompressed', 'lz4', 'zstd'}
Compression method. Defaults to "uncompressed".
Expand Down Expand Up @@ -3402,7 +3402,7 @@ def write_parquet(
Parameters
----------
file
File path or writeable file-like object to which the result will be written.
File path or writable file-like object to which the result will be written.
compression : {'lz4', 'uncompressed', 'snappy', 'gzip', 'lzo', 'brotli', 'zstd'}
Choose "zstd" for good compression performance.
Choose "lz4" for fast compression/decompression.
Expand Down Expand Up @@ -6272,7 +6272,7 @@ def join(
* *outer_coalesce*
Same as 'outer', but coalesces the key columns
* *cross*
Returns the cartisian product of rows from both tables
Returns the Cartesian product of rows from both tables
* *semi*
Filter rows that have a match in the right table.
* *anti*
Expand Down
2 changes: 1 addition & 1 deletion py-polars/polars/lazyframe/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -3952,7 +3952,7 @@ def join(
* *outer_coalesce*
Same as 'outer', but coalesces the key columns
* *cross*
Returns the cartisian product of rows from both tables
Returns the Cartesian product of rows from both tables
* *semi*
Filter rows that have a match in the right table.
* *anti*
Expand Down
2 changes: 1 addition & 1 deletion py-polars/tests/unit/interop/numpy/test_to_numpy_df.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def test_df_to_numpy_zero_copy_path() -> None:
assert str(x[0, :]) == "[1. 2. 1. 1. 1.]"


def test_to_numpy_zero_copy_path_writeable() -> None:
def test_to_numpy_zero_copy_path_writable() -> None:
rows = 10
cols = 5
x = np.ones((rows, cols), order="F")
Expand Down
2 changes: 1 addition & 1 deletion py-polars/tests/unit/io/test_csv.py
Original file line number Diff line number Diff line change
Expand Up @@ -1820,7 +1820,7 @@ def test_provide_schema() -> None:
}


def test_custom_writeable_object() -> None:
def test_custom_writable_object() -> None:
df = pl.DataFrame({"a": [10, 20, 30], "b": ["x", "y", "z"]})

class CustomBuffer:
Expand Down

0 comments on commit e283bca

Please sign in to comment.