I added a column for the first purchase and added value_counts for that column.
>>> import pandas as pd
>> df = pd.DataFrame ({"keyword": ["first purchase", "first love", "re-purchase", "re-purchase", "steel-purchase"]})
>>> df
keyword
0 First purchase
First love
2 Repurchase
3 Repurchase
4 Steel ball
>>> df["first_buy"] = df["keyword"].str.contains ("first")
>>> df
keyword first_buy
0 First purchase True
1. First love, true
2 Repurchase False
3 Repurchase False
4. Strong Jaegu False
>>> df["first_buy"].value_counts()
False 3
True 2
Name: first_buy, dtype: int64
>>>
598 Uncaught (inpromise) Error on Electron: An object could not be cloned
877 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
571 Understanding How to Configure Google API Key
595 GDB gets version error when attempting to debug with the Presense SDK (IDE)
© 2024 OneMinuteCode. All rights reserved.