实验遇到的问题04

1.脚本报错
报错:
KeyError: “None of [Int64Index([ 0, 1, 2, 3, 4, 5,
6, 7, 8, 10,\n …\n 2062, 2063, 2064, 2065, 2066, 2067, 2068, 2069, 2070, 2071],\n dtype=‘int64’, length=1864)] are in the [columns]”
解决方法:
将数据转换成np.array()。

2. matplotlib添加图例出现问题
报错:
UnicodeDecodeError: ‘ascii’ codec can’t decode byte 0xe5 in position 0: ordinal not in range(128)
解决方法:
在代码前添加以下几行代码即可解决问题

#coding=utf-8
import sys
reload(sys)
sys.setdefaultencoding('utf8') 

方法来源于博客:
https://blog.csdn.net/qq_35393693/article/details/85307809
3.pandas中Series转list,dataframe

Series.tolist()

可参考博客https://blog.csdn.net/sinat_26811377/article/details/99292830
https://blog.csdn.net/dta0502/article/details/82966790

4. linux打开jupyter notebook出现问题
报错:Firefox is already running, but is not responding. To open a new window, you must first close the existing …?
解决方案:在linux终端输入

firefox -profilemanager

新建一个profile,并选择这个新的profile即可
参考博客:
https://blog.csdn.net/helloworld0906/article/details/98185966

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值