I am currently having issues exporting updated code in a csv, xlsx, or txt file. When run in a Sublime's text editor, the code displays properly, however once exported using pandas .to function, the data isn't exporting as when run in Sublime's text editor. The data simply exports as the original document.
Code used below:
import pandas as pd
df = pd.read_csv('test_data.csv')
print(df['Name']) # column 1, column 0 = index
df.to_csv('modified_data.txt', index = False)
I'm expecting once exported, the data to be a .txt file with only the names listed in the first column. The remaining columns however still show up in the txt. file. Same applies when I try to convert the document to a .csv or .xlsx.
Any suggestions would be appreciated.