小程序4103错误

博客主要介绍小程序生成二维码时可能出现的4103错误。若出现该错误,首先要检查page传值是否正确,如“/page/index/index”会报错,“page/index/index”才正确;若传值无误仍报错,则可能是小程序未发布,测试版本也不行。

小程序4103错误
小程序生成二维码中会有个坑,可能会报4103错误,首先检查page传的对不对。
例如:
$page = “/page/index/index”; 这样会报错
$page = “page/index/index”;这样是对的
如果这个是对的,那么还报错的话,就是小程序未发布了,测试版本也不行。

# 2. 数据清洗和转换 # 转换发布时间为datetime类型 df['发布时间'] = pd.to_datetime(df['发布时间']) # 处理空标题和正文 df['标题'] = df['标题'].fillna('') df['正文内容'] = df['正文内容'].fillna('') 这段代码发生了以下错误 --------------------------------------------------------------------------- KeyError Traceback (most recent call last) File d:\anaconda3\Lib\site-packages\pandas\core\indexes\base.py:3805, in Index.get_loc(self, key) 3804 try: -> 3805 return self._engine.get_loc(casted_key) 3806 except KeyError as err: File index.pyx:167, in pandas._libs.index.IndexEngine.get_loc() File index.pyx:196, in pandas._libs.index.IndexEngine.get_loc() File pandas\\_libs\\hashtable_class_helper.pxi:7081, in pandas._libs.hashtable.PyObjectHashTable.get_item() File pandas\\_libs\\hashtable_class_helper.pxi:7089, in pandas._libs.hashtable.PyObjectHashTable.get_item() KeyError: '发布时间' The above exception was the direct cause of the following exception: KeyError Traceback (most recent call last) Cell In[3], line 3 1 # 2. 数据清洗和转换 2 # 转换发布时间为datetime类型 ----> 3 df['发布时间'] = pd.to_datetime(df['发布时间']) 4 # 处理空标题和正文 5 df['标题'] = df['标题'].fillna('') File d:\anaconda3\Lib\site-packages\pandas\core\frame.py:4102, in DataFrame.__getitem__(self, key) 4100 if self.columns.nlevels > 1: 4101 return self._getitem_multilevel(key) -> 4102 indexer = self.columns.get_loc(key) 4103 if is_integer(indexer): 4104 indexer = [indexer] File d:\anaconda3\Lib\site-packages\pandas\core\indexes\base.py:3812, in Index.get_loc(self, key) 3807 if isinstance(casted_key, slice) or ( 3808 isinstance(casted_key, abc.Iterable) 3809 and any(isinstance(x, slice) for x in casted_key) 3810 ): 3811 raise InvalidIndexError(key) -> 3812 raise KeyError(key) from err 3813 except TypeError: 3814 # If we have a listlike key, _check_indexing_error will raise 3815 # InvalidIndexError. Otherwise we fall through and re-raise 3816 # the TypeError. 3817 self._check_indexing_error(key) KeyError: '发布时间' Click to add a cell.
最新发布
05-30
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值