Hi All,
Does anyone know how to count words in a column in the Python tool? I am aware that this can be done with other Alteryx tools but I am having a go with the Python tool and i'm a little stuck with this particular problem.
Thanks in advance!
Solved! Go to Solution.
Hi @G1,
In all honesty, your question is purely Python and not really Alteryx related....
With that said, I guess that following will return what you are looking for:
from ayx import Alteryx
data = Alteryx.read('#1')
data['CountField1'] = data['Field1'].str.split().str.len()
print(data)
Thanks,
PaulN
Apologies PaulN! I moved off this project and onto something new and never got around to replying. But thank you, that did work and will help me going forward now I'm picking this up again 🙂