博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
data mining 2 (import numpy, pandas )
阅读量:6527 次
发布时间:2019-06-24

本文共 1960 字,大约阅读时间需要 6 分钟。

numpy: process the data& array

pandas:data analysis and explore

matplotlib:show with mat &plot 

scipy: matrix integration

statsmodels: statistic

Gensim:tex mining

sklearn、keras:computing learning’

 

numpy:

import numpy as nn a=nn.array(["element1","element2","1","8a"]) a.sort() b=nn.array([["key1","key2"],["1","2","0"],["a","2","0b"]]) b.sort() print(a,b) a1=a[0:4] a2=a[:3] a3=a[1:] b1=b.max() print(a[0],a1,a2,a3) print(b[0][1],b1) pandas:
import pandas as p c=p.Series([2,2,3,4,5,3]) print(c) c1=p.Series([3,4,5,6,7],index=["one","two","three","four","five"]) print(c1) d=p.DataFrame([["a","b","c",2],[2,3,1,2,3,4,6]],columns=["one","two","three","four","five","six","seven"]) print(d) d1=p.DataFrame({
"one":3, "two":[3,4,5], "three":list(str(233)) }) print(d1) d2=d.head()#first five lines d3=d.head(2) d4=d.tail()#last five lines d5=d.tail(3) d6=d.describe() d7=d.T# trans line to column print(d2,d3,d4,d5,d6,d7)

['1' '8a' 'element1' 'element2'] [list(['1', '2', '0']) list(['a', '2', '0b']) list(['key1', 'key2'])]

1 ['1' '8a' 'element1' 'element2'] ['1' '8a' 'element1'] ['8a' 'element1' 'element2']
2 ['key1', 'key2']
0 2
1 2
2 3
3 4
4 5
5 3
dtype: int64
one 3
two 4
three 5
four 6
five 7
dtype: int64
one two three four five six seven
0 a b c 2 NaN NaN NaN
1 2 3 1 2 3.0 4.0 6.0
one three two
0 3 2 3
1 3 3 4
2 3 3 5
one two three four five six seven
0 a b c 2 NaN NaN NaN
1 2 3 1 2 3.0 4.0 6.0 one two three four five six seven
0 a b c 2 NaN NaN NaN
1 2 3 1 2 3.0 4.0 6.0 one two three four five six seven
0 a b c 2 NaN NaN NaN
1 2 3 1 2 3.0 4.0 6.0 one two three four five six seven
0 a b c 2 NaN NaN NaN
1 2 3 1 2 3.0 4.0 6.0 four five six seven
count 2.0 1.0 1.0 1.0
mean 2.0 3.0 4.0 6.0
std 0.0 NaN NaN NaN
min 2.0 3.0 4.0 6.0
25% 2.0 3.0 4.0 6.0
50% 2.0 3.0 4.0 6.0
75% 2.0 3.0 4.0 6.0
max 2.0 3.0 4.0 6.0 0 1
one a 2
two b 3
three c 1
four 2 2
five NaN 3
six NaN 4
seven NaN 6

 

转载于:https://www.cnblogs.com/rabbittail/p/7724134.html

你可能感兴趣的文章
DLL,DML,DCL,TCL in Oracle
查看>>
android之存储篇_存储方式总览
查看>>
SSE指令集学习:Compiler Intrinsic
查看>>
两种attach to process的方法
查看>>
WCF如何使用X509证书(安装和错误)(二)
查看>>
Dubbo与Zookeeper、SpringMVC整合和使用(负载均衡、容错)
查看>>
iOS中--NSArray调用方法详解 (李洪强)
查看>>
java异步操作实例
查看>>
Centos6.8防火墙配置
查看>>
php and web service with wsdl
查看>>
JAVA多线程的问题以及处理【转】
查看>>
【Java面试题】10 abstract的method是否可同时是static,是否可同时是native,是否可同时是synchronized?...
查看>>
简单记录一次ORA-00600 kcratr_nab_less_than_odr
查看>>
【视频教程】一步步将AppBox升级到Pro版
查看>>
开源Java时间工具类Joda-Time体验
查看>>
如何新建UML2项目?详细操作步骤介绍
查看>>
[精讲17] 组策略
查看>>
控制流
查看>>
interlij的快捷键
查看>>
如何在Rancher上运行Elasticsearch
查看>>