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进行数据分析>.这里记录一下学习过程,其中有些方法和书中不同 ...
随机推荐
- [翻译] SlideInView
SlideInView This is a quick and lightweight example of how to present a notification like view from ...
- HTML学习---HTML状态码
301 Moved Permanently 永久移动.请求的资源已被永久的移动到新URI,返回信息会包括新的URI,浏览器会自动定向到新URI.今后任何新的请求都应使用新的URI代替302 Found ...
- netstat 常用方法
netstat简介 netstat是一个监控TCP/IP网络的非常有用的工具,它可以显示路由表,实际的网络连接以及每一个网络接口设备的状态信息,netstat用于显示与IP,TCP,UDP和ICMP协 ...
- [COGS 2065]学数数
2065. 学数数 ★★★☆ 输入文件:jxthree.in 输出文件:jxthree.out 简单对比时间限制:1 s 内存限制:256 MB [题目描述] 从前有一只咩,还有一只叽 ...
- 排序算法Java版,以及各自的复杂度,以及由堆排序产生的top K问题
常用的排序算法包括: 冒泡排序:每次在无序队列里将相邻两个数依次进行比较,将小数调换到前面, 逐次比较,直至将最大的数移到最后.最将剩下的N-1个数继续比较,将次大数移至倒数第二.依此规律,直至比较结 ...
- Cordova Android源代码分析系列一(项目总览和CordovaActivity分析)
版权声明:本文为博主offbye西涛原创文章.未经博主同意不得转载. https://blog.csdn.net/offbye/article/details/31776833 PhoneGap/Co ...
- 【NOIP2014】解方程
题目描述 已知多项式方程 \[a_0 + a_1x + a_2x^2 + \dots +a_nx^n=0\] 求这个方程在\([1,m]\)内的整数解(\(n\)和\(m\)均为正整数). 输入输出格 ...
- [19/04/30-星期二] GOF23_行为型模式(中介者模式、命令模式、解释器模式、访问者模式)
一.中介者模式(meditor) [中介] /*** * 抽象中介者接口和其具体实现类"经理"类 */ package cn.sxt.meditor; import java.ut ...
- 【React】使用 create-react-app 快速构建 React 开发环境
create-react-app 是来自于 Facebook,通过该命令我们无需配置就能快速构建 React 开发环境. create-react-app 自动创建的项目是基于 Webpack + E ...
- Hadoop学习笔记---HDFS
Hadoop分布式文件系统(HDFS)被设计成适合运行在通用硬件(commodity hardware)上的分布式文件系统.HDFS是一个高度容错性的系统,适合部署在廉价的机器上.HDFS能提供高吞吐 ...