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,625,884 | 19,850,415 | Have quarto find the jupyter kernel within Visual Studio Code | <h3>Description</h3>
<p>I am trying to follow this <a href="https://quarto.org/docs/get-started/hello/vscode.html" rel="nofollow noreferrer">vscode tutorial</a> in the quarto.org <a href="https://quarto.org" rel="nofollow noreferrer">site</a>.</p>
<p>The tutorial uses a document <code>hello.qmd</code> whose content ca... | <python><jupyter-notebook><quarto> | 2024-06-15 07:16:47 | 1 | 507 | Jau A |
78,625,785 | 2,672,788 | tracker.init throws Unknown C++ exception from OpenCV | <p>I wrote a program to test opencv <code>trackers</code> but I got error. Here is my <code>python</code> code using <code>opencv 4.10.0</code>:</p>
<pre><code>import cv2
video_path = '.../v1.mp4'
video = cv2.VideoCapture(video_path)
tracker = cv2.TrackerDaSiamRPN()
if not video.isOpened():
print("Could not... | <python><opencv><video-tracking> | 2024-06-15 06:21:54 | 1 | 2,958 | Babak.Abad |
78,625,485 | 9,571,463 | How to handle Async Appends to CSV File Without Corruption | <p>I have a large number of asyncio tasks that are consuming data via a queue and writing to to separate files. However, some of the files will be written to multiple times via mode <code>a+</code>. I have written some code to simulate some random processing in a similar way to my real world example.</p>
<p>I am using ... | <python><csv><locking><python-asyncio><python-aiofiles> | 2024-06-15 02:25:48 | 1 | 1,767 | Coldchain9 |
78,625,360 | 1,609,514 | How to include a modulus operation in CasADi function | <p>I can't find a modulus function in CasADi. I want to build a function with something like this:</p>
<pre class="lang-python prettyprint-override"><code>from casadi import MX
angle = MX.sym('angle')
wrapped_angle = ((angle + 180) % 360) - 180
</code></pre>
<pre class="lang-none prettyprint-override"><code>TypeErro... | <python><modulo><casadi> | 2024-06-15 00:25:07 | 2 | 11,755 | Bill |
78,625,271 | 22,673,230 | Array of strings sorted with less specific match first | <p>I have a list of files named like:</p>
<pre><code>file1.jpg
file2.jpg
.
.
.
</code></pre>
<p>where occasionally there is a duplicate such that the correct order should be:</p>
<pre><code>fileN.jpg
fileN 1.jpg
fileN 2.jpg
</code></pre>
<p><em>not</em>:</p>
<pre><code>fileN 1.jpg
fileN 2.jpg
fileN.jpg
</code></pre>
<p... | <python><sorting> | 2024-06-14 23:19:51 | 2 | 316 | shea |
78,625,174 | 2,977,256 | Jax random matrices running out of memory | <p>I want to create an Nxk matrix in jax, where each row has k DISTINCT integer entries each between 0 and N-1 (so, in range(N)), and this was my attempt:</p>
<pre><code>def generate_row(N, k, key):
return jax.random.choice(key, N, (k,), replace=False)
generate_rows = jax.vmap(generate_row, in_axes=(None, None, 0)... | <python><random><jax> | 2024-06-14 22:26:53 | 2 | 4,872 | Igor Rivin |
78,625,150 | 6,404,949 | how to modify a non json data into a specific format in python? | <p>I have an input file that contain the data like this --</p>
<pre><code>{
0/2 = [
"test_server_101:99904"
,"test_server_103:99907"
,"test_server_106:99906"
];
1/2 = [
"test_server_203:99906"
,"test_server_303:99902"
,"test_server_403:99906"
];
}
</code></pre... | <python><python-3.x> | 2024-06-14 22:14:05 | 1 | 3,157 | VIPIN KUMAR |
78,625,002 | 1,479,670 | Strange behaviour of the in-operator on NumPy arrays | <p>This behavior of the <code>in</code> operator on NumPy arrays I don't understand:</p>
<pre><code>>>> a=[0,1,2]
>>> x=np.array([a])
>>> b=[3,4,5]
>>> np.append(x,[b],axis=0)
array([[0, 1, 2],
[3, 4, 5]])
>>> a in x
True
>>> b in x
False
</code></pre>
<p>I w... | <python><numpy> | 2024-06-14 21:13:34 | 4 | 1,355 | user1479670 |
78,624,883 | 6,606,057 | Matplotlib annotations do not appear at the proper distance in graph | <p>I have subset of countries where I am comparing gdp per person and geographic latitude. I've developed code down here:</p>
<pre><code>country_sub.plot(kind='scatter', figsize=(6, 4), grid=True, x=lat_col, y=gdp_ppp_col)
gdp_ppp_col = "gdp_ppp"
lat_col = "lat"
position_text = {
"Israel&... | <python><python-3.x><matplotlib><scatter-plot> | 2024-06-14 20:30:29 | 1 | 485 | Englishman Bob |
78,624,817 | 9,669,142 | Plot points on offline map in Python | <p>I'm using Spyder and have a couple of coordinates that I want to plot on a world map. Currently I use Folium, save data as an HTML-file and then open it in a webbrowser. My question is: is it possible to plot coordinates on a map without the use of the webbrowser? Or anything external for that matter? I was hoping t... | <python><folium> | 2024-06-14 20:07:30 | 1 | 567 | Fish1996 |
78,624,582 | 1,021,259 | How to use Django generated fields to get a single value from a many-to-many relationship? | <p>I have a Django model representing a Book, which can have many different types of Person, including AUTHOR, EDITOR, ILLUSTRATOR, etc.</p>
<pre><code>class PersonType(models.Model):
name = models.CharField()
class Person(models.Model):
name = models.TextField()
class Book(models.Model):
title = models.T... | <python><django><django-models> | 2024-06-14 18:57:21 | 1 | 1,972 | Rob Rose |
78,624,534 | 16,569,183 | 3D plot labels exceed subplot limits - Matplotlib | <p>For 2D plots, using <code>constrained</code> or <code>tight</code> layout is generally enough to adjust the size of the axes to fit labels, but none of the default layouts manages to do it for small 3D plots like the one shown below. I've been trying to read about transforms to see if I could manually scale down the... | <python><matplotlib> | 2024-06-14 18:41:00 | 1 | 313 | alfonsoSR |
78,624,500 | 2,920,226 | Optimizing pandera polars validation check function | <p>I'm testing out switching to polars from pandas, and running into performance issues I wasn't expecting. Hoping this is just an issue of not knowing the really optimized lazyframe way of validating data.</p>
<p>Here is one of the checks I'm noticing relatively significant differences between polars checks and panda... | <python><python-polars><pandera> | 2024-06-14 18:33:50 | 2 | 443 | Cthulhujr |
78,624,498 | 5,924,264 | How to check that all entries of a timestamp column in dataframe has UTC timezone? | <p>I have a dataframe with a timestamp column. I want to assert that all entries for this column have UTC time stamp.</p>
<p>I tried</p>
<pre><code>import pandas as pd
# Example DataFrame with a deal_timestamp column
data = {
'ts': [
pd.Timestamp('2024-06-11 12:00:00', tz='UTC'),
pd.Timestamp('2024... | <python><pandas><dataframe> | 2024-06-14 18:33:28 | 1 | 2,502 | roulette01 |
78,624,467 | 903,188 | How do I force a Mako function to require named arguments? | <p>With Python, you can require arguments to be named when a function is called, e.g.</p>
<pre><code>def myfunc (a, b, *, c, d):
print(f"arguments c and d must be named arguments")
myfunc(1,2,3,4)
>>> TypeError: myfunc() takes 2 positional arguments but 4 were given
</code></pre>
<p>That same sy... | <python><mako> | 2024-06-14 18:27:05 | 2 | 940 | Craig |
78,624,364 | 1,956,082 | Which PCA results are correct? | <p>I aim to find which directions in my data have "vary greatly". To do that, I understand a method called PCA, which uses the eigenvectors of the covariant matrix to find them.</p>
<p>I used different implementations to calculate the principal component analysis.</p>
<pre class="lang-py prettyprint-override"... | <javascript><python><matrix><pca><eigenvalue> | 2024-06-14 17:57:58 | 1 | 1,112 | allevo |
78,624,269 | 6,610,176 | Is there a better way to cleanup text files with Python, using regex? | <p>I'm trying to create a script to match regex patterns in a series of text files, and the remove those matches from the file. Right now, I have the following, which works for my purposes, but I don't think this is an effective way to do it:</p>
<pre><code>import os
import re
os.chdir("/home/user1/test_files&qu... | <python><regex> | 2024-06-14 17:29:13 | 2 | 459 | SVill |
78,624,158 | 11,028,689 | ARMA model function for future unseen data with start and end dates? | <p>I have a dataframe like this</p>
<pre><code>lstvals = [30.81,27.16,82.15,31.00,9.13,11.77,25.58,7.57,7.98,7.98]
lstdates = ['2021-01-01', '2021-01-05', '2021-01-09', '2021-01-13', '2021-01-17', '2021-01-21', '2021-01-25', '2021-01-29', '2021-02-02', '2021-02-06']
data = {
"Dates": lstdates,
&qu... | <python><pandas><statsmodels> | 2024-06-14 16:54:25 | 1 | 1,299 | Bluetail |
78,624,141 | 3,120,501 | Understanding partial derivative error in Dymos | <p>I've built a dynamics model in Dymos, using Jax to calculate the partial derivatives using auto-differentiation. The code looks something like the following:</p>
<pre><code>import openmdao.api as om
import dymos as dm
import jax
import jax.numpy as jnp
import numpy as np
from functools import partial
</code></pre>
<... | <python><optimization><openmdao> | 2024-06-14 16:49:30 | 1 | 528 | LordCat |
78,624,113 | 2,617,896 | Checking oAuth token expiration in FlaskAppBuilder App | <p>Does anyone know how to check token expiry on requests in a Flask AppBuilder app. I'm specifically talking Superset here, but I think the same would apply anywhere.</p>
<p>I've got an OAUTH configuration for Keycloak and the app is authenticating just fine using <code>auth_type = AUTH_OAUTH</code> and an <code>AuthO... | <python><apache-superset><authlib><flask-appbuilder> | 2024-06-14 16:39:13 | 0 | 368 | Pat Buxton |
78,624,066 | 991,077 | Retrieving results from finished multiprocessing task as it has finished | <p>I need to run dozens of computationally intensive CPU-bound parallel tasks. Currently I do it using <code>joblib</code> <code>delayed</code> and <code>Parallel</code>:</p>
<pre><code>resultTuples = Parallel(n_jobs=-1, prefer="processes")(delayed(RunSingleTask)(*p) for p in run_params)
</code></pre>
<p>It w... | <python><asynchronous><multiprocessing><python-multiprocessing><joblib> | 2024-06-14 16:25:38 | 1 | 734 | shda |
78,624,056 | 4,076,764 | How to change cursor type in with clause | <p>I have the following statement</p>
<pre><code> statement = """
INSERT INTO rag.chunks (project_id, document_id, model_id, text, metadata)
VALUES {}
RETURNING *;
"""
async with pool.connection() as conn:
async with conn.cursor() as cur:
values ... | <python><psycopg3> | 2024-06-14 16:24:16 | 1 | 16,527 | Adam Hughes |
78,624,031 | 1,806,566 | Is there a way in python's readline module to bind a key to a custom function? | <p>I'm using the python readline module (and using the input() function, which readline modifies). Everything is working, but I would like to add a feature to call a custom python function when a certain key is pressed during input (the function would record that the key was pressed, change the prompt on the current l... | <python><readline> | 2024-06-14 16:17:54 | 0 | 1,241 | user1806566 |
78,623,890 | 14,427,714 | ChromeDriver Assuming Crash: The process started from chrome location /usr/bin/google-chrome is no longer running | <p>I am working on a web scraping bot using Selenium in Python. My setup involves using webdriver.Chrome and I am running into an issue where the ChromeDriver assumes that Chrome has crashed. Here are the details of my setup and the error message:</p>
<pre><code>The process started from chrome location /usr/bin/google-... | <python><python-3.x><google-chrome><selenium-webdriver><selenium-chromedriver> | 2024-06-14 15:39:06 | 0 | 549 | Sakib ovi |
78,623,778 | 15,045,363 | Is Additional Bootstrapping Useful Before Training a Random Forest? | <p>I am reviewing a codebase that uses a Random Forest (RF) Regressor, and I've noticed that bootstrapping is applied before creating each RF model. However, RF inherently uses bootstrapping to train each Decision Tree (DT).</p>
<p><strong>Does it make sense and is it usefull to use additional bootstrapping before crea... | <python><machine-learning><scikit-learn><random-forest> | 2024-06-14 15:15:11 | 0 | 865 | Maxime Charrière |
78,623,552 | 6,606,057 | Matplotlib arrows do not have proper length | <p>I have subset of countries where I am comparing gdp per person and geographic latitude. I've developed code down here:</p>
<pre><code>import matplotlib.pyplot as plt
plt.rc('font', size=12)
plt.rc('axes', labelsize=14, titlesize = 14)
plt.rc('legend', fontsize =12)
plt.rc('xtick', labelsize=10)
plt.rc('ytick', lab... | <python><python-3.x><matplotlib><scatter-plot> | 2024-06-14 14:29:44 | 1 | 485 | Englishman Bob |
78,623,536 | 896,451 | Providing an argument to the lambda / function passed to filter | <p>In this code, the regular expression is hardcoded in <code>filterf</code>, which is then provided as the evaluating function to <code>filter</code>.</p>
<pre><code>import re
filterf = lambda s:re.match(r'^T', s)
print("".join(list(filter(filterf, ["T x", "M y"])))) # outputs: T x
</cod... | <python> | 2024-06-14 14:26:29 | 1 | 2,312 | ChrisJJ |
78,623,491 | 9,591,276 | Passing fields to a nested model with model_validate() in Pydantic V2 | <p>Consider I have the following SQLAlchemy DB model:</p>
<pre class="lang-py prettyprint-override"><code>class User(Base):
__tablename__ = "users"
id: Mapped[int] = mapped_column(sa.Integer(), primary_key=True)
username: Mapped[str | None] = mapped_column(sa.String(64), nullable=True, index=True... | <python><python-3.x><pydantic-v2> | 2024-06-14 14:16:26 | 2 | 491 | goedwig |
78,623,230 | 20,770,190 | How to extarct the google's buttons element via playwright? | <p>I have a code snippet to extract the inputable and clickable node elements (i.e. interactive elements) from the DOM tree of the web pages via Playwright in python.</p>
<p>This code almost works properly but in some cases misses some elements like google's buttons! In fact, this button is marked as unclickable with t... | <python><web-scraping><web-crawler><playwright><playwright-python> | 2024-06-14 13:25:09 | 1 | 301 | Benjamin Geoffrey |
78,622,978 | 12,013,353 | solve_ivp gets "stuck" at incredibly small "time" step | <p>I'm trying to solve a problem of filling and emptying of a retention behind a dam. What I've got are: 1) a function that relates the elevation of the water in the retention with the volume of the water, V(h); 2) a function that relates the discharge through the dam outlet with the water elevation, q(h); and 3) a fun... | <python><scipy><differential-equations> | 2024-06-14 12:31:43 | 0 | 364 | Sjotroll |
78,622,855 | 4,105,440 | Jupyter notebook running in Visual Studio Code cannot import local module, but the same jupyter server can | <p>I started having this issue today, it was working fine last time I used it so I guess something was broken with one of the updates (not surprising).</p>
<p>I'm using VsCode in remote connected to a machine and running a jupyter notebook. I cannot import a module located in a subfolder of my home.</p>
<p><a href="htt... | <python><visual-studio-code><jupyter-notebook><vscode-remote> | 2024-06-14 12:06:32 | 1 | 673 | Droid |
78,622,703 | 11,681,306 | Celery apps are remaining in background for weeks (memory footprint increases accordingly) | <p>I am fairly new to celery, and have some celery workers and some apps are started with a service with a line such as this:</p>
<pre><code>ExecStart=/bin/sh -c '${CELERY_BIN} multi start ${CELERYD_NODES} \
-A ${CELERY_APP} --pidfile=${CELERYD_PID_FILE} \
--logfile=${CELERYD_LOG_FILE} --loglevel=${CELERYD_LOG_LEVE... | <python><python-3.x><rabbitmq><celery> | 2024-06-14 11:33:17 | 0 | 309 | Fabri Ba |
78,622,682 | 3,442,166 | Change fieldnames of a csv.DictReader in Python | <p>I have a CSV file as follows.</p>
<p><strong>oldFile.csv content:</strong></p>
<pre><code>oldHeader1,oldHeader2,oldHeader3
data01,data02,data03
data11,data12,data13
data21,data22,data23
</code></pre>
<p>and I want to rename the headers with new ones. Here's the code I use to do this:</p>
<pre><code>import csv
with ... | <python><csv><dictionary> | 2024-06-14 11:27:56 | 1 | 1,819 | deltonio2 |
78,622,674 | 5,269,892 | Pandas performance of fillna vs. boolean masking + writing value | <p>In an example dataframe with NaNs in the third column, let us compare the performance of <code>fillna()</code> with boolean masking + setting the value:</p>
<pre><code>import pandas as pd
import numpy as np
np.random.seed(100)
nrows = 10000000
nnan = 25000
df = pd.DataFrame(np.random.uniform(0,250000,size=(nrows,3)... | <python><pandas><fillna> | 2024-06-14 11:25:07 | 1 | 1,314 | silence_of_the_lambdas |
78,622,508 | 3,117,006 | Poetry doesn't see torch when installing other libraries | <p>I'm trying to install some package (in this particular example xformers, but this happens for other packages as well).</p>
<p><code>poetry run pip install xformers</code> results in <code>ModuleNotFoundError: No module named 'torch'</code>. (The same will happen if I try <code>poetry add</code>).</p>
<p>However I ca... | <python><python-poetry> | 2024-06-14 10:47:42 | 2 | 1,010 | zlenyk |
78,622,473 | 19,369,310 | Merging two Pandas dataframes without a primary keys but using latest dates instead | <p>I have two pandas dataframes that looks like:</p>
<p><code>df1</code> records the students and their mock exam score and the mock exam date:</p>
<pre><code>ID Mock_Date Student_ID Mock_score
1 14/3/2020 792 213
2 9/5/2020 792 ... | <python><pandas><dataframe><merge> | 2024-06-14 10:40:45 | 1 | 449 | Apook |
78,622,415 | 11,829,398 | How to remove duplication of loguru logger patching in pytest | <p>I am testing a function which calls <code>loguru.logger.add("file.log")</code> at the start. This causes issues during pytest execution. The file is written to a temp dir and thus is being used by another process (good ol' Windows) when clean-up happens.</p>
<pre class="lang-py prettyprint-override"><code>... | <python><logging><pytest><monkeypatching><loguru> | 2024-06-14 10:28:20 | 1 | 1,438 | codeananda |
78,622,328 | 7,089,108 | How can I calculate the blending factor from a linear combination of two pictures? | <p>I have a sequence of images that are very similar and can be approximately represented as a combination of two 'ground truth' images with added noise, in the form:</p>
<pre><code>Image_i ≈ x_i × Image(1) + (1−x_i) × Image(2) + Noise
</code></pre>
<p>where x_i is the mixing coefficient.</p>
<p>I'm looking for the bes... | <python><image-processing><pattern-matching> | 2024-06-14 10:07:22 | 1 | 433 | cerv21 |
78,622,130 | 3,906,713 | How to fix Gekko's `@error: Solution not found` | <p>I want to perform parameter inference for an ODE model (<code>m.options.IMODE = 5</code>). I have 2 models in Gekko. First, I generate model data from each model, and perform parameter inference directly on the corresponding model data. That works no problem for each model. Then, I attempt to perform parameter infer... | <python><optimization><ode><gekko> | 2024-06-14 09:28:57 | 1 | 908 | Aleksejs Fomins |
78,622,087 | 5,800,969 | How to scrape flutter/dart dynamic renderer website where inspecting web element is not allowed | <p>I am scrapping a website which has many list items and buttons web lements contents getting displayed through the dynamic rendering of the flutter/dart website.
I tried to approximate the button position and used <code>pyautogui</code> to click on various elements but this solution won't work when there any many but... | <python><flutter><dart><selenium-webdriver> | 2024-06-14 09:22:25 | 1 | 2,071 | iamabhaykmr |
78,621,986 | 2,547,570 | asyncio.Task is not garbage-collected after using del | <p>Why is a task created with <code>asyncio.create_task()</code> in the below not garbage collected?</p>
<pre><code>import asyncio
import gc
c = 0
async def run():
global c
try:
while True:
await asyncio.sleep(1)
c += 1
except Exception as e:
print(e)
async def m... | <python><garbage-collection><python-asyncio> | 2024-06-14 09:00:13 | 1 | 1,319 | mq7 |
78,621,909 | 3,067,732 | constant-memory vectorized sum of function values with jax | <p>Let's say I have a function <code>f</code> that takes an integer argument and returns a fixed-size array. I want to evaluate the sum of <code>f(i)</code> over <code>range(N)</code> for some large <code>N</code>, such that storing all values in memory becomes problematic. With a simple <code>for</code> loop I can fix... | <python><jax> | 2024-06-14 08:42:05 | 1 | 810 | pierre |
78,621,648 | 19,392,385 | Text shifted in legend because of LaTeX formatting in matplotlib | <p>For some reason in my subplot, the legend of the second ax is cropped at the bottom <strong>inside</strong> of the legend box. It seems the index causes the text to shift a bit.</p>
<p>The legend box itself is perfectly fine. I've check if the grid or the tight layout were responsible but they weren't. What could ca... | <python><matplotlib><plot><legend> | 2024-06-14 07:35:39 | 0 | 359 | Chris Ze Third |
78,621,593 | 14,833,503 | PCA in Python: Reproducing pca.fit_transform() results using pca.fit()? | <p>I have a data frame called <code>data_principal_components</code> with dimensions (306x21154), so 306 observations and 21154 features. Using PCA, I want to project the data into 10 dimensions.</p>
<p>As far as I understand, the following code does this. The resulting matrix (<code>projected</code>) has a dimension o... | <python><scikit-learn><pca> | 2024-06-14 07:21:29 | 1 | 405 | Joe94 |
78,621,470 | 4,731,848 | Modulus `%%` giving unexpected result for `3.1 %% 0.1`. Is this expected? | <p>I'm using the base modulus (<code>%%</code>) operator, and just struggling to understand the following behaviour. My understanding is that <code>%%</code> returns the remainder after dividing 2 numbers. So eg:</p>
<pre class="lang-r prettyprint-override"><code>5 %% 2
# [1] 1
6 %% 2
# [1] 0
</code></pre>
<p>Since af... | <python><r><modulo> | 2024-06-14 06:55:56 | 2 | 5,640 | rosscova |
78,621,461 | 2,993,606 | Password-protect an excel file on DataBricks environment | <p>I have a requirement to password protect an excel file, meaning no one should be able to read from it unless they have the password). I want to use DataBricks because that's where the file is getting generated. I have explored some options online, but either they don't meet the functionality (openpyxl, pandas), or n... | <python><excel><azure-databricks> | 2024-06-14 06:54:22 | 1 | 5,263 | SouravA |
78,621,378 | 1,818,059 | How do I best scale png to 1 bit BMP (pyvips or PIL) | <p>For a project I need to convert a PDF to strips of (large) BMP images, in 1 bit.</p>
<p>Quality is not the major issue here, but conversion speed is.</p>
<p>The input is a PDF document, the output is a series of BMP images, all around 65.000 x 4800 px.</p>
<p>I can't post the actual PDF, so as example I include a st... | <python><image-processing><bitmap><vips> | 2024-06-14 06:31:13 | 1 | 1,176 | MyICQ |
78,621,282 | 5,844,307 | How to execute Python modules on MacOS terminal | <p>The problem with this question is that I do not the proper words to refer to my problem. Let me be clear about what I'm not asking. I'm not asking how to execute a python file. I can already do that. Simply cd to the director where the Python file is in, then run</p>
<pre><code>>>>python module.py
</cod... | <python><macos> | 2024-06-14 06:01:02 | 2 | 581 | logic1976 |
78,621,128 | 5,938,276 | VSCode and debugging in venv | <p>I have a issue in a python project in VSCode where the debugger does not stop at breakpoints and I am unable to inspect variables. The environment is Windows 10 and the project is using a venv.</p>
<p>I was able to get the debuigger to eventually respect a breakpoint by adding <code>"justMyCode": false</co... | <python><visual-studio-code><vscode-debugger> | 2024-06-14 05:11:47 | 1 | 2,456 | Al Grant |
78,620,930 | 6,676,101 | What is a regular expression for the letter "i" all by itself? | <p>In the following English sentences, the letter <code>i</code> is not capitalized correctly.</p>
<pre class="lang-None prettyprint-override"><code>with this notice know that i inscribe messages to inform.
a boy named "Will" said into a microphone that time is like a high-five.
i give lines to computers to f... | <python><regex> | 2024-06-14 03:37:07 | 1 | 4,700 | Toothpick Anemone |
78,620,797 | 1,651,270 | defaultdict ignores its default_factory argument when assigned explicitly | <p>I ran into this problem when working with defaultdict. Here's a program that demonstrates it:</p>
<pre><code>from collections import defaultdict
d1 = defaultdict(default_factory=dict)
d2 = defaultdict(dict)
print("d1's default_factory:", d1.default_factory)
print("d2's default_factory:", d2.def... | <python> | 2024-06-14 02:33:40 | 1 | 308 | Nick |
78,620,595 | 1,806,566 | How can I print to a pipe in python? | <p>I'm creating a pipe with:</p>
<pre><code>popen = subprocess.Popen(command, stdin=subprocess.PIPE)
</code></pre>
<p>and I would like to print to popen.stdin. The key is that I'd like to print(..., file=popen.stdin) to it, not call write() on it, but popen.stdin is a _io.BufferedWriter which only supports writing byt... | <python><python-3.x> | 2024-06-14 00:35:38 | 0 | 1,241 | user1806566 |
78,620,466 | 11,098,908 | Why does a Python class need to rely on a function defined outside of its scope? | <p>I came across the following code that <a href="https://stackoverflow.com/questions/64867475/how-to-put-a-health-bar-over-the-sprite-in-pygame">draws a health bar above a sprite</a></p>
<pre><code>import pygame
import math
def draw_health_bar(surf, pos, size, borderC, backC, healthC, progress):
pygame.draw.rect(... | <python><pygame> | 2024-06-13 23:17:14 | 1 | 1,306 | Nemo |
78,620,440 | 1,196,033 | How can I tell Pyyaml to convert PosixPath to str in yaml.dump? | <p>I understand that YAML allows you to represent arbitrary data using tags. I would like to convert a PosixPath to a str instead of representing it as a <code>!!pathlib.PosixPath</code>. How can I tell pyyaml to convert PosixPath to str every time it encounters the type?</p>
| <python><yaml><pyyaml> | 2024-06-13 23:02:17 | 1 | 1,766 | xaviersjs |
78,620,432 | 1,313,890 | PySpark NOT_COLUMN_OR_STR Exception on Disconnected List | <p>I am getting an odd pyspark exception when attempting to use <code>filter</code> and <code>lambda</code> functions on a list of ints I've collected from a pyspark dataframe, which makes no sense as the data exists in memory as a list and should be completely disconnected from pyspark. Here is the scenario.</p>
<p>I ... | <python><apache-spark><pyspark> | 2024-06-13 23:00:18 | 0 | 547 | Shane McGarry |
78,620,395 | 7,053,357 | how does python determine encodings under different circumstances? | <p>I have a python script that runs on a windows machine and looks like this:</p>
<pre><code>print(f"Current encoding: {sys.stdout.encoding}")
print(some_randomized_chars)
</code></pre>
<p>and I run it in different ways using pycharm.
My confusion is about the way it behaves when it comes to encodings.
When I... | <python><windows><encoding><utf-8> | 2024-06-13 22:39:24 | 0 | 364 | felisimo |
78,620,245 | 1,877,600 | Azure Services Connectivity Watchdog | <p>I'm developing a system with a microservices architecture that relies on several Azure services for continuous inter-service communication. For context, here's a simplified overview of my setup:</p>
<ul>
<li><strong>Container App</strong>: Hosts the Django application.</li>
<li><strong>Keda-Scaled Container Apps</st... | <python><azure><watchdog><keda> | 2024-06-13 21:27:59 | 1 | 597 | user1877600 |
78,620,210 | 8,897,442 | Python and Selenium unable to find all tables on a page | <p>Being new to Selenium and Python I have been given the task of extracting all the data from three tables on a wikipedia page. In all tests I have been able to get the pertinent data from the fist table but the code is unable to find anything about the 2nd or 3rd table. I know it can't really be this hard but I have ... | <python><selenium-webdriver> | 2024-06-13 21:16:27 | 2 | 899 | Erik James Robles |
78,620,037 | 9,669,142 | Create dataframe from specific XML data in Python | <p>I have an XML file (example shown below) that I want to have in a dataframe in Python. The issue is that the data in the XML has a specific structure and I'm having some trouble with getting the data I need.</p>
<p>I tried to use lxml and Pandas (read_xml), where both do what I would expect but not what I need exact... | <python><pandas><xml> | 2024-06-13 20:25:33 | 3 | 567 | Fish1996 |
78,620,028 | 14,386,187 | Unexpected result from zipping two generators. How does zip work? | <p>I have two generators, one which depends on the output of the other.</p>
<pre><code>def do_work(n):
for i in range(n):
yield i
def more_work(x):
for i in x:
yield i * 2
def main():
x = do_work(5)
y = more_work(x)
for i, j in zip(x, y):
print(i, j)
if __name__ == &quo... | <python><generator> | 2024-06-13 20:22:34 | 4 | 676 | monopoly |
78,619,951 | 1,748,679 | How can I efficiently calculate the score function gradient estimator (REINFORCE algorithm)? | <p>I wish to use the <a href="https://www.cl.uni-heidelberg.de/statnlpgroup/blog/sfge/" rel="nofollow noreferrer">score function gradient estimator</a> (also called the <a href="https://stillbreeze.github.io/REINFORCE-vs-Reparameterization-trick/" rel="nofollow noreferrer">REINFORCE algorithm</a>). Taking the notation ... | <python><tensorflow><tensorflow-probability> | 2024-06-13 20:03:37 | 0 | 9,846 | Kyle Heuton |
78,619,949 | 22,437,734 | How to identify if provided string is a bash or python script | <p>I have been given a strange request: "Create a python program that will identify if a provided string contains bash or python code".</p>
<p>How can I do this? Are there any python libraries that can help me parse the string and find out if it contains (valid) bash/python code?</p>
| <python><bash> | 2024-06-13 20:03:35 | 2 | 473 | Gleb |
78,619,891 | 10,634,126 | Pythonic parallelized streaming of batches (list-of-dicts) of JSON into a single file write | <p>I have a multiprocessing thread pool where each job returns a requested batch of JSON (an array of objects). I want all results to write into a single file, but without storing the full result (as a single list) in-memory due to RAM constraints (the full result contains about 1.5 million records totaling about 1.5 G... | <python><json><multithreading><file><stream> | 2024-06-13 19:46:32 | 0 | 909 | OJT |
78,619,878 | 10,323,798 | Google Cloud Platform App Engine flask app gives 404 but not locally | <p>I created a flask app that has been working until I deleted the default project to clean up. I had no versionining so the buckets were non-recoverable.</p>
<p>So, I created a new project and pointed my local app to that with authorization. The staging and default app buckets were created. When deploying, the process... | <python><flask><google-cloud-platform><google-app-engine><google-cloud-storage> | 2024-06-13 19:41:18 | 0 | 13,317 | NelsonGon |
78,619,816 | 1,077,748 | Can I create a global ThreadPoolExecutor in a Flask application? | <p>I am using a concurrent.futures.ThreadPoolExecutor in a WSGI (Flask) Python REST service to send queries in parallel. I use the code below to instantiate one executor per request. There is one ThreadPoolExecutor per request with as many threads as there are requests. Obviously, if there are multiple queries in paral... | <python><multithreading><concurrent.futures> | 2024-06-13 19:26:08 | 1 | 625 | Fabio |
78,619,703 | 3,369,545 | Facing pyodbc.InterfaceError When Connecting to SQL Server Using Python 3.10 | <p>I am currently encountering an issue with a Python script that connects to a SQL Server database using pyodbc. This script was functioning correctly under Python 3.7.3, but since upgrading to Python 3.10, I am facing an interface error. Despite setting environment variables and specifying driver details in my connec... | <python><python-3.x><sql-server><pyodbc><unixodbc> | 2024-06-13 18:59:20 | 1 | 421 | user3369545 |
78,619,482 | 4,858,605 | Sending data and files as multipart request using aiohttp | <p>I am trying to send a "multipart/form-data" request through aiohttp. I have already tried using requests and the request works fine.
I have a class where <code>self.files</code> is an <code>io.BytesIO</code> object and <code>self.data</code> is a dictionary of string values.</p>
<p>Here's the relevant part... | <python><python-3.x><python-requests><aiohttp> | 2024-06-13 17:57:15 | 1 | 2,462 | toing_toing |
78,619,257 | 1,315,125 | Can send an SSL message via mosquitto but getting CERTIFICATE_VERIFY_FAILED from python paho script | <p>Using mosquitto:</p>
<pre><code>mosquitto_pub -h <public ip address> -t testssl/topic -m "hello world" --cafile ./ca_certificate.pem -p 8883 --tls-version tlsv1.2 -d --id client2
Client client2 sending CONNECT
Client client2 received CONNACK (0)
Client client2 sending PUBLISH (d0, q0, r0, m1, 'test... | <python><ssl><mosquitto><paho> | 2024-06-13 17:01:25 | 1 | 3,515 | Igor L. |
78,619,042 | 8,329,213 | How to load data using ipywidgets and display it in modern Jupyter | <p>I am trying to load a sample <code>Excel</code> file to test a functionality, which ultimately will have to be rendered through <a href="https://voila-gallery.org/" rel="nofollow noreferrer"><code>Voila</code></a>. Let alone perform an operation on the <code>Dataframe</code> and make it available for download as <co... | <python><ipywidgets><voila> | 2024-06-13 16:12:53 | 1 | 7,707 | cph_sto |
78,618,674 | 16,521,194 | Passing dynamically generated classes' instances as parameters for celery tasks | <h2>Goal</h2>
<p>The objective is to pass an instance of a dynamically generated class (inheriting from a statically defined one) as a parameter to a task to be executed on a Celery worker.</p>
<h2>Issue</h2>
<p>I am encountering an error at runtime, when trying to pass my instance as parameter: <code>kombu.exceptions.... | <python><celery><pickle><dill><kombu> | 2024-06-13 15:03:48 | 1 | 1,183 | GregoirePelegrin |
78,618,644 | 2,721,897 | Pandas rate limit output based on minimum change in a column | <p>I have a dataframe which has column t which is a monotonically increasing integer - I want to filter the dataframe such that I choose as many rows as I can but in the OUTPUT i never have any two rows where t - t.shift(1) <= 10 (and always including the first row of the input dataframe in the output). This is dif... | <python><pandas> | 2024-06-13 14:58:58 | 2 | 367 | user2721897 |
78,618,559 | 6,195,489 | How to speed up interpolation in dask | <p>I have a piece of data code that performs interpolation on a large number of arrays.</p>
<p>This is extremely quick with numpy, but:</p>
<ul>
<li>The data the code will work with in reality will often not fit in memory</li>
<li>The tasks are embarrassingly parallel</li>
</ul>
<p>So I would like to use dask/xarray to... | <python><numpy><interpolation><dask><dask-distributed> | 2024-06-13 14:41:33 | 0 | 849 | abinitio |
78,618,405 | 621,594 | I want the right click menu of pystray to also apear on left-click | <p>I have a very simple pystray icon with a menu.
(Basicaly the normal example code)</p>
<p>Its also working so far. An Icon apears and if I right click it the menu apears.</p>
<p>But so far I couldn't find a way to make the menu show on left-click to.</p>
<p>It seems like there is no way to do that. I cant find anythi... | <python><pystray> | 2024-06-13 14:11:40 | 0 | 837 | Phillip |
78,618,385 | 7,201,487 | Making configuration name customizable | <p>I'm using Hydra to create some configuration of layers in my neural network, these layers will then be used in other configs to create neural network architectures. However, I find myself creating multiple repeated configs, and the only difference between them for example is the width.</p>
<p>An example of a layer c... | <python><fb-hydra> | 2024-06-13 14:08:27 | 1 | 559 | schlodinger |
78,618,381 | 17,795,398 | Why numpy data type kind returns void when it was created as float64? | <p>I have this code:</p>
<pre><code>>>> d = np.dtype([("pos", np.float64, 3)])
>>> d[0].kind
'V'
</code></pre>
<p>Why does it return <code>'V'</code> instead of <code>'f'</code>? In the full code, I need to know if the field corresponds to an integer, float, string...</p>
| <python><numpy> | 2024-06-13 14:08:18 | 4 | 472 | Abel Gutiérrez |
78,618,340 | 890,537 | Azure Function not triggered by Service Bus Queue | <p>Perhaps I'm missing something very basic here. Coming from GCP and AWS, Azure Functions are somewhat ... different in some aspects.</p>
<h1>What</h1>
<p>What I'm trying to do is have an Azure Function triggered by a Service Bus Queue. Or, one step back, I'm publishing to an Event Grid subject and need a function to ... | <python><azure><terraform><azure-functions><azureservicebus> | 2024-06-13 14:00:15 | 0 | 3,161 | m02ph3u5 |
78,618,260 | 5,166,312 | Using Bleak with threading in a PyQt/PySide application | <p>I have a PyQt/PySide application where I use threads to process commands from a queue. In one thread, I need to use Bleak to work with BLE devices. Bleak is based on asyncio, and I am having trouble integrating these asynchronous functions into a synchronous thread. Here is a sample of my code:</p>
<pre><code>import... | <python><multithreading><python-asyncio><pyside><python-bleak> | 2024-06-13 13:47:41 | 0 | 337 | WITC |
78,618,147 | 3,527,454 | Select multiple columns from array, multiple times | <p>Hi I have the following setup:</p>
<p>from scipy</p>
<pre><code>def _bootstrap_resample(sample, n_resamples=None, random_state=None):
"""Bootstrap resample the sample."""
n = sample.shape[-1]
# bootstrap - each row is a random resample of original observations
i = rng_i... | <python><python-3.x><numpy><scipy><numpy-ndarray> | 2024-06-13 13:23:08 | 1 | 355 | Revist |
78,618,055 | 5,678,653 | derive (approximate) rotation transform matrix (numpy) on a unit sphere given a mapping of vectors (n=12) | <p>While I am aware of vaguely similar questions, I seem to be stuck on this.</p>
<p>Buckminster Fuller introduced a spherical mapping of the world onto an icosahedron - it's known as the <a href="https://en.wikipedia.org/wiki/Dymaxion_map" rel="nofollow noreferrer">Dymaxion Map</a></p>
<p>A <a href="https://en.wikiped... | <python><numpy><mapping><computational-geometry> | 2024-06-13 13:08:01 | 2 | 2,248 | Konchog |
78,617,576 | 5,305,512 | In Confluence, how to replicate manual search with API search? | <p>I am following the Confluence API search <a href="https://developer.atlassian.com/cloud/confluence/advanced-searching-using-cql/" rel="nofollow noreferrer">documentation</a> to implement text search with CQL (confluence query language) in the company Confluence pages. Here is my code for a search query:</p>
<pre><co... | <python><confluence><confluence-rest-api> | 2024-06-13 11:31:16 | 1 | 3,764 | Kristada673 |
78,617,556 | 7,235,767 | Unable to fix this playwright error: ValueError: The future belongs to a different loop than the one specified as the loop argument | <p>Getting this error:</p>
<p><strong>ValueError: The future belongs to a different loop than the one specified as the loop argument.</strong></p>
<p><strong>Future exception was never retrieved
future: <Future finished exception=TargetClosedError('Target page, context or browser has been closed')>
playwright._im... | <python><pytest><playwright><playwright-python><pytest-asyncio> | 2024-06-13 11:28:02 | 2 | 305 | Basavaraj Lamani |
78,617,536 | 8,271,180 | A reliable way to check if a method has been wrapped with a decorator from within it | <p>In python 3.7 or higher.</p>
<p>I have the following class:</p>
<pre><code>def dec(method):
@functools.wraps(method)
def wrapper(*args, **kwargs):
print("wrapped")
return method(*args, **kwargs)
return wrapper
class A:
@dec()
def f1(self):
print(is_wrapped())
... | <python><python-decorators><inspect> | 2024-06-13 11:23:14 | 2 | 1,356 | Tomer Wolberg |
78,617,530 | 3,367,720 | How to configure HuggingFaceEndpoint in Langchain | <p>I'm trying to use this model</p>
<pre><code>from langchain_huggingface import HuggingFaceEndpoint
repo_id="google/flan-t5-large"
huggingface_llm = HuggingFaceEndpoint(
huggingfacehub_api_token=HUGGINGFACEHUB_API_TOKEN,
repo_id=repo_id,
temperature=0,
max_new_tokens=200)
from langchain.prompts import Promp... | <python><langchain><huggingface> | 2024-06-13 11:21:39 | 2 | 1,343 | kintela |
78,617,498 | 7,120,013 | Problem with OPC UA Client (async handling) and GUI Interaction | <p>I'm working on developing an OPC UA client with a GUI interface. I've successfully connected to the server and interacted with it within the main loop. However, when I try to call methods via a class that manages the GUI, I encounter exceptions without any error messages.</p>
<p>Currently, I try to get running the L... | <python><python-asyncio><opc-ua> | 2024-06-13 11:13:08 | 0 | 393 | swiftUser |
78,617,484 | 9,506,773 | How do I store vectors generated by AzureOpenAIEmbeddingSkill in indexer given my current setup | <p>This is a follow up question to: <a href="https://stackoverflow.com/questions/78602675/error-in-azure-cognitive-search-service-when-storing-document-page-associated-to/78615922?noredirect=1#comment138603745_78615922">Error in Azure Cognitive Search Service when storing document page associated to each chunk extracte... | <python><azure><azure-cognitive-search> | 2024-06-13 11:09:46 | 1 | 3,629 | Mike B |
78,617,300 | 10,200,497 | What is the most efficient way to fillna multiple columns with values from other columns in a way that they can be paired with a suffix? | <p>This is my DataFrame:</p>
<pre><code>import pandas as pd
import numpy as np
df = pd.DataFrame(
{
'x': [1, np.nan, 3, np.nan, 5],
'y': [np.nan, 7, 8, 9, np.nan],
'x_a': [1, 2, 3, 4, 5],
'y_a': [6, 7, 8, 9, 10]
}
)
</code></pre>
<p>Expected output is <code>fill_na</code> column... | <python><pandas><dataframe> | 2024-06-13 10:28:30 | 6 | 2,679 | AmirX |
78,616,941 | 12,550,791 | how is typing a function with list[TypeVar bound to MotherClass] different from typing directly with list[MotherClass]? | <p>I wrote a small utilitarian function to convert a list of class instances to a list of dictionaries. The implementation is the following:</p>
<pre class="lang-py prettyprint-override"><code>from pydantic import RootModel, BaseModel
def convert_pydantic_list_to_dict_list(pydantic_sequence):
return RootModel(pyda... | <python><python-typing><pydantic><type-variables> | 2024-06-13 09:18:14 | 0 | 391 | Marco Bresson |
78,616,913 | 1,557,306 | How to serialize a related model at depth 2 without serializing intermediate model at depth 1? | <p>I have three models with foreign keys in this direction <code>Order -> Customer -> User</code>. I would like to write a view set for orders that serializes the corresponding user without the intermediate customer.</p>
<p><strong>Models</strong>:</p>
<pre class="lang-py prettyprint-override"><code>class Order(m... | <python><django><django-rest-framework> | 2024-06-13 09:11:22 | 1 | 1,869 | Leevi L |
78,616,907 | 6,025,629 | Polars - Issue with read_csv_batched when separator is included in the field | <p>I am trying to read a relatively large csv +30M rows that cannot fit into memory so I am using <code>read_csv_batched</code>. However, I noticed that <code>reader.next_batch(5)</code> instead of returning number of batches dfs (in our case 5) it always returned 1 df with all the rows inside (bigger than the given ba... | <python><csv><python-polars> | 2024-06-13 09:10:26 | 0 | 489 | Mike Xydas |
78,616,608 | 5,346,843 | Another issue with entering user name and password using Selenium | <p>I am trying to scrape the data from a URL on my home network that, (I think) is populated with data by Javascript. The URL is password protected, and I need to fill in the user name and password with this form to access it:</p>
<p><a href="https://i.sstatic.net/6iJAP1BM.png" rel="nofollow noreferrer"><img src="https... | <python><selenium-webdriver> | 2024-06-13 08:10:44 | 0 | 545 | PetGriffin |
78,616,189 | 815,859 | Python mido not detecting keyboard input in Raspberry Pi | <p>I have a simple python code that takes MIDI signal from a musical keyboard via USB connected to a PC which then sends command to an Arduino board to write to its digital out. This works perfectly fine and is without issues.
I tried migrating the same code to Raspberry Pi with some modification specific to the Pi. My... | <python><raspberry-pi><midi><mido> | 2024-06-13 06:40:24 | 1 | 795 | Monty Swanson |
78,615,752 | 20,283,624 | Errno 110 Connection timed out in firebase admin python lambda | <p>I'm trying to create a lambda python api that can send notification to a user device but I'm encountering <code>Connection Timed Out</code> error.
Also tried already to set the timeout in lambda to 1 minute but still the same.</p>
<p>What I did is installed firebase-admin via <code>pip3 install firebase-admin</code>... | <python><aws-lambda><firebase-admin> | 2024-06-13 03:57:19 | 0 | 349 | ramedju |
78,615,700 | 2,210,825 | Aggregate columns that fall within range | <p>I have two dataframes called <code>df</code> and <code>ranges</code>:</p>
<pre class="lang-py prettyprint-override"><code>data = {
'group': ['A', 'B', 'A', 'C', 'B'],
'start': [10, 20, 15, 30, 25],
'end': [50, 40, 60, 70, 45],
'val1': [5, 10, 11, 12, 6],
'val2': [5, 2, 1, 1, 0],
}
df = pd.DataF... | <python><pandas><numpy><aggregation> | 2024-06-13 03:27:28 | 4 | 1,458 | donkey |
78,615,577 | 8,390,889 | langchain: how to prevent the language model response from being prefixed with AI: or Assistant: | <p>I have the following langchain prompt setup for a RAG based chat application:</p>
<pre><code>## Prompt Chain Setup ##
retrieval_qa_chat_prompt = hub.pull("langchain-ai/retrieval-qa-chat")
retriever = chroma_db.as_retriever()
contextualize_q_system_prompt = (
"Given a chat history and the latest u... | <python><langchain><large-language-model> | 2024-06-13 02:18:47 | 0 | 2,972 | JamesMatson |
78,615,014 | 6,097,123 | How to create Pydantic model based on string (s3 access logs) data | <p>The issue is I need to parse a string line delimited by spaces (but not exactly) into a Pydantic model. The field names are known and types for this task are not important, so keeping <code>str</code> is fine.</p>
<p>I'm unfamiliar with Pydantic, but I assume there is a way to leverage the <code>BaseModel.model_vali... | <python><csv><pydantic> | 2024-06-12 21:25:30 | 1 | 537 | sann05 |
78,614,880 | 14,890,683 | Pyspark <3.3 Extract all regex and replace with another DataFrame | <p>Using pyspark 3.3 (no <code>regexp_extract_all</code>), I'd like to take a column of values</p>
<pre><code>+-------------------------+
| value |
+-------------------------+
| MONOCYTES 1511|A5905.5 |
+-------------------------+
</code></pre>
<blockquote>
<p>the data format is not constant. ie. The... | <python><apache-spark><pyspark> | 2024-06-12 20:39:20 | 1 | 345 | Oliver |
78,614,809 | 570,339 | Order failed: 200-{"msg":"Funds increment invalid.","code":"400100"} | <p>I'm using the kucoin api to check what is my USDT balance and purchase its equivalent in Bitcoin using Python 3.12.3</p>
<p>Now if I understand correctly there might be two problems:</p>
<ul>
<li>the trade can be rejected if it's not a multiple of the quote increment provided by the api</li>
<li>This is more of my o... | <python><cryptocurrency><kucoin> | 2024-06-12 20:19:41 | 1 | 22,076 | Ramy Al Zuhouri |
78,614,773 | 19,048,408 | With Polars, how to concatenate list-of-string expression/column to string | <p>Here's a naive solution of what I want to do using <code>map_elements</code>. How can I do this with only Polars functions?</p>
<pre class="lang-py prettyprint-override"><code>import polars as pl
# Create a DataFrame with a column containing lists of strings
df = pl.DataFrame({
"list_of_strings": [[&q... | <python><dataframe><python-polars> | 2024-06-12 20:10:16 | 1 | 468 | HumpbackWhale194 |
78,614,694 | 1,187,968 | AWS/Python Lambda: keep a global variable within a lambda run that's isolated from other lambda runs | <p>The AWS lambdas doc said that global variable will be share across lambda runs. Due to legacy reason, I need to find way to declare and keep a global variable to a lambda run, and it need to be isolated from other lambda runs.</p>
<p>I'm was thinking using class attribute. AWS lambda still treat class attribute as g... | <python><amazon-web-services><aws-lambda> | 2024-06-12 19:48:29 | 1 | 8,146 | user1187968 |
78,614,542 | 1,248,544 | scrapy tsv file download. how to convert file to parquet before upload to s3 | <p>I have a working scrapy project that downloads tsv files and saves them to s3.</p>
<p>I use a custom pipeline to save the original file names with dates.</p>
<p>I am wondering if it is possible to convert the tsv files to parquet before uploading them to s3. If so how would I do this in scrapy?</p>
<p>I should note ... | <python><amazon-s3><web-scraping><scrapy> | 2024-06-12 19:03:09 | 4 | 555 | JonDog |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.