Selecting calculated columns using different mathematical operations in SQL, translated to pandas.

Selecting a calculated column

In SQL:

SELECT
  *,
  column_1/column_2 AS ratio
FROM
  table;

In pandas:


table
    .assign(ratio = table['column_1']/table['column_2'])

References