自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(9)
  • 收藏
  • 关注

原创 Pandas基础(3)

赋值用索引自动对齐新增列的数据:s1 = pd.Series([1,2,3,4,5,6],index=pd.date_range('20200102',periods=6))output:按标签赋值:df.at[dates[0],'A'] = 0按位置赋值:df.iat[0,1] = 0按numpy数组赋值:df.loc[:,'D'] = np.array([5]*len(df))output:用where条件赋值:df2 = df.copy

2020-09-27 13:51:42 92

原创 Pandas基础(2)

dfdescribe()可以快速查看数据的统计摘要。df.describa()output:转置数据:df.Toutput:按轴排序df.sort_index(axis=1,ascending=False)output:选择获取数据选择单列,产生Series,与df.A等效。df['A']output:使用[ ]切片行:df[0:3]output:df['20200101':'20200104']

2020-09-24 13:52:34 89

原创 pandas基础(1)

导入Pandas与Numpyimport numpy as npimport pandas as pd生成对象用值列表生成Series时,Pandas默认自动生成整数索引:new = pd.Series([1,2,3,4,np.nan,6,9])output:用含日期时间索引与标签的Numpy数组生成的DataFrame:dates = pd.date_range('20200101',periods = 6)outputdf = pd.DataF

2020-09-23 15:16:44 104

原创 5个实用的pandas操作

1.explodeexplode用于将一行数据展开成多行。dataFrame中某一行其中一个元素包含多个类型的数据,可以使其分别展开。语法:DataFrame.explode(self,column:Union[str,Tuple])参数作用:column:str或tuple使用explode轻松将[2,3,8]转换成多行,且行内其他元素保持不变。2.NuniqueNunique用于计算行或列上唯一值的数量,即去重后计数。用法:Series.nunique(drop = True

2020-09-23 10:16:12 155

原创 keras和tensorflow对应版本

TensorFlow 1.14.0 + Keras 2.2.5 on Python 3.6. TensorFlow 1.13.0 + Keras 2.2.4 on Python 3.6. TensorFlow 1.12.0 + Keras 2.2.4 on Python 3.6. TensorFlow 1.12.0 + Keras 2.2.4 on Python 2. TensorFlow 1.11.0 + Keras 2.2.4 on Python 3.6. TensorFlow 1.11.0

2020-09-13 16:20:21 716

原创 numpy随机生成数据

用numpy.random模块来生成随机数组1.np.random.rand 用于生成[0.0, 1.0)之间的随机浮点数, 当没有参数时,返回一个随机浮点数,当有一个参数时,返回该参数长度大小的一维随机浮点数数组,参数建议是整数型。import numpy as npnp.random.rand(8)output [ 0.55958421 0.97358761 0.77753246 0.28072869 0.18467794 0.857553360.03976048 0.08161

2020-09-13 15:41:34 1216

原创 anaconda 报错HTTPSConnectionPool(host=‘www.anaconda.com‘, port=443): Read timed out

anaconda 报错HTTPSConnectionPool(host='www.anaconda.com', port=443): Read timed out. (read timeout=5)错误的原因:默认镜像源访问速度过慢,会导致超时从而导致更新和下载失败。解决方法:更换镜像源为清华镜像源,并且删除默认镜像源。conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/.

2020-09-09 20:00:12 10206 1

原创 -bash:dirname:command not found的解决办法

-bash:dirname:command not found解决方法:#Ubuntuapt-get install coreutils#CentOSyum install coreutils#osxbrew install coreutils#anacondaconda install coreutils

2020-09-03 10:56:41 5746 1

原创 pandas模块的简单介绍

pandas模块pandas是一个强大的分析结构化数据的工具集;它的使用基础是Numpy(提供高性能的矩阵运算);用于数据挖掘和数据分析,同时也提供数据清洗功能。Pandas中常见的数据结构有两种:SeriesDataFrame类似一维数组的对象类似多维数组/表格数组;每列数据可以是不同的类型;索引包括列索引和行索引Series构建Series:ser_obj = pd.Series(range(10))由索引和数据组成(索引在左<自动创建>,数据在右)。

2020-09-03 10:50:02 480

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除