Please I have issue understanding exactly what this line of code does: Series.str [:10]
@horacewillie7, the code “series.str[:10]” returns the first 10 characters of a string. This code is similar to displaying a certain number of rows in a dataframe. For example, in the eBay Car Sales Data, if you typed the typed the code “print(autos[:6])”, you would print the first 6 rows of the dataframe ‘autos’. The series.str[:10], in conjunction with the value_counts() method allows you to count the number of items that the date (represented as a string) occurs in specific columns.
Hope this helps.
1 Like
Thank you very much Samson.