0

I have bulk of Datasets, which is filter from CSV file. I need to map these values to the CSV file.

i used the below code to store values in Array

import csv
import time

with open("/path to file/report.csv", "r", encoding='utf-8-sig') as f:
    reader = csv.DictReader(f)
    rows = [row for row in reader if row['Temp'] > '25.00']

arr_list = []
for row in rows:
    arr_list.append(row)

Output

array_data = [{'Time': '2021-04-19 23:14:50', 'Temp': '25.21'}, {'Time': '2021-04-19 23:24:08', 'Temp': '25.16'}, {'Time': '2021-04-19 23:33:26', 'Temp': '25.35'}, {'Time': '2021-04-19 23:42:44', 'Temp': '25.45'}, {'Time': '2021-04-19 23:52:03', 'Temp': '25.45'}, {'Time': '2021-04-20 00:01:21', 'Temp': '25.39'}, {'Time': '2021-04-20 00:10:38', 'Temp': '25.71'},
...
//Continues bulk data

I need to store these values in CSV file. Headers are 'Time' Vs 'Temp'

Dilux
  • 136
  • 7
  • 1
    What have you tried? I've attached a link as a place to start that will hopefully give you some ideas https://pandas.pydata.org/pandas-docs/stable/user_guide/visualization.html – el_oso May 17 '21 at 21:27
  • check https://stackoverflow.com/questions/37289951/how-to-write-to-a-csv-line-by-line – lojza May 18 '21 at 08:40

0 Answers0