被这个问题影响太久了,今天一定要记录一下!

说到底,是自己学的不扎实,基本概念不牢靠,很多东西只知道用。

import pandas as pd
print(pd.DataFrame([1,2]))
print('------------------')
print(pd.DataFrame([[1,2]]))

运行结果如下:

可以看到,当是 [1,2]时,是一个列表,只有一维,相当于是:

print(pd.DataFrame([[1],[2]]))

当是 [[1,2]]时,有两个括号,算是二维:

print(pd.DataFrame([[1,2],[3,4]]))

当每个变量都是列表时,如果要达到二维的效果,就要再加一个括号:

data = pd.DataFrame([[index, uri_data_list, first_data]], columns=['index', 'uri_list', 'first_uri'])

成功解决 ValueError: Shape of passed values is (3, 1), indices imply (3, 3)相关推荐

  1. 成功解决ValueError: Shape of passed values is (33, 1), indices imply (33, 2)

    成功解决ValueError: Shape of passed values is (33, 1), indices imply (33, 2) 目录 解决问题 解决思路 解决方法 解决问题 Valu ...

  2. 成功解决ValueError: Shape of passed values is (1, 332), indices imply (1, 1)

    成功解决ValueError: Shape of passed values is (1, 332), indices imply (1, 1) 目录 解决问题 解决思路 解决方法 解决问题 Valu ...

  3. 成功解决 ValueError: Shape of passed values is (2, 3), indices imply (4, 3)

    昨天整理了知识点,今天复盘时,发现了error,巩固dataframe的用法. 错误原因 file3 = pd.DataFrame(data = {'Gender':['M','F'],'Height ...

  4. 已解决ValueError: Shape of passed values is (1509, 1), indices imply (1509, 2)

    已解决(pandas创建DataFrame对象失败)ValueError: Shape of passed values is (1509, 1), indices imply (1509, 2) 文 ...

  5. 已解决ValueError: Shape of passed values is (6, 3), indices imply (4, 3)

    已解决(pd.concat连接错误)ValueError: Shape of passed values is (6, 3), indices imply (4, 3) 文章目录 报错代码 报错翻译 ...

  6. ValueError: Shape of passed values is (10, 10000), indices imply (3, 10000)

    ValueError: Shape of passed values is (10, 10000), indices imply (3, 10000) 错误原因是: 维度保持不一致,原来是(10,10 ...

  7. Value Error:Shape of passed values is (2, 3), indices imply (3, 2)

    Pandas库已导入,拟通过pd.DataFrame导入Panel data. 出现报错:ValueError: Shape of passed values is (2, 3), indices i ...

  8. 成功解决Shape of passed values is (962, 1201), indices imply (3420, 1201)

    # data1 = pd.DataFrame(data1) # data1 = data1.values new_data = np.delete(data1, [0, 1], axis=0) # a ...

  9. Shape of passed values is (230999, 1), indices imply (230999, 3)

    起因 使用pandas报错 serires = pd.Series(counter) serires.sort_values(ascending=False, inplace=True) df = p ...

  10. 解决ValueError: Shape of passed values is (1,5), indices imply (1,3)

    报错部分代码: MetricsDataFrame = pd.DataFrame(Metrics,columns=np.tile(MetricNames, datasetNum),index=exper ...

最新文章

  1. centos 扫毒软件clamAV安装
  2. 比特币再度遭遇资金“大逃离” 后市前景愈发摇摇欲坠
  3. zabbix企业应用之监控mysql 5.6版本
  4. python导入csv数据例子-使用python读取csv文件快速插入数据库的实例
  5. stm32超声波测距代码_干货!特斯拉Autopilot核心传感器解读超声波雷达篇
  6. 【Trie】最大异或对(ybtoj Trie-2)
  7. django-中间件
  8. postmapping注解_Swagger常用注解
  9. WORD给文档设置密码保护?
  10. python sizeof_python 变量作用域 v.__sizeof__() python 深复制 一切皆对象 尽量减少内存消耗 赋值语句的原理...
  11. systemd 与 sysVinit 彩版对照表
  12. ASP.NET Core DI 手动获取注入对象
  13. [渝粤教育] 西南科技大学 婚姻家庭继承法 在线考试复习资料
  14. java符号用语_java常用语
  15. Jenkins插件Gerrit Trigger配置,实现change-merged时自动触发Jenkins工程build
  16. win10 怎么由豆沙绿恢复为默认的颜色
  17. linux下ftp搭建流程
  18. pstack 安装linux_linux下的进程堆栈查看工具pstack
  19. 虚拟机权限不足,无法访问文件
  20. 别再花时间统计考勤数据了,这个报表统计神器才是你最后出路

热门文章

  1. 欢迎使用抖音无水印解析
  2. 二重积分计算(几何法)
  3. 微信公众号 开发详解05【二维码制作、调查表单、短网址、微小宝、引流】
  4. 微信小程序使用百度地图的Api
  5. python爬虫模拟浏览器的两种方法_python3爬虫的模拟浏览器
  6. python 爬虫是什么_python爬虫什么意思
  7. mindoc快速搭建教程
  8. SVM---通俗易懂图解高斯核函数及实现
  9. Unity3D 串口连接
  10. Keil5下载芯片包并导入教程