0
이 프로젝트가 끝나갈 무렵입니다. 다시 붙어 있습니다. 지금까지 프로그램은 특정 데이터를 추출하는 URL에서 usgs 사이트로 이동합니다. 데이터와 메타 데이터를 분리하여 다른 것을해야한다는 것을 알고 있습니다.datatime.datatime.strptime으로 날짜를 추출하십시오.
데이터 나 데이터가 확실하지 않습니다. 데이터 내가 채워 것을 것은 여기에 1500 라인은 내가 지시로 주어진 몇
USGS 14211720 2017-01-30 19:15 PST 28600 P 6.26 P
USGS 14211720 2017-01-30 19:30 PST 30400 P 6.17 P
USGS 14211720 2017-01-30 19:45 PST 38300 P 6.03 P
source site # date discharge stage level
부분 코드 내가 코드에서 믿고있어
import datetime
# define empty lists, we will append the data to them
dateList = []
dischargeList = []
stagelevelList = []
for line in dataLines:
# use 'datatime.datatime.strptime()' to extract date
#use the '.strip()' and float() functions to convert values
print (dateList)
print("we have {} items in the date list".format(len(dateList)))
print("we have {} items in the discharge list".format(len(dischargeList)))
print("we have {} items in the velocity list".format(len(stagelevelList)))
그래서 나는 date_obj 라인을 추가하고, dateList의으로 .Append (라인)를 첨가하고, 나는이 (가)입니다 .END_ITEMEND_UNORDERED_LISTEND_PARAGRAPHSTART_PARAGRAPHSTART_BOLDDATE_STR가 정의되지와 dateList가 비어있다, 나는 정의 된 모든 파일의 세 개 이제까지 무엇을 작성해야 그들이 1400 줄 목록의 데이터로 호출되지만 각 열에 특정 열만 넣어야합니다. –