自定义博客皮肤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)
  • 收藏
  • 关注

原创 Xarray修改变量、坐标和维度名,增加维度

xarray修改变量维度坐标名

2023-03-07 18:38:40 2428 1

原创 Pycharm(查找某个对象引用位置、一次修改多个位置的同一变量)

PyCharm的Find Usages功能可以查找某个对象(变量、函数、或者类等)被引用的地方使用:在要查找的对象上右键 -> Find Usages -> 界面下方会列出查找结果。快捷键:Alt + F7以test.py和test2.py为例,其中test2.py使用了test.py的foo函数;在文件test.py中,把鼠标放到foo上面再右键点击Find Usages;可以看出foo()函数被引用了3次,其中test2.py引用了2次,test3.py引用了1次。Pychar

2021-02-15 20:26:18 2124

原创 conda_command

一、环境管理查看当前系统下的环境conda info -e创建新的环境#指定python版本为2.7,注意至少需要指定python版本或者要安装的包 #后一种情况下,自动安装最新python版本conda create -n env_name python=2.7同时安装必要的包conda create -n env_name numpy matplotlib python=2.7环境切换切换到新环境 # linux/Mac下需要使用source activate env_nam

2021-02-15 20:17:42 133

原创 python pprint模块

pprint模块 提供了打印出任何python数据结构类和方法。模块方法:1.class pprint.PrettyPrinter(indent=1,width=80,depth=None, stream=None)创建一个PrettyPrinter对象indent --- 缩进,width --- 一行最大宽度,depth --- 打印的深度,这个主要是针对一些可递归的对象,如果超出指定depth,其余的用"..."代替。 eg: a=[1,2,[3,4,],5]

2021-01-02 21:16:03 155

原创 anaconda 中 jupyter notebook的使用

1. jupyter notebook使用python虚拟环境conda create -n py36 python=3.6激活虚拟环境:activate py36 # 进入虚拟环境在虚拟环境中安装ipykernelpip install ipykernelpython -m ipykernel install --name py36 # 将虚拟环境加入到jupyter notebook中给虚拟环境安装其他库pip install gensimpip install

2021-01-02 21:06:04 141

原创 Python numpy.where() 用法

numpy.where (condition[, x, y])numpy.where() 有两种用法:np.where(condition, x, y)满足条件(condition),输出x,不满足输出y。如果是一维数组,相当于[xv if c else yv for (c,xv,yv) in zip(condition,x,y)]aa = np.arange(10)np.where(aa,1,-1)array([-1, 1, 1, 1, 1, 1, 1, 1, 1,

2021-01-02 12:58:53 194

原创 python中出现MatplotlibDeprecationWarning:

python中出现警告MatplotlibDeprecationWarning:The compare_versions function was deprecated in Matplotlib 3.2 and will be removed two minor releases later.上述警告的意思是: matplotlib 3.2中已被弃用,将在两个较小的版本之后删除。如果还想用那么就不能升级版本可以用import warningswarnings.filterwarnings(‘i

2021-01-02 12:46:24 16866

原创 python库的官方API

python库的官方APIxarray http://xarray.pydata.org/en/stable/ (中文)pandas https://pandas.pydata.org/ https://www.pypandas.cn/(中文)numpy https://numpy.org/ https://www.numpy.org.cn/(中文)matplotlib https://matplotlib.org/ https://www.matplotlib.org.cn/(中

2021-01-01 10:36:33 335

转载 python pandas.get_dummies

一、实践      离散特征的编码分为两种情况: 1、离散特征的取值之间没有大小的意义,比如color:[red,blue],那么就使用one-hot编码 2、离散特征的取值有大小的意义,比如size:[X,XL,XXL],那么就使用数值的映射{X:1,XL:2,XXL:3}说明:对于有大小意义的离散特征,直接使用映射就可以了,{'XL':3,'L':2,'M':1...

2020-12-31 16:45:29 230

空空如也

空空如也

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

TA关注的人

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