python報錯解決方法:Must have equal len keys and value when setting with an iterable
報錯型別
在編寫爬蟲程式時,出現以下提示:
Must have equal len keys and value when setting with an iterable
讀取的資料型別如下:
報錯程式碼:
df.loc[m,'geo']=s['geo']
原因
將內容存入dataframe時出現的情況,原因是所爬取的物件是一個列表,左右兩邊鍵值不相等而出現報錯提示!
修改
if s['geo']!=None: df.loc[m,'geo']=str(s['geo']['coordinates'][1])+','+str(s['geo']['coordinates'][0]) else: df.loc[m,'geo']=''
修改後成功解決問題
相關推薦
python報錯解決方法:Must have equal len keys and value when setting with an iterable
技術標籤:pythonpython 報錯型別 在編寫爬蟲程式時,出現以下提示: Must have equal len keys and value when setting with an iterable
Python連線Oracle之環境配置、例項程式碼及報錯解決方法詳解
Oracle Client 安裝 1、環境 日期:2019年8月1日 公司已經安裝好Oracle服務端 Windows版本:Windows10專業版
python中關於TabError: inconsistent use of tabs and spaces in indentation報錯解決方法!
技術標籤:python基礎解析報錯python 錯誤原理 這類的報錯經常出現在你去複製貼上其他文章時候出現的空格和tab鍵混合使用的情況。
MySQL關於ERROR 1290 (HY000)報錯解決方法
一個問題糾結很久,反覆確認語法問題。但是後來網上搜了一下,茅塞頓開。特此總結一下。
詳解mysql8.0建立使用者授予許可權報錯解決方法
問題一: 會報錯的寫法: GRANT ALL PRIVILEGES ON *.* ‘root\'@\'%\' identified by ‘123123\'WITH GRANT OPTION;
IDEA安裝lombok外掛設定Enable Annotation Processing後編譯依然報錯解決方法
IDEA匯入的專案中有依賴lombok的getset註解,build專案時報錯:找不到get/set方法。
vscode啟動Flutter專案相關報錯解決方法
文章目錄 一、vscode模擬器連線二、出現Failed to find Build Tools revision 28.0.3三、 Could not resolve io.flutter:flutter_embedding_debug:1.0.0-5babba6c4d25fa237bbf755ab85c9a0c50b3c6ec...
安裝webpack 報錯解決方法
安裝webpack如果儲存,就操作以下: 1.npm install webpack -g 2.npm install webpack-cli -g 3.webpack -v
Not allowed to access normals on mesh ‘Combined Mesh (root: scene)‘ (isReadable is false...報錯解決方法
Unity播放時如果出現的“Not allowed to access normals on mesh ‘Combined Mesh (root: scene)’ (isReadable is false; Read/Write must be enabled in import settings) UnityEngine.Mesh:get_norm
C++中未定義識別符號ULONG,UINT的報錯解決方法 VS2019
技術標籤:c++ C++中未定義識別符號ULONG,UINT的報錯解決方法 VS2019 在使用VS 2019中 ulong,uint出現報錯情況,如下圖:解決方法如下: 1、加入標頭檔案#include <wtypes.h> 2、#define ulong ULONG 3、#
詳解vue-cli專案在IE瀏覽器開啟報錯解決方法
首先要知道VUE官網已表明僅支援IE8以上版本(不包括IE8),css彈性佈局flex各瀏覽器支援如下:
安裝了ros後Python3 呼叫import cv2報錯解決辦法:
技術標籤:opencvROS Enjoy lab and life 分類專欄: opencv ros 錯誤如下: Traceback (most recent call last): File “./run.py”, line 9, in import cv2 ImportError: /opt/ros/kinetic/lib/python2.7/
ssm專案連線資料庫報錯解決方法
(1)首先看報錯資訊,ERROR 1251 (08004): Client does not support authentication protocol requested by server; consider upgrading MySQL client。
‘MNIST’資料集報錯解決方法
技術標籤:pythontensorflow ** \'MNIST’資料集報錯解決方法 ** 問題一: 在TensorFlow中,當庫scikit-learn的版本在0.2及以上時或者在0.2以下時,MNIST資料集的匯入方法:
【Python報錯解決方案】TypeError: ‘float‘ object is not callable
技術標籤:Python報錯解決方案 最近又開始寫程式碼了,今天學習神經網路的BP時候發現了一個報錯並且在網站上看了,大部分的解釋都很簡單但是有很難懂,但是人家的方法也是可以用的。其實這個錯誤非常簡單,但如果
‘primordial is not defined‘ node 報錯解決方法 終極篇!!
技術標籤:js前端 各位小夥伴在使用gulp的過程中因為種種情況遇到了primordial is not defined\' node的報錯。不要慌,相信你已經在百度到了發生的原因。就是gulp和node的版本不匹配,我猜你得版本是node12和gul
-bash: ./run.sh: /bin/bash^M: bad interpreter: No such file or directory 報錯解決方法
技術標籤:IT bash: ./run.sh: /bin/bash^M: bad interpreter: No such file or directory技術交流qq群 1093476453
關於mysql修改密碼 set password for root@localhost = password(‘xxx‘);報錯解決方法
mysql> SET PASSWORD FOR \'root\'@\'localhost\' = PASSWORD(\'123456\'); ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for
ora-00245報錯解決方法
1.發現問題 最近使用備份軟體對客戶11G RAC資料庫進行備份,發現備份失敗檢視日誌發現數據庫報ORA-00245: control file backup failed; target is likely on a local file system錯誤。
vue安裝sass-loader報錯解決方法
一、深坑的出現 如果初次安裝sass-loader依賴後就報錯,那很大概率應該是由於版本問題導致。 你應該是採用如下幾個命令安裝: