pythonnumpypandas
Ben Gorman

Ben Gorman

Life's a garden. Dig it.

Given a Series of product descriptions like “birch table measures 3’x6’x2'”, estimate the volume of each product. (Note: 3' means 3 "feet" in the imperial system of units.)

import numpy as np
import pandas as pd
 
descriptions = pd.Series([
    "soft and fuzzy teddy bear, product dims: 1'x2'x1', shipping not included",
    "birch table measures 3'x6'x2'",
    "tortilla blanket ~ sleep like a fajita ~ 6'x8'x1'",
    "inflatable arm tube man | 12'x1'x1' when inflated",
    "dinosaur costume -- 6'x4'x2' -- for kids and small adults"
], dtype='string')

Solution 1

This content is gated

Subscribe to one of the products below to gain access

Solution 2

This content is gated

Subscribe to one of the products below to gain access