zoukankan      html  css  js  c++  java
  • 吴裕雄--天生自然 python数据分析:加纳卫生设施数据分析

    import numpy as np # linear algebra
    import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)
    
    # Any results you write to the current directory are saved as output.
    import matplotlib.pyplot as plt
    import seaborn as sns
    
    %matplotlib inline
    path = "F:\kaggleDataSet\"
    facility_tiers = pd.read_csv(path + os.listdir(path)[1])
    facility_tiers.head()

    facility_gh = pd.read_csv(path + os.listdir(path)[0])
    facility_gh.head()

    plt.figure(figsize=(12, 4))
    ax = sns.countplot(facility_gh['Region'])
    plt.title('Distribution of Regions')

    plt.figure(figsize=(20, 6))
    ax = sns.countplot(facility_gh['Ownership'])
    plt.title('Distribution of Ownership')

    from mpl_toolkits.basemap import Basemap
    
    fig = plt.figure()
    m = Basemap(projection='cyl', llcrnrlon=-180, urcrnrlon=180, llcrnrlat=-90, urcrnrlat=90, resolution='c',lat_ts=True)
    m.drawcoastlines()
    m.fillcontinents(color='#04BAE3', lake_color='#FFFFFF')
    m.drawcountries()
    m.drawmapboundary(fill_color='#FFFFFF')
    
    mloc = m(facility_gh['Latitude'].tolist(), facility_gh['Longitude'].tolist())
    m.scatter(mloc[1], mloc[0], color='red', lw=3, alpha=0.3, zorder=5)

  • 相关阅读:
    java中float内存存储原理
    java生产者消费者模式代码示例
    数据库死锁解决方案
    eclipse插件FindBugs使用笔记
    cmd查看环境变量
    springsECURITYDemo依赖
    2.27上课使用页面
    激活idea
    麻蛋 居然在jdk 问题上弱智
    Erek
  • 原文地址:https://www.cnblogs.com/tszr/p/11228316.html
Copyright © 2011-2022 走看看