I'm loading user's input file that contains sentences into a data frame to display the maximum length of a sentence in characters and in words, but my code returns the lengths of each sentence in the dataframe. I just want the maximum values to be displayed. Any ideas where is my mistake?
res = wdata['sentences'].str.split().str.len()
print ("The maximum length in words are : " + str(res))
length = wdata['sentences'].str.len().sort_values()
print ("The maximum length in chars are : " + str(length))
#I expect the output to be
#The maximum length in words are : 4
#The maximum length in words are : 40
