python-3.x - 将多个 DataFrame 转换为 numpy 数组
问题描述
我正在尝试将 5 个数据帧循环转换为 numpy 数组。
df = [df1, df2, df3, df4, df5]
for index, x in enumerate(df):
x = x.to_numpy()
print(type(df3))
仍然给我 pandas DataFrame 作为输出。
解决方案
此剂量不会保存到环境中
for index, x in enumerate(df):
df[index] = x.to_numpy()
然后你做
df[0]
推荐阅读
- android - 在 PreferenceActivity 中加载不同的 XML 值集
- python - 关于离线绘图和更新 jupyter notebook 中的图表的困惑
- javafx - JavaFX:X 轴上的对数刻度
- jpa - 从 Java 10.0 NullPointer 开始搜索持久性 - JPA eclipselink 2.6.5
- python - 如何仅访问列表的特定元素
- c# - Xamarin 登录页面和 C#
- linux - 哪个Linux程序将失败的sshd登录尝试写入/var/log/btmp Centos 7
- php - Laravel 5.6 RESRful Webervice 更新和删除
- asp.net-core-mvc - 在控制器内调用 add-migration
- blockchain - 去中心化存储系统 Storj 是如何工作的?