| Data Evaluation |

- Use Shift + Enter or Shift + Return to run the upper box so as to make it display the edited text format.

- Markdown used for text writing, while the other is Code cell used for code writing.

import csv
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn
%matplotlib inline

  # Import/load the data set use the read_csv function of Pandas

Shanghai_data = pd.read_csv('ShanghaiPM20100101_20151231.csv')

  # View the basic information of data by means of head, info and describe.

Shanghai_data.head()
Shanghai_data.info()

  # Print type of python object

print(type(Shanghai_data['cbwd'][0]))

  # Change the space into an underline

Shanghai_data.columns = [c.replace(' ', '_') for c in Shanghai_data.columns]

  # Convert the numerical value of 1, 2, 3, 4 to four corresponding seasons (by means of the map method of Pandas):

Shanghai_data['season'] = Shanghai_data['season'].map({1:'Spring', 2:'Summer', 3:'Autumn', 4: 'Winter'})

- Check data missing and data type:

  # Print the length of data

print("The number of row in this dataset is ",len(Shanghai_data.index))

  # Calculating the number of records in column "PM_Jingan"

print("There number of missing data records in PM_Jingan is: ",len(Shanghai_data.index) - len(Shanghai_data['PM_Jingan'].dropna()))

Note: # “dropna()” function used in the following code can delete missing value in data.

Learning notes | Data Analysis: 1.1 data evaluation的更多相关文章

  1. Learning notes | Data Analysis: 1.2 data wrangling

    | Data Wrangling | # Sort all the data into one file files = ['BeijingPM20100101_20151231.csv','Chen ...

  2. How to use data analysis for machine learning (example, part 1)

    In my last article, I stated that for practitioners (as opposed to theorists), the real prerequisite ...

  3. Learning Spark: Lightning-Fast Big Data Analysis 中文翻译

    Learning Spark: Lightning-Fast Big Data Analysis 中文翻译行为纯属个人对于Spark的兴趣,仅供学习. 如果我的翻译行为侵犯您的版权,请您告知,我将停止 ...

  4. An Introduction to Stock Market Data Analysis with R (Part 1)

    Around September of 2016 I wrote two articles on using Python for accessing, visualizing, and evalua ...

  5. 《利用Python进行数据分析: Python for Data Analysis 》学习随笔

    NoteBook of <Data Analysis with Python> 3.IPython基础 Tab自动补齐 变量名 变量方法 路径 解释 ?解释, ??显示函数源码 ?搜索命名 ...

  6. Python for Data Analysis

    Data Analysis with Python ch02 一些有趣的数据分析结果 Male描述的是美国新生儿男孩纸的名字的最后一个字母的分布 Female描述的是美国新生儿女孩纸的名字的最后一个字 ...

  7. 深入浅出数据分析 Head First Data Analysis Code 数据与代码

    <深入浅出数据分析>英文名为Head First Data Analysis Code, 这本书中提供了学习使用的数据和程序,原书链接由于某些原因不 能打开,这里在提供一个下载的链接.去下 ...

  8. 数据分析---《Python for Data Analysis》学习笔记【04】

    <Python for Data Analysis>一书由Wes Mckinney所著,中文译名是<利用Python进行数据分析>.这里记录一下学习过程,其中有些方法和书中不同 ...

  9. 数据分析---《Python for Data Analysis》学习笔记【03】

    <Python for Data Analysis>一书由Wes Mckinney所著,中文译名是<利用Python进行数据分析>.这里记录一下学习过程,其中有些方法和书中不同 ...

随机推荐

  1. HAProxy负载均衡保持客户端和服务器Session亲缘性的3种方式

    1 用户IP 识别  haroxy 将用户IP经过hash计算后 指定到固定的真实服务器上(类似于nginx 的IP hash 指令) 配置指令: balance source 配置实例: backe ...

  2. August 18th 2017 Week 33rd Friday

    If you shed tears when you miss the sun, you also miss the stars. 如果你因为错过太阳而哭泣,你也将会错过繁星. If you have ...

  3. 浅析VS2010反汇编

    第一篇 1. 怎样进行反汇编 在调试的环境下,我们能够很方便地通过反汇编窗体查看程序生成的反汇编信息. 例如以下图所看到的. 记得中断程序的运行,不然看不到反汇编的指令 看一个简单的程序及其生成的汇编 ...

  4. codeforces 414D Mashmokh and Water Tanks

    codeforces 414D Mashmokh and Water Tanks 题意 题解 \(a_i\):第 \(i\) 层的结点个数. \(b_i\):第 \(i\) 层初始有水的结点个数. 如 ...

  5. Centos 7 iptables配置

    systemctl status firewalld.service #检测是否开启了firewall systemctl stop firewalld.service #关闭firewall syt ...

  6. nfs 安装配置

    系统环境:centos 6.4 x86_64 minimal,记得是199个安装包. 两台机器(可以是虚拟机): 192.168.1.150--->a机器 192.168.1.11-----&g ...

  7. python3 安装win32api

    Python3 中先安装pip install pywin32 但是在调用时任然说找不到该模块,于是查找资料后得出需要使用python -m pip install pypiwin32.

  8. C/C++ 格式化读取和读取一行

    文件内容 23 21 4 1 1 0 114 1 1 1 8 112 5 0 0 0 114 1 0 0 0 115 52 4 1 0 1 134 4 0 1 12 131 4 1 1 0 133 5 ...

  9. python反序列化

    import pickle import os class A(object): def __reduce__(self): a = """python -c 'impo ...

  10. xss练习平台及writeup

    今天玩了一天的xss. 分享几个xss game https://xss.haozi.me/#/0x00 http://47.94.13.75/test/  writeup:http://www.cn ...