SQL  and Pandas  aren’t new technologies. Still, it’s not the easiest task to find corresponding functions for both technologies. That’s where this one and the previous article  come into play — providing you with a detailed comparison between the two.

A couple of days back, I’ve covered the first part of this two-part series, dealing with more simple comparisons between the two technologies:

Reading that article first is not a prerequisite, but will definitely help you to get a better understanding of the two. The technologies aren’t designed for the same job, but it’s nice to see corresponding functions between the two. As promised, today we’ll cover more advanced topics:

  • Joins
  • Unions
  • Groupings

Before we do so, let’s start simple with the delete statements.


Delete

DELETE statement is used in SQL to delete or remove a row from the table. The syntax for deleting rows in SQL is as follows:

DELETE FROM table_name
WHERE condition;

Deleting a row is slightly different in Pandas. In Pandas, we do not delete a row, we just select the part that we require and discard the rest of it. Don’t worry if it seems like a riddle to you, the example will illustrate it further.

Let’s say we want to delete all the records from the Asian region.

#programming #towards-data-science #sql #python #data-science

SQL vs. Pandas — Which one to choose in 2020? Part 2
2.00 GEEK