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,253,818 | 17,729,094 | How to specify column data type | <p>I have the following code:</p>
<pre class="lang-py prettyprint-override"><code>import polars as pl
from typing import NamedTuple
class Event(NamedTuple):
name: str
description: str
def event_table(num) -> list[Event]:
events = []
for i in range(num):
events.append(Event("name"... | <python><python-polars> | 2024-04-01 05:32:37 | 2 | 954 | DJDuque |
78,253,728 | 3,810,748 | How to fix issue with column alignment when printing pandas dataframe with emojis? | <p>When printing a DataFrame with emojis, the column header alignment issue worsens with more columns. This doesn't happen without emojis. Any solutions?</p>
<h1>With Emojis</h1>
<pre><code>import pandas as pd
pd.set_option('display.max_rows', 1000)
pd.set_option('display.max_columns', 1000)
pd.set_option('display.... | <python><pandas><dataframe> | 2024-04-01 04:55:43 | 3 | 6,155 | AlanSTACK |
78,253,231 | 721,666 | How to run llama-cpp-python in a Docker Container? | <p>I have a more conceptional question about running llama-cpp-python in a Docker Container. Following a lot of different tutorials I am more confused as in the beginning.</p>
<p>I have a Debian 12 Server with a CPU - Intel Core i7-7700 and a GPU - GeForce GTX 1080.</p>
<p>I installed on the host via the Debian via DEF... | <python><docker> | 2024-04-01 00:39:26 | 0 | 4,966 | Ralph |
78,253,071 | 1,543,167 | Writes to child subprocess.Popen.stdin don't work from within process group? | <p>From within a Python script, I'm launching an executable in a subprocess (for anyone interested: it's the terraria server).</p>
<pre><code># script.py
server_process = subprocess.Popen("my_executable arg1 arg2", stdin=subprocess.PIPE, text=True)
# My Bash shell
$ ps aux | grep my_executable
# I've removed... | <python><python-3.x><subprocess><stdin> | 2024-03-31 22:58:56 | 0 | 2,376 | pipsqueaker117 |
78,253,020 | 2,428,124 | Can't install packages in python conda environment | <p>I'm kinda new to python and it's the first time managing environments with Anaconda.</p>
<p>There's some discrepancy that I can't figure out between my conda environment and my visual studio code, I'll explain:</p>
<p>I created a conda environment with python 3.8.11, recognised by vscode:
<a href="https://i.sstatic.... | <python><anaconda> | 2024-03-31 22:33:57 | 0 | 3,289 | ste |
78,252,973 | 11,833,216 | Python and regex, can't understand why some words are left out of the match | <pre><code>s = ("If Iβm not in a hurry, then I should stay. " +
"On the other hand, if I leave, then I can sleep.")
re.findall(r'[Ii]f (.*), then', s)
</code></pre>
<p>The output is:</p>
<pre><code>Iβm not in a hurry, then I should stay. On the other hand, if I leave
</code></pre>
<p>The question is... | <python><regex> | 2024-03-31 22:09:42 | 1 | 307 | cat15ets |
78,252,766 | 16,717,009 | Filtering inside groups in polars | <p>I'm new to Polars and need some advice from the experts. I have some working code but I've got to believe theres a faster and/or more elegant way to do this. I've got a large dataframe with columns cik(int), form(string) and period(date) of relevance here. Form can have value either '10-Q' or '10-K'. Each cik will h... | <python><python-polars> | 2024-03-31 20:38:58 | 1 | 343 | MikeP |
78,252,692 | 1,709,768 | Why numpy.vectorize calls vectorized function more times than elements in the vector? | <p>When we call vectorized function for some vector, for some reason it is called twice for the first vector element.
What is the reason, and can we get rid of this strange effect (e.g. when this function needs to have some side effect, e.g. counts some sum etc)</p>
<p>Example:</p>
<pre class="lang-py prettyprint-overr... | <python><numpy> | 2024-03-31 20:09:58 | 1 | 315 | vvch |
78,252,518 | 2,813,152 | use dict from python in django html template and also in js | <p>I am having a dict <code>statistics</code> in my <code>view.py</code> and give it as param in my <code>context</code> to my <code>index.html</code>. There I want to use it in my html like <code>{{ statistics.key1 }}</code>. But I also want to use it in <code>js</code>.</p>
<p>When using <code>json.dumps</code> like ... | <python><django><django-views><django-templates> | 2024-03-31 19:04:47 | 1 | 4,932 | progNewbie |
78,251,924 | 5,618,251 | How to add a new variable to xarray.Dataset in Python with same time,lat,lon dimensions with assign? | <p>I have an xarray.Dataset that looks like:</p>
<pre><code>print(ds2)
<xarray.Dataset>
Dimensions: (time: 46, latitude: 360, longitude: 720)
Coordinates:
* time (time) datetime64[ns] 1976-01-01 1977-01-01 ... 2021-01-01
* latitude (latitude) float64 89.75 89.25 88.75 ... -88.75 -89.25 -89.75... | <python><dataset><python-xarray><assign> | 2024-03-31 15:46:54 | 1 | 361 | user5618251 |
78,251,888 | 13,349,653 | Polars: efficiently get the 2nd largest element | <p>In polars, how do you efficiently get the 2nd largest element, or nth for some small n compared to the size of the column?</p>
| <python><dataframe><python-polars> | 2024-03-31 15:36:08 | 2 | 1,788 | Test |
78,251,515 | 13,084,917 | How to append row to specific columns with gspread? | <p>I have a google sheet with values on it. Think it like this:</p>
<div class="s-table-container"><table class="s-table">
<thead>
<tr>
<th>header1</th>
<th>col1</th>
<th>header 3</th>
<th>col2</th>
</tr>
</thead>
<tbody>
<tr>
<td>First</td>
<td></td>
<td>row</td>
<td></td>
</tr>
<tr>
<td>Second</td>
<td></td>
<td>row<... | <python><google-sheets><google-sheets-api><gspread> | 2024-03-31 13:41:12 | 1 | 884 | omerS |
78,251,440 | 1,082,349 | Unknown dependency "pin-1" prevents conda installation | <p>I'm trying to downgrade libffi=3.3 because of a bug I'm encountering (see very end).</p>
<pre><code>conda install libffi==3.3 -n mismatch
Channels:
- defaults
Platform: linux-64
Collecting package metadata (repodata.json): done
Solving environment: \ warning libmamba Added empty dependency for problem type SOLVER_... | <python><conda><libffi> | 2024-03-31 13:19:24 | 1 | 16,698 | FooBar |
78,251,217 | 15,524,510 | How to convert pandas series to integer for use in datetime.fromisocalendar | <p>I am trying to transform a pandas series which has dates in it. I'd like to take the date that is in there and return the following Monday.</p>
<p>Here is what I have tried:</p>
<pre><code>db['date'] = datetime.date.fromisocalendar(db['date'].dt.year.astype(np.int64),(db['date'].dt.week+1).astype(np.int64),1)
</code... | <python><pandas><datetime><series> | 2024-03-31 11:55:39 | 2 | 363 | helloimgeorgia |
78,251,194 | 595,305 | Grey-out QLineEdit as per disabled state automatically, combined with non-conditional style sheet directive? | <p>By default, a <code>QLineEdit</code> is greyed-out when disabled.</p>
<p>If you set a stylesheet with a simple directive, e.g. setting a border, this cancels that default behaviour.</p>
<p>Fortunately it is possible to mimic the default behaviour, like so:</p>
<pre><code>qle.setStyleSheet('QLineEdit[readOnly=\"... | <python><pyqt><qtstylesheets> | 2024-03-31 11:45:16 | 1 | 16,076 | mike rodent |
78,251,060 | 3,859,500 | Can't import LlamaParse | <p>I created a short python application in a Google Colab notebook, that works fine. I am trying to move the application from Google Colab into a local Docker-Python-Application.</p>
<p>But whenever <strong>I run the application with Docker and do in a .py file</strong></p>
<pre><code>from llama_parse import LlamaParse... | <python><docker><llama-index> | 2024-03-31 10:52:23 | 1 | 806 | Ben Spi |
78,250,997 | 1,497,139 | how to set the width and height of an ui.image in nicegui? | <p>I want to migrate some justpy code to nicegui. While the justpy IMG class could set with and height in the constructor the natural way to migrate would be:</p>
<pre class="lang-py prettyprint-override"><code>with topicHeader:
_topicIcon = ui.image(
source=icon_url,
... | <python><nicegui> | 2024-03-31 10:21:16 | 1 | 15,707 | Wolfgang Fahl |
78,250,951 | 10,200,497 | What is the best way to merge two dataframes that one of them has date ranges and the other one has date WITHOUT any shared columns? | <p>I have two DataFrames:</p>
<pre><code>import pandas as pd
df1 = pd.DataFrame(
{
'date': ['2024-01-01','2024-01-02', '2024-01-03', '2024-01-04', '2024-01-05', '2024-01-06', '2024-01-07', '2024-01-08', '2024-01-09', '2024-01-10', '2024-01-11', '2024-01-12', '2024-01-13'],
'price': list(range(13))
... | <python><pandas><dataframe> | 2024-03-31 10:05:52 | 1 | 2,679 | AmirX |
78,250,914 | 9,059,634 | Python ModuleNotFoundError for command line tools built with setup.py | <p>I am trying to build a simple command line tool and package it with <code>setup.py</code>. Here's my directory structure.</p>
<pre><code>βββ s3_md5
β βββ __init__.py
β βββ cmd.py
β βββ src
β βββ __init__.py
β βββ cli.py
β βββ logger.py
β βββ s3_file.py
β βββ s3_md5.py
βββ setup.py... | <python><python-3.x><python-import><python-module> | 2024-03-31 09:52:03 | 0 | 536 | sakib11 |
78,250,867 | 1,442,554 | Custom dynamic version provider for Python projects | <p>In a Python project that uses pyproject.toml (and setuptools), I want to have a custom version number provider. I want it to work like <code>setuptools_scm</code>, but use my own logic to determine the version (and preferably other fields such as description and author). I know it can be accomplished by using dynami... | <python><setuptools><build-system><pyproject.toml> | 2024-03-31 09:33:15 | 0 | 4,101 | avishorp |
78,250,765 | 2,485,708 | How to call Steam InitTxn properly using python? | <p>Iβm making an in app purchase for my game on Steam. On my server I use python 3. Iβm trying to make an https request as follows:</p>
<pre><code>conn = http.client.HTTPSConnection("partner.steam-api.com")
orderid = uuid.uuid4().int & (1<<64)-1
print("orderid = ", orderid)
key = "xxx... | <python><steam><steamworks-api> | 2024-03-31 08:56:02 | 1 | 2,022 | ArtS |
78,250,500 | 9,576,988 | SQLAlchemy Many-to-Many Relationship: UNIQUE constraint failed | <p>So, I have a many to many SQLAlchemy relationship defined likeso,</p>
<pre class="lang-py prettyprint-override"><code>from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import relationship, sessionmaker
from sqlalchemy import Column, Integer, String, ForeignKey, UniqueConstraint, Table, crea... | <python><sqlalchemy><many-to-many> | 2024-03-31 06:45:36 | 1 | 594 | scrollout |
78,250,222 | 5,121,282 | how to set same port on fastapi and eureka? | <p>I want the same port on uvicorn and eureka configuration, I have search a lot and only found this link <a href="https://github.com/encode/uvicorn/issues/761" rel="nofollow noreferrer">https://github.com/encode/uvicorn/issues/761</a> but it doesn't work, this is my code:</p>
<pre><code>import py_eureka_client.eureka_... | <python><fastapi><netflix-eureka> | 2024-03-31 03:44:37 | 1 | 940 | Alan Gaytan |
78,249,960 | 6,000,739 | Using the sympy module to compute the matrix multiplication involving symbols | <p>My problem is given as follows:</p>
<p><a href="https://i.sstatic.net/XlrcJ.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/XlrcJ.png" alt="" /></a></p>
<pre class="lang-py prettyprint-override"><code>import sympy as sp
p = sp.symbols('p')
I_p = sp.Identity(p)
C = sp.BlockMatrix([[I_p, I_p], [I_p, -I... | <python><matrix><sympy><matrix-multiplication> | 2024-03-31 00:41:47 | 1 | 715 | John Stone |
78,249,695 | 547,231 | How can I convert a flax.linen.Module to a torch.nn.Module? | <p>I would like to convert a <code>flax.linen.Module</code>, taken from <a href="https://colab.research.google.com/drive/1SeXMpILhkJPjXUaesvzEhc3Ke6Zl_zxJ?usp=sharing" rel="nofollow noreferrer">here</a> and replicated below this post, to a <code>torch.nn.Module</code>.</p>
<p>However, I find it extremely hard to figure... | <python><machine-learning><pytorch><neural-network><flax> | 2024-03-30 22:24:42 | 1 | 18,343 | 0xbadf00d |
78,249,645 | 6,301,394 | Polars asof join on next available date | <p>I have a frame (events) which I want to join into another frame (fr), joining on Date and Symbol. There aren't necessarily any date overlaps. The date in events would match with the first occurrence only on the same or later date in fr, so if the event date is 2010-12-01, it would join on the same date or if not pre... | <python><dataframe><join><python-polars> | 2024-03-30 22:05:15 | 2 | 2,613 | misantroop |
78,249,205 | 1,231,450 | Enable / disable the automatic reload of shiny | <p>I have a shiny express app like</p>
<pre><code>import matplotlib.pyplot as plt, pandas as pd
from shiny import reactive, req, render
from shiny.express import input, render, ui
# variables
ui.page_opts(title="Range Rover", fillable=True)
...
</code></pre>
<p>It runs in <code>VS Code</code> which works fi... | <python><py-shiny> | 2024-03-30 19:16:36 | 1 | 43,253 | Jan |
78,248,902 | 1,588,847 | Typing a function decorator with conditional output type, in Python | <p>I have a set of functions which all accept a <code>value</code> named parameter, plus arbitrary other named parameters.</p>
<p>I have a decorator: <code>lazy</code>. Normally the decorated functions return as normal, but return a partial function if <code>value</code> is None.</p>
<p>How do I type-hint the decorator... | <python><mypy><python-typing> | 2024-03-30 17:44:49 | 1 | 2,124 | Jetpac |
78,248,879 | 3,433,875 | Remove gaps between subplots_mosaic in matplotlib | <p>How do I remove the gaps between the subplots on a mosaic? The traditional way does not work with mosaics:</p>
<pre><code>plt.subplots_adjust(wspace=0, hspace=0)
</code></pre>
<p>I also tried using <code>gridspec_kw</code>, but no luck.</p>
<pre><code>import matplotlib.pyplot as plt
import numpy as np
ax = plt.figu... | <python><matplotlib><subplot> | 2024-03-30 17:39:47 | 1 | 363 | ruthpozuelo |
78,248,657 | 2,036,386 | Process to Upload a run a Python Hello World script via IDE and accessed through browser | <p>I have googled this and cannot find an answer. I am coming from PHP. In PHP I would write my code in my IDE on my laptop, upload the .php script to my server (VPS), and then execute/run the script through web browser.</p>
<p>I am new to Python. I have written the following code</p>
<pre><code>print("Hello Wo... | <python><server-side> | 2024-03-30 16:22:38 | 1 | 397 | bobafart |
78,248,647 | 1,484,601 | pytest mock failing when mocking function from imported package | <p>pytest-mock is properly installed:</p>
<pre><code>> pip list | grep pytest
pytest 7.4.2
pytest-mock 3.14.0
</code></pre>
<p>This unit test passes with success:</p>
<pre class="lang-py prettyprint-override"><code>import pytest
class A:
def __init__(self, value):
self.value = v... | <python><unit-testing><mocking><pytest><pytest-mock> | 2024-03-30 16:19:46 | 1 | 4,521 | Vince |
78,248,551 | 10,200,497 | How can I change the groupby scope to find the first value that meets the conditions of a mask? | <p>This is an extension to this <a href="https://stackoverflow.com/questions/78246775/how-can-i-change-the-groupby-column-to-find-the-first-row-that-meets-the-condtio">post</a>.</p>
<p>My DataFrame is:</p>
<pre><code>import pandas as pd
df = pd.DataFrame(
{
'main': ['x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', '... | <python><pandas><dataframe><group-by> | 2024-03-30 15:53:40 | 1 | 2,679 | AmirX |
78,248,462 | 5,618,251 | Convert lat,lon,data points to matrix (2D grid) at 0.5 degree resolution in Python | <p>I have a geodataframe which I load in as follows:</p>
<pre><code>gdf = gpd.GeoDataFrame(
ds.to_pandas(),
geometry=gpd.points_from_xy(ds["CENLON"], ds["CENLAT"]),
crs="EPSG:4326",
)
</code></pre>
<p>It looks as:</p>
<pre><code>print(gdf)
CENLON CENLAT O1REGION O2R... | <python><geospatial><geo><cartopy><rasterizing> | 2024-03-30 15:24:09 | 2 | 361 | user5618251 |
78,248,435 | 522,477 | Calls to external API work when running code as a script, but receive `500 Internal Server Error` response when using FastAPI to run the same code? | <p>I have an application to predict the size of a fish in an image. I have built a FastAPI endpoint --<code>/predict/</code>-- that runs the multi-step process to make that prediction. The steps include two calls to external APIs (not under my control, so I can't see more than what they return).</p>
<p>When I run my co... | <python><fastapi><http-status-code-500> | 2024-03-30 15:16:29 | 2 | 2,079 | Savage Henry |
78,248,039 | 66,191 | Validate a nested dictionary using python/marshmallow when field names are variable | <p>Given this example...</p>
<pre><code>{
"A-B": {
"x": {
"name": "x A-B"
},
"y": {
"level": 6
}
},
"B-C": {
"x": {
"name": "x B-C"
},
"y": {
"leve... | <python><marshmallow> | 2024-03-30 13:07:08 | 1 | 2,975 | ScaryAardvark |
78,247,747 | 45,843 | Tkinter menu spontaneously adding extra item | <p>I'm writing a Tkinter program that so far creates a window with a menu bar, a File menu, and a single item. The menu is successfully created, but with two items, the first being one that I did not specify, whose name is "-----".</p>
<p>If I don't add an item, the spontaneous one is still added. This still ... | <python><tkinter> | 2024-03-30 11:32:11 | 1 | 34,049 | rwallace |
78,247,587 | 6,630,397 | Sweep shape along 3D path in Python | <p>Using <a href="https://www.python.org/" rel="nofollow noreferrer">Python</a> (3.10.14 at the time of writing), how could one build a 3D mesh object (which can be saved in either STL, PLY or GLB/GLTF format) using:</p>
<ul>
<li>a 3D path as the sweep axis,</li>
<li>a 2D rectangular shape</li>
</ul>
<p>with those cons... | <python><3d><computational-geometry><trimesh> | 2024-03-30 10:34:34 | 2 | 8,371 | swiss_knight |
78,247,408 | 13,231,896 | Validation for multiple fields on pydantic BaseModel | <p>In my fastapi app I have created a pydantic BaseModel with two fields (among others):
'relation_type' and 'document_list' (both are optional). I want to validate that, if 'relation_type' has a value, then, 'document_list' must have al least one element. Otherwise it will show a Validation error. How can I do it?</p>... | <python><fastapi><pydantic> | 2024-03-30 09:26:47 | 1 | 830 | Ernesto Ruiz |
78,247,260 | 1,307,905 | How to set the Python executable name, now that Py_SetProgramName() is deprecated? | <p>The Python 3.12 embedding documentation for embedding gives this example:</p>
<pre><code>#define PY_SSIZE_T_CLEAN
#include <Python.h>
int
main(int argc, char *argv[])
{
wchar_t *program = Py_DecodeLocale(argv[0], NULL);
if (program == NULL) {
fprintf(stderr, "Fatal error: cannot decode ar... | <python><c><python-c-api> | 2024-03-30 08:24:44 | 1 | 78,248 | Anthon |
78,247,258 | 1,330,734 | Selenium Wire webdriver cannot browse site | <p>I am using Python and Selenium (selenium-wire) to automatically control a browser for two sites.
Browsing most sites like:
<a href="https://www.google.com" rel="nofollow noreferrer">https://www.google.com</a><br />
<a href="https://platform.cmcmarkets.com/" rel="nofollow noreferrer">https://platform.cmcmarkets.com/<... | <python><selenium-webdriver><http2><mitmproxy><seleniumwire> | 2024-03-30 08:22:58 | 1 | 490 | user1330734 |
78,246,797 | 1,572,146 | Including non-Python files without __init__.py using `package_data` in setup.py? | <p>Given this directory structure (empty <code>__init__.py</code> and <code>logging.yml</code> is fine):</p>
<pre class="lang-none prettyprint-override"><code>foo
β setup.py
β
ββββ foo
β __init__.py
β
ββββ config
logging.yml
</code></pre>
<p>Here is my attempt, this <code>setup.py</code... | <python><setuptools><setup.py><egg><data-files> | 2024-03-30 04:06:19 | 1 | 1,930 | Samuel Marks |
78,246,775 | 10,200,497 | How can I change the groupby column to find the first row that meets the conditions of a mask if the initial groupby failed to find it? | <p>This is my DataFrame:</p>
<pre><code>import pandas as pd
df = pd.DataFrame(
{
'main': ['x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'y', 'y', 'y', 'y', 'y', 'y', 'y'],
'sub': ['c', 'c', 'c', 'd', 'd', 'e', 'e', 'e', 'e', 'f', 'f', 'f', 'f', 'g', 'g', 'g'],
'num_1': [10, 9, 80, 80, 99, 101... | <python><pandas><dataframe><group-by> | 2024-03-30 03:51:48 | 2 | 2,679 | AmirX |
78,246,765 | 5,121,282 | Adding eureka to FastAPI is throwing RuntimeError: Cannot run the event loop while another loop is running | <p>My project have the following structure:</p>
<p><a href="https://i.sstatic.net/439AC.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/439AC.png" alt="enter image description here" /></a></p>
<p>I want to add eureka to my fastapi applicaction, IΒ΄'m trying to do that in the <strong>init</strong>.py file:... | <python><runtime-error><fastapi><netflix-eureka> | 2024-03-30 03:45:32 | 2 | 940 | Alan Gaytan |
78,246,736 | 15,412,256 | Scikit-Learn Permutating and Updating Polars DataFrame | <p>I am trying to re-write the source code of <a href="https://github.com/scikit-learn/scikit-learn/blob/f07e0138b/sklearn/inspection/_permutation_importance.py#L77" rel="nofollow noreferrer">scikit-learn permutation importance</a> to achieve:</p>
<ol>
<li>Compatibility with Polars</li>
<li>Compatibility with clusters ... | <python><machine-learning><scikit-learn><python-polars> | 2024-03-30 03:20:39 | 1 | 649 | Kevin Li |
78,246,713 | 2,756,466 | chromadb Collection.add(Includes=[""]) giving error | <p>I am new to chromadb. Learning it first time. Just a simple code is here:</p>
<pre><code> collection.add(
documents=["This is a document", "This is another document"],
metadatas=[{"source": "test_source", "page": 1},{"source": "test_source2&quo... | <python><chromadb> | 2024-03-30 03:03:19 | 1 | 7,004 | raju |
78,246,430 | 23,805,311 | Issues with my Javascript code to parse files | <p>I am currently working on implementing a JavaScript code that aims to read and parse some numpy .npy files generated from Python's numpy, specified by a JSON file. These .npy files contain arrays of floating values (a ML model weights and biases as arrays). However, I am encountering errors while running the script.... | <javascript><python><node.js><arrays><numpy> | 2024-03-30 00:15:54 | 1 | 409 | Mary H |
78,246,105 | 2,057,516 | How to start a download and render a response without hitting disk? | <p>So I have a scientific data Excel file validation form in django that works well. It works iteratively. Users can upload files as they accumulate new data that they add to their study. The <code>DataValidationView</code> inspects the files each time and presents the user with an error report that lists issues in ... | <python><django><django-templates><stream> | 2024-03-29 21:58:54 | 2 | 1,225 | hepcat72 |
78,246,081 | 823,859 | How to transfer all conda environments to new computer | <p>Is it possible to transfer all of my individual conda environments to a file, where each environment lists the packages, and then I can rebuild all of the environments at once on the new machine?</p>
<p>There are many similar questions on here, but commands such as <code>conda list --export > package-list.txt</co... | <python><anaconda><conda> | 2024-03-29 21:52:41 | 1 | 7,979 | Adam_G |
78,246,079 | 19,090,746 | A python Path.rglob pattern to match all package.json files in a directory that are not nested inside of a node_modules folder | <p>I'm working with a massive monorepo, and I'm trying to write a script that will need to grab some information from all of the monorepo's package.json files, but <em>not</em> and package.json files that are nested in any of the <code>node_modules</code> folder. I've tried everything apart from just filtering them wit... | <python><glob><pathlib> | 2024-03-29 21:52:29 | 1 | 642 | Andrew |
78,245,999 | 2,621,316 | java.lang.AssertionError when trying to train certain datasets with h2o | <p>I am getting an error for my desired dataset when trying to use an isolation forest method to detect anomalies. However I have another completely different dataset that it works fine for, what could cause this issue?</p>
<pre><code>isolationforest Model Build progress: | (failed) | 0% Traceback (most recent call las... | <python><java><h2o> | 2024-03-29 21:21:16 | 1 | 2,981 | Amon |
78,245,954 | 1,210,296 | How do you update Celery Task State/Status to see it in Flower? | <p>When using a Python Celery Task callback to process tasks on a Redis Queue, how do you dynamically change state/status to show interim updates within Flower?</p>
<pre><code>@shared_task(queue='my_queue', bind=True)
def process_event( self, payload ):
self.update_state( state="PROGRESS", meta={ 'current... | <python><asynchronous><celery><task><apply-async> | 2024-03-29 21:06:10 | 0 | 617 | justdan23 |
78,245,928 | 11,930,602 | How would I modify an outside variable within a list comprehension? | <p>Python code:</p>
<pre class="lang-py prettyprint-override"><code>i: int = 1
table: list = [[i, bit, None, None] for bit in h]
</code></pre>
<p>Expected behaviour: <code>i</code> needs to be incremented by 1 per iteration.</p>
<p>Pseudocode:</p>
<pre class="lang-py prettyprint-override"><code>i: int = 1
table: list =... | <python><list-comprehension><variable-assignment> | 2024-03-29 20:58:57 | 3 | 2,322 | kesarling |
78,245,818 | 825,227 | Pandas pivot_table where one values column is comprised of lists of values | <p>I have a Pandas dataframe that I'm looking to pivot where one of the included <code>values</code> entries is comprised of lists of values.</p>
<p><strong>df</strong></p>
<pre><code> l1_ratio mse_path coef intercept
0 1.0 581499561.8597653 [253.03936312711443, 3649.109906786345, 14798.282876868554, 48... | <python><pandas><pivot><pivot-table> | 2024-03-29 20:24:12 | 1 | 1,702 | Chris |
78,245,627 | 428,862 | How to rework rolling sum using Numpy.strides? | <p>I have this code that works. I was wondering how to implement using
np.lib.stride_tricks.as_strided or avoid loops.</p>
<pre><code>import yfinance as yf
import pandas as pd
import numpy as np
# Fetch Apple stock data
apple_data = yf.download('AAPL', start='2024-01-01', end='2024-03-31')
# Extract volume data
appl... | <python><numpy> | 2024-03-29 19:39:35 | 2 | 25,847 | Merlin |
78,245,568 | 1,317,018 | Understanding batching in pytorch models | <p>I have following model which forms one of the step in my overall model pipeline:</p>
<pre><code>import torch
import torch.nn as nn
class NPB(nn.Module):
def __init__(self, d, nhead, num_layers, dropout=0.1):
super(NPB, self).__init__()
self.te = nn.TransformerEncoder(
nn... | <python><machine-learning><deep-learning><pytorch><transformer-model> | 2024-03-29 19:24:58 | 1 | 25,281 | Mahesha999 |
78,245,458 | 5,443,401 | Vectorization with multiple rows and columns of dataframe instead of one | <p>Currently working on building a csv file that include historical stock info, while not only includes historical prices, but momentum indicators. I've successfully added indicators by looping through an entire dataframe (w/ > 25,000,000 rows), but it takes too long (30 - 36 h).</p>
<p>What I'm trying to accomplish... | <python><pandas><dataframe> | 2024-03-29 18:54:33 | 1 | 425 | Joel J. |
78,245,411 | 47,152 | Unclear about python async task cancel/shutdown at program exit | <p>I can't find docs that clearly describe the mechanism here so just want to try to understand and learn best practices. For tasks created by <code>asyncio.create_task</code>, they seem to be cleaned up at program end without generating any <code>CancelledError</code> or requiring a call to explicitly cancel the task.... | <python><python-asyncio> | 2024-03-29 18:43:45 | 1 | 1,465 | chacmool |
78,245,380 | 7,592,072 | Regex - capture group whish is optionally enclosed in sequence of characters | <p>I have a file with lines I need to extract from the JSON-like syntax.
My regex works good in most cases. It extracts desired symbols into a second capture group. But I noticed sometimes my desired text is optionally can be enclosed by some tags which I want to ignore.</p>
<p><strong>Sample file:</strong></p>
<pre><c... | <python><regex><regex-group> | 2024-03-29 18:34:26 | 1 | 871 | Nikita Smirnov |
78,245,236 | 480,118 | postrgres/psycopg: cannot insert multiple commands into a prepared statement | <p>I have two postgres tables that have a relationship, but no cascading delete set. So i need to delete from the related table as well as the main table manually.
I am using sqlalchemy core along with psycopg3 driver.</p>
<p>I have the following code:</p>
<pre><code> identifiers = ['id100', 'id200']
sql = ... | <python><postgresql><sqlalchemy><psycopg3> | 2024-03-29 17:57:31 | 2 | 6,184 | mike01010 |
78,245,156 | 8,236,076 | How to respond to slash command in different channel? | <p>I'm using slash commands in pycord. Normally, to respond to a user's command, one can use the <code>ctx.respond</code> method, like so:</p>
<pre class="lang-py prettyprint-override"><code>@bot.slash_command(description="Say hello.")
async def say_hello(ctx: ApplicationContext) -> None:
ctx.respond(&... | <python><pycord> | 2024-03-29 17:37:17 | 1 | 1,144 | Willem |
78,245,061 | 2,612,259 | How do I properly add a callback to individual traces in Plotly? | <p>The code below attempts to register a callback on Plotly traces in 3 different ways.</p>
<ol>
<li>Method 'a', registers a callback on the trace object directly, before adding it to the figure.</li>
<li>Method 'b', registers the callback after adding it to the figure by getting the object from the figure data list af... | <python><plotly> | 2024-03-29 17:16:14 | 0 | 16,822 | nPn |
78,245,057 | 7,437,143 | Sphinx warning: Failed to import test.test_adder from module `pythontemplate` | <h2>Context</h2>
<p>After creating a <code>root_dir/docs/source/conf.py</code> that automatically generates the <code>.rst</code> files for each <code>.py</code> file in the <code>root_dir/src</code> (and <code>root_dir/test/</code>) directory (and its children), I am experiencing some difficulties linking to the <code... | <python><python-sphinx><restructuredtext><documentation-generation><autodoc> | 2024-03-29 17:15:47 | 1 | 2,887 | a.t. |
78,244,944 | 5,589,640 | Matching hundreds non-adjaccent keywords in large text corpus in Python | <p>I need to <strong>match non-adjacent keywords</strong> in a large collection of texts (several thousands). If matched, a label is assigned, else a label "unkown" is assigned.</p>
<p>To provide an example, I would like to find the keywords <em>sales representative</em> and <em>dealt</em> in the below text s... | <python><loops><match><nested-loops> | 2024-03-29 16:50:49 | 1 | 625 | Simone |
78,244,888 | 20,358 | Using Python CDK to bundle dotnet 8 code to AWS Lambda function | <p>I am using CDK with Python and trying to build, package and deploy dotnet 8 code as a lambda function.</p>
<p>This python code below gets an error <code>Error: .NET binaries for Lambda function are not correctly installed in the /var/task directory of the image when the image was built.</code></p>
<pre><code>from co... | <python><python-3.x><.net-core><aws-lambda><aws-cdk> | 2024-03-29 16:35:30 | 2 | 14,834 | user20358 |
78,244,861 | 3,353,160 | Launching Python Debug with Arguments messes with file path | <p>I'm using VSCode on Windows, with the GitBash as integrated terminal. When I launch the Python Debugger with default configurations, it works fine, and I get this command executed on the terminal:</p>
<pre class="lang-bash prettyprint-override"><code>/usr/bin/env c:\\Users\\augus\\.Apps\\anaconda3\\envs\\muskit-env\... | <python><vscode-extensions><vscode-debugger><debugpy> | 2024-03-29 16:29:23 | 1 | 721 | Erico |
78,244,796 | 5,079,779 | Is it possible to type-hint a strict subclass of a given type? | <p>Let's say I wanted to hint that a particular field of a dataclass should be a subclass of one class, but not the type itself. For a more concrete example:</p>
<pre class="lang-py prettyprint-override"><code>class Foo:
...
class Bar(Foo):
...
class Baz(Foo):
...
@dataclass
class Data:
foo_subclass_... | <python><python-typing> | 2024-03-29 16:12:19 | 0 | 808 | Beefster |
78,244,790 | 13,494,917 | Failing to pass a downloaded file-like object from sharepoint using the shareplum and paramiko libraries | <p>I'm receiving an error when passing a file object using paramiko's putfo().</p>
<blockquote>
<p>AttributeError: 'bytes' object has no attribute 'read'</p>
</blockquote>
<p>Here's what my putfo() looks like</p>
<pre><code>ssh_client = paramiko.SSHClient()
ssh_client.set_missing_host_key_policy(paramiko.AutoAddPolicy... | <python><sftp><paramiko><shareplum> | 2024-03-29 16:11:29 | 1 | 687 | BlakeB9 |
78,244,664 | 5,379,479 | Keras TensorFlow Probability model not learning distribution spread | <p>I built and trained a Keras Tensorflow Probability model. It's basically a fully connected Neural Network model with a DistributionLambda on the output layer. Last Layer code example here:</p>
<pre><code>tfp.layers.DistributionLambda(
lambda t: tfd.Independent(tfd.Normal(loc=t[..., :n], scale=1e-5 + tf... | <python><tensorflow><tf.keras><calibration><tensorflow-probability> | 2024-03-29 15:44:42 | 1 | 2,138 | Jed |
78,244,656 | 6,376,297 | Distribute a list of positive numbers into a desired number of sets, aiming to have sums as close as possible between them | <p>My goal in posting this is to integrate my other post <a href="https://stackoverflow.com/q/78236646/6376297">here</a>, where I was asked to provide a minimal working example, but also to ask for advice regarding the code itself, in case someone can suggest a better/faster/more reliable approach. Hence the separate ... | <python><optimization><partitioning><linear-programming><pulp> | 2024-03-29 15:43:31 | 1 | 657 | user6376297 |
78,244,632 | 2,776,012 | How to fix node position and increase edge spacing in Pyvis network graph? | <p>I am very new to Python and its graph libraries however i have a requirement to construct a directed graph network with multiple nodes and edges. I have kind of achieved the functionality but with a couple of hiccups. One, unable to fix the position of the nodes in the network i.e it changes with every refresh and s... | <python><charts><networkx><pyvis> | 2024-03-29 15:37:06 | 0 | 837 | Shivayan Mukherjee |
78,244,620 | 547,231 | jax: How do we solve the error: pmap was requested to map its argument along axis 0, which implies that its rank should be at least 1, but is only 0? | <p>I'm trying to run this <a href="https://colab.research.google.com/drive/1SeXMpILhkJPjXUaesvzEhc3Ke6Zl_zxJ?usp=sharing#scrollTo=8PPsLx4dGCGa" rel="nofollow noreferrer">simple introduction to score-based generative modeling</a>. The code is using <code>flax.optim</code>, which seems to be moved to <code>optax</code> m... | <python><neural-network><jax><pmap> | 2024-03-29 15:34:59 | 1 | 18,343 | 0xbadf00d |
78,244,582 | 3,821,009 | Parsing strings with numbers and SI prefixes in polars | <p>Say I have this dataframe:</p>
<pre><code>>>> import polars
>>> df = polars.DataFrame(dict(j=['1.2', '1.2k', '1.2M', '-1.2B']))
>>> df
shape: (4, 1)
βββββββββ
β j β
β --- β
β str β
βββββββββ‘
β 1.2 β
β 1.2k β
β 1.2M β
β -1.2B β
βββββββββ
</code></pre>
<p>How would I go about par... | <python><python-polars> | 2024-03-29 15:26:58 | 2 | 4,641 | levant pied |
78,244,574 | 6,207,558 | Python BaseHTTPRequestHandler css loaded but not rendered | <p>I'm stumped. The below code will return the index.html as well as the css asked for, but when the index.html is requested by Firefox, it won't render the page with the css applied. I have the same result in Konqueror (which in Chrome based)</p>
<pre><code>class MyServer(BaseHTTPRequestHandler):
def do_GET(self):... | <python><html><css><basehttprequesthandler> | 2024-03-29 15:25:50 | 1 | 510 | Mr. Wrong |
78,244,443 | 5,618,251 | How to replace last 4 digits in Pandas Dataframe by 0101 if they are 9999 (Python) | <p>I have a Dataframe that looks like this:</p>
<pre><code>OrdNo year
1 20059999
2 20070830
3 20070719
4 20030719
5 20039999
6 20070911
7 20050918
8 20070816
9 20069999
</code></pre>
<p>How to replace last 4 digits in the Pandas Dataframe by 0101 if they are 9999?</p>
<p>Thanks</p>
| <python><pandas> | 2024-03-29 15:00:06 | 2 | 361 | user5618251 |
78,243,767 | 17,194,313 | Why do Python type hints sometimes worsen IDE recommendations? | <p>I'm going through an exercise of adding type hints through a large codebase, but I'm sometimes seeing that less-than-optimal type hint worsens IDE recommendations:</p>
<p>Before, the IDE is able to figure out that y['result'] is a string:</p>
<p><a href="https://i.sstatic.net/vlcUE.png" rel="nofollow noreferrer"><im... | <python><python-typing><pylance> | 2024-03-29 12:32:00 | 2 | 3,075 | MYK |
78,243,747 | 774,575 | How to use two key functions when sorting a MultiIndex dataframe? | <p>In this call to <code>df.sort_index()</code> on a MultiIndex dataframe, how to use <code>func_2</code> for level <code>two</code>?</p>
<pre><code>func_1 = lambda s: s.str.lower()
func_2 = lambda x: np.abs(x)
m_sorted = df_multi.sort_index(level=['one', 'two'], key=func_1)
</code></pre>
<p>The <a href="https://pandas... | <python><pandas><sorting><multi-index> | 2024-03-29 12:27:15 | 1 | 7,768 | mins |
78,243,509 | 3,616,293 | LeNet5 & Self-Organizing Maps - RuntimeError: Trying to backward through the graph a second time - PyTorch | <p>I have a LeNet-5 CNN training with a Self-Organizing Map trained on MNIST data. The training code (for brevity) is:</p>
<pre><code># SOM (flattened) weights-
# m = 40, n = 40, n = 84 (LeNet's output shape/dim)
centroids = torch.randn(m * n, dim, device = device, dtype = torch.float32)
locs = [np.array([i, j]) for i... | <python><pytorch><conv-neural-network> | 2024-03-29 11:29:45 | 1 | 2,518 | Arun |
78,243,450 | 589,571 | Extending Airflow DAG class - is this a bad practice? | <p>I didn't see any examples of this so I am wondering if this is a bad practice to extend DAG class.
Is it a bad practice and why, if it is?</p>
<p>Example of where I can see this useful follows...</p>
<p>Let's say we have a number of DAGs which all share the same behaviour: calling a specific function as a very last ... | <python><airflow><orchestration> | 2024-03-29 11:15:20 | 0 | 2,182 | ezamur |
78,243,391 | 5,049,813 | How to type-hint a truly optional parameter with overloads | <p>I have this function complete with type-hinting:</p>
<pre class="lang-py prettyprint-override"><code>class HDF5DataTypes(Enum):
SCALAR = "scalar"
ARRAY = "array"
UNKNOWN = "unknown"
@overload
def index_hdf5_to_value(file_or_group: Union[h5py.File, h5py.Group], indexes: List... | <python><python-typing><pyright> | 2024-03-29 11:04:04 | 1 | 5,220 | Pro Q |
78,243,381 | 15,474,507 | How to include Poppler for docker build | <p>I use <a href="https://github.com/mathewskevin/pdf-to-cbz/blob/master/pdf_to_cbz.py" rel="nofollow noreferrer">this</a> script to convert pdf into cbz. For Windows no problem, just add Poppler bin folder into PATH<br>
But I try to understand how can I include to install <a href="https://github.com/cbrunet/python-pop... | <python><docker> | 2024-03-29 11:01:17 | 1 | 307 | Alex Doc |
78,243,370 | 20,920,790 | How to simulate windows fuction with partition by in pandas? | <p>I got this data with Nulls in original_eur column.</p>
<div class="s-table-container"><table class="s-table">
<thead>
<tr>
<th style="text-align: right;"></th>
<th style="text-align: left;">event_id</th>
<th style="text-align: left;">category</th>
<th style="text-align: left;">rounds_bot_date</th>
<th style="text-al... | <python><pandas><window-functions> | 2024-03-29 10:58:31 | 1 | 402 | John Doe |
78,243,249 | 17,015,816 | Scraping Text through sections using scrapy | <p>So i am currently using scrapy to scrape a website. The website has n number sublinks which i was able to enter. Each sublink has 3 things i need title, description and content. I am able to get title, description but the content is split across n number of section where number of section differ per sublink like in ... | <python><web-scraping><scrapy> | 2024-03-29 10:31:10 | 1 | 479 | Sairam S |
78,243,244 | 15,163,418 | Python pillow library text align center | <p>Am trying to make the text align center but it doens't work as I expected.</p>
<p>Expected output: <a href="https://imgur.com/5HU7TBv.jpg" rel="nofollow noreferrer">https://imgur.com/5HU7TBv.jpg</a> (photoshop)</p>
<p>My output: <a href="https://i.imgur.com/2jpgNr6.png" rel="nofollow noreferrer">https://i.imgur.com/... | <python><image><image-processing><python-imaging-library> | 2024-03-29 10:29:44 | 1 | 541 | Raghavan Vidhyasagar |
78,242,979 | 961,631 | How to use Anaconda? | <p>I am in Windows 10 and I need to switch between Python environments. I found there is a program named "Anaconda" for that.</p>
<p>After installing the heavy (1GB) Anaconda installer, with default options the command prompt still does not recognize <code>conda</code> command.</p>
<p>I searched and then foun... | <python><anaconda> | 2024-03-29 09:35:15 | 3 | 15,427 | serge |
78,242,915 | 4,095,235 | cov2corr() for scipy sparse matrices | <p>How do I make (big) sparse covariance matrices into sparse correlation matrices?</p>
<p>Following the code for <a href="https://www.statsmodels.org/dev/generated/statsmodels.stats.moment_helpers.cov2corr.html" rel="nofollow noreferrer"><code>statsmodels.stats.moment_helpers.cov2corr()</code></a>, if the covariance m... | <python><scipy><sparse-matrix><covariance-matrix> | 2024-03-29 09:18:09 | 1 | 3,709 | Giora Simchoni |
78,242,608 | 5,379,182 | Why is query via SQLAlchemy session slower on first run | <p>I am profiling an SQLAalchemy repository method to fetch orders as of a certain date</p>
<pre><code>def test_profile_get_orders_asof():
for i in range(1, 11):
with DBContextManager() as session:
data_repo = SqlAlchemyRepository(session)
sut = data_repo.get_orders_asof
... | <python><sql-server><sqlalchemy> | 2024-03-29 08:00:04 | 0 | 3,003 | tenticon |
78,242,561 | 11,046,379 | Pandas dataframe : Replace value according case conditions | <p>There is dataframe with one column</p>
<pre><code>disposition
---------
NO ANSWER
ANSWERED
FAILED
BUSY
ERROR
WARNING
CANCEL
</code></pre>
<p>code:</p>
<pre><code>import pandas as pd
data1 = {'disposition': ['NO ANSWER', 'ANSWERED', 'FAILED', 'BUSY', 'ERROR', 'WARNING', 'CANCEL']}
df = pd.DataFrame(data1)
</code></pr... | <python><pandas> | 2024-03-29 07:45:41 | 2 | 1,658 | harp1814 |
78,242,488 | 354,051 | similarity between two numpy arrays based on shape but not distance | <pre class="lang-py prettyprint-override"><code>import matplotlib.pyplot as plt
import numpy as np
from numpy.linalg import norm
def cosine_similarity(arr1:np.ndarray, arr2:np.ndarray)->float:
dot_product = np.dot(arr1, arr2)
magnitude = norm(arr1) * norm(arr2)
similarity = dot_product / magnitude
r... | <python><similarity> | 2024-03-29 07:24:07 | 2 | 947 | Prashant |
78,242,484 | 10,200,497 | How can I create groups based on ascending streak of a column? | <p>This is my DataFrame:</p>
<pre><code>import pandas as pd
df = pd.DataFrame(
{
'a': [10, 14, 20, 10, 12, 5, 3]
}
)
</code></pre>
<p>And this is the expected output. I want to create four groups:</p>
<pre><code> a
0 10
1 14
2 20
a
3 10
4 12
a
5 5
a
6 3
</code></pre>
<p>From... | <python><pandas><dataframe><group-by> | 2024-03-29 07:22:55 | 1 | 2,679 | AmirX |
78,242,480 | 11,279,170 | Train and test split in such a way that each name and proportion of tartget class is present in both train and test | <p>I am trying to solve a ML problem if a person will deliver an order or not. Highly Imbalance dataset. Here is the glimpse of my dataset</p>
<pre><code>[{'order_id': '1bjhtj', 'Delivery Guy': 'John', 'Target': 0},
{'order_id': '1aec', 'Delivery Guy': 'John', 'Target': 0},
{'order_id': '1cgfd', 'Delivery Guy': 'John... | <python><machine-learning><scikit-learn><train-test-split><imbalanced-data> | 2024-03-29 07:21:32 | 1 | 631 | DSR |
78,242,432 | 4,019,775 | ImportError: cannot import name 'DIFFUSERS_SLOW_IMPORT' from 'diffusers.utils' | <p>When using diffusers like</p>
<pre><code>from diffusers import AutoencoderKL, DDPMScheduler, UNet2DConditionModel
</code></pre>
<p>I get the following error:</p>
<pre><code>ImportError: cannot import name 'DIFFUSERS_SLOW_IMPORT' from 'diffusers.utils' (/opt/conda/lib/python3.10/site-packages/diffusers/utils/__init__... | <python> | 2024-03-29 07:07:02 | 2 | 884 | Nilamber Singh |
78,242,414 | 2,358,969 | Why does the value interpolation not work when using python hydra library? | <p>I modify the <a href="https://github.com/facebookresearch/hydra/blob/main/examples/tutorials/basic/your_first_hydra_app/6_composition/conf/config.yaml" rel="nofollow noreferrer">config.yaml</a> form the tutorials in the <a href="https://github.com/facebookresearch/hydra/tree/main" rel="nofollow noreferrer">hydra</a>... | <python><fb-hydra><omegaconf> | 2024-03-29 07:01:39 | 1 | 1,263 | Yulong Ao |
78,242,374 | 19,130,803 | creating lists in single scan | <p>I want to create 2 lists from one column based on condition in other column. Currently, I am able to get the 2 lists by scaning dataframe twice.</p>
<ol>
<li>Is it possible to get the 2 lists in single scan?</li>
<li>Getting lists by individual groups?</li>
</ol>
<pre><code>data = {
"co2": [95, 90, 99,... | <python><pandas> | 2024-03-29 06:52:08 | 1 | 962 | winter |
78,242,185 | 8,652,920 | How to create an improperly closed gzip file using python? | <p>I have an application that occasionally needs to be able to read improperly closed gzip files. The files behave like this:</p>
<pre><code>>>> import gzip
>>> f = gzip.open("path/to/file.gz", 'rb')
>>> f.read()
Traceback (most recent call last):
File "<stdin>", l... | <python><python-3.x><unit-testing><pytest><gzip> | 2024-03-29 05:42:43 | 2 | 4,239 | notacorn |
78,242,183 | 4,399,016 | Python GET Request returns data when tried on Postman but the generated python code not working | <p>I have this URL that works on Postman and returns data:</p>
<pre><code>https://www.tablebuilder.singstat.gov.sg/api/table/resourceid?isTestApi=true&keyword=manufacturing&searchoption=all
</code></pre>
<p>But the Python code generated on Postman does not work.</p>
<pre><code>import requests
url = "https:... | <python><python-requests> | 2024-03-29 05:41:48 | 1 | 680 | prashanth manohar |
78,242,095 | 6,702,598 | How do I create a *clean* AWS lambda function in python? | <h5>Problem</h5>
<p>When I run my lambda API locally with <code>sam local start-api</code>, I get the error <code>{"message":"Missing Authentication Token"}</code> for a request that is not supposed to require an authentication token.</p>
<h5>Code</h5>
<p>In my cloudformation template file I create ... | <python><amazon-web-services><aws-lambda> | 2024-03-29 05:08:26 | 1 | 3,673 | DarkTrick |
78,241,869 | 1,228,906 | No matching distribution found for tensorboard~=2.15.0 | <p>I'm trying to build a Docker image and I'm running into a compatibility issue when building the Dockerfile.</p>
<p>The Dockerfile below leads to a successful build. But when I add "tensorflow-gpu" it fails with a requirements error. I'm not sure how to isolate this issue, so any guidance will be appreciate... | <python><docker><tensorflow><horovod> | 2024-03-29 03:37:14 | 1 | 1,896 | webber |
78,241,291 | 2,348,587 | How to deselect columns in PySide/Qt QColumnView | <p>I am creating a simple File Browser and trying to implement <a href="https://en.wikipedia.org/wiki/Miller_columns" rel="nofollow noreferrer">Miller Columns</a> like found in the macOS Finder. Qt provides both <code>QColumnView</code> and a <code>QFileSystemModel</code> which should make it easy to combine and get th... | <python><qt><selection><pyside6><qcolumnview> | 2024-03-28 23:16:18 | 1 | 3,763 | Darrick Herwehe |
78,240,874 | 22,407,544 | No such file or directory: '/tmp/tmp_ejr26m6.upload.mp3' in Django | <p>I recently adjusted the location of media files when I was presented with this error: <code>[Errno 2] No such file or directory: '/tmp/tmp1d93dhp7.upload.mp4'</code> in Django. So far I've checked for typos in my file location code in my settings, views and models.</p>
<p>The website works by simply storing user upl... | <python><django><file> | 2024-03-28 21:07:05 | 1 | 359 | tthheemmaannii |
78,240,565 | 2,280,645 | How to speed up combining multiple sheets of Excel files into one Excel file | <p><strong>Problem overview</strong></p>
<p>I need to combine several .xlsx files into sheets, where each sheet name must be the file name.</p>
<hr />
<p><strong>Current issue</strong></p>
<p>The code below, becomes slow and spends a lot of memory after a few files.</p>
<hr />
<p><strong>Attempted solution</strong></p>... | <python><excel><pandas><file-io><openpyxl> | 2024-03-28 19:53:20 | 3 | 797 | KenobiBastila |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.