Keyword only arguments for transform()

Also renamed columns= to types=

Closes #165
This commit is contained in:
Simon Willison 2020-09-21 23:39:10 -07:00 committed by GitHub
commit f8e10df00e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 9 deletions

View file

@ -926,12 +926,12 @@ The ``table.transform()`` method can do all of these things, by implementing a m
The ``.transform()`` method takes a number of parameters, all of which are optional.
To alter the type of a column, use the first argument:
To alter the type of a column, use the ``types=`` argument:
.. code-block:: python
# Convert the 'age' column to an integer, and 'weight' to a float
table.transform({"age": int, "weight": float})
table.transform(types={"age": int, "weight": float})
The ``rename=`` parameter can rename columns: