Search code examples
python-3.xexceldatabasegrouping

Creating tables for clean Data


let me start out by saying I have a basic understanding of python and excel. What I’m trying to do is take a CSV file with data points for voltages along side with date in mm/dd/yyyy in a separate column, and averaging the data points for each day into a chart. There’s roughly 10000 data points for the month each separated by 5 minute increments. I don’t know where to start. I also have to do this about 12 separate times so if I can just feed a program an excel file or data from notepad that would help me tremendously.

I’m a bit rusty with python but I can read it pretty well to figure out what does what. Any help would be greatly appreciated.

If I can do this all in excel then that would be amazing. But I would like to brush up on my coding. If someone can point me in the right direction, I’m using Jupyter notebook and excel for reference. I tried starting with just opening the file with open() but now I don’t even know where to begin. Should I install pandas? Selenium?

I tried grouping the data in excel manually by using group. I tried opening up files in Python and creating a list of values to go through and average them. I also looked into using pivot tables to group the data as well.


Solution

  • No coding needed for that. Excel pivot can solve it.

    1. Bring your date column in a format excel understands as date. SourceData

    2. Insert pivot from the range that contains your data

    3. Drag the Date to lower left quadrant rows

    4. Drag the voltage to lower right quadrant values

    5. Change aggregation of values from sum to average

    pivotQuadrants

    1. The result will be this table:

    TheResult