May-20-2020, 04:06 PM
I have a csv file with 4 columns.
col 1 (numbers)
col 2 (text)
col 3 (numbers)
col 4 (text)
technically all four columns have a format type of general, basically my number are not really numbers which is fine.
When I import into pandas it removes my leading zeros for ONLY 3 (col 1 loads fine for some reason). How can I keep the leading zeros for col 3? I guess I have to tell pandas to treat those columns as strings?
col 1 (numbers)
col 2 (text)
col 3 (numbers)
col 4 (text)
technically all four columns have a format type of general, basically my number are not really numbers which is fine.
When I import into pandas it removes my leading zeros for ONLY 3 (col 1 loads fine for some reason). How can I keep the leading zeros for col 3? I guess I have to tell pandas to treat those columns as strings?
df = pd.read_csv("myfile.csv")*I am new to python