0

Bad design has left me with database fields that can be populated with comma separated list

Assume my database has the following columns

  • ID
  • DESCRIPTION
  • USERS
  • LOCATIONS

I know that ID and DESCRIPTION are always relevant.

USERS and LOCATIONS can contain 0, 1, or more strings separated by a comma

ASSUME if ID=1, DESCRIPTION=BASIC, USERS=MANNY,MO,JACK,HAMBURGLAR LOCATIONS=PEPBOYS,MCDONALDS

I would like the processed table to yield:

1 BASIC MANNY ‘PEPBOYS,MCDONALDS’

1 BASIC MO ‘PEPBOYS,MCDONALDS’

1 BASIC JACK ‘PEPBOYS,MCDONALDS’

1 BASIC HAMBURGLAR ‘PEPBOYS,MCDONALDS’

1 BASIC ‘MANNY,MO,JACK,HAMBURGLAR’ PEPBOYS

1 BASIC ‘MANNY,MO,JACK,HAMBURGLAR’ MCDONALDS

the pandas module included in the python environment pre-dates DataFrame.explode() capabilities.  
any elegant suggestions?

1 reply

null
    • NPANS
    • 3 wk ago
    • Reported - view

    Add a new Python environment and use the Pandas module that you want.

Content aside

  • Status Answered
  • 3 wk agoLast active
  • 1Replies
  • 21Views
  • 2 Following