You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# The first rowprint(myDF[0])
# The last rowprint(myDF[-1])
Printthe10firstforiteminmyList[:10]:
print (item)
Printthe10lastforiteminmyList[-10:]:
print (item)
# Get the lengthprint(len(myarray))
importpandasaspdthelist2=pd.Series(thelist).unique().tolist()
print ("The list of words is : "+str(thelist2))
# Other ways https://datagy.io/python-remove-duplicates-from-list/
Sort
Sort the list
Sort the list
# Sort alphabeticallythelist.sort()
# Sort on the word lenghtthelist.sort(key=lambdas: len(s))
String functions on the list
.lower()
.strip()
Math on a list
.median()
Other functions on a list
# Count he occurance of a specific value (in this case the number 1)
.count(1)