Closed conorhamill36 closed 1 hour ago
I just tested with numpy 2.1.1 and cannot replicate an error.
It seems to be complaining about creating a Series from .rand()
?
>>> pl.__version__
'1.8.2'
>>> np.__version__
'2.1.1'
>>> pl.Series(np.random.rand(3))
shape: (3,)
Series: '' [f64]
[
0.852444
0.277395
0.185109
]
Restarted my kernel and it ran fine this time. Unsure what the issue was, but I doubt it'll be reproducible now now and likely a fault of how I created my environment, so I'll close the issue.
Thanks for having a look.
Checks
Reproducible example
import polars as pl import numpy as np
df = pl.DataFrame( { "a": range(8), "b": np.random.rand(8), "d": [1.0, 2.0, float("nan"), float("nan"), 0.0, -5.0, -42.0, None], } )
Log output
Issue description
In the Join sub-section of the Combining DataFrames section of the Getting Started guide (https://docs.pola.rs/user-guide/getting-started/#combining-dataframes), there is python API example for joining two dataframes. When executing the code as it's written, the TypeError shared is raised, with an issue constructing the Series using the
ndarray
type. This was tested with numpy version 2.1.1. The rest of the conda environment used is shared below.Name Version Build Channel
_libgcc_mutex 0.1 main
_openmp_mutex 5.1 1_gnu
anyio 4.6.0 pypi_0 pypi argon2-cffi 23.1.0 pypi_0 pypi argon2-cffi-bindings 21.2.0 pypi_0 pypi arrow 1.3.0 pypi_0 pypi asttokens 2.4.1 pypi_0 pypi async-lru 2.0.4 pypi_0 pypi attrs 24.2.0 pypi_0 pypi babel 2.16.0 pypi_0 pypi beautifulsoup4 4.12.3 pypi_0 pypi bleach 6.1.0 pypi_0 pypi bzip2 1.0.8 h5eee18b_6
ca-certificates 2024.7.2 h06a4308_0
certifi 2024.8.30 pypi_0 pypi cffi 1.17.1 pypi_0 pypi charset-normalizer 3.3.2 pypi_0 pypi comm 0.2.2 pypi_0 pypi debugpy 1.8.6 pypi_0 pypi decorator 5.1.1 pypi_0 pypi defusedxml 0.7.1 pypi_0 pypi executing 2.1.0 pypi_0 pypi expat 2.6.3 h6a678d5_0
fastjsonschema 2.20.0 pypi_0 pypi fqdn 1.5.1 pypi_0 pypi h11 0.14.0 pypi_0 pypi httpcore 1.0.5 pypi_0 pypi httpx 0.27.2 pypi_0 pypi idna 3.10 pypi_0 pypi ipykernel 6.29.5 pypi_0 pypi ipython 8.27.0 pypi_0 pypi isoduration 20.11.0 pypi_0 pypi jedi 0.19.1 pypi_0 pypi jinja2 3.1.4 pypi_0 pypi json5 0.9.25 pypi_0 pypi jsonpointer 3.0.0 pypi_0 pypi jsonschema 4.23.0 pypi_0 pypi jsonschema-specifications 2023.12.1 pypi_0 pypi jupyter-client 8.6.3 pypi_0 pypi jupyter-core 5.7.2 pypi_0 pypi jupyter-events 0.10.0 pypi_0 pypi jupyter-lsp 2.2.5 pypi_0 pypi jupyter-server 2.14.2 pypi_0 pypi jupyter-server-terminals 0.5.3 pypi_0 pypi jupyterlab 4.2.5 pypi_0 pypi jupyterlab-pygments 0.3.0 pypi_0 pypi jupyterlab-server 2.27.3 pypi_0 pypi ld_impl_linux-64 2.40 h12ee557_0
libffi 3.4.4 h6a678d5_1
libgcc-ng 11.2.0 h1234567_1
libgomp 11.2.0 h1234567_1
libstdcxx-ng 11.2.0 h1234567_1
libuuid 1.41.5 h5eee18b_0
markupsafe 2.1.5 pypi_0 pypi matplotlib-inline 0.1.7 pypi_0 pypi mistune 3.0.2 pypi_0 pypi nbclient 0.10.0 pypi_0 pypi nbconvert 7.16.4 pypi_0 pypi nbformat 5.10.4 pypi_0 pypi ncurses 6.4 h6a678d5_0
nest-asyncio 1.6.0 pypi_0 pypi notebook-shim 0.2.4 pypi_0 pypi numpy 2.1.1 pypi_0 pypi openssl 3.0.15 h5eee18b_0
overrides 7.7.0 pypi_0 pypi packaging 24.1 pypi_0 pypi pandocfilters 1.5.1 pypi_0 pypi parso 0.8.4 pypi_0 pypi pexpect 4.9.0 pypi_0 pypi pip 24.2 py312h06a4308_0
platformdirs 4.3.6 pypi_0 pypi polars 1.8.2 pypi_0 pypi prometheus-client 0.21.0 pypi_0 pypi prompt-toolkit 3.0.48 pypi_0 pypi psutil 6.0.0 pypi_0 pypi ptyprocess 0.7.0 pypi_0 pypi pure-eval 0.2.3 pypi_0 pypi pycparser 2.22 pypi_0 pypi pygments 2.18.0 pypi_0 pypi python 3.12.5 h5148396_1
python-dateutil 2.9.0.post0 pypi_0 pypi python-json-logger 2.0.7 pypi_0 pypi pyyaml 6.0.2 pypi_0 pypi pyzmq 26.2.0 pypi_0 pypi readline 8.2 h5eee18b_0
referencing 0.35.1 pypi_0 pypi requests 2.32.3 pypi_0 pypi rfc3339-validator 0.1.4 pypi_0 pypi rfc3986-validator 0.1.1 pypi_0 pypi rpds-py 0.20.0 pypi_0 pypi send2trash 1.8.3 pypi_0 pypi setuptools 75.1.0 py312h06a4308_0
six 1.16.0 pypi_0 pypi sniffio 1.3.1 pypi_0 pypi soupsieve 2.6 pypi_0 pypi sqlite 3.45.3 h5eee18b_0
stack-data 0.6.3 pypi_0 pypi terminado 0.18.1 pypi_0 pypi tinycss2 1.3.0 pypi_0 pypi tk 8.6.14 h39e8969_0
tornado 6.4.1 pypi_0 pypi traitlets 5.14.3 pypi_0 pypi types-python-dateutil 2.9.0.20240906 pypi_0 pypi tzdata 2024a h04d1e81_0
uri-template 1.3.0 pypi_0 pypi urllib3 2.2.3 pypi_0 pypi wcwidth 0.2.13 pypi_0 pypi webcolors 24.8.0 pypi_0 pypi webencodings 0.5.1 pypi_0 pypi websocket-client 1.8.0 pypi_0 pypi wheel 0.44.0 py312h06a4308_0
xz 5.4.6 h5eee18b_1
zlib 1.2.13 h5eee18b_1
Expected behavior
My expectation is that the example code snippet should run without any errors and create a dataframe.
Installed versions