python - Nested ndarray reshape
问题描述
I have a problem,i am working with tensorflow keras for classification. For this i loaded images with skimage.io and store it into pandas dataframe. Now the problem is that i have ndarrays of shape(160,160) within ndarray of shape (520,). Now, i want to convert this to shape(520,160,160).I tried reshape method
array = np.array(df.image)
array.reshape(520,160,160)
This code give me error: ValueError: cannot reshape array of size 520 into shape (520,160,160)
解决方案
推荐阅读
- python - 从折线图中绘制matplotlib中的平均值?
- xml - Webmethods IS:Webmethods IS 能否从 1 个响应消息中调用来自 XML 参数/属性的多个请求
- python - 如何在没有继承的情况下访问类的方法?
- swift - 需要帮助将部分添加到 TableViewController 数组
- c++ - 二叉树的布尔递归函数
- css - CSS创建偏移突出显示的文本
- python - 使用索引连接数据框
- ios - 包含 UITextfield 的子视图未注册 Tapgesture
- javascript - 无法使用 Google 应用脚本向联系人添加自定义字段
- php - 使用php和mysql绘制饼图