Learning notes | Data Analysis: 1.1 data evaluation
| 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的更多相关文章
- Learning notes | Data Analysis: 1.2 data wrangling
| Data Wrangling | # Sort all the data into one file files = ['BeijingPM20100101_20151231.csv','Chen ...
- 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 ...
- Learning Spark: Lightning-Fast Big Data Analysis 中文翻译
Learning Spark: Lightning-Fast Big Data Analysis 中文翻译行为纯属个人对于Spark的兴趣,仅供学习. 如果我的翻译行为侵犯您的版权,请您告知,我将停止 ...
- 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 ...
- 《利用Python进行数据分析: Python for Data Analysis 》学习随笔
NoteBook of <Data Analysis with Python> 3.IPython基础 Tab自动补齐 变量名 变量方法 路径 解释 ?解释, ??显示函数源码 ?搜索命名 ...
- Python for Data Analysis
Data Analysis with Python ch02 一些有趣的数据分析结果 Male描述的是美国新生儿男孩纸的名字的最后一个字母的分布 Female描述的是美国新生儿女孩纸的名字的最后一个字 ...
- 深入浅出数据分析 Head First Data Analysis Code 数据与代码
<深入浅出数据分析>英文名为Head First Data Analysis Code, 这本书中提供了学习使用的数据和程序,原书链接由于某些原因不 能打开,这里在提供一个下载的链接.去下 ...
- 数据分析---《Python for Data Analysis》学习笔记【04】
<Python for Data Analysis>一书由Wes Mckinney所著,中文译名是<利用Python进行数据分析>.这里记录一下学习过程,其中有些方法和书中不同 ...
- 数据分析---《Python for Data Analysis》学习笔记【03】
<Python for Data Analysis>一书由Wes Mckinney所著,中文译名是<利用Python进行数据分析>.这里记录一下学习过程,其中有些方法和书中不同 ...
随机推荐
- 类型“Microsoft.Office.Interop.Word.ApplicationClass”错误 4317 无法嵌入互操作类型
类型“Microsoft.Office.Interop.Word.ApplicationClass”错误 4317 无法嵌入互操作类型“Microsoft.Office.Interop.Word.Ap ...
- [翻译] LTInfiniteScrollView
LTInfiniteScrollView 效果: Usage - 使用 Create the scroll view by: 通过以下方式来创建出scroll view self.scrollView ...
- 51nod 1102 面积最大的矩形
题目地址在这儿 求取:以某矩形g[i]为最小值的区间的左右端点,得到一个临时解.所有临时解中的最大值即为解. 求取区间的方法可以用单调栈,也可以用下面这种十分简洁的类似于递归的方法.下面这种解法求出来 ...
- (六)Linux下的压缩命令
======================================================================================== .zip格式的压缩和解 ...
- [POI2006]TET-Tetris 3D
题目 二维线段树板子题啊 但是惊讶的发现我不会打标记 毕竟内层是线段树不能\(pushup\)也不能\(pushdown\) 于是考虑一下标记永久化 其实非常显然\(mx_i\)表示区间最大值,\(t ...
- 随手练——HDU 1237 表达式求值(输入格式典型)
坑了老子半天,结果是 float 范围不够!!! 基本思想: 开一个符号栈,一个数字栈: 碰到数字就入栈,碰到符号就与栈顶符号进行对比,如果当前符号优先级小于栈顶符号,数字栈弹出两个数进行栈顶符号运算 ...
- ionic 入门创建第一个应用demo
一.ionic卸载 1.清除旧版本的ionic框架 npm uninstall -g ionic npm uninstall -g cordova npm cache clear npm cache ...
- 32位 的变量 用于表示 ms ,可以表示多少天那?
1.在 TI 的 BLE 协议栈 中,即 OSAL 中 获取当前 系统 tick 的方法如下 /* * Read the system clock - returns milliseconds * ...
- Gradle Goodness: Display Available Tasks
To see which tasks are available for our build we can run Gradle with the command-line option -t or ...
- ts简单点
typescript 简洁使用 *做最简洁核心的记录,可以节约时间.再是提炼概括,理解归纳.便于日后查阅联想* > typescript原则之一: 对值所具有的结构进行类型检查 #### 基础类 ...