(May-24-2018, 03:53 PM)oldcity Wrote: The plan is to work with 11 categories.If you want do some work with data Pandas give a lot for free,take a look later.
Can first look at csv module,i guss you want to add header so it look like this.
Output:pdate,catg,atm,howp
010118,1,1.00,1
020218,2,2.22,2
030318,3,33.33,3
040418,4,44.44,4
This code gives output over.import csv with open("expenses-18.csv") as f, open("output.csv","w", newline='') as f_out: cr = csv.reader(f) cw = csv.writer(f_out) header = ['pdate', 'catg', 'atm', 'howp'] cw.writerow(header) cw.writerows(cr)Pandas as mention you get a lot for free ,if need to work with data.
Here add header,and all data get convert to integer64 or float64.
Now it's easy to calculate with data or add plot ect.
>>> import pandas >>> df = pandas.read_csv('expenses-18.csv', header=None) >>> df.columns = ['pdate', 'catg', 'atm', 'howp'] # It's now a Dataframe >>> df pdate catg atm howp 0 10118 1 1.00 1 1 20218 2 2.22 2 2 30318 3 33.33 3 3 40418 4 44.44 4 >>> # All is correct type >>> df.catg 0 1 1 2 2 3 3 4 Name: catg, dtype: int64 >>> df.atm 0 1.00 1 2.22 2 33.33 3 44.44 Name: atm, dtype: float64
Quote:Using Python version 2.7.12 on Linux Mint 18.2.Drop Python 2 there is no excuses for use it anymore
![Wink Wink](https://python-forum.io/images/smilies/wink.png)
Mint 18.2 comes with Python 3.5,look at Linux Python 3 environment