Commit 5dd1b131 authored by banashree.p's avatar banashree.p

Assignment-1,task-2

parent 5b6833ce
# Default ignored files
/shelf/
/workspace.xml
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="PyUnresolvedReferencesInspection" enabled="true" level="WARNING" enabled_by_default="true">
<option name="ignoredIdentifiers">
<list>
<option value="main.device" />
<option value="main.Dr_Bana" />
<option value="str.__setitem__" />
</list>
</option>
</inspection_tool>
</profile>
</component>
\ No newline at end of file
<component name="InspectionProjectProfileManager">
<settings>
<option name="USE_PROJECT_PROFILE" value="false" />
<version value="1.0" />
</settings>
</component>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.9 (pythonProjecttask2)" project-jdk-type="Python SDK" />
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/pythonProjecttask2.iml" filepath="$PROJECT_DIR$/.idea/pythonProjecttask2.iml" />
</modules>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$/.." vcs="Git" />
</component>
</project>
\ No newline at end of file
This diff is collapsed.
from starlette.responses import FileResponse
import uvicorn
#from service import minm
from fastapi import FastAPI
#from service import monthlytempdata
from code import weeklytempdata, dailytempdata, monthlytempdata
from qu import *
app = FastAPI()
@app.get("/getData1")
def monthlytempdata1():
fpath,fname = monthlytempdata()
return FileResponse(fpath, media_type='application/octet-stream', filename=fname)
@app.get("/getData2")
def dailytempdata1():
fpath,fname = dailytempdata()
return FileResponse(fpath, media_type='application/octet-stream', filename=fname)
@app.get("/getData3")
def weeklytempdata1():
fpath, fname = weeklytempdata()
return FileResponse(fpath, media_type='application/octet-stream',filename=fname)
if __name__ == '__main__':
uvicorn.run('appi:app')
\ No newline at end of file
This diff is collapsed.
import pandas as pd
from datetime import datetime
epoch = datetime.strptime('2004-12-31 1:00:00', '%Y-%m-%d %H:%M:%S').timestamp()
print(epoch)
pd.options.display.max_rows = 99999
df = pd.read_csv("airrrr1-AirQualityUCI-_1_ - Worksheet.csv")
print(df.head(10))
print(df.Datetime)
print(df["Datetime"].values.tolist())
seconds = []
for j in df['Datetime'].values:
seconds.append(int(datetime.strptime(j, "%m/%d/%Y%H:%M:%S").timestamp()) * 1000)
print(seconds)
df['Datetime'] = seconds
print(df['Datetime'])
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment