Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Lab_Customer Analysis Round 1] Sara #39

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sarasilva123
Copy link

No description provided.

@pt-data-ta-lis
Copy link

Good Job!

Comments:

  • Rearrange the columns in the dataframe as needed
    tab2_data = tab2_data[tab1_data.columns]
    tab3_data = tab3_data[tab1_data.columns]

  • Which columns are numerical?
    datatotal_data.select_dtypes('float')

  • Which columns are categorial?
    datatotal_data.select_dtypes('object')

  • Delete the column education and number_of_open_complaints from the dataframe
    datatotal_data = datatotal_data.drop(['education', 'number_of_open_complaints'], axis=1)

  • Correct the values in the column customer_lifetime_value. They are given as percent, so multiply them by 100 and change dtype to numerical type
    datatotal_data['customer_lifetime_value'] = datatotal_data['customer_lifetime_value'].str.replace('%',''") --> Excluding the '%' character from the colum so that you can convert all the column to float.
    datatotal_data['customer_lifetime_value'] = pd.to_numeric(datatotal_data['customer_lifetime_value'], errors='coerce')*100

  • Filter out the data for customers who have an income of 0 or less
    The logic is right, but it was intendend to take out who has an income of 0 or less so that the final data frame shows only who has a positive income. The condition should be:
    datatotal_data[datatotal_data['income'] > 0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants