Jul-14-2019, 06:16 PM
(Jul-14-2019, 09:22 AM)scidam Wrote: The main issue here, I think, is missingsep=';'
. You need to callread_csv
with a parametersep=';'
, e.g.
data = pd.read_csv('C:\\Users\\Tesema\\Desktop\\PYTHON\\PYTHON3\\Deterent2.csv', sep=';')If you do so, you will get a data frame, which has columns namedDetergent_Brands
,Cold
,Hot
without any semicolons.
These columns will include valuestop
andalpha
(without any semicolumns too), so you won't need to apply any cleaning up at all.
Try passsep=';'
and do df restructure as it is shown in #2.
As far as.apply
is concerned, you can read about this method in official docs.
Thank you very much for further comments, I will take your solution into consideration. Usually, I practice Python in weekends, I will try it in the coming weekend.