| 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. awk 正则表达式、正则运算符详细介绍

    前言:使用awk作为文本处理工具,正则表达式是少不了的. 要掌握这个工具的正则表达式使用.其实,我们不必单独去学习它的正则表达式.正则表达式就像一门程序语言,有自己语法规则已经表示意思. 对于不同工具 ...

  2. ‘ActiveX component can’t create object解决方法

    Event Type:    WarningEvent Source:    Health Service ScriptEvent Category:    NoneEvent ID:    1Dat ...

  3. Linux watch命令详解

    watch可以帮你监测一个命令的运行结果,来监测你想要的一切命令的结果变化 常见命令参数 Usage: watch [-dhntv] [--differences[=cumulative]] [--h ...

  4. xise官方网站|XISE官网|xise最新版下载|超级XISE WBMS管理V12.0版本官方网站|

    诠释: 1. 破解VIP登陆限制 2.去后门 (自查) 下载地址 :https://pan.baidu.com/s/1eR2rUOM 查毒地址:http://a.virscan.org/a3983f3 ...

  5. 解决charles中文乱码(附代码)

    1. 将下面的代码保存为一个*.xml的文件 <?xml version='1.0' encoding='UTF-8' ?> <?charles serialisation-vers ...

  6. 通过webview控件访问网页

    初学android开发,在界面编辑器上放了一个webview控件,可惜不知道如何访问控件,在网上看到一段代码记录下来,算是第一次学习笔记. 要想让程序联网需要授权,在AndroidManifest.x ...

  7. SQL Server系统常用存储过程

    SQL Server系统存储过程也是好几百个,算了,还是写几个常用的. 1.sp_help 查询表的信息 执行存储过程: sp_help Person 显示结果如下: 妈了个B,有了这张图,你还不懂怎 ...

  8. 内网渗透中的mimikatz

    0x00 前言 上篇测试了中间人攻击利用框架bettercap,这次挑选一款更具代表性的工具--mimikatz 0x01 简介 mimikatz,很多人称之为密码抓取神器,但在内网渗透中,远不止这么 ...

  9. lisp base

    一 .quote lisp 使用s-expr表示数据和代码,通常会将第一项作为函数,而将后续元素当做参数传给第一项进行计算.可以通过quote来进行其他解析,quote可用(‘)表示: ( + 1 1 ...

  10. python面向对象之类成员

    面向对象编程: OOP编程是利用类和对象来创建各种模型来实现对真实世界的描述,使用面向对象编程的原因一方面是因为它可以使程序的维护和扩展变得简单,并可以大大提高程序开发效率.另外,基于面向对象的程序可 ...