Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Simple Average
#1
I'm new to Python and I want to start using it vs. using Excel.  

At the moment, I want to calculate the average selling price using a comma separated file that looks similar to this:

Filename:  pricelist.txt

Part Number      Amount
        A                   10
        A                   12
        A                   19
        A                   12
        B                   19
        B                   13
        B                   10

I want to see the output to look similar to this:
Part Number    Amount
        A               13.25
        B               14

How would I write code to do this?

Thanks a million in advance!!!!

Regards,

Dan
Reply


Messages In This Thread
Simple Average - by ddoogles - Feb-02-2017, 05:40 PM
RE: Simple Average - by buran - Feb-02-2017, 05:45 PM
RE: Simple Average - by ddoogles - Feb-02-2017, 06:23 PM
RE: Simple Average - by buran - Feb-02-2017, 07:12 PM
RE: Simple Average - by wavic - Feb-02-2017, 07:49 PM
RE: Simple Average - by ddoogles - Feb-02-2017, 09:46 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020