Master programming syntax, solve interactive challenges & run live code in Syntaxis Explore Arena →
menu_book Course Curriculum (Data Science Foundations) expand_more
Data Science Foundations / Feature Engineering

Text length feature

Learn Text length feature in Data Science Foundations with a focused explanation, a topic-specific example, edge guidance, and a mastery check.

12 min read • Advanced
data-science-068.py
python
import pandas as pd
text=pd.Series(["short","a somewhat longer review"])
features=pd.DataFrame({"chars":text.str.len(),"words":text.str.split().str.len()})
print(features)
What to watch
Content source & attribution
Original Syntaxis Content · Original Syntaxis Content