TypeError when using substring function in Python 3
Question: I wrote a function to open a csv, find max of data in a column & then
substring to take only last 4 digits. It worked very well for almost 2 hours.
But suddenly failing with the error `TypeError: unorderable types: float() >
str()` Relevant code is:

    
    
    import pandas
    
    mycsvfile = 'filepath'
    df = pandas.read_csv(mycsvfile, sep=",", usecols=['ColumnName'])
    start_num=int(max(df['ColumnName'])[-4:])+1
    

Values in the column are of the format XXXX11XX1111 where X's are alphabets &
1's are numerals. I want to extract only last four digits of this field.

What baffles me is that it was working perfectly fine for more than 1000
records & suddenly started failing for no reason. I even deleted records &
started a fresh, still it fails.


Answer: Empty cell in the column caused that issue. Filling it with appropriate value
resolved the issue.

