Skip to content

Commit

Permalink
Fixing small typos in docs (#3811)
Browse files Browse the repository at this point in the history
  • Loading branch information
thatlittleboy committed Jun 26, 2022
1 parent fbe23fe commit 077deab
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions py-polars/polars/internals/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ class DataFrame(metaclass=DataFrameMetaClass):
[<class 'polars.datatypes.Int64'>, <class 'polars.datatypes.Int64'>]
In order to specify dtypes for your columns, initialize the DataFrame with a list
of typed Series, or set the columns parameter with a list of (name,dtype) pairs:
of typed Series:
>>> data = [
... pl.Series("col1", [1, 2], dtype=pl.Float32),
Expand All @@ -232,9 +232,13 @@ class DataFrame(metaclass=DataFrameMetaClass):
│ 2.0 ┆ 4 │
└──────┴──────┘
# or, equivalent... (and also compatible with all of the other valid data parameter types):
Or set the `columns` parameter with a list of (name,dtype) pairs (compatible with
all of the other valid data parameter types):
>>> data = {"col1": [1, 2], "col2": [3, 4]}
>>> df3 = pl.DataFrame(data, columns=[("col1", pl.Float32), ("col2", pl.Int64)])
>>> df3
shape: (2, 2)
┌──────┬──────┐
│ col1 ┆ col2 │
│ --- ┆ --- │
Expand Down Expand Up @@ -1403,8 +1407,8 @@ def write_parquet(
use_pyarrow
Use C++ parquet implementation vs rust parquet implementation.
At the moment C++ supports more features.
**kwargs are passed to pyarrow.parquet.write_table
kwargs
Arguments are passed to pyarrow.parquet.write_table.
"""
if compression is None:
compression = "uncompressed"
Expand Down Expand Up @@ -4449,11 +4453,12 @@ def partition_by(
Parameters
----------
groups
Groups to partition by
Groups to partition by.
maintain_order
Keep predictable output order. This is slower as it requires and extra sort operation.
Keep predictable output order. This is slower as it requires an extra sort operation.
as_dict
Return as dictionary
If True, return the partitions in a dictionary keyed by the distinct group values instead
of a list.
Examples
--------
Expand Down

0 comments on commit 077deab

Please sign in to comment.