I have ran descriptive statistics on a dataset but I have to write them to a CSV and TXT file. Here is my code so far in that section:
dfst=pd.DataFrame(sk)
print (dfst.describe())
dfstt=pd.DataFrame(ku)
print (dfstt.describe())
dfst.describe().to_csv('skewness_stats.csv',index=True)
dfstt.describe().to_csv('kurtosis_stats.csv', index=True)
The DF's run descriptive statistics on Kurtosis and Skewness simulations I ran. I am able to write the statistics to seperate CSV files, but how do I write them to the same one with column headers, etc.? Also unsure how to write them to the same TXT file. Any Ideas?
This is Python 3.10 by the way