-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fix Python syntax
- Loading branch information
Showing
8 changed files
with
31 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,29 +22,29 @@ Erste Schritte | |
|
||
#. Zunächst wird ipython-sql in eurem Notebook aktiviert mit | ||
|
||
.. code-block:: python | ||
.. code-block:: ipython | ||
In [1]: %load_ext sql | ||
#. Für die Verbindung zur Datenbank wird die `SQLAlchemy URL | ||
<https://docs.sqlalchemy.org/en/14/core/engines.html#database-urls>`_ | ||
verwendet: | ||
|
||
.. code-block:: python | ||
.. code-block:: ipython | ||
In [2]: %sql postgresql:// | ||
#. Anschließend könnt ihr eine Tabelle erstellen, :abbr:`z.B. (zum Beispiel)`: | ||
|
||
.. code-block:: python | ||
.. code-block:: ipython | ||
In [3]: %%sql postgresql:// | ||
....: CREATE TABLE accounts (login, name, email) | ||
....: INSERT INTO accounts VALUES ('veit', 'Veit Schiele', [email protected]); | ||
#. Die Inhalte der Tabelle ``accounts`` könnt ihr abfragen mit | ||
|
||
.. code-block:: python | ||
.. code-block:: ipython | ||
In [4]: result = %sql select * from accounts | ||
|
@@ -62,7 +62,7 @@ Begrenzung, mit ``Autolimit`` lässt sich jedoch die Ergebnismenge limitieren. | |
Mit ``%config SqlMagic`` könnt ihr Euch die aktuelle Konfiguration ausgeben | ||
lassen: | ||
|
||
.. code-block:: python | ||
.. code-block:: ipython | ||
In [5]: %config SqlMagic | ||
SqlMagic options | ||
|
@@ -89,7 +89,7 @@ pandas | |
|
||
Wenn pandas installiert ist, kann die ``DataFrame``-Methode verwendet werden: | ||
|
||
.. code-block:: python | ||
.. code-block:: ipython | ||
In [6]: result = %sql SELECT * FROM accounts | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -97,10 +97,7 @@ Create Session | |
address = Address(street="Birnbaumweg 10", zipcode="79115", country="Germany") | ||
contact = Contact( | ||
firstname="Veit", | ||
lastname="Schiele", | ||
email="[email protected]", | ||
address=address | ||
firstname="Veit", lastname="Schiele", email="[email protected]", address=address | ||
) | ||
session.add(contact) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters