Let me ask you a question about how to write python class.
I created a class (defined two methods) because I wanted to aggregate the customer's purchase price and rank it based on that amount.Method 1 worked as expected, but Method 2 doesn't know how to write it down.(Is it better not to separate the methods in the first place...?)
*In Method 2, we would like to apply it to the "rev" column of the result returned by Method 1.
(I want to create a new column and substitute the results)
I would appreciate it if you could advise me if you notice anything.
Thank you for your cooperation.
The source code shown in the question is a simple function that returns a string of
None depending on the value of the parameter.
If you run Method 1 in question and the result is an integer or floating point number, you will get the result by calling:
However, if you pass a string or any object as a parameter, you get an error.
Also, no matter what number you pass as a parameter or how many times you call it, the
thisY object has no effect or change.
(I want to create and substitute a new column for the result) Does thisY object mean something that includes the Pandas DataFrame, and you want to increase the column to that object by calling the
There is no such action in the current source code.
Also, even if you try to add something like that, it will be difficult to get advice and answers because there is no information on what kind of things, how to process and what kind of results you want to get.
If you want those advice or answers, it's better to ask a new question.
© 2022 OneMinuteCode. All rights reserved.