Home > other > O great god look at why this has been an error
O great god look at why this has been an error
Time:10-22
I want to add a new column called user_type, if install_month=log_month assignment of new, old, or assignment tried a lot of methods has been an error, and the correct approach is what? by the way, why the payment and other header is not in the same row -
CodePudding user response:
Card for two days really don't know how make, just registered a number to post for help
CodePudding user response:
Because it is over, installmonth and logmonth userid is your grouping conditions, payment is your query column,
CodePudding user response:
import pandas as pd The from pandas import DataFrame
Frame=DataFrame ({" a ": hc-positie [1], 'b' :,3,5,6 [5]}) Frame/' c '=frame. The apply (lambda x:' new 'if x==[' a'] x [' b '] else 'old' axis=1) Print (frame)