#FREQ File Create
name = fixed_data['Sample ID'].unique()
number = fixed_data.shape[0]
temp_list = pd.DataFrame(
{'ids': name,
'nums': number,
})
fileAppendName1 = concon + "FREQ.FREQ"
with open(fileAppendName1, 'a') as f:
temp_list.to_csv(f, header=False, index = False)
This code compiled by Jupyter notebook create FREQ file property and that file looks like this:
name[i], num[i]
name[i], num[i]
name[i], num[i]
name[i], num[i]
But if I download the file as .py and try to run it from cmd by doing python file.py when i open the property file in wordpad I got this:
name[i], num[i]name[i], num[i]name[i], num[i]name[i], num[i]
all in one line.
in MS notepad I got:
name[i], num[i]
name[i], num[i]
name[i], num[i]
with an empty line between.
Can someone explain to me why? And can someone give me advice about what I should change in the code to reach first (from Jupyter compilator) result?
EDIT: I forgot. That sample of code work in a big loop working on many files.