mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-07-23 01:14:31 +02:00
Keyword only arguments for transform()
Also renamed columns= to types= Closes #165
This commit is contained in:
parent
987dd123f2
commit
f8e10df00e
3 changed files with 11 additions and 9 deletions
|
|
@ -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:
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue