Informula

Informula

Share this post

Informula
Informula
How to Convert SQL into Python Pandas? Part 5

How to Convert SQL into Python Pandas? Part 5

Informula's avatar
Informula
Oct 13, 2023
∙ Paid

Share this post

Informula
Informula
How to Convert SQL into Python Pandas? Part 5
Share

Previously on How to Convert SQL into Python Pandas? Part 4, we talked about how to convert SQL statements into Pandas syntax. In this article, we will continue to discover more scenarios and operations. (Data import into Python)

Where (=)

-- SQL
SELECT *
FROM main.invoices
WHERE BillingCountry = 'Germany'
# Python Pandas 1
filt = df_invoices['BillingCountry'] == "Germany"
df_invoices[filt]

# Python Pandas 2
df_invoices.query("BillingCountry == 'Germany'")

Keep reading with a 7-day free trial

Subscribe to Informula to keep reading this post and get 7 days of free access to the full post archives.

Already a paid subscriber? Sign in
© 2025 Informula
Privacy ∙ Terms ∙ Collection notice
Start writingGet the app
Substack is the home for great culture

Share