sonwanesuresh95 / rfm

Python Package for RFM Analysis and Customer Segmentation
MIT License
10 stars 1 forks source link

rfm object changes `NaN` to `nan` #3

Closed SSMK-wq closed 2 years ago

SSMK-wq commented 2 years ago

I have a column in my dataframe (that is not used in rfm analysis) like as below

image

However, once I execute the below code

r = RFM(df_new, customer_id='unique_key', transaction_date='Date', amount='Revenue')

the same column market segment MC becomes like as below. I verified multiple times. Not sure why is this happening. Is there any shallow copy, deep copy etc stuff happening that is causing change in my input dataframe?

image

sonwanesuresh95 commented 2 years ago

It is simply because of str() function. It gets NaN values converted to 'nan'. Will add a feature in next release to use specified columns for analysis and keep/remove NaN records.