Have a bunch of lists that are converted from a .txt file that have been read as a collection of strings that look like:
['New', 'Jersey', '1', '0', '1', '999']
['West', 'North', 'Central', '1', '0', '100', '90']
These lists have differing numbers of side-by-side words (the first has 2 the second has 3, etc..)
I want to output a new list (then into a compiled dataframe) that joins the words together that are side-by-side like:
['New Jersey', '1', '0', '1', '999']
['West North Central', '1', '0', '100', '90']
Which will make the new list (and dataframe) of the same length.
It's easy to just append(line.split())
into a new list for each string but can't figure out the if-statement and .join() needed to join all words and append each number separately.