Participer au site avec un Tip
Rechercher
 

Améliorations / Corrections

Vous avez des améliorations (ou des corrections) à proposer pour ce document : je vous remerçie par avance de m'en faire part, cela m'aide à améliorer le site.

Emplacement :

Description des améliorations :

Vous êtes un professionnel et vous avez besoin d'une formation ? Machine Learning
avec Scikit-Learn
Voir le programme détaillé
Classe « Result »

Méthode sqlalchemy.Result.scalars

Signature de la méthode scalars

def scalars(self, index: '_KeyIndexType' = 0) -> 'ScalarResult[Any]' 

Description

help(Result.scalars)

Return a :class:`_engine.ScalarResult` filtering object which
will return single elements rather than :class:`_row.Row` objects.

E.g.::

    >>> result = conn.execute(text("select int_id from table"))
    >>> result.scalars().all()
    [1, 2, 3]

When results are fetched from the :class:`_engine.ScalarResult`
filtering object, the single column-row that would be returned by the
:class:`_engine.Result` is instead returned as the column's value.

.. versionadded:: 1.4

:param index: integer or row key indicating the column to be fetched
 from each row, defaults to ``0`` indicating the first column.

:return: a new :class:`_engine.ScalarResult` filtering object referring
 to this :class:`_engine.Result` object.



Vous êtes un professionnel et vous avez besoin d'une formation ? Programmation Python
Les compléments
Voir le programme détaillé