我正在使用 Polars 练习 Python。我有一个数据框,我在数据框中生成了一堆计算,然后想将其转换为 Pandas 数据框,以便我可以将隔离森林应用于数据集。我已经安装了 Polars、pyarrow 和 pandas 使用
我的代码和软件包版本如下。我有 Windows 作为我的操作系统
# Name Version Build Channel
pandas 1.5.3 py310h1c4a608_1 https://conda.anaconda.org/conda-forge
pandas-flavor 0.6.0 pyhd8ed1ab_1 https://conda.anaconda.org/conda-forge
polars 0.20.5 pypi_0 pypi
pyarrow 10.0.1 pypi_0 pypi
pyarrow-hotfix 0.6 pyhd8ed1ab_0 https://conda.anaconda.org/conda-forge
# ADD OUTLIER COLUMNS---------------------------------------------------------
# Using Isolation Forests to find outliers
from sklearn.ensemble import IsolationForest
import pandas as pd
import polars as pl
features = df_calc.drop('status')
features.to_pandas()
ImportError: DLL load failed while importing lib: The specified module could not be found.
有人可以帮忙吗?
我也遇到了同样的问题。我使用 Anaconda/Jupyter Notebook,通常使用 !{sys.executable} -mpip install
!{sys.executable} -mpip install pyarrow
Requirement already satisfied: pyarrow in c:\users\user\anaconda3\lib\site-packages (14.0.2)
Requirement already satisfied: numpy>=1.16.6 in c:\users\user\anaconda3\lib\site-packages (from pyarrow) (1.26.3)
但是并没有解决问题。然后我尝试了这个(注意“-U”参数):
!{sys.executable} -mpip install -U pyarrow
Requirement already satisfied: pyarrow in c:\users\user\anaconda3\lib\site-packages (14.0.2)
Collecting pyarrow
Downloading pyarrow-15.0.0-cp39-cp39-win_amd64.whl.metadata (3.1 kB)
Requirement already satisfied: numpy<2,>=1.16.6 in c:\users\user\anaconda3\lib\site-packages (from pyarrow) (1.26.3)
Downloading pyarrow-15.0.0-cp39-cp39-win_amd64.whl (24.9 MB)
---------------------------------------- 0.0/24.9 MB ? eta -:--:--
---------------------------------------- 24.9/24.9 MB 22.6 MB/s eta 0:00:00
Installing collected packages: pyarrow
Attempting uninstall: pyarrow
Found existing installation: pyarrow 14.0.2
Uninstalling pyarrow-14.0.2:
Successfully uninstalled pyarrow-14.0.2
Successfully installed pyarrow-15.0.0
\
这对我有用。祝你好运!
贝尔帕