I have a DataFrame column named "price" that contains prices, which are either in 'pw' or 'pcm' format ('600pcm' for an example).
prices = {'price': ["100pw","600pcm","321pw"]}
df = DataFrame(prices,columns=['price'])
df.head()
I want to be able to convert all prices into weekly prices.
Ideally, there would be a loop function that would convert pcm amount into pw but I would have to remove the string part before I could convert the int.
I tried making a new list of prices in weeks and months through list comprehensions but how would I match them up to the correct row index?
Also tried the np.where function but it seems inappropriate.
Any thought guys? I am newbie to python