You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
832 B

#!/usr/bin/env python
# coding: utf-8
# In[ ]:
import pandas as pd
#读取cvs文件
file="1.csv"
csvPD=pd.read_csv(file)
csvPD['starthour']
csvPD['endhour']
csvPD['name']
for i in range(len(csvPD)):
if str(csvPD['starthour'][i])=="2022-1-28":
print(csvPD['starthour'][i])
for i in range(len(csvPD)):
if str(csvPD['endhour'][i])=="2022-1-29":
print(csvPD['endhour'][i])
for i in range(len(csvPD)):
if str(csvPD['name'][i])=="理发":
print(csvPD['name'][i])
keyWord="1001A"
for i in range(len(csvPD)):
if str(csvPD['starthour'][i])=="2022-1-28" and str(csvPD['type'][i])== "AQI":
result=csvPD[keyWord][i]
keyWord="1001A"
for i in range(len(csvPD)):
if str(csvPD['endhour'][i])=="2022-1-29" and str(csvPD['type'][i])== "AQI":
result=csvPD[keyWord][i]