Day 22

Day 22 was spend importing csv files and what Pandas can do for you. I see some opportunity as a project to make my powershell base ControlUp Stress Calculator into a python app 🙂

Notes

csv files

import csv

with open("D:\\GIT\\100-days-of-python\\Days 22-29\\Day 22\\weather_data.csv") as data_file:
    #content=data_file.readlines()
    data = csv.reader(data_file)
    temperatures = []
    for row in data:
        if row[1] != "temp":
            temperatures.append(int(row[1]))
        print(row)
    print(temperatures)


pandas = better

import pandas

#data = pandas.read_csv("D:\\GIT\\100-days-of-python\\Days 22-29\\Day 22\\weather_data.csv")

data = pandas.read_csv("D:\\GIT\\100-days-of-python\\Days 22-29\\Day 22\\CUMONITOR01.controlUp.demo-ControlUp_Machines_09_28_2020_08_10_56.csv", skiprows=[0] , header=[0])
print(type(data))

 

Comments are closed.