Sign up to take part
Registered users can ask their own questions, contribute to discussions, and be part of the Community!
Registered users can ask their own questions, contribute to discussions, and be part of the Community!
Hello,
I'm looking at a list of song names and want to be able to have a column with the number of words in the song titles.
For example: Take me Home = 3 words
Please help, thank you!
Hi,
There is no processor or visual recipe in DSS that does exactly that. Nevertheless, you can use pandas in a python script:
import pandas as pd
# Sample list of song names
song_names = [
"Take me Home",
"Bohemian Rhapsody",
"Hotel California",
"Yesterday",
"Shape of You",
"Stairway to Heaven"
]
# Create a DataFrame with the list of song names
df = pd.DataFrame({'Song Name': song_names})
# Count the number of words in each song title and add as a new column
df['Word Count'] = df['Song Name'].str.split().str.len()
# Display the DataFrame
print(df)
You can also do this visually by using two steps in a prepare recipe.