on ‎2025 Jun 01 1:12 PM
Hi,
I'm very new to python, I hvae a data set with 13 column , once of the called 'gender'. I want to filter the data and result moved to Target table.
However I'm getting below error message called "'method' object is not subscriptable"
Please my code below, unfortunatly we can't debug the code in datasphere
def transform(data):
specific_name = ['Male']
df = data['gender'].isin[('specific_name')]
#data[NV]
return df
Any input would be greatly appreciated
Kind regards
Hari
Request clarification before answering.
I believe there's a typo in your code, the isin function should be followed by parentheses () instead of brackets []
Like: df = data[data['gender'].isin(specific_name)]
Regards,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 13 | |
| 7 | |
| 6 | |
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 3 | |
| 3 | |
| 3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.