-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathfile_create.py
More file actions
39 lines (36 loc) · 781 Bytes
/
file_create.py
File metadata and controls
39 lines (36 loc) · 781 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import pandas
from datetime import *
import csv
import plotly.tools as tls
import matplotlib.pyplot as plt
import numpy as np
df=pandas.DataFrame(columns=["Code"])
date=str(datetime.today())
temp=1
lis=[]
while(temp==1):
moist=input("Enter code: ")
lis.append(moist)
temp=int(input())
df['Code']=lis
df.to_csv("date.csv",index=False)
report=[]
date=str(datetime.now())
df=pandas.read_csv("date.csv")
report=[]
temp=1
while(temp==1):
moist=int(input("moisture: "))
report.append(moist)
temp=int(input("0/1"))
new_c=date[10:16]
df[new_c]=report
df.to_csv("date.csv")
x=df.Code
y=df[new_c]
plt.bar(x,y,label='moisture content')
plt.xlabel('Plant Code')
plt.ylabel('Moisture')
plt.title(new_c)
plt.legend()
plt.show()