Python Forum
Redistributing column data
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Redistributing column data
#1
Hello All,

Sample data from one column in my SQLServer database:
ColumnA
,Take one tablet first of every month
,Take one tablet every 30 days
,Take 1 tablet every 7 days
,Take one tablet every twenty four hours
,Take 2 tablets every 12 hours
,Take 2 tablets once in every week
,Take 0.5 tablets by mouth every 12 hours.
,Take 1 tablet by mouth twice daily with meals for 41 doses.
,Take one tablet by mouth once daily.
,Take 1 tablet by mouth daily with dinner.
,Take two tablet by mouth twice daily as needed (for pain). Take with food
,Take 1 tablet by mouth every 4 hours as needed.
,Take 1 tablet by mouth once daily.
,Take 5 mL by mouth twice daily for 6 days.
,Take 1 tablet by mouth twice daily for 7 days. Do not use alcohol while taking this medication or for 48h after completion.
,Inject 0.6 mL subcutaneously q 12 HR for 28 days.
,Take 1 tablet by mouth once daily for 7 days. Take 200mg loading dose followed by 100mg daily x 7 days.
,Take 1 capsule by mouth four times daily as needed.
,Take 1 tablet by mouth daily at bedtime.
,Take 1 tablet by mouth DAILY (6 AM).
,Take 0.5 tablets by mouth twice daily.
,Take 1 tablet by mouth every 6 hours as needed for Pain.
,Take 1 tablet by mouth every 6 hours as needed.
,Take 5 mL by mouth three times daily as needed for Nausea/Vomiting.
,Take 1 tablet by mouth twice daily.
,Take 0.5 tablets by mouth every 12 hours. For prevention of atrial fibrillation after thoracic surgery, stop after 30 days
,Inject 0.4 mL subcutaneously once daily for 4 days. after discharge from the hospital.
,Take 1 tablet by mouth four times daily as needed.
,Take 1 capsule by mouth twice daily.
,Take one tablet by mouth every 6 hours as needed for Pain.
,Take 3 tablets by mouth twice daily for 7 days.
,Take three tablet by mouth every 6 hours as needed for Pain for up to 7 days.


How can I redistribute this data into multiple columns as:
Sample columns: DosageQuantity DosageFrequency TimebetweenDosages

How can I achieve this.
Reply
#2
Please make an effort, show your code, and ask specific questions when a problem arises.
We are glad to help, but won't write the code for you.
Reply
#3
(Nov-28-2020, 12:15 PM)Larz60+ Wrote: Please make an effort, show your code, and ask specific questions when a problem arises.
We are glad to help, but won't write the code for you.

Dear Larz60+,
I was not asking for code.I was asking if this this possible and wanted some direction. I am a SQL person and a newbie to python and hence the post.I dabbled in python basics long time back.I know python can do things but need some direction/ideas/references. Thanks.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Make unique id in vectorized way based on text data column with similarity scoring ill8 0 861 Dec-12-2022, 03:22 AM
Last Post: ill8
  What if a column has about 90% of data as outliers? Asahavey17 1 1,784 Aug-23-2021, 04:55 PM
Last Post: jefsummers
  Pandas Data frame column condition check based on length of the value aditi06 1 2,655 Jul-28-2021, 11:08 AM
Last Post: jefsummers
  Adding a new column to a Panda Data Frame rsherry8 2 2,083 Jun-06-2021, 06:49 PM
Last Post: jefsummers
  How to shift data frame rows of specified column Mekala 0 1,861 Jul-21-2020, 02:42 PM
Last Post: Mekala
  Filter data based on a value from another dataframe column and create a file using lo pawanmtm 1 4,245 Jul-15-2020, 06:20 PM
Last Post: pawanmtm
  Select column between to dates CSV data PythonJD 0 1,762 Apr-14-2020, 12:22 PM
Last Post: PythonJD
  How can I convert time-series data in rows into column srvmig 0 2,036 Apr-11-2020, 05:40 AM
Last Post: srvmig
  add formatted column to pandas data frame alkaline3 0 1,643 Mar-22-2020, 06:44 PM
Last Post: alkaline3

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020