Search code examples
pandasazure-machine-learning-service

Is there an Azure Machine Learning Studio module that works like the Pandas 'mask' method?


I'm trying to perform the following Python Pandas operation in Azure Machine Learning Studio, but cannot find a module that handles it:

df.credit_score = df.credit_score.mask(df.credit_score > 800, df.credit_score / 10)

So I'm effectively just trying to find all values in my 'credit_score' column that are greater than 800 and divide them by 10. I have been unable so far to find a module in AML Studio that does that.

Also, I should add that I'm having issues with my Python script in AML Studio, which is why I'm attempting to replicate all of my code using AML built-in modules.


Solution

  • To my knowledge, there's no built-in module to do this succinctly (to my knowledge). If you prefer to use built-ins, you could:

    1. Use a Split Dataset module to split the entries based on credit score
    2. Divide the credit score in large-credit-score rows by 10 using Apply Math Operation
    3. Concatenate the two datasets row-wise with an Add Rows module