QuestionId int64 74.8M 79.8M | UserId int64 56 29.4M | QuestionTitle stringlengths 15 150 | QuestionBody stringlengths 40 40.3k | Tags stringlengths 8 101 | CreationDate stringdate 2022-12-10 09:42:47 2025-11-01 19:08:18 | AnswerCount int64 0 44 | UserExpertiseLevel int64 301 888k | UserDisplayName stringlengths 3 30 ⌀ |
|---|---|---|---|---|---|---|---|---|
78,386,994 | 2,710,331 | Python: Subtract one 2D line from another | <p><strong>The problem</strong></p>
<p>I need to calculate the difference between the two lines (ie. subtract one from the other), which should result in an output line.</p>
<p><em>The input lines - and output line - may include vertical sections. ie. the X values for the lines may not be monotonically increasing (alth... | <python><python-3.x><math><plot><geometry> | 2024-04-25 19:57:58 | 1 | 343 | asibs |
78,386,891 | 5,502,917 | Raspberry Pi 4: Python - RuntimeError: Error waiting for edge | <p>I am trying to get the falling edge of a HB100 doppler radar with a Lm358 amplifier module.</p>
<p>The error is RuntimeError: Error waiting for edge</p>
<p>It was working great and stopped suddenly.</p>
<p>I have already tried with another radar and amplifier modules and the error continues.
I have tried to switch t... | <python><python-3.x><raspberry-pi><gpio> | 2024-04-25 19:34:06 | 1 | 1,731 | GuiDupas |
78,386,617 | 6,583,606 | Configure an interpreter using WSL with VS Code | <p>Within VS Code, I would like to configure a conda environment living in WSL as the interpreter of a project living in Windows. This is possible with PyCharm, as indicated <a href="https://www.jetbrains.com/help/pycharm/using-wsl-as-a-remote-interpreter.html" rel="nofollow noreferrer">here</a>.</p>
<p>With VS Code, I... | <python><visual-studio-code><pycharm><conda><windows-subsystem-for-linux> | 2024-04-25 18:33:52 | 1 | 319 | fma |
78,386,298 | 1,143,935 | Is there a way we can attach an identifier to link when clicked from email | <p>So this is an authentication link which we auto generate with some token for that particular email, Where we don't want the user to forward it, even if he/she forward it, we want to know from which email address it is coming from? If it's not coming from original email we want to stop authentication.
If we can get ... | <javascript><python><authentication><email><single-sign-on> | 2024-04-25 17:29:11 | 1 | 401 | Atul Verma |
78,386,256 | 1,422,096 | Compilation works on Cython 0.29, but not Cython 3.0 | <p>The project <a href="https://github.com/superquadratic/rtmidi-python" rel="nofollow noreferrer">rtmidi-python</a> compiles well on Cython 0.29.37 (the latest version before Cython 3.0), but it fails on Cython 3.0, with the error below.</p>
<p>Are there known incompatibilities when upgrading to Cython 3?</p>
<p>If so... | <python><cython> | 2024-04-25 17:19:44 | 1 | 47,388 | Basj |
78,386,222 | 1,662,775 | Scraping a website with dynamic javascript using beautiful soup | <p>I am trying to the IBM docs. The following is the URL that I am looking at. I am wondering how to expand all the toggles on the left hand pane programatically so that I can get all the URLs and get the data.</p>
<p><a href="https://www.ibm.com/docs/en/b2b-integrator/6.1.0" rel="nofollow noreferrer">https://www.ibm.c... | <python><selenium-webdriver><beautifulsoup><web-crawler> | 2024-04-25 17:12:09 | 1 | 1,204 | Baradwaj Aryasomayajula |
78,385,768 | 3,606,412 | Does the nums array make a deep copy of letters[2:5] = ['C', 'D', 'E']? | <p>I am learning shallow v.s. deep copying a list in Python. I learned that <a href="https://docs.python.org/3/tutorial/introduction.html#lists" rel="nofollow noreferrer">there're two ways to create copies that have the original values unchanged and only modify the new values or vice versa. They're <em>shallow copy</e... | <python><arrays><deep-copy><shallow-copy> | 2024-04-25 15:42:33 | 3 | 1,383 | LED Fantom |
78,385,716 | 13,123,667 | Pytorch and Matplotlib interfering | <p>I'm facing a weird bug with Matplotlib and torch in my jupyter notebook. If I run with this torch.hub.load line the plt.imshow will simply not display anything (even tho frame is a correct image). If I comment this line the plt.imshow works.</p>
<p>Whether this torch.hub.load line is commented or not cv2.imshow will... | <python><matplotlib><pytorch> | 2024-04-25 15:32:52 | 2 | 896 | Timothee W |
78,385,605 | 984,621 | Streaming logs throws "maximum recursion depth exceeded while calling a Python object" error. How to deal with that? | <p>I have a Python app that's streaming logs to a third-party service (in this case, it's an AWS S3 bucket).</p>
<p>My simplified code looks like this:</p>
<pre><code>class S3Handler(logging.StreamHandler):
def __init__(self, bucket_name, key):
super().__init__()
self.bucket_name = bucket_name
... | <python> | 2024-04-25 15:15:49 | 1 | 48,763 | user984621 |
78,385,485 | 5,397,009 | Filter a query set depending on state at a given date | <p>Given the following model (using <a href="https://pypi.org/project/django-simple-history/" rel="nofollow noreferrer"><code>django-simple-history</code></a>):</p>
<pre><code>class MyModel (models.Model):
status = models.IntegerField()
history = HistoricalRecords()
</code></pre>
<p>I would like to get all inst... | <python><django><django-queryset> | 2024-04-25 14:54:35 | 2 | 24,071 | Jmb |
78,384,983 | 3,561,842 | matplotlib pyplot creates a broken plot when long | <p>I'm struggling with this strange behavior in the matplotlib pyplot library.</p>
<p>The actual plot is more complex but I've reduced it to these few lines of python code:</p>
<pre><code>from matplotlib import pyplot as plt
import numpy as np
def plot(w, h):
num_samples = int(w * h)
x = w * np.random.rand(nu... | <python><matplotlib> | 2024-04-25 13:26:51 | 0 | 968 | estebanuri |
78,384,821 | 1,991,332 | How do I add reversible noise to the MNIST dataset using PyTorch? | <p>I would like to add reversible noise to the MNIST dataset for some experimentation.</p>
<p>Here's what I am trying atm:</p>
<pre><code>import torchvision.transforms as transforms
from torchvision.datasets import MNIST
from torch.utils.data import DataLoader
from PIL import Image
import torchvision
def display_img(p... | <python><pytorch><computer-vision><signal-processing><noise> | 2024-04-25 12:55:51 | 1 | 408 | RasmusJ |
78,384,769 | 1,122,189 | parsing webhook information to fetch specific parts in python | <p>I have a code that listens for a post to be sent
It receives the post as</p>
<pre><code> {"description": "Test Call", "map_code": "", "details": "", "cross_street": ""}
</code></pre>
<p>It will print this using the following</p>
<pre>... | <python><json><webhooks><endpoint> | 2024-04-25 12:48:35 | 1 | 815 | nate |
78,384,680 | 1,432,792 | cannot import name 'Service' from 'services' when using semantic-kernel | <p>I am currently working through Microsoft's semantic-kernel exercises found <a href="https://github.com/microsoft/semantic-kernel/blob/main/python/notebooks/01-basic-loading-the-kernel.ipynb" rel="nofollow noreferrer">here</a></p>
<p>But am getting the following error when I try to access the Services within the libr... | <python><import><semantic-kernel> | 2024-04-25 12:34:07 | 1 | 3,949 | Taylrl |
78,384,268 | 12,013,353 | Newmark-beta method solution to dynamic equation of motion lagging behind true solution for lower periods of vibration | <p>I have an earthquake record and I'm trying to obtain the spectral acceleration plot by solving the following differential equation:<br />
<a href="https://i.sstatic.net/jDzDN.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/jDzDN.png" alt="differential equation" /></a></p>
<pre><code>T = np.geomspace(0... | <python><differential-equations><numerical-integration> | 2024-04-25 11:19:53 | 0 | 364 | Sjotroll |
78,384,202 | 4,247,881 | Filter a polars dataframe based on JSON in string column | <p>I have a Polars dataframe like</p>
<pre class="lang-py prettyprint-override"><code>df = pl.DataFrame({
"tags": ['{"ref":"@1", "area": "livingroom", "type": "elec"}', '{"ref":"@2", "area": "kitchen"}', '{... | <python><json><dataframe><python-polars> | 2024-04-25 11:08:53 | 1 | 972 | Glenn Pierce |
78,383,921 | 2,957,687 | The most pythonic way to make a list / a generator with limits | <p>I would like to plot a function in <code>matplotlib</code>, but only in a range bounded by two floats, say <code>2.6</code> and <code>8.2</code>. For that I need a list or a generator that includes two float bounds, such as</p>
<pre><code>[2.6, 3, 4, 5, 6, 7, 8, 8.2]
</code></pre>
<p>I know this can be done like th... | <python><list><matplotlib><generator> | 2024-04-25 10:17:37 | 1 | 921 | Pygmalion |
78,383,916 | 248,616 | Cannot download file when using selenium Chrome webdriver with option prompt_for_download=False in Windows OS | <p>The download error from webdriver's browser</p>
<p><a href="https://i.sstatic.net/02eXd.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/02eXd.png" alt="enter image description here" /></a></p>
<p>The code I run</p>
<pre><code>from selenium import webdriver # pip install selenium
from webdriver_manage... | <python><selenium-webdriver><download><webdriver><auto> | 2024-04-25 10:17:04 | 0 | 35,736 | Nam G VU |
78,383,754 | 18,089,995 | How to find best matching anchor texts from paragraph and list of titles? | <p>I have a paragraph:</p>
<pre><code>In today's world, keeping your personal information safe online is more important than ever. With cyber-attacks on the rise, having a strong cybersecurity strategy is essential.
Whether it's protecting against viruses or securing your passwords, everyone needs to be vigilant. Unde... | <python><elasticsearch><pattern-matching><match><string-matching> | 2024-04-25 09:50:20 | 0 | 595 | Manoj Kamble |
78,383,743 | 8,159,580 | Authentication fails on localhost postgresql with alembic and pytest | <p>I want to connect to a postgresql database via alembic in pytest. I can connect to the database via pg admin with the password i set, but i always get the error:</p>
<pre><code>sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (127.0.0.1), port 5432 failed: FA... | <python><sqlalchemy><pytest><windows-subsystem-for-linux><alembic> | 2024-04-25 09:48:25 | 2 | 325 | Zu Jiry |
78,383,633 | 8,087,322 | Surprising result with a conditional `yield` | <p>I have the following Python code using <code>yield</code>:</p>
<pre class="lang-py prettyprint-override"><code>def foo(arg):
if arg:
yield -1
else:
return range(5)
</code></pre>
<p>Specifically, the <code>foo()</code> method shall iterate over a single value (<code>-1</code>) if its argument ... | <python><yield> | 2024-04-25 09:32:47 | 1 | 593 | olebole |
78,383,395 | 9,342,193 | Adding labels within a pie chart in Python by optimising space | <p>I have a dataframe such as :</p>
<pre><code>import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
# Sample data
data = {
'genus': ['SpeciesA', 'SpeciesB', 'SpeciesC', 'SpeciesD', 'SpeciesE', 'SpeciesF', 'SpeciesG', 'SpeciesH'],
'count': [10, 2, 1, 1, 1, 1, 1, 1],
'Type': ['Animal', 'Env... | <python><matplotlib><pie-chart> | 2024-04-25 08:51:57 | 1 | 597 | Grendel |
78,383,268 | 10,816,404 | How to use logging with custom jsonPayload in GCP Dataflow | <p>by default, GCP Dataflow 'just works' with the standard Python logging library, so:</p>
<pre class="lang-py prettyprint-override"><code>import logging
logging.info('hello')
</code></pre>
<p>yields a log message in Google Logging while the Dataflow job runs in GCP. This log entry contains some useful log context - m... | <python><google-cloud-platform><google-cloud-dataflow><apache-beam><google-cloud-logging> | 2024-04-25 08:26:24 | 1 | 2,220 | Duck Ling |
78,383,166 | 984,621 | How to save logs to an AWS S3 bucket? | <p>The logs the Scrapy spider is producing are getting bigger over time, which is causing an issue in terms of the performance of my server (Ubuntu). I don't want to limit the level of information I am putting to logs, because I find it very useful in general, and even more when it comes to debugging.</p>
<p>So right n... | <python><scrapy> | 2024-04-25 08:10:19 | 0 | 48,763 | user984621 |
78,383,130 | 5,618,856 | Select sibling node value based on multiple sibling conditions not using an xpath string | <p>There are various answers to finding an xml node using xpath like <a href="https://stackoverflow.com/questions/65505341/select-sibling-node-value-based-on-multiple-sibling-conditions">here</a>. In python using lxml, is there a more pythonic way of building this condition list? I know I can build the xpath string usi... | <python><xml><xpath><lxml> | 2024-04-25 08:02:23 | 1 | 603 | Fred |
78,382,633 | 7,680,592 | ERROR API Binance convert limit placeOrder | <p>I'm trying to make a limit order of convert using binance api. The Postman doc tell us that should be pass as parameter in the POST like we do with <code>user_saldo</code> that works just fine.</p>
<p>The error returned <code>content: b'{"code":345214,"msg":"Placing a limit order has failed.... | <python><python-requests><request><binance><binance-api-client> | 2024-04-25 06:26:57 | 2 | 600 | Joao Victor |
78,382,516 | 3,909,896 | Pyenv - Switching between Python and PySpark versions without hardcoding environment variable paths for python | <p>I have trouble getting different versions of PySpark to work correctly on my windows machine in combination with different versions of Python installed via PyEnv.</p>
<p>The setup:</p>
<ol>
<li>I installed <strong>pyenv</strong> and let it set the environment variables (<em>PYENV</em>, <em>PYENV_HOME</em>, <em>PYENV... | <python><windows><pyspark> | 2024-04-25 06:01:00 | 1 | 3,013 | Cribber |
78,382,233 | 12,936,009 | ImportError: cannot import name 'BPF' from 'bcc' (unknown location) | <p>My bcc is build here:</p>
<pre><code>/home/pegasus_vm/Documents/eBPFShield/bcc/build
</code></pre>
<p>Why I try to run <code>python main.py -h</code> from <code>/home/pegasus_vm/Documents/eBPFShield/</code>
It shows the following error:</p>
<pre><code>(env) pegasus_vm@pegasusvm:~/Documents/eBPFShield$ python main.py... | <python><ebpf><bpf><bcc><bcc-bpf> | 2024-04-25 04:24:03 | 2 | 847 | NobinPegasus |
78,382,145 | 2,307,441 | Row based filter and aggregation in pandas python | <p>I have two dataframes as below.</p>
<p>df1:</p>
<pre class="lang-py prettyprint-override"><code>data1 = {
'Acc': [1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 4],
'indi_val': ['Val1', 'val2', 'Val_E', 'Val1_E', 'Val1', 'Val3', 'val2', 'val2_E', 'val22_E', 'val2_A', 'val2_V', 'Val_E', 'Val_A', 'Val', 'Val2', ... | <python><pandas><dataframe> | 2024-04-25 03:48:19 | 4 | 1,075 | Roshan |
78,382,125 | 18,579,739 | How to divide large python file into small files without change program structure? | <p>I face a program like following:</p>
<pre class="lang-py prettyprint-override"><code># This code just used to reflect the recursive structure, DO NOT take it grammatically !!
class A:
def __init__(self) -> None:
pass
def check(self, element):
if element == 'TypeA':
sel... | <python> | 2024-04-25 03:41:45 | 2 | 396 | shan |
78,382,107 | 480,118 | creating a multi-index column from an existing dataframe | <p>I have data that is coming to me as it appears in a spreadsheet.<br />
When it arrives it looks like this:</p>
<pre><code>import pandas as pd, numpy as np
data1 = [['symbol', 'appl', 'goog', None, 'msft', None, None, None],
['date' , 'close', 'close', 'volume', 'close', 'open', 'high', 'l... | <python><pandas><numpy> | 2024-04-25 03:31:23 | 1 | 6,184 | mike01010 |
78,381,917 | 198,666 | How to chain find() methods and dealing with None in BeautifulSoup? | <p>I am writing some HTML processing and am loving BS4. I do find it a bit lengthy and was hoping there was some better way to deal with this.</p>
<p>I would love to chain my finds together like this:</p>
<pre><code>soup.find('li', class_='positions').find('span', class_='list-value').getText()
</code></pre>
<p>Instea... | <python><web-scraping><beautifulsoup> | 2024-04-25 02:09:59 | 1 | 329 | Davery |
78,381,577 | 14,656,198 | Is it possible to ignore pyright linting only for magic commands IPython command | <p>It's possible to use the <code># type: ignore</code> comment to ignore linting on a specific line:</p>
<pre class="lang-py prettyprint-override"><code>print(syntax error) # type: ignore
</code></pre>
<p>However, the same is not possible with magic commands:</p>
<pre class="lang-py prettyprint-override"><code>%load_e... | <python><ipython><pyright> | 2024-04-24 23:08:29 | 0 | 1,745 | Luiz Martins |
78,381,457 | 2,165,613 | Where to find Azure Functionapp deploy errors for python 3.11 in the Azure Portal | <p>I want to move my local python 3.11 project to an Azure Functionapp. <em>Somewhere</em> in the deployment process, an error happens, such as an <code>ModuleNotFoundError</code>. I assume it's because a package that can be installed locally just fine, fails to install on the Azure Functionapp. I can't find the errors... | <python><azure><azure-functions><azure-application-insights><azure-deployment> | 2024-04-24 22:14:52 | 1 | 412 | Emiel Steerneman |
78,381,363 | 11,999,957 | Why is this constraint function so much slower than a similar one and how do I increase the speed in Scipy Optimize? | <p>I have an optimization that has around 22 constraint functions. I tried to turn that into a single constraint function and the optimizer is taking 10x as long. Any way to reduce the speed?</p>
<p>The below are the original constraint functions. I only included 2 but there are like 22 of them, each with hard coded... | <python><scipy><constraints><scipy-optimize> | 2024-04-24 21:47:49 | 2 | 541 | we_are_all_in_this_together |
78,381,352 | 480,118 | Rreadng NULL/EMPTY from JSON in an HTTP post request handler | <p>I'm posting data from excel to a back-end Python server. The JSON from excel VBA, just before sending is shown below: What you'll notice in below. Is there is an empty cell/field after 2020-01-10?</p>
<pre><code>[
[
"name",
"RTX",
"SPX",
"NDX&qu... | <python><vba><flask> | 2024-04-24 21:42:52 | 0 | 6,184 | mike01010 |
78,381,277 | 7,564,952 | Databricks Spark throwing [GC (Allocation Failure) ] message | <p>I used this code to update a new_df. Idea is to get all the records between date_updated and stop time and assign them a number which i will used in group by in next steps. so basically assigning same number to every group between dateupdated and stop time.</p>
<pre><code># Create an empty DataFrame
new_df = spark.c... | <python><apache-spark><pyspark><databricks> | 2024-04-24 21:20:30 | 1 | 455 | irum zahra |
78,381,249 | 1,202,863 | Mock a class with a parameter | <p>This is my method below that returns a dataframe</p>
<pre><code>def refactorReport( df):
"""Enhance with additional information as needed"""
for userclass in [ 'ClassA', 'ClassB', 'ClassC' ]:
df[ '%s_Region'%userclass ] = df[ userclass ].apply(lambda x: commutils.UserNam... | <python><unit-testing><class><mocking> | 2024-04-24 21:13:42 | 1 | 586 | Pankaj Singh |
78,381,203 | 111,307 | How do you get the XYZ coordinates of a point from a Maya Python script? | <p>How do you get the numerical xyz components of a vertex in Maya from a Python script?</p>
| <python><maya> | 2024-04-24 21:04:17 | 1 | 67,904 | bobobobo |
78,381,199 | 1,123,094 | Prevent specific key presses from being sent to foreground app using PyQt5 and pynput | <p>So I want to detect certain keys being pressed and stop those keys being sent to the foreground app.</p>
<p>I don't want to use hideous libraries like pywin32 and pyHook as they are such a headache to build. So lets use pynput</p>
<p>The problem is no matter what I do - space does get blocked - but then the whole QT... | <python><pyqt5><qthread><pynput> | 2024-04-24 21:01:39 | 1 | 2,250 | willwade |
78,381,197 | 3,103,957 | Python FastAPI: Request and Response instances auto creation | <p>I have this code snippet.</p>
<pre><code>from fastapi import Request, Response
my_api = FastAPI()
@my_api.get("/get_items")
async def get_items(req : Request, res : Response):
json_data = await req.josn()
res.status_code = 200
....
....
return res
</code></pre>
<p>The above code ... | <python><request><fastapi><response> | 2024-04-24 21:00:39 | 0 | 878 | user3103957 |
78,381,155 | 3,878,168 | Python setuptools multiple extension modules with shared C source code building in parallel | <p>I'm working on a Python project with a setup.py that has something like this<sup>1</sup>:</p>
<pre class="lang-py prettyprint-override"><code>setup(
cmdclass={"build_ext": my_build_ext},
ext_modules=[
Extension("A", ["a.c", "common.c"]),
Extension("... | <python><setuptools><python-c-api> | 2024-04-24 20:51:26 | 1 | 1,875 | Yay295 |
78,380,991 | 9,462,829 | io.UnsupportedOperation: fileno when trying to write pdf from .zip to MinIO | <p>I'm working on a Flask app where a user uploads a .zip file populated with .pdf files and I want to upload its contents to minIO. Been trying to use the <code>put_object</code> function, but I'm having issues trying to get the size.</p>
<p>Tried to replicate <a href="https://stackoverflow.com/questions/61499835/uplo... | <python><io><minio> | 2024-04-24 20:11:18 | 1 | 6,148 | Juan C |
78,380,686 | 5,693,706 | Concatenate two geoshape charts in Altair / Vega-Lite with independent axis? | <p>I am trying to plot two separate geoshape charts and concatenate them together. Below is a MWE of what I am trying to do:</p>
<pre class="lang-py prettyprint-override"><code>import altair as alt
from vega_datasets import data
import geopandas as gpd
source = data.us_10m
source = gpd.read_file(source.url).set_crs(e... | <python><vega-lite><altair> | 2024-04-24 19:00:08 | 1 | 1,038 | kgoodrick |
78,380,647 | 3,224,196 | Python script run from C# hangs at high memory usage | <p>I want my C# (.NET 8) app to start a Python script under Python 3.12. The Python script is fairly resource-intensive. When I run the script manually, all is well; it consumes memory up to a bit over 3 GB RAM, then completes. But when I run it in C# by spawning a new CMD window, it consumes just about 1 GB of memory ... | <python><c#><python-3.12> | 2024-04-24 18:50:18 | 0 | 380 | Martin |
78,380,522 | 10,437,727 | Handle async packages in Python Tasks inside of Airflow | <p>I'm dealing with an annoying error on my local Airflow setup.</p>
<p>I use a LocalExecutor, with a MySQL database (if that helps).</p>
<p>My task looks something like that:</p>
<pre class="lang-py prettyprint-override"><code>
@task()
def pdf_to_text_task() -> None:
file_storage_instance = get_file_storage_ins... | <python><airflow> | 2024-04-24 18:23:22 | 1 | 1,760 | Fares |
78,380,193 | 7,726,586 | FastAPI (uvicorn) + Docker ignores specified host | <p>I need to run a FastAPI in Docker on the remote machine and make it accessible for curl requests from any machine. Container builds and uvicorn starts, but when I try to do a curl request I get connection errors. I've already specified host 0.0.0.0 in the parameters, but experimenting with different ports I've notic... | <python><docker><docker-compose><fastapi><uvicorn> | 2024-04-24 17:19:37 | 1 | 534 | maria |
78,380,179 | 596,057 | Opening QDockWidget Closes Previous QDockWidget on Ubuntu | <p>I wrote a PyQt5 program using QDockWidgets on Windows. Selecting items in a QList in the central widget causes a widget to be placed in the right docking area that allows me to edit that item and as I select different items in the QList the widget gets replaced. If I move the dock widget out into a floating widget... | <python><ubuntu><pyqt5><qt5> | 2024-04-24 17:16:53 | 1 | 1,638 | HahaHortness |
78,380,077 | 16,383,578 | WinError 206 when passing way too many command line arguments | <p>I am no fool and I know exactly what caused this issue and how to make it not pop up, by not using the command that caused it, but I would rather like to use the command, and have yet to find a workaround.</p>
<p>The problem is simple, and it is absolutely not about file paths longer than 255 characters and the like... | <python><windows> | 2024-04-24 16:54:51 | 1 | 3,930 | Ξένη Γήινος |
78,379,995 | 308,827 | Creating a custom colorbar in matplotlib | <p>How can I create a colorbar in matplotlib that looks like this:</p>
<p><a href="https://i.sstatic.net/EY2hV.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/EY2hV.png" alt="enter image description here" /></a></p>
<p>Here is what I tried:</p>
<pre><code>import matplotlib.pyplot as plt
from matplotlib.c... | <python><matplotlib><colorbar> | 2024-04-24 16:36:51 | 2 | 22,341 | user308827 |
78,379,929 | 390,897 | Broken Recursive Typing for Python | <p>I have a type alias that I call <code>point2d</code> and a related recursive type alias.</p>
<pre><code>point2d = tuple[float, float]
point2d_nested = (
point2d
| list["point2d_nested"]
| tuple["point2d_nested", ...]
)
</code></pre>
<p>Now I want to write a function that will scale p... | <python><python-typing><pyright> | 2024-04-24 16:24:20 | 2 | 33,893 | fny |
78,379,820 | 1,309,503 | LLM Studio fail to download model with error : unable to get local issuer certificate | <p>In LLM studio, when I try to download any model, I am facing following error:</p>
<p>Download Failed: unable to get local issuer certificate</p>
<p><a href="https://i.sstatic.net/WkMZI.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/WkMZI.png" alt="enter image description here" /></a></p>
| <javascript><python><machine-learning> | 2024-04-24 16:03:26 | 4 | 1,735 | divyang4481 |
78,379,777 | 16,363,897 | Fill nan based on other rows/columns and other dataframe | <p>I have the following "covar" dataframe (it's a covariance matrix), where I have the same items both as index and as column names.</p>
<pre><code>covar_data = {
'a': [0.04, np.nan, 0.03, np.nan, -0.04],
'XY': [np.nan, np.nan, np.nan, np.nan, np.nan],
'b': [0.03, np.nan, 0.09, np.nan, 0.00],
... | <python><pandas><numpy> | 2024-04-24 15:57:19 | 2 | 842 | younggotti |
78,379,670 | 21,286,804 | "AssertionError: settings.yaml file not found" in pynest | <p>I am facing the following issue:</p>
<pre><code>File "/home/rugain/Documents/repos/sap_integration_api/.venv/lib/python3.12/site-packages/nest/cli/click_handlers.py", line 63, in create_nest_module
db_type, is_async = get_metadata()
^^^^^^^^^^^^^^
File "/home/rugain/Docum... | <python><fastapi> | 2024-04-24 15:38:39 | 1 | 427 | Magaren |
78,379,599 | 5,423,080 | Unique legend in Seaborn and Matplotlib subplots | <p>I am analysing some data and plotting three violin plots on two subplots using <code>matplotlib</code> and <code>seaborn</code>.</p>
<p>My problem is with the legends, I would like to have just one legend for the subplot outside them.</p>
<p>A MWE is:</p>
<pre><code>import pandas as pd
import numpy as np
import matp... | <python><matplotlib><seaborn> | 2024-04-24 15:27:17 | 1 | 412 | cicciodevoto |
78,379,572 | 2,437,514 | Using Pydantic with typing.Protocol | <p>I'm attempting to use typing protocols and pydantic together and am running into some issues. I expect probably my understanding of how to properly use the two of them together is lacking.</p>
<p>This pydantic code is producing an error:</p>
<pre class="lang-py prettyprint-override"><code>from typing import TypeVar,... | <python><python-typing><pydantic> | 2024-04-24 15:22:14 | 1 | 45,611 | Rick |
78,379,570 | 6,223,748 | Quick way for checking if two objects are deep copies of each other | <p>Assume I have two objects of a certain class and want to make sure that they are deep copies and not just shallow copies.</p>
<p>The code below checks if <code>is</code> can be used to determine if they are deep copies.</p>
<pre><code>import copy
class MyClass():
def __init__(self, a, b, c):
self.a = a
... | <python><object><copy> | 2024-04-24 15:21:53 | 0 | 351 | Dave |
78,379,296 | 14,838,954 | How to Create and Visualize a Directed Weighted Graph with Parallel Edges and Different Weights Using Python? | <p>I'm working on a project where I need to create a directed weighted graph in Python that allows parallel edges with different weights between nodes. I am using the <a href="https://networkx.org/documentation/stable/index.html" rel="nofollow noreferrer">networkx</a> library and <code>Matplotlib</code> for visualizati... | <python><networkx><directed-graph><graph-visualization><weighted-graph> | 2024-04-24 14:40:00 | 2 | 485 | Nirmal Sankalana |
78,379,126 | 1,873,403 | How can I convert a discrete coordinate map into a data flow diagram in python? | <p>I have some data stored in a database with the following schema</p>
<pre><code>table1, field1, table2, field2
</code></pre>
<p>This shows how table 1 relates to table 2 via the field value. I'd like to turn this into a diagram that shows how each of these tables are related to each (i.e. an ER diagram). For example,... | <python><entity-relationship><diagram> | 2024-04-24 14:15:42 | 0 | 1,180 | Brad Davis |
78,379,097 | 7,803,545 | Regular expression look ahead anchor with multiple match | <p>I am using Regular Expression in Python 3.11 (because it allows the <code>(?>...)</code> pattern, <a href="https://docs.python.org/3/library/re.html" rel="nofollow noreferrer">https://docs.python.org/3/library/re.html</a>) to transform the bellow string to a dictionary by an interactive match pattern:</p>
<pre cl... | <python><regex><python-3.11> | 2024-04-24 14:11:05 | 1 | 896 | hildogjr |
78,379,017 | 3,258,600 | Remove selected libraries from the Pip Cache | <p>I have a library in development using a private PyPi server that I am trying to test with other python modules without having to update the version number after making changes.</p>
<p>My development environment uses tox, pyproject.toml, and setuptools for build.</p>
<p>After making a change to the upstream library, ... | <python><pip> | 2024-04-24 13:58:52 | 1 | 12,963 | kellanburket |
78,378,995 | 10,425,150 | Save matplotlib as mp4 in python | <pre><code>from matplotlib import pyplot as plt
import numpy as np
import matplotlib.animation as animation
fig = plt.figure()
axis = plt.axes(xlim=(0, 4), ylim=(-1.5, 1.5))
line, = axis.plot([], [], lw=3)
def animate(frame_number):
x = np.linspace(0, 4, 1000)
y = np.sin(2 * np.pi * (x - 0.01 * fram... | <python><matplotlib><animation> | 2024-04-24 13:55:26 | 2 | 1,051 | Gооd_Mаn |
78,378,829 | 2,475,195 | PerformanceWarning: DataFrame is highly fragmented when adding more columns | <p>I am getting this warning when inserting new columns in a dataframe that are shifted copies of existing columns. How can I rewrite this code so as to avoid the warning? One solution I found was copying the whole dataframe after every insertion, but that seems inefficient.</p>
<pre><code>data = {str(i):[pow(k, i) for... | <python><pandas><dataframe> | 2024-04-24 13:29:31 | 3 | 4,355 | Baron Yugovich |
78,378,811 | 12,081,269 | Is there any way to optimize my function for district matching using Python's GeoPandas and Pandas? | <p>I have a table with polygons and district names; I also have data on purchases with exact longitude and latitude. I wrote a function that checks for every coordinate pair a match in a polygon; then it assigns district name for a purchase. The problem is that it works very-very slow due to lack of vectorization and n... | <python><pandas><geopandas> | 2024-04-24 13:26:50 | 2 | 897 | rg4s |
78,378,769 | 832,490 | How to authenticate on msgraph.GraphServiceClient? | <p>There is no documentation for do this, I found it unacceptable.</p>
<pre><code>from msal import ConfidentialClientApplication
from msgraph import GraphServiceClient
client_id = ''
client_secret = ''
tenant_id = ''
authority = f'https://login.microsoftonline.com/{tenant_id}'
scopes = ['https://graph.microsoft.com/.d... | <python><azure><azure-active-directory><microsoft-graph-api><office365> | 2024-04-24 13:20:23 | 1 | 1,009 | Rodrigo |
78,378,738 | 5,774,969 | Saving tensorflow dataset extremely slow after applying filter | <p>Relatively new to tensorflow here, and I am facing an issue where I have not yet managed to find a good answer through searching. So here goes:</p>
<p>I am trying to understand why applying a filter function to my tensorflow dataset, suddenly makes the time it takes to write the dataset to disk, seemingly explode. T... | <python><tensorflow><scikit-image> | 2024-04-24 13:15:18 | 0 | 502 | AstroAT |
78,378,626 | 12,415,855 | Python-PPTX copy shape von one PPT to another? | <p>I try to copy a shape from one slide from a PPTX to another slide on another PPTX using the following code:</p>
<pre><code>from pptx import Presentation
from pptx.dml.color import RGBColor
import os
import sys
if __name__ == '__main__':
path = os.path.abspath(os.path.dirname(sys.argv[0]))
fn = ... | <python><python-pptx> | 2024-04-24 12:55:20 | 0 | 1,515 | Rapid1898 |
78,378,549 | 6,000,414 | botocore.eventstream.InvalidHeadersLength | <p>I am trying to invoke Bedrock agent using boto3, and I am getting the following error:</p>
<pre><code>botocore.eventstream.InvalidHeadersLength: Header length of 1953527156 exceeded the maximum of 131072
</code></pre>
<p>Here is the code I am using:</p>
<pre><code>import boto3
import uuid
bedrock = boto3.client('be... | <python><amazon-web-services><boto3><botocore><amazon-bedrock> | 2024-04-24 12:43:18 | 1 | 901 | Alexey Zelenkin |
78,378,542 | 5,568,409 | Why the LateX instruction \Large doesn't run when used in Matplotlib label? | <p>In the small program below, I don't understand why <code>label = r"$\tilde{Q}$")</code> runs well and <code>label = r"$\Large{Q}$")</code> doesn't run:</p>
<pre><code>%matplotlib inline
import matplotlib.pyplot as plt
x = np.linspace(-3, +3, 100)
y = x**2
fig, ax = plt.subplots(figsize=(4, 2))
... | <python><matplotlib><latex> | 2024-04-24 12:41:59 | 0 | 1,216 | Andrew |
78,378,373 | 9,925,065 | numpy add array of constants to array of matrixes | <p>Consider a numpy array <code>X</code> with <code>m</code> elements. Each element it's itself a numpy matrix of a generic (but, more importantly, fixed shape <code>(n0, n1, ..., n)</code> so that <code>X</code> shape is <code>(m, n0, n1, ..., n)</code>.
Now, take a list of m (different) scalar, let's say something li... | <python><numpy> | 2024-04-24 12:15:53 | 3 | 365 | Gigino |
78,378,202 | 11,267,783 | With Matplotlib, how to create one figure with cartesian and polar coordinates | <p>I want to create a figure with 2 subplots using mosaic and display the same signal in polar and cartesian coordinates with Matplotlib.</p>
<pre><code>import matplotlib.pyplot as plt
import numpy as np
t = np.arange(0, 30, 0.1)
s = np.sin(2 * np.pi * 1 * t)
fig = plt.figure(layout="constrained")
ax_dict =... | <python><matplotlib> | 2024-04-24 11:46:24 | 2 | 322 | Mo0nKizz |
78,378,146 | 5,678,057 | Pandas: Prevent (blank) from being read as '' | <p>I'm loading a dataframe that has a column with <strong>string</strong> <code>(blank)</code> in it. I want to read this as is, i.e as a string itself, and to be displayed in the output, instead of being converted to any other form (<code>Nan</code>, <code><NA></code>, <code>''</code> etc.).</p>
<p>This is not a... | <python><pandas><dataframe><casting> | 2024-04-24 11:36:58 | 0 | 389 | Salih |
78,377,980 | 2,546,099 | Generate wheel-package for specific python version using pyproject.toml | <p>I'm currently transferring my project build pipeline from being <code>setup.py</code>-based to a <code>pyproject.toml</code>-based approach. Most of the parameters are easily transferable, however, I can't find an equivalent to</p>
<pre><code>python_requires="~=3.11"
</code></pre>
<p>Of course, there is</p... | <python><build><pyproject.toml> | 2024-04-24 11:10:27 | 0 | 4,156 | arc_lupus |
78,377,856 | 11,233,365 | Failure to install python-javabridge: How does pip work differently between Python 3.10 and 3.11? | <p>I am trying to install <code>python-javabridge</code> (<a href="https://github.com/CellProfiler/python-javabridge" rel="nofollow noreferrer">GitHub link</a>) in order to set up a Java virtual machine to house libraries for different file formats that Python can subsequently refer to. However, the authors of the pack... | <python><pip><setuptools><cpython> | 2024-04-24 10:51:26 | 1 | 301 | TheEponymousProgrammer |
78,377,648 | 16,383,578 | Can't import libarchive-c in Python: FileNotFoundError | <p>I am trying to selectively extract files from many 7zip files automatically, the usual <code>patool</code> and <code>pyunpack</code> and the like don't allow selection of files to be extracted. <code>py7zr</code> seems to provide the functionality however I find it extremely inefficient to extract individual files.<... | <python><ctypes><libarchive> | 2024-04-24 10:16:19 | 1 | 3,930 | Ξένη Γήινος |
78,377,563 | 4,809,610 | Mypy: properly typing a Django mixin class when accessing a method on super() | <p>Django has a quirk where it doesn't validate models by default before writing to the database. A non-ideal situation that devs try to work around by creating a Mixin class for example:
<a href="https://www.xormedia.com/django-model-validation-on-save/" rel="nofollow noreferrer">https://www.xormedia.com/django-model-... | <python><django><mypy><python-typing> | 2024-04-24 10:02:09 | 1 | 754 | KCDC |
78,377,343 | 19,954,200 | converting json data to vector for better langchain chatbot results | <p>im creating a chatbot for my university website as a project.
for the last 3 days i've been searching all over the internet how to use <code>Langchain</code> with json data such that my chatbot is fast. i came up with this:</p>
<pre><code>from langchain_google_genai import ChatGoogleGenerativeAI
from langchain.agent... | <python><json><nlp><langchain><large-language-model> | 2024-04-24 09:29:39 | 1 | 1,268 | Ayman Ait |
78,377,181 | 587,587 | How can I translate this TCP/IP MULTICAST code from Python to Go | <p>I have this code, written in Python. From what I understand it</p>
<ul>
<li>Creates a single socket</li>
<li>Adds every local IP address as a member of the given multicast groups.</li>
</ul>
<p>If any local interface receives a multicast message with that group/port, recv will return the result.</p>
<pre><code>impor... | <python><go><network-programming><multicast> | 2024-04-24 09:05:26 | 1 | 492 | Anton Lahti |
78,376,979 | 3,103,957 | Usage of ellipsis in Python | <p>I have see that when we use ellipsis (three continuous dots <code>...</code>) in Python, it means different things according to the context. I am aware that ... can be used to omit definition, in typing module (Callable, Tuple etc.), in Pydantic etc.., I looked into the links of SO already which they don't answer my... | <python><ellipsis> | 2024-04-24 08:33:08 | 0 | 878 | user3103957 |
78,376,871 | 11,770,390 | Python: how to pass the same lock to multiple threads mapped to a ThreadPoolExecutor? | <p>Let's say I don't want to specify the lock globally. How can I pass the same lock to each thread within a <code>ThreadPoolExecutor</code>? Here's what doesn't work:</p>
<pre><code>import threading
from concurrent.futures import ThreadPoolExecutor
def main():
lock = threading.Lock()
with ThreadPoolExecu... | <python><multithreading><concurrency><mutex> | 2024-04-24 08:09:36 | 1 | 5,344 | glades |
78,376,438 | 11,141,816 | How to specify the specific node connection/data flow in the tensorflow or pytorch? | <p>The neurons in the tensorflow were often assumed to be fully connected layers, i.e.</p>
<pre><code>model = tf.keras.Sequential([
tf.keras.layers.Conv2D(32, (3, 1), activation='relu', input_shape=(10, 1, 1)), # layer 1
tf.keras.layers.Dense(32, activation='relu'), # layer 2
tf.keras.layers.Dense(32, activ... | <python><tensorflow><pytorch><neural-network> | 2024-04-24 06:49:49 | 1 | 593 | ShoutOutAndCalculate |
78,376,362 | 1,826,893 | Unable to get all users from Microsoft Graph using Python SDK | <p>I need to know user emails and id (so I can identify the user from the email).</p>
<p>According to Microsoft <a href="https://learn.microsoft.com/en-us/graph/api/user-get?view=graph-rest-1.0&tabs=python#examples" rel="nofollow noreferrer">documentation</a>, the below code should allow the retrival of user inform... | <python><azure><azure-active-directory><microsoft-graph-api> | 2024-04-24 06:32:32 | 2 | 1,559 | Edgar H |
78,376,273 | 107,294 | Why is setuptools not including a (non-package) top-level module in the generated wheel? | <p>I have a <a href="https://github.com/mc68-net/r8format/tree/ae5ba998dca7ff446cb0477591d65b5064e904ee/" rel="nofollow noreferrer">Python project</a> that I configure with <code>pyproject.toml</code> and build with <code>pyproject-build</code>. The lines relating to the build and which files to include in the distribu... | <python><python-packaging> | 2024-04-24 06:06:39 | 1 | 27,842 | cjs |
78,376,132 | 3,161,801 | Google App Engine to python3 migration for a specific service | <p>I am deploying the following in sync.yaml. This was part of my python 2 project.</p>
<pre class="lang-yaml prettyprint-override"><code>service: sync
instance_class: F2
automatic_scaling:
max_instances: 1
runtime: python312
app_engine_apis: true
# taskqueue and cron tasks can access admin urls
handlers:
- url: /.... | <python><google-app-engine> | 2024-04-24 05:22:47 | 2 | 775 | ffejrekaburb |
78,376,096 | 3,727,678 | Generic[T] classmethod implicit type retrieval in Python 3.12 | <p>I would like to use the new <a href="https://docs.python.org/3/library/typing.html#generics" rel="nofollow noreferrer">Python 3.12 generic type signature</a> syntax to know the type of an about-to-be-instantiated class within the <strong>classmethod</strong> of that class.</p>
<p>For example, I would like to print t... | <python><generics><python-typing> | 2024-04-24 05:09:47 | 1 | 369 | clintval |
78,375,871 | 7,985,802 | LLAMA3 instruct 8B hallucinates even though I am using the correct prompt format | <p>I am running <code>meta-llama/Meta-Llama-3-8B-Instruct</code> endpoint on AWS and for some reason cannot get reasonable output when prompting the model. It hallucinates even when I send through a simple prompt. Could someone please advise what I am doing wrong?</p>
<p>Exemplary prompt:</p>
<pre><code><|begin_of_t... | <python><amazon-web-services><amazon-sagemaker><llama> | 2024-04-24 03:45:25 | 2 | 441 | Ilia Slobodchikov |
78,375,632 | 12,133,280 | Difference between linearmodels PanelOLS and statsmodels OLS | <p>I am running two regressions that I thought would yield identical results and I'm wondering whether anyone can explain why they are different. One is with statsmodels OLS and the other is with linearmodels PanelOLS.</p>
<p>A minimum working example is shown below. The coefficients are similar, but definitely not the... | <python><regression><panel><statsmodels><linearmodels> | 2024-04-24 01:52:47 | 1 | 447 | pasnik |
78,375,583 | 1,429,402 | Draw a filled polygon with fill color *inside* the outline | <p>I want to draw a polygon as an outline and fill it with a specific color. This should be an easy enough task for <code>PIL</code>... Unfortunately the <code>fill</code> argument produces an image that bleeds out of the outline... Demonstration:</p>
<p>Step 1, lets show clearly what my outline should look like:</p>
<... | <python><python-imaging-library> | 2024-04-24 01:25:57 | 2 | 5,983 | Fnord |
78,375,230 | 1,374,078 | Find a module's function using Python ast | <p>There are variations, like</p>
<pre><code> import ast
code = """
import datetime
datetime.datetime.now()
"""
tree = ast.parse(code)
print(ast.dump(tree, indent=2))
</code></pre>
<p>the AST prints</p>
<pre><code>Module(
body=[
Import(
names=[
alias(name... | <python><abstract-syntax-tree><python-ast> | 2024-04-23 22:27:19 | 0 | 1,652 | phoxd |
78,375,119 | 1,072,283 | Losing duckdb entries when quitting Flask | <p>I just finished migrating my Flask app from Postgres to DuckDB, and pretty much everything seems to be working perfectly. There is one very odd issue though that I've been banging my head against the wall on for hours and can't seem to make heads or tails of it.</p>
<p>In one of my Flask routes there are various thi... | <python><flask><sqlalchemy><flask-sqlalchemy><duckdb> | 2024-04-23 21:43:31 | 1 | 661 | dongle |
78,375,068 | 1,052,204 | Mypy does not see my singleton class attribute. It throws [attr-defined] and [no-untyped-def] | <pre><code>class WaitService:
_instance = None
def __new__(cls, name: str = "Default"):
if not cls._instance:
cls._instance = super(WaitService, cls).__new__(cls)
cls._instance.name = name
return cls._instance
if __name__ == '__main__':
w = WaitService(&q... | <python><mypy><python-typing> | 2024-04-23 21:29:11 | 1 | 3,224 | Uchenna Nwanyanwu |
78,374,985 | 2,036,035 | How to modify rust types passed to python which were initially created in python from Pyo3 | <p>I've created the following directory structure</p>
<pre><code>- python
* main.py
- src
* lib.rs
* Cargo.toml
* pyproject.toml
</code></pre>
<p>where only lib.rs and main.py are custom made, the rest was generated by <code>maturin init</code></p>
<p>lib.rs is :</p>
<pre><code>use pyo3::prelude::*;
#[pyclass]
#[der... | <python><python-3.x><rust><ffi><pyo3> | 2024-04-23 21:05:53 | 1 | 5,356 | Krupip |
78,374,969 | 18,380,679 | "Selected dimensions and metrics cannot be queried together." - UA API | <p>After attempting to run this piece of code with Universal Analytics version 4, I encountered an error:
code :</p>
<pre><code>def get_ua_report(analytics):
"""Fetches the report data from Google Analytics UA."""
return analytics.reports().batchGet(
body={
'rep... | <python><google-analytics><google-analytics-api><universal> | 2024-04-23 21:02:20 | 1 | 557 | ali izadi |
78,374,872 | 10,998,056 | JSON Schema Validation of a Decimal Number in a Panda Dataframe | <p>The following Python script must validate the number of decimal places in the records. In the schema, I am trying to define that it has 3 decimal places, using <code>"multipleOf": 0.001</code>.</p>
<p>I have a record with 5 decimal places: <code>"scores": [1.12345]</code></p>
<p>It should report ... | <python><pandas><jsonschema><json-schema-validator> | 2024-04-23 20:36:26 | 2 | 505 | Antonio José |
78,374,733 | 3,170,702 | Snakemake handle variable input datasets | <p>I'm just getting started with Snakemake and I can't make sense of wildcards. My workflow will have an input data directory with the following structure:</p>
<pre><code>data/
├─ somedataset/
│ ├─ somesubset.csv
│ ├─ someothersubset.csv
├─ seconddataset/
│ ├─ somesubsetofsecond.csv
│ ├─ yetanothersubset.csv
│ ├─ ... | <python><snakemake> | 2024-04-23 19:59:40 | 1 | 2,071 | user3170702 |
78,374,548 | 7,265,114 | No authentication box appears when authenticating Google Earth Engine (GEE) Python in VS code notebook | <p>I try to authenticate the GEE, the kernel keeps running, but authenticating box does not show to paste the authentication code in (picture below, but no authentication box showed). Anyone has similar experience?</p>
<p><a href="https://i.sstatic.net/bYwS7.png" rel="nofollow noreferrer"><img src="https://i.sstatic.ne... | <python><authentication><visual-studio-code><google-earth-engine> | 2024-04-23 19:10:01 | 1 | 1,141 | Tuyen |
78,374,325 | 2,444,008 | Django admin panel shows field max length instead of field name | <p>I know it is a little bit weird but I see field max length instead of field name in admin panel as below:</p>
<p><a href="https://i.sstatic.net/snJPU.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/snJPU.png" alt="enter image description here" /></a></p>
<p>My model:</p>
<pre><code>class SituationFlag... | <python><django> | 2024-04-23 18:15:03 | 1 | 1,093 | ftdeveloper |
78,374,279 | 736,662 | Getting all values from a certain node in json using python | <p>I hava a large json response on an api call using pytest. I want to pick up all hpsIds and all ids and "store it somewhere" to be used as parameters in a subsequent request.</p>
<pre><code>[
{
"hpsId": 10032,
"powerPlant": {
"name": "Svartisen",
&quo... | <python><json><pytest> | 2024-04-23 18:03:47 | 2 | 1,003 | Magnus Jensen |
78,373,921 | 859,591 | How to convert numpy.timedelta64 to a pint quantity object with a time unit? | <p>I need to convert a power time series (MW) to energy (MWh) by taking the sum:</p>
<pre><code>import pint
import xarray as xr
import pandas as pd
ureg = pint.UnitRegistry()
power_mw = xr.DataArray(
np.random.random(365*24),
dims='time',
coords={'time': pd.date_range('2023', freq='h', periods=365*24)}
)
... | <python><pandas><numpy><python-xarray><pint> | 2024-04-23 16:43:37 | 1 | 9,363 | lumbric |
78,373,868 | 1,030,002 | Installing poppler on macos without homebrew | <p>Need to have poppler for python sourced from a network drive, so trying to find a way to install it without using homebrew and have it work for all ARM macs.
Can this be done?</p>
| <python><macos><poppler> | 2024-04-23 16:33:19 | 0 | 1,357 | Hsarp |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.