Score of 4
4
votes
Accepted
Chaining programmatic expression functions failing in with_columns
If you have multiple generators in the same context, you need to unpack them yourself
def my_generator():
for i in range(3):
yield pl.lit(i).alias(str(i))
def my_other_generator():
...
Score of 3
3
votes
Accepted
Problems in rendering gif created with ffmpeg
The problem seems to be the GIF's color palette. The limited number of colors available in GIFs (256) means that Matplotlib/Pillow has to quantize the frames to show only those colors, which might be ...
Score of 3
3
votes
Why is my coroutine wrapper working when I use it as a decorator but not when I use it as a wrapper?
We often use the word "coroutine" for two different types. Unfortunately it sometimes creates a confusion, but we must not mix those two types up.
If we have e.g. async def af(), then af is ...
Score of 2
2
votes
Accepted
Why is my coroutine wrapper working when I use it as a decorator but not when I use it as a wrapper?
Your exception_handler takes a function and returns a function. As a decorator that's exactly right, since do_something is a function at class definition time.
But in _add_child_task, coro is already ...
Score of 2
2
votes
Get Pandas to accept an arbitrary string of spaces as 'NaN'
You can use the skipinitialspace keyword argument of pd.read_csv:
import io
import pandas as pd
DATA = """
id,value,label
1,1.23,ok
2, ,missing
3,4.56,ok
"""
...
Score of 1
1
vote
Updating one of Python's previous versions to its latest version for bug fixes
-V:3.13 is a runtime-selection option, so py -V:3.13 install --update launches Python 3.13 and passes install to the interpreter as a script name. That is why it tries to open D:\install.With the ...
Score of 1
1
vote
How to resolve the validation error which has come while running the code involving Docling which has been configured
It seems like DoclingLoader treats convert_kwargs as keyword arguments to DocumentConverter.convert().
But by the docs, format_options belongs to the DocumentConverter constructor. Not ...
Score of 1
1
vote
matplotlib savefig silently exits with code 1 after plt.plot() succeeds — no exception, no output
the problem is one of these two things:
problem in environment management by confusing between numpy 1 and numpy 2 version which makes matplotlib having issue with it. you have two solutions i think:
...
Score of 1
1
vote
Accepted
matplotlib savefig silently exits with code 1 after plt.plot() succeeds — no exception, no output
The issue is that you did not run conda activate bo-xgb before running ~/.conda/envs/bo-xgb/python.exe, so the environment variables like PATH was not populated by Conda, causing the Python process to ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
python × 2204955pandas × 249197
python-3.x × 205341
django × 158338
numpy × 102366
dataframe × 92539
list × 71339
matplotlib × 62852
python-2.7 × 62783
selenium-webdriver × 52744
dictionary × 47808
tensorflow × 47629
tkinter × 45805
flask × 41816
regex × 36190
arrays × 34493
json × 33998
csv × 33460
string × 32533
web-scraping × 30028
opencv × 28589
beautifulsoup × 28264
html × 28011
machine-learning × 27192
keras × 26684