sklearn实战-乳腺癌细胞数据挖掘(博主亲自录制视频)

https://study.163.com/course/introduction.htm?courseId=1005269003&utm_campaign=commission&utm_source=cp-400000000398149&utm_medium=share

执行结果

详细参数

city  #城市信息
cod #内部参数
cnt #预测天数
list #信息列表,主要获取weatherData---weather---main和description信息
message #内部参数

# -*- coding: utf-8 -*-
#! python3
# quickWeather.py - Prints the current weather for a location from the command line.
"""
Created on Sat Apr 16 10:24:28 2016 @author: daxiong
""" import json, requests, sys '''
# Compute location from command line arguments.
if len(sys.argv) < 2:
print('Usage: quickWeather.py location')
sys.exit()
location = ' '.join(sys.argv[1:])
'''
#城市名称
cityName="Chongqing"
#城市ID号
cityID="1814905"
#我的免费appID
appID="0383ae59663e14ab5a6855d5b6ad5d00"
#获取天气天数
days="3"
# Download the JSON data from OpenWeatherMap.org's API
url="http://api.openweathermap.org/data/2.5/forecast/city?id=%s&APPID=%s&cnt=%s"%(cityID,appID,days)
response = requests.get(url)
response.raise_for_status() # Load JSON data into a Python variable.
weatherData = json.loads(response.text) # Print weather descriptions.
#主要获取weatherData---weather---main和description信息
w = weatherData['list']
print('Current weather in %s:' % (cityName))
print(w[0]['weather'][0]['main'], '-', w[0]['weather'][0]['description'])
print()
print('Tomorrow:')
print(w[1]['weather'][0]['main'], '-', w[1]['weather'][0]['description'])
print()
print('Day after tomorrow:')
print(w[2]['weather'][0]['main'], '-', w[2]['weather'][0]['description']) '''
len(weatherData)
Out[21]: 5
for i in weatherData:
print(i)
city #城市信息
cod #内部参数
cnt #预测天数
list #信息列表,主要获取weatherData---weather---main和description信息
message #内部参数 ''' '''
weatherData
Out[23]:
{'city': {'coord': {'lat': 30.25, 'lon': 107.75},
'country': 'CN',
'id': 1814905,
'name': 'Chongqing Shi',
'population': 0,
'sys': {'population': 0}},
'cnt': 1,
'cod': '200',
'list': [{'clouds': {'all': 44},
'dt': 1460775600,
'dt_txt': '2016-04-16 03:00:00',
'main': {'grnd_level': 937.55,
'humidity': 98,
'pressure': 937.55,
'sea_level': 1025.81,
'temp': 288.16,
'temp_kf': 0.4,
'temp_max': 288.16,
'temp_min': 287.759},
'rain': {'3h': 0.01},
'sys': {'pod': 'd'},
'weather': [{'description': 'light rain',
'icon': '10d',
'id': 500,
'main': 'Rain'}],
'wind': {'deg': 267.501, 'speed': 1.63}}],
'message': 0.0109} '''

  

获取天气预报API的更多相关文章

  1. [整]C#获取天气预报信息(baidu api)包括pm2.5

    /// <summary> /// 获取天气预报信息 /// </summary> /// <returns></returns> public Bai ...

  2. 天气预报API(四):全国城市代码列表(“新编码”)

    说明 天气预报API系列文章涉及到的天气网站10个左右,只发现了中国气象频道和腾讯天气城市代码参数特别: 暂且称 中国气象频道.腾讯天气使用的城市代码为 "新编码" 注:中国气象频 ...

  3. 聚合数据全国天气预报api接口

    查询天气预报在APP中常用的一个常用功能,聚合数据全国天气预报api接口可以根据根据城市名/id查询天气.根据IP查询天气.据GPS坐标查询天气.查询城市天气三小时预报,并且支持全国不同城市天气预报查 ...

  4. 天气预报API简单实现

    本人小白,觉得好玩,就注册了一个博客.一时也不知道写些什么,就把昨天做的一个简单的网页天气预报写一下吧,希望对各位看官有所帮助. 运行环境:php+mysql+WIN/Linux,框架什么的都无所谓了 ...

  5. Android访问中央气象台的天气预报API得到天气数据

      最新说明:该接口已失效! 2014-03-04 可申请它公布的API,需申请:http://smart.weather.com.cn/wzfw/smart/weatherapi.shtml 在用A ...

  6. (41)zabbix监控api接口性能及可用性 天气预报api为例

    现在各种应用都走api,例如淘宝,天气预报等手机.pad客户端都是走api的,那么平时也得对这些api做监控了.怎么做呢?zabbix的web监控是不二选择了.今天就以天气预报api作为一个例子. 天 ...

  7. 如何用全国天气预报API接口进行快速开发

    最近公司项目有一个全国天气预报的小需求,想着如果用现成的API就可以大大提高开发效率,在网上的API商店搜索了一番,发现了 APISpace,它里面的全国天气预报API非常符合我的开发需求.   全国 ...

  8. 天气预报API开发

    天气预报API开发 一.        寻觅篇 最近想要跟着视频练习一下利用API开发一个天气预报系统,就在网上找了一下可以用的API,结果好多都已经失效了... 1.       百度车联网天气预报 ...

  9. Struts2中获取servlet API的几种方式

    struts2是一个全新的MVC框架,如今被广大的企业和开发者所使用,它的功能非常强大.这给我们在使用servlet 纯java代码写项目的时候带来了福音.但是一般来说,我们的项目不到一定规模并不需要 ...

随机推荐

  1. 【转】GPS定位准确度CEP、RMS

    转自:http://blog.sina.com.cn/s/blog_70f96fda0101lcb9.html CEP和RMS是GPS的定位准确度(俗称精度)单位,是误差概率单位.就拿2.5M CEP ...

  2. [buaa-SE-2017]个人项目

    个人项目 Part1:github https://github.com/Aria-K-Alethia/Sudoku Part2:解题思路描述 关于数独的解法 我选择的是暴力搜索算法. (1)关于 - ...

  3. Activiti For Eclipse(Mars)插件配置

    Activiti BPMN 2.0 designer : http://www.activiti.org/designer/update/

  4. Trouble shooting(问题解决):centos 7 gnome show someting has gone wrong.

    centos 7 升级 内核 3.10,startx启动不了了.进界面也是oh,no!someting has gone wrong . 参见帖子:http://bbs.csdn.net/topics ...

  5. vuex最简单、最详细的入门文档

    如果你在使用 vue.js , 那么我想你可能会对 vue 组件之间的通信感到崩溃 . 我在使用基于 vue.js 2.0 的UI框架 ElementUI 开发网站的时候 , 就遇到了这种问题 : 一 ...

  6. [百家号]雷电3和USB Type-C究竟有什么区别?

    雷电3和USB Type-C究竟有什么区别? https://baijiahao.baidu.com/s?id=1617271490773519582&wfr=spider&for=p ...

  7. Intel SP处理机以及AMD处理器的一些对比资料

    1. EPYC 与 intel的CPU对比 2. Intel SP处理器参数: 3. AMD处理器参数 4. Intel SP处理器部分参数2 5. Intel SP处理器简单说明 6. intel ...

  8. spring学习总结(一)_Ioc基础(上)

    最近经历了许许多多的事情,学习荒废了很久.自己的目标成了摆设.现在要奋起直追了.最近发现了张果的博客.应该是一个教师.看了他写的spring系列的博客,写的不错.于是本文的内容参考自他的博客,当然都是 ...

  9. 16mysql1

    一.数据库的基本概念 1.1  常用的关系型数据库                        数据库(Database)是按照数据结构来组织.存储和管理数据的仓库. 1.2  sql语言     ...

  10. java 使用 WebUploader

    参考: http://blog.csdn.net/finalAmativeness/article/details/54668090 最近项目需要多文件上传. 所以使用了 baidu的 webuplo ...