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 🙂
Day 22 of my #100DaysOfCode #Python challenge, done! Today I learned to import csv files and more importantly tp use pandas with csv data.
— Wouter Kursten (@Magneet_nl) January 25, 2021
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))