in a pandas dataframe how can I apply a sort of excel left(\'state\',2) to only take the first two letters. Ideally I want to learn how to use left,right and mid in a datafr
With regards to the mid, probably a short cut code would be df['state'].str[3,5]
this will start from the 3rd character and give you the 3rd and 4th character of the string.