I have a master CSV file that looks something like this -- it's only 1 column.
column_name
string1010string
string1013string
string1014string
string1015string
string1016string
string1018string
string1020string
Then I have a temporary CSV that I would like to keep track of separtely but also merge it with the master CSV and have it sorted in ascending order only taking the integers into consideration. I am aware that I have to strip the strings (from the start & the end) of each row to isolate the integers and then sort but I'm not quite sure how to approach it after that.
column_name
string1011string
string1012string
string1017string
string1019string
My function looks something like this:
def output_master_concatenated(list1, list2):
master= pd.concat([list1, list2])
#sorting_system
master.to_csv(str('master' + '.csv'), index = False, sep = ' ')
return master
Ideally, this is what I would like it to look like.
column_name
string1010string
string1011string
string1012string
string1013string
string1014string
string1015string
string1016string
string1017string
string1018string
string1019string
string1020string
update: string(integer)string is actually a link, each row is basically the same link with only the integer changing
stringpart literal or variable? Fixed length? Alpha only? etc. Can you update your question to reflect this?http://www.company.tld/path/to/1010/page.phporhttp://www.compagny.tld/path/to/page.php?id=1010'http://www2.example3.tld/4/x/1234'