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进行数据分析>.这里记录一下学习过程,其中有些方法和书中不同 ...
随机推荐
- Windows API 查找窗体,发送Windows消息
最近项目中需要做Windows消息截获操作,在网上找了一些资料. public class WindowsAPI { /// <summary> /// 回调函数代理 /// </s ...
- 将csv导出json格式
将csv导出json格式 import os,csv,json cf = open('D:\OneDrive\\Tech\\Script\\Powershell_Script\\Uxin_work\\ ...
- LAMP配置NFS页面共享,autofs实现挂载,DNS实现名称解析,纯手动操作
0.实验架构: 共6台服务器 分工如下: 服务器 职责 IP地址 Centos版本 描述 A DNS 172.18.7.70 7 B Apache 172.18.7.71 7 httpd+php-fp ...
- jquery.form.js(ajax表单提交)
Form插件地址: 官方网站:http://malsup.com/jQuery/form/ 翻译地址:http://www.aqee.net/docs/jquery.form.plugin/jquer ...
- jQueryeasyUI+Hibernate+struts2实现商城后台管理之添加操作时的unique验证
1. 在admin.js中添加扩展验证的操作checkName var checkUrl = "./hytc/AdminAction_check.action";
- 【Java虚拟机结构(第1部分)数据类型】摘要
<Java虚拟机规范(Java SE 7版)>作者:Tim Lindholm.Frank Yellin.Gilad Bracha.Alex Buckley 摘要:第二章 Java虚拟机结构 ...
- BZOJ4807:車(组合数学,高精度)
Description 众所周知,車是中国象棋中最厉害的一子之一,它能吃到同一行或同一列中的其他棋子.車跟車显然不能在一起打起来,于是rly一天又借来了许多许多的車在棋盘上摆了起来……他想知道,在N× ...
- numeric_limits<>函数
因为比较有用,所以自己试验并且翻译了一下,很可能有错误,希望发现错误的朋友能给我留言纠正,谢谢! 有部分没有翻译,因为还没弄清楚到底什么作用 numeric_limits是模板类. 需要注意的是返回值 ...
- Css3 实现丝带效果
代码如下: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF ...
- urlparse 用法
ifrom urllib2 import urlparse ‘’ captcha_id = urlparse.parse_qs(urlparse.urlparse(link).query, True) ...