Photo by William Fortunato from Pexels

Pandas Brain Teaser

Quite Some Time

Don’t Get Tripped up by How SQLite Handles Data Types

3 min readSep 7, 2021

--

📚 Connect with us. Want to hear what’s new at The Pragmatic Bookshelf? Sign up for our newsletter. You’ll be the first to know about author speaking engagements, books in beta, new books in print, and promo codes that give you discounts of up to 40%.

Let’s say you have a database table that contains the daily number of hits to your website. Before you run some calculations, you’d like to check the time span in the database. Here’s an example code:

When you run this code, you get the following error:

What!? SQL does have a TIMESTAMP type, and it should be translated to Python's datetime (or in pandas, pd.Timestamp). right?

--

--