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 ⌀ |
|---|---|---|---|---|---|---|---|---|
75,608,134 | 1,411,345 | python pyloudnorm get RMS values (loudness metering) for PCM WAV | <p>Currently I am using this code:</p>
<pre><code>import sys
import soundfile as sf
import pyloudnorm as pyln
f = open( "c:\\temp\\wav_analysis.txt", "w" )
data, rate = sf.read(sys.argv[1]) # load audio (with shape (samples, channels))
meter = pyln.Meter( rate ) # create BS.1770 meter
loudness = me... | <python><pcm><rms> | 2023-03-01 19:29:47 | 1 | 619 | a1s2d3f4 |
75,608,033 | 3,713,236 | How to apply the same cat.codes to 2 different dataframes? | <p>I have 2 dataframes <code>X_train</code> and <code>X_test</code>. These 2 dataframes have the same columns.</p>
<p>There is 1 column called <code>levels</code> that needs to be changed from <code>str</code> to <code>int</code>. However, each dataframe's <code>levels</code> columns has different unique values:</p>
<p... | <python><pandas><dataframe><categorical-data> | 2023-03-01 19:16:10 | 1 | 9,075 | Katsu |
75,607,929 | 2,908,017 | How to display PopUp ShowMessage on Python FMX GUI App? | <p>How do I display a <code>MessageBox</code> or <code>ShowMessage</code> popup dialog on a <a href="https://github.com/Embarcadero/DelphiFMX4Python" rel="nofollow noreferrer">DelphiFMX Python App</a>?</p>
<p>I basically want a <code>Form</code> with a <code>Button</code> and when you press on the button, then there sh... | <python><user-interface><popup><firemonkey><messagebox> | 2023-03-01 19:04:09 | 1 | 4,263 | Shaun Roselt |
75,607,888 | 243,031 | not able to access pytest mark on module level fixture | <p>I am declaring <code>pytest.mark</code> on the test case, and trying to access that in <code>pytest.fixture</code>.</p>
<p><strong>test_my_code.py</strong></p>
<pre><code>import pytest
@pytest.mark.mymark("test", "mark")
def test_the_code():
assert 1 == 1
</code></pre>
<p><strong>conftest.p... | <python><scope><pytest><fixtures> | 2023-03-01 19:00:44 | 0 | 21,411 | NPatel |
75,607,814 | 4,245,834 | Is it possible to run python38 venv on python37 or python310? | <p>My project supports Python37 and Python 310. One library (a2ba_sdk) that I will need to use only supports Python38. Is it possible to create virtual environment for this library and can run it from python37 or python310.</p>
<p>What I am looking for here is to work with multiple version of python.</p>
| <python><python-3.x><python-venv><virtual-environment> | 2023-03-01 18:52:11 | 0 | 453 | Sagar Mehta |
75,607,749 | 2,172,751 | Pycharm Console Does Not Print Dots | <p>I am running PyCharm 2022.3.2.</p>
<p>If I <code>print('...')</code> I get blank output in both Python Console and IPython Console. This does not happen if I run Python from the terminal.</p>
<p>This happens with any multiples of three dots at the start of the line. Every three dots are converted to blanks. Does not... | <python><pycharm> | 2023-03-01 18:44:22 | 0 | 533 | Danyal |
75,607,683 | 259,543 | Conditional type hints in python | <p>How to do proper type hinting in Python when certain packages only declare type hints when <code>typing.TYPE_CHECKING</code> is enabled?</p>
<p>For example, in flask:</p>
<pre><code># This works in mypy, not in python
# because flask checks for t.TYPE_CHECKING
# before declaring WSGIEnvironment
from flask import WS... | <python><type-hinting> | 2023-03-01 18:35:08 | 2 | 5,252 | alecov |
75,607,640 | 3,768,655 | Form Recognizer in deep Learning with Annotation | <p>I have regular digital forms with blanks, boxes, checkboxes, tables, and signature fields. My aim is to extract the field name along with its fillable coordinates.</p>
<p>For e.g. if form has a field named "Name of benificiary" and has it's corresponding blank space at (x=500,y=750), I require the field N... | <python><deep-learning><azure-cognitive-search><amazon-textract><document-layout-analysis> | 2023-03-01 18:30:46 | 1 | 1,859 | R.K |
75,607,616 | 5,203,151 | Django: maximum recursion depth exceeded in comparison - Postman works | <p>I have a Django backend running as a service on an Ubuntu machine. After a while, I am getting this error when trying to execute my requests:</p>
<p>maximum recursion depth exceeded in comparison</p>
<p>I have attached to the process and found where the problem is occurring:</p>
<pre><code> response = requests.de... | <python><django><python-requests> | 2023-03-01 18:27:11 | 0 | 451 | Nightrain |
75,607,567 | 7,437,143 | Re-using update function for 2 plotly-dash figures? | <h2>Context</h2>
<p>After having created a code that adds an arbitrary number of graphs in the Dash web interface, I was trying to re-use the updater function, as it is the same for each respective graph.</p>
<h2>Issue</h2>
<p>When I inspect the graph, they are both the same graph (the last one that was created/updated... | <python><plotly-dash><updates> | 2023-03-01 18:20:20 | 1 | 2,887 | a.t. |
75,607,544 | 7,483,211 | How to display formatted Jupyter stack trace from "full output data" | <p>I am debugging Python code in VS Code using the Jupyter integration in interactive mode.</p>
<p>The stack trace I get is only partially displayed, because "Output exceeds the <em>size limit</em>." I would like to see the full stack trace.</p>
<p>I'm advised to "Open the full output data <em>in a text ... | <python><visual-studio-code><formatting><jupyter><stack-trace> | 2023-03-01 18:18:09 | 2 | 10,272 | Cornelius Roemer |
75,607,502 | 1,720,743 | conda's behavior differs between two identical pc's using the same version | <p>My colleague and I are having a head-scratcher moment. We built an internal library that are trying to get working on two machines. The machines are nearly identical in hardware spec.</p>
<p>On my machine i can do this:</p>
<pre><code>>conda create --no-default-packages -n library_test_env python=3.8
>conda a... | <python><sqlalchemy><anaconda><conda> | 2023-03-01 18:12:57 | 0 | 770 | XiB |
75,607,488 | 5,272,967 | Mean value calculation for clustered data using NumPy | <p>Suppose I have two arrays:</p>
<ul>
<li><code>x</code> which contains <code>m</code> points;</li>
<li><code>c</code> which contains <code>m</code> cluster ids for each corresponding point from <code>x</code>.</li>
</ul>
<p>I want to calculate the mean value for points which share the same id, i.e. which belong to th... | <python><numpy> | 2023-03-01 18:11:36 | 1 | 313 | andywiecko |
75,607,419 | 11,092,636 | openpyxl hides two columns instead of 1 | <p>Here is a MRE. <a href="https://wetransfer.com/downloads/89eff5d269cfc2a771dec590a7f3901020230301180308/23666a" rel="nofollow noreferrer">Download "huge_bug.xlsx" (it's a wetransfer link)</a> first:</p>
<pre class="lang-py prettyprint-override"><code>from openpyxl import load_workbook
document = load_work... | <python><excel><openpyxl> | 2023-03-01 18:04:41 | 0 | 720 | FluidMechanics Potential Flows |
75,607,393 | 7,014,837 | Adding global X/Y labels to a grid of subplots | <p>I'm trying to plot a summary of many experiments in one grid of graphs in order to compare the results. My goal is to get a graph that looks as follows:</p>
<p><a href="https://i.sstatic.net/B7x7P.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/B7x7P.png" alt="Illustration of the desired graph" /></a>... | <python><matplotlib> | 2023-03-01 18:01:00 | 2 | 1,110 | Kerek |
75,607,375 | 2,568,341 | how to combine multiple dictionaries from list? | <p>I have a list of dictionaries like this one:</p>
<pre><code> my_dict = [{'year-0': '2022', 'dividend-0': ''},
{'year-1': '2021', 'dividend-1': '52.37'},
{'year-2': '2020', 'dividend-2': '44.57'},
{'year-3': '2019', 'dividend-3': '35.00'},
{'year-4': '2018', 'dividend-4': '24.00'},
{'year-5': '2017', 'dividend-... | <python><list><dictionary> | 2023-03-01 17:59:24 | 3 | 36,305 | krokodilko |
75,607,361 | 21,309,333 | Custom function in pandas does not print out values as expected | <p>I have the following code:</p>
<pre class="lang-py prettyprint-override"><code>def fillRow(df, key, type_):
print(f"Key (before if statements): {key}, Type: {type_}")
if type_ == 0:
replacement = df[key].median(skipna=True)
elif type_ == 1:
replacement = df[key].mean(skipna=True... | <python><pandas><function> | 2023-03-01 17:57:18 | 1 | 365 | God I Am Clown |
75,607,274 | 5,452,378 | Importing shared Python Module in Dataflow (Apache Beam) job | <p>I'm building out a series of data pipelines using Google Cloud's Dataflow tool.</p>
<p>This is my file structure:</p>
<pre><code>-- dataflow_jobs
|-- README.md
|-- cleanse_export
| |-- __init__.py
| |-- run_cleanse_export.py
| |-- setup.py
| `-- src
| |-- __init__.py
| ... | <python><dependencies><python-import><google-cloud-dataflow><apache-beam> | 2023-03-01 17:48:06 | 2 | 409 | snark17 |
75,607,256 | 3,713,236 | Amazon Product Advertising API: How to translate Curl statement into Python? | <p>Amazon Product Advertising API: How to translate Curl statement into Python?</p>
<p>I got a signed curl request from <a href="https://webservices.amazon.com/paapi5/documentation/quick-start/using-curl.html" rel="nofollow noreferrer">this Amazon link</a>. The curl statement looks like this, sensitive info redacted:</... | <python><json><curl><python-requests><amazon-advertising-api> | 2023-03-01 17:46:36 | 0 | 9,075 | Katsu |
75,607,074 | 386,861 | Plotting several plots in matplotlib using a list of dicts | <p>I have a simple plot function:</p>
<pre><code>def plot_data(dataset="boys", baby_name="David"):
ax = dataset.T.sort_index().loc[:, baby_name].plot(legend = baby_name)
list_of_dict = [{"data": boys, "baby_name": "David",
"data": girls, ... | <python><pandas><matplotlib> | 2023-03-01 17:27:43 | 2 | 7,882 | elksie5000 |
75,606,996 | 11,115,072 | Efficient way of applying calculations on dataframes with different conditions and levels | <p>I have a dataframe in the following format, it is sorted by the dates for each item, which have a determined frequency:</p>
<pre class="lang-python prettyprint-override"><code>df = pd.DataFrame(
{
"date": [2020-01-01, 2020-02-01, 2020-03-01, 2020-01-01, 2020-02-01],
"item_ID": ["a&quo... | <python><pandas><data-analysis> | 2023-03-01 17:20:35 | 1 | 381 | Gabriel Caldas |
75,606,993 | 8,642,375 | Azure Pronunciation Assessment SDK return wrong result compare with api call | <p>I'm using azure speech sdk to do pronunciation assessment, it works fine when i used api provide by azure, but when i use speech sdk the result is not correct. I follow the sample from <a href="https://github.com/Azure-Samples/cognitive-services-speech-sdk/blob/master/samples/python/console/speech_sample.py" rel="no... | <python><azure><speech-recognition><azure-cognitive-services> | 2023-03-01 17:20:24 | 2 | 502 | TRose |
75,606,960 | 10,404,281 | How do I add string values from List to DataFrame and recreate DF? | <p>I have a data frame and list like below.</p>
<pre class="lang-py prettyprint-override"><code>df = pd.DataFrame({'player_id': [298, 118, 108, 109, 168, 198, 116],
'date': ['2018-06-22', '2018-06-23', '2018-07-24', '2018-07-25',
'2019-06-22', '2019-06-25', '2019-07-25']... | <python><pandas><dataframe> | 2023-03-01 17:17:09 | 1 | 819 | rra |
75,606,940 | 7,980,206 | calculate sum of a column after groupby based on unique values of second column | <p>I have a <code>dataframe</code>, where there are columns like <code>gp1, gp2, gp3, id, sub_id, activity</code></p>
<pre><code>usr gp2 gp3 id sub_id activity
1 IN ASIA 1 1 1
1 IN ASIA 1 2 1
1 IN ASIA 2 9 0
2 IN ASIA 3 4 1
2 IN ASIA 3 5 1
2 IN ASIA 4 6 1
2 ... | <python><pandas> | 2023-03-01 17:14:11 | 2 | 717 | ggupta |
75,606,870 | 3,541,631 | Downloading from web using threads(inside a separate process) and multiprocessing queues | <p>I have the following class to download from web:</p>
<pre><code>class Downloader:
SENTINEL = END_QUEUE_SENTINEL
def __init__(self, to_download, downloaded):
self.to_download = to_download
self.downloaded = downloaded
self.mutex = Lock()
self._stop_workers = False
@stat... | <python><python-3.x><python-3.8> | 2023-03-01 17:07:19 | 1 | 4,028 | user3541631 |
75,606,835 | 2,908,017 | How to display Image on a Python FMX GUI App? | <p>I've made a small Form App using the DelphiFMX GUI Library for Python, but I'm not sure how to add or display an <code>Image</code> onto the <code>Form</code>. Here's my current code:</p>
<pre><code>from delphifmx import *
class frmMain(Form):
def __init__(self, owner):
self.Caption = 'My Form'
... | <python><image><user-interface><firemonkey> | 2023-03-01 17:02:34 | 1 | 4,263 | Shaun Roselt |
75,606,819 | 2,365,416 | Pulumi Azure Native - How to manage multiple Azure Subscriptions using Python? | <p>I have 2 Azure Subscriptions(say Subscription A & B) already created, service principal is also configured.
I want to configure diagnostics in Subscription A so that I can send data to a workspace in Subscription B.
I'm using Pulumi as IaC tool, how can I achieve this using Pulumi Native Azure API?</p>
<p>All I ... | <python><azure><pulumi><pulumi-azure><pulumi-python> | 2023-03-01 17:01:02 | 1 | 2,333 | Amrit |
75,606,751 | 4,451,315 | resample('D').interpolate() fills value, but resample('Y').interpolate() produces nans? | <p>Let's start with two dates, two days apart, resample daily, and interpolate:</p>
<pre class="lang-py prettyprint-override"><code>In [1]: ts = pd.Series([1, 2], index=pd.DatetimeIndex(['1950-01-01', '1950-01-03']))
In [2]: ts.resample('D').interpolate()
Out[2]:
1950-01-01 1.0
1950-01-02 1.5
1950-01-03 2.0
F... | <python><pandas><interpolation><pandas-resample> | 2023-03-01 16:54:14 | 1 | 11,062 | ignoring_gravity |
75,606,699 | 7,052,505 | Checking empty cells using openpyxl | <p>In python <code>str(None)</code> is <code>"None"</code>. But when reading a cell with openpyxl we get a None instead of an empty string. So when casting the empty cell we end up with an object with a different bool value.</p>
<p>This causes errors if a value would need to be checked if it's empty.</p>
<p>I... | <python><openpyxl> | 2023-03-01 16:49:50 | 0 | 350 | Monata |
75,606,607 | 2,908,017 | Initialize Form as Maximized in a Python FMX GUI App | <p>I'm making an app in the <a href="https://github.com/Embarcadero/DelphiFMX4Python" rel="nofollow noreferrer">DelphiFMX GUI Library for Python</a>. I have a Form that is being created, but it's being created as a normal window. How do I create and maximize it immediately? It should start as maximized.</p>
<p>This is ... | <python><user-interface><firemonkey><maximize-window> | 2023-03-01 16:41:09 | 1 | 4,263 | Shaun Roselt |
75,606,583 | 1,459,607 | Understanding the raft algorithm RequestVote RPC | <p>I'm trying to read page 4 of this paper: <a href="https://raft.github.io/raft.pdf" rel="nofollow noreferrer">https://raft.github.io/raft.pdf</a></p>
<p>I am trying to implement the RequestVote RPC but I'm struggling to understand the second part of the "receiver implementation." "If votedFor is null&q... | <python><distributed-computing><raft> | 2023-03-01 16:39:55 | 1 | 1,386 | Ryan Glenn |
75,606,435 | 4,403,073 | Import Python logistic regression results into R using | <p>Because Python uses multiple cores and is more efficient with memory, I would like to run logistic regression in Python, but then import the summary table to R (as in the end is used in a Quarto document).</p>
<p>My reprex is below. I fail when I try to import the outcome from Python. Please help.
I would like to o... | <python><r><reticulate> | 2023-03-01 16:25:37 | 1 | 1,005 | Justas Mundeikis |
75,606,409 | 8,406,249 | Applying a tensorflow function to part of a tensor which meets a condition | <p>I have a 2d matrix of values with distances from the origin (to be used for a 2D Fourier Transform):</p>
<pre><code>s = tf.linspace(0, 10, 100)
x_grid, y_grid = tf.meshgrid(s, s)
t = x_grid**2 + y_grid**2
</code></pre>
<p>I want to apply a tensorflow function to this tensor which has piecewise behaviour such that, ... | <python><numpy><tensorflow> | 2023-03-01 16:23:28 | 1 | 390 | Seb Morris |
75,606,326 | 5,426,539 | Python Parallel Processing with ThreadPoolExecutor Gives Wrong Results with Keras Model | <p>I am using parallel processing using the <code>concurrent.futures.ThreadPoolExecutor</code> class to make multiple predictions using a Keras model for different sets of weights.</p>
<p>But the Keras model predictions using parallel processing are not correct.</p>
<p>This is a reproducible sample code that creates 10... | <python><tensorflow><keras><parallel-processing><concurrent.futures> | 2023-03-01 16:16:26 | 1 | 874 | Ahmed Gad |
75,606,279 | 3,425,104 | Docker doesn't see .env in dockerfile when trying to run Django collectstatic | <p>I have multiple containers run in the order stated in docker-compose. In an app container, I need to execute file collectstatic. The thing is when I try to do it in dockerfile like that:</p>
<pre><code>RUN python manage.py collectstatic
</code></pre>
<p>it breaks down as it doesn't see env vars, although the file is... | <python><django><docker><docker-compose><dockerfile> | 2023-03-01 16:13:02 | 1 | 2,288 | Zbyszek Kisły |
75,606,130 | 6,296,919 | create new column with incremental values | <p>I have below result set which got populated with the following code. I require to add new Column GROUP_ID in this result.</p>
<pre><code>import pandas as pd
import numpy as np
df = pd.read_csv ('dups_check_group_v1.csv',encoding= 'unicode_escape',usecols= ['ID','ENTITY_NAME','ENTITY_VALUE','SECTION_GROUP','DOC_ID']... | <python><python-3.x><pandas><dataframe><group-by> | 2023-03-01 16:01:54 | 1 | 847 | tt0206 |
75,605,972 | 6,077,239 | Polars: how to handle 'window expression not allowed in aggregation'? | <p>I have a task on hand where I want to perform regressions of transformed columns on a set of specified columns in a polars dataframe. The transformation and set of independent columns are all controlled by a <code>specs</code> dict.</p>
<p>Below is a simplified mini example for illustrating purposes.</p>
<pre><code>... | <python><python-polars> | 2023-03-01 15:46:23 | 1 | 1,153 | lebesgue |
75,605,946 | 2,163,392 | Extract features by a CNN with pytorch not working | <p>I am trying to use the RESNET-18 pre-trained CNN with Pytorch to act as a feature extractor for new images. To do that, I followed <a href="https://kozodoi.me/python/deep%20learning/pytorch/tutorial/2021/05/27/extracting-features.html" rel="nofollow noreferrer">this tutorial</a>.</p>
<p>Basically, I want the output ... | <python><deep-learning><pytorch><computer-vision><conv-neural-network> | 2023-03-01 15:44:36 | 1 | 2,799 | mad |
75,605,942 | 14,269,252 | Combination of checkboxes in streamlit app | <p>I am building stream lit app, I know how to define if option_1 is chosen do something, but what if a user choose option 1 and option 2? I want the code doesn't runs if a user select anything rather than only option_1, even a combination of option_1 or option_2.</p>
<pre><code>option_1 = st.sidebar.checkbox('df1', va... | <python><pandas><streamlit> | 2023-03-01 15:44:13 | 1 | 450 | user14269252 |
75,605,839 | 10,983,819 | Create a new column using index in python | <p>I have a df with double indexation in python, where Asset and Scenario are the indexes obtained after using pandas.</p>
<pre><code>As Scen V1 v2 v3
0 1 34 45 78
0 2 30 95 58
0 3 14 -5 68
1 1 54 ... | <python><pandas><dataframe><indexing> | 2023-03-01 15:34:07 | 1 | 397 | Eve Chanatasig |
75,605,559 | 18,091,372 | Finding the root nodes in a networkx.Graph() and paths between those nodes | <p>This should be a simple question, but one I am not sure how to answer since I am new to the networkx api.</p>
<p>The graphs I will be working with will not be directed and be acyclic.</p>
<p>I have created a nx.Graph(), added nodes and edges, can draw it with nx.draw(G), etc.</p>
<p>What I want to find are two thing... | <python><graph><networkx> | 2023-03-01 15:09:23 | 1 | 796 | Eric G |
75,605,522 | 3,204,942 | ast or syntax tree for all the locals() and globals() in a python file | <p>How do I get the tree for all the <code>locals()</code> and <code>globals()</code> in a python file parsed in a string or a shell stdout. I am getting this right now for globals:</p>
<pre><code>{
'__name__': '__main__',
'__doc__': None,
'__package__': None,
'__loader__': <class '_frozen_import... | <python><global><loader><local-variables><built-in> | 2023-03-01 15:06:23 | 0 | 2,349 | Gary |
75,605,487 | 7,636,192 | How to implement a multi form 'wizard' using forms | <p>I'm <em>not</em> using django-formtools, just built in forms.</p>
<p>I'm struggling to understand the correct flow to construct such a view.</p>
<p>I was trying to chain my logic like so</p>
<pre><code>def step_one(request, ...):
if request.method == 'POST':
form = step_one_form(data=request.POST)
el... | <python><django> | 2023-03-01 15:04:17 | 1 | 759 | Chris |
75,605,273 | 9,532,692 | PySpark in synapse notebook raises Py4JJavaError when using count() and save() | <p>I'm using spark version 3.3.1.5.2 in synapse notebook. I first read parquet data from azure storage account and do transformation. Finally, when I want to check the size of the pyspark dataframe (final_df) by running <code>final_df.count()</code>, it throws a Py4JJavaError error shown below:</p>
<pre><code>----> ... | <python><apache-spark><pyspark> | 2023-03-01 14:48:47 | 1 | 724 | user9532692 |
75,605,184 | 1,000,343 | Left Align the Titles of Each Plotly Subplot | <p>I have a facet wraped group of plotly express barplots , each with a title. How can I left align each subplot's title with the left of its plot window?
<a href="https://i.sstatic.net/2ZUWs.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/2ZUWs.png" alt="enter image description here" /></a></p>
<pre><c... | <python><plotly><facet-grid> | 2023-03-01 14:42:28 | 2 | 110,512 | Tyler Rinker |
75,605,178 | 528,369 | Mypy type compatible with list, tuple, range, and numpy.array? | <p>The code</p>
<pre><code>import numpy as np
def join(v:list, delim:str = ","):
""" join the elements of v using the given delimiter """
return delim.join(str(x) for x in v)
print(join([0,1,2,3]))
print(join((0,1,2,3)))
print(join(range(4)))
print(join(np.array(range(4... | <python><mypy> | 2023-03-01 14:42:00 | 1 | 2,605 | Fortranner |
75,605,177 | 11,267,783 | Spacing adjustment for gridspec subfigures | <p>I wanted to change the size of <code>hspace</code> on my figure without using <code>constrained_layout=True</code>.</p>
<p>Here is my code:</p>
<pre class="lang-py prettyprint-override"><code>import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
import numpy as np
fig = plt.figure()
# fig = plt.fig... | <python><matplotlib><matplotlib-gridspec> | 2023-03-01 14:41:56 | 1 | 322 | Mo0nKizz |
75,605,089 | 14,385,099 | Extract string before underscore in python string | <p>I have a list of strings in python that looks something like: [AAA_X, BBB_X, CCC_X].</p>
<p>How can I efficiently extract the part of the string before the underscore?</p>
<p>Thank you!</p>
| <python> | 2023-03-01 14:33:18 | 2 | 753 | jo_ |
75,604,996 | 1,330,719 | Debouncing distributed task dependencies in python | <p>I would like to define some tasks that can be triggered dependent on messages from a broker (e.g. SQS). These tasks would be able to re-publish messages triggering other tasks.</p>
<p>While this is partially solved solved by libraries like celery/selinon, one extra requirement I have is that I would like to debounce... | <python> | 2023-03-01 14:26:30 | 1 | 1,269 | rbhalla |
75,604,912 | 4,879,688 | Function or dict comprehension as a Snakefile output | <p>I have a Snakemake rule with a highly redundant output (here simplified):</p>
<pre><code>rule redundant:
output:
a_x = "prefix_a_x.ext"
b_x = "prefix_b_x.ext"
a_y = "prefix_a_y.ext"
b_y = "prefix_b_y.ext"
run:
process_1(output.a_... | <python><python-3.x><python-3.7><snakemake> | 2023-03-01 14:20:43 | 1 | 2,742 | abukaj |
75,604,761 | 10,416,012 | How to parse custom operators inside a evaluable python string? | <p>Having a formula as a string like:</p>
<pre><code>str_forumla = "x > 0 AND y < 5 AND 'this AND that' in my_string"
</code></pre>
<p>Where the python operator "&" have been substituted by "AND" (but the string AND was not affected) how to revert the operation so we get the orig... | <python><string><abstract-syntax-tree><python-re> | 2023-03-01 14:04:39 | 2 | 2,235 | Ziur Olpa |
75,604,751 | 5,094,019 | Execute equation from the elements of a list in python | <p>I have the following list and dataframe:</p>
<pre><code>import pandas as pd
data = [[5, 10, 40], [2, 15, 70], [6, 14, 60]]
df = pd.DataFrame(data, columns=['A', 'B', 'C'])
lst = [5, '*', 'A', '+', 'C']
</code></pre>
<p>And I would like to create a code to execute the equation in the lst like <code>5 x A + C</code> r... | <python><python-3.x><pandas> | 2023-03-01 14:03:37 | 1 | 725 | Thanasis |
75,604,705 | 10,409,809 | How do I plot box plot for multiple columns in pyspark? | <p>I have a pyspark dataframe (pyspark.sql.dataframe.DataFrame). I would like to plot the numeric columns in a boxplot to detect outliers.</p>
<p>I started by selecting only the numeric columns with:</p>
<pre><code>numeric_columns = [item[0] for item in df.dtypes if item[1].startswith('float')]
</code></pre>
<p>I tried... | <python><dataframe><pyspark> | 2023-03-01 13:58:59 | 1 | 537 | jessirocha |
75,604,692 | 18,455,931 | How to delete 30 days older files from a directory in Python databricks | <p>I have a files in directory with name model/year(current year)/month(current month)/date(current date)
<code>Example model/2023/01/24/mm.parquet, model/25/02/1998/mm.parquet</code>.</p>
<p>so there are dozens of file there on my directory so i want to delete files which is 30 days older. For example if latest file i... | <python><pandas><databricks><azure-databricks> | 2023-03-01 13:58:01 | 1 | 375 | Anubhav |
75,604,651 | 9,321,944 | How to convert c++ std::map<enum, enum> to python type using pythonBinding | <p>I have a C++ library that needs to be used with a Python application. I have created a pythonBinding for that library.</p>
<p>header.h</p>
<pre class="lang-cc prettyprint-override"><code>enum class enumA {
app1,
app2,
app3};
enum class enumB {
kInit,
kRunning,
kFaile... | <python><c++><python-3.x><python-bindings> | 2023-03-01 13:55:03 | 0 | 371 | deepan muthusamy |
75,604,621 | 11,829,398 | How to automatically run python files using python -m in VS Code | <p>I need to run files using <code>python -m foo.bar.baz</code> due to having absolute imports in other areas of the codebase.</p>
<p>In VS Code, when I click the top-right corner to <code>Run Python File</code>, I'd like it to automatically do <code>python -m foo.bar.baz</code> instead of <code>python /absolute/path/t... | <python><visual-studio-code> | 2023-03-01 13:51:36 | 1 | 1,438 | codeananda |
75,604,590 | 6,296,919 | merge group by data into single list or dataframe | <p>Hello I am new to python and not sure how to achieve.</p>
<div class="s-table-container">
<table class="s-table">
<thead>
<tr>
<th style="text-align: left;">ID</th>
<th style="text-align: center;">ENTITY_NAME</th>
<th style="text-align: right;">ENTITY_NAME</th>
<th style="text-align: right;">SECTION_GROUP</th>
<th s... | <python><python-3.x><pandas><dataframe><group-by> | 2023-03-01 13:48:58 | 1 | 847 | tt0206 |
75,604,545 | 9,187,350 | Share tree structure between 2 instances of dict | <p>I have the following <code>dict</code>:</p>
<pre class="lang-py prettyprint-override"><code>d1 = {"parent1": {"get": {"responses": {200: {"content": {"application/json": {}}}}}}}}
d2 = {"parent2": {"get": {"responses": {200: {"conte... | <python><dictionary> | 2023-03-01 13:44:58 | 2 | 20,003 | renatodamas |
75,604,540 | 453,851 | Is there a good way to store logging calls for publishing as log messages later? | <p>I often find myself stuck in the early phases of a program wanting to write log messages before logging has been configured. This might happen if the log configuration itself is being loaded from some remote location or even logging about steps in logging setup.</p>
<p>Two options have come to mind but I'm not sure... | <python><logging><python-logging> | 2023-03-01 13:44:28 | 1 | 15,219 | Philip Couling |
75,604,236 | 12,845,199 | Make sure that kilogram are converted to grams pandas | <p>I have the following series</p>
<pre><code>s = pd.Series({0: '1kg',
1: '500g',
2: '200g'})
</code></pre>
<p>What I want to do is to make a very similar column that basically has the same type of measurement, that being in grams. So in this case convert the 1kg to one thousand int value and leave the gram integer i... | <python><pandas> | 2023-03-01 13:15:35 | 4 | 1,628 | INGl0R1AM0R1 |
75,604,189 | 7,920,004 | f-string in Python's parameter | <p>Is it possible to use <code>f-string</code> to modify output of Python's default argument?
I want such functionallity to re-name one argument per function's calling.</p>
<p>When calling a function with <code>xyz</code> argument I would like to see it injected into <code>v</code> in <code>f"this_is_{v}</code>.</... | <python> | 2023-03-01 13:11:50 | 3 | 1,509 | marcin2x4 |
75,604,139 | 8,741,781 | Django/PyCharm - Unresolved attribute reference '' for class 'User' | <p>Just wondering if there's a way to get around this super annoying PyCharm warning without having to ignore it altogether.</p>
<p>I have a custom <code>User</code> model with extra fields and methods. When I try to access these attributes in a view (ex. <code>if self.request.user.type == 'foo':</code>) I'll get the w... | <python><django><pycharm> | 2023-03-01 13:06:30 | 1 | 6,137 | bdoubleu |
75,604,098 | 11,555,352 | FedEx REST API (Upload Documents): Invalid request: invalid input: Incoming request [code 1001] | <p>I am trying to create a simple Python script to upload a PDF document via the new FedEx REST API.</p>
<p>Below is my minimal code example, which can be used to replicate the issue by placing a file, <code>file.pdf</code>, next to the script and updating to your own FedEx REST API production credentials.</p>
<p>In ru... | <python><rest><fedex> | 2023-03-01 13:02:30 | 1 | 1,611 | mfcss |
75,604,092 | 3,116,231 | Azure functions disable logging not successful | <p>When running my Azure function locally, I'm getting lots of logging messages which I'd like to disable, e.g.</p>
<pre><code>[2023-03-01T12:45:15.038Z] Response status: 200
[2023-03-01T12:45:15.038Z] Response headers:
[2023-03-01T12:45:15.038Z] 'Cache-Control': 'no-cache'
[2023-03-01T12:45:15.038Z] 'Pragma': ... | <python><logging><azure-functions><python-logging> | 2023-03-01 13:01:42 | 1 | 1,704 | Zin Yosrim |
75,603,959 | 3,057,900 | python find difference between two list of dictionary | <p>I try to find out the difference between two list of dictionary based on value of certain keys:</p>
<pre><code>test_list1 = [{"name" : "name1", "number": "number1", "data": "data1"},
{"name" : "name2", "number": ... | <python><list><list-comprehension> | 2023-03-01 12:48:25 | 3 | 1,681 | ratzip |
75,603,874 | 7,046,421 | Trying to calculate an essential matrix using skimage, or cv2 | <p>I am trying to understand how to work with cv2.findEssentialMat or skimage variant. I have a known 3d model in world coordinates and two calibrated cameras. I computed the true essential matrix of the system and my goal is to project the known 3d model points into each of the cameras and use cv2 (or skimage) to reco... | <python><opencv><computer-vision><camera-calibration> | 2023-03-01 12:40:56 | 1 | 333 | ClimbingTheCurve |
75,603,734 | 221,270 | Compare dataframes and extract if values overlapp with minimum occurency | <p>I would like to compare a couple of data frames and extract overlapping row values:</p>
<pre><code>import pandas as pd
#df1
data= {
'id': ['ID1', 'ID2', 'ID3', 'ID4'],
'type': ['1/1', '1/1', '1/1', '1/1'],
'value': [-10, 2, 28, 40]
}
df1 = pd.DataFrame(data)
#df2
data2= {
'id': ['ID1', 'ID5', 'ID6', 'ID7'],
'type... | <python><pandas> | 2023-03-01 12:26:39 | 1 | 2,520 | honeymoon |
75,603,641 | 15,852,600 | Function that retuns a dataframe without leading 0s of a specific column | <p>I have the following dataframe:</p>
<pre><code>df=pd.DataFrame({
'n' : [0,1,2,3, 0,1,2, 0,1,2],
'col1' : ['A', 'A', 'A', 'B', 'B', 'B', 'B', 'C', 'C', 'C'],
'col2' : [0, 0, 0, 0, 3.3, 0, 4, 1.94, 0, 6.17]
})
</code></pre>
<p>It has the form:</p>
<pre><code> n col1 col2
0 0 A 0.00
1 ... | <python><pandas><dataframe> | 2023-03-01 12:19:27 | 3 | 921 | Khaled DELLAL |
75,603,579 | 9,859,642 | Multiple series with subplots for shared columns in DataFrames | <p>I have two DataFrames with identical row indexes and column names that are sometimes only in one DataFrame, and sometimes in both. I wanted to plot data from columns that are in both DataFrames and arrange them in subplots. The final figure should look like this:</p>
<div class="s-table-container">
<table class="s-t... | <python><pandas><dataframe><matplotlib> | 2023-03-01 12:13:22 | 1 | 632 | Anavae |
75,603,485 | 12,945,785 | pandas multiindex columns from an other dataframe | <p>The first one is like that:</p>
<div class="s-table-container">
<table class="s-table">
<thead>
<tr>
<th style="text-align: left;"></th>
<th style="text-align: right;">F2</th>
<th style="text-align: right;">F1</th>
<th style="text-align: right;">F3</th>
<th style="text-align: right;">F4</th>
<th style="text-align: r... | <python><pandas><multi-index> | 2023-03-01 12:05:02 | 3 | 315 | Jacques Tebeka |
75,603,171 | 7,676,365 | Problem with data table webcsrape (web with open data) | <p>I need read table from web (city open data) directly to pandas dataframe. But when I use <code>pandas.read_html()</code>, python return error message <code>No tables found</code>.</p>
<p><strong>My code:</strong></p>
<pre class="lang-py prettyprint-override"><code>import requests
import pandas as pd
url = 'https://... | <python><pandas><web-scraping> | 2023-03-01 11:37:09 | 1 | 403 | 314mip |
75,602,839 | 18,895,773 | NP reshape (add extra 2 dimension) | <p>I will illustrate my question with an example. If I have the array:</p>
<pre><code>a = np.array([[1,2,3,4],
[9,10,11,12],
[17,18,19,20],
[25,26,27,28]])
</code></pre>
<p>I would like to get</p>
<pre><code>array([[[ 1, 2], [[ 3, 4],
[9, 10], [11, 12],
[... | <python><numpy> | 2023-03-01 11:05:38 | 2 | 362 | Petar Ulev |
75,602,801 | 1,436,800 | How to track that a request is handled by which view in django project? | <p>I am working on a django project which consists of multiple apps and every app has its separate urls.py file.
Now when we send a request in a browser, how can we track that the request is handled by which view in our project?</p>
<p>e.g. We send a request with this url:
<a href="http://mywebsite.com:8000/item?id=2" ... | <python><django><django-rest-framework><django-views> | 2023-03-01 11:02:02 | 1 | 315 | Waleed Farrukh |
75,602,637 | 981,768 | How can I build a 2D Array from array stack, selecting non-NAN along third dimension? | <p>I have <em>n</em> 2D numpy arrays, that are stacked along the third dimension. Each array contains <code>np.nan</code> values. I want to construct a new 2D array out of the stack. Each value in it should be the first <em>non np.nan</em> value along the third dimension.</p>
<p>To illustrate, think of the <em>top view... | <python><arrays><numpy> | 2023-03-01 10:46:42 | 1 | 741 | Hans Roelofsen |
75,602,619 | 4,358,785 | How to left join numpy array python | <p>What's the numpy "pythonic" way to left join arrays? Let's say I have two 2-D arrays that share a key:</p>
<pre><code>a.shape # (20, 2)
b.shape # (200, 3)
</code></pre>
<p>Both arrays share a common key in their first dimension:
a[:, 0] # values from 0..19
b[:, 0] # values from 0..19</p>
<p>How are I lef... | <python><numpy><join><left-join> | 2023-03-01 10:45:27 | 1 | 971 | Ruslan |
75,602,541 | 11,092,636 | Whole column background formatted the same manner with openpyxl doesn't work as intended | <p>MRE:</p>
<pre class="lang-py prettyprint-override"><code>import openpyxl
from openpyxl.styles import PatternFill
# Create a new workbook
workbook = openpyxl.Workbook()
# Select the active sheet
sheet = workbook.active
# Set the background color of the third column to black
fill = PatternFill(start_color='000000',... | <python><excel><openpyxl> | 2023-03-01 10:36:54 | 1 | 720 | FluidMechanics Potential Flows |
75,602,420 | 4,105,440 | TypeError when applying a function to every element of a nested array | <p>I want to vectorize the function apply to an array of arrays in order to avoid the loop.</p>
<p>The input array <code>arr</code> is</p>
<pre class="lang-py prettyprint-override"><code>array([array([], dtype=float64),
array([0.03, 0.04,])],
dtype=object)
</code></pre>
<p>If I do a loop</p>
<pre class="la... | <python><arrays><numpy> | 2023-03-01 10:26:28 | 1 | 673 | Droid |
75,602,364 | 2,402,501 | Create a Contingency table of Total and Shared Visitors between two buildings | <p>I need to create a contingency table based on a location, and values should be frequency of visits based on a person's check in.</p>
<p>Below is a sample problem with data:</p>
<pre class="lang-py prettyprint-override"><code>import pandas as pd
a = [
["A", "Building 12", 1],
["A&quo... | <python><pandas><group-by> | 2023-03-01 10:22:28 | 1 | 3,307 | Bryce Ramgovind |
75,602,300 | 1,938,096 | Convert NumPy array to x- and y-axis for matplotlib | <p>Strugling with this for couple of days now because I' don't fully understand how all the object / datetime conversions work and which are needed for matplotlib. And I can't get beyond the point of try this or that instead of getting more understanding of why I should do things.</p>
<p>I have this numpy array that I ... | <python><numpy><matplotlib> | 2023-03-01 10:16:38 | 1 | 579 | Gabrie |
75,602,282 | 12,945,785 | How to group by a dataframe based on another dataframe | <p>The first one is like that:</p>
<div class="s-table-container">
<table class="s-table">
<thead>
<tr>
<th style="text-align: left;"></th>
<th style="text-align: right;">F1</th>
<th style="text-align: right;">F2</th>
<th style="text-align: right;">F3</th>
<th style="text-align: right;">F4</th>
<th style="text-align: r... | <python><dataframe><group-by> | 2023-03-01 10:14:56 | 3 | 315 | Jacques Tebeka |
75,602,267 | 1,581,090 | How to deserialize a string into a dict with json loads with unknown function? | <p>When I have a string like this</p>
<pre><code>test = '{"key1":"value1", "key2": UnknownFunction("value2")}'
</code></pre>
<p>I cannot use <code>json.loads</code> to deserialize its content as the serialized data object contains an unknown function. Is there a simple way to map... | <python><json> | 2023-03-01 10:13:59 | 1 | 45,023 | Alex |
75,602,071 | 1,005,334 | Endpoint with multipart: Quart-Schema only shows 'application/x-www-urlencoded' in Swagger | <p>I'm using Quart-Schema and have defined an endpoint for a multipart call with the help of <a href="https://pgjones.gitlab.io/quart-schema/how_to_guides/request_validation.html" rel="nofollow noreferrer">https://pgjones.gitlab.io/quart-schema/how_to_guides/request_validation.html</a>.</p>
<p>Looks like this:</p>
<pre... | <python><swagger><multipartform-data><quart> | 2023-03-01 09:55:05 | 1 | 1,544 | kasimir |
75,602,070 | 14,058,726 | How to test if import raises ImportError if package is missing? | <p>I am writing a module which can have <code>pandas</code> as an optional package. The import statement at the top of the file <code>my_submodule.py</code> looks like this.</p>
<pre><code>try:
import pandas as pd
except (ImportError, ModuleNotFoundError):
pd = None
</code></pre>
<p>Now I want to test that <cod... | <python><mocking><python-unittest> | 2023-03-01 09:54:46 | 1 | 6,392 | mosc9575 |
75,602,063 | 21,310,501 | pip install -r requirements.txt is failing: "This environment is externally managed" | <p>Command:</p>
<pre class="lang-none prettyprint-override"><code>pip install -r requirements.txt
</code></pre>
<p>Output:</p>
<pre class="lang-none prettyprint-override"><code>error: externally-managed-environment
× This environment is externally managed
╰─> To install Python packages system-wide, try apt install
... | <python><linux> | 2023-03-01 09:53:49 | 12 | 1,943 | iReXes |
75,602,040 | 4,116,300 | How to read an excel file from a local directory using <py-script> | <p><strong>Requirement :</strong> I want to read a excel file from my local directory by using <a href="https://pyscript.net/" rel="nofollow noreferrer"><code><py-script></code></a></p>
<p><strong>Problem Statement :</strong> <code>py-script</code> runs under their own environment. Hence, It is not able to locate... | <python><pyscript><pyodide> | 2023-03-01 09:51:52 | 1 | 27,347 | Rohìt Jíndal |
75,601,992 | 1,433,751 | Django ORM: LEFT JOIN condition based on another LEFT JOIN | <p>I'm using Django 4.0 and PostgreSQL (13.7) as the backend (upgrading would be possible if its required for a solution)</p>
<p>I have two models: <code>Cat</code> and <code>Attribute</code>.
The <code>Attribute</code> holds generic key-value pairs describing <code>Cat</code> instances.</p>
<p><code>Cat</code> table:<... | <python><django><postgresql><left-join><django-orm> | 2023-03-01 09:47:31 | 1 | 384 | Noxx |
75,601,903 | 2,202,989 | Python statsforecast season_length vs freq | <p>When setting up statsforecast models (for example AutoARIMA), one parameter is season_length for each model, and then for the statsforecast object, there is the freq parameter.</p>
<p>My assumption is that if I have weekly data, but I think that seasonality is monthly, I set freq to weekly and season_length to 4, or... | <python><arima><statsforecast> | 2023-03-01 09:40:57 | 1 | 383 | Nyxeria |
75,601,889 | 11,801,923 | Downloading & Uploading Python Logging logs from S3 to AWS Lambda | <p>I have an S3 bucket which holds a pipeline.log file. Each time I run a lambda function, I want the logs to be written and then uploaded to my S3 bucket.</p>
<p>I have created custom functions that handle the downloads and uploads from s3. These custom S3 functions are tested and running well in sagemaker, lambdas an... | <python><amazon-web-services><logging><aws-lambda><aws-step-functions> | 2023-03-01 09:39:51 | 2 | 445 | therion |
75,601,802 | 4,865,723 | Get default font size of an empty document in Python-Docx | <p>I would like to get the default font size of the current document.</p>
<p><strong>But</strong> the document is empty. There is no paragraph or run I can ask.</p>
<p>The default style "Normal" doesn't have a size set.</p>
<pre><code>print(doc.styles['Normal'].font.size) # None
</code></pre>
<p>So how can I... | <python><python-docx> | 2023-03-01 09:32:10 | 1 | 12,450 | buhtz |
75,601,631 | 940,091 | Nested loop over all row-pairs in a Pandas dataframe | <p>I have a dataframe in the following format with ~80K rows.</p>
<pre><code>df = pd.DataFrame({'Year': [1900, 1902, 1903], 'Name': ['Tom', 'Dick', 'Harry']})
Year Name
0 1900 Tom
1 1902 Dick
2 1903 Harry
</code></pre>
<p>I need to call a function with each combination of the name column as parameters. C... | <python><pandas> | 2023-03-01 09:17:19 | 6 | 457 | primelens |
75,601,614 | 10,829,044 | Pandas assign value to nearest IF block in else clause | <p>I have a pandas dataframe that looks like below</p>
<pre><code>customer_id recency frequency H_cnt Years_with_us
1 0 143 3 0.32
2 14 190 8 1.7
</code></pre>
<p>I would like to do the below</p>
<p>a) If any of my row is not matched using a <code>I... | <python><pandas><dataframe><if-statement><group-by> | 2023-03-01 09:16:02 | 1 | 7,793 | The Great |
75,601,593 | 6,730,854 | Draw open polygon in Tkinter Canvas? | <p>How do I draw an open polygon in Tkinter canvas?</p>
<p>I've been playing with <code>create_polygon</code> option, but that does not seem to have a capability to not close it. I'm writing something where you can draw a polygon, smooth it, and than close it with double click.</p>
| <python><tkinter><tkinter-entry> | 2023-03-01 09:13:12 | 0 | 472 | Mike Azatov |
75,601,592 | 3,327,034 | pandas date_range giving wrong result | <p>shouldn't the below example include '2022-01-01'?</p>
<pre><code>>>> import pandas as pd
>>> pd.date_range("2022-01-03", "2023-12-31", freq='MS')
DatetimeIndex(['2022-02-01', '2022-03-01', '2022-04-01', '2022-05-01',
'2022-06-01', '2022-07-01', '2022-08-01', '2022... | <python><pandas> | 2023-03-01 09:13:11 | 1 | 405 | user3327034 |
75,601,543 | 1,826,066 | Access newly created column in .with_columns() when using polars | <p>I am new to Polars and I am not sure whether I am using <code>.with_columns()</code> correctly.</p>
<p>Here's a situation I encounter frequently:
There's a dataframe and in <code>.with_columns()</code>, I apply some operation to a column. For example, I convert some dates from <code>str</code> to <code>date</code> t... | <python><dataframe><python-polars> | 2023-03-01 09:08:10 | 3 | 1,351 | Thomas |
75,601,403 | 5,672,950 | where to store decision trees and multiple regression models? | <p>I have implemented decission tree and multiple regression models. I am planning to deploy it and have access to calculate/classify something by rest. Will use most likely rest from python. The only question is how to and where to store those models. Should I store them in mongo and a json or? I dont want to everytim... | <python><scikit-learn><artificial-intelligence><decision-tree> | 2023-03-01 08:50:49 | 0 | 954 | Ernesto |
75,601,358 | 7,760,910 | Assertion error for BytesIO object in Python unittest | <p>I have a core logic classes like below:</p>
<pre><code>class SomeDBTManifestProvider:
def __init__(self):
pass
def extract_manifest_json(self, file_stream: BytesIO):
try:
zipf = zipfile.ZipFile(file_stream)
manifest_json_text = [zipf.read(name) for name in zipf.namel... | <python><python-3.x><unit-testing><python-unittest> | 2023-03-01 08:46:10 | 1 | 2,177 | whatsinthename |
75,601,314 | 9,974,205 | Cplex optimization program returns results equal to zero | <p>I am currently working on an optimization problem in which a lake has 150 units of water. I am paid 3$ for each unit of water sold, but I need to guarantee that 100 units of water will remain at the end of the month or pay 5$ for each unit below the threshold of 100. I know that rain will bring 125 units of water (l... | <python><optimization><cplex><solver><stochastic> | 2023-03-01 08:41:50 | 2 | 503 | slow_learner |
75,601,308 | 6,610,407 | Aggregating dataframe rows using groupby, combining multiple columns | <p>I have the following pandas dataframe:</p>
<pre class="lang-py prettyprint-override"><code>import pandas as pd
from datetime import date, timedelta
df = pd.DataFrame(
(
(date(2023, 2, 27), timedelta(hours=0.5), "project A", "planning"),
(date(2023, 2, 27), timedelta(hours=1),... | <python><group-by> | 2023-03-01 08:41:21 | 3 | 475 | MaartenB |
75,600,954 | 1,794,617 | pathlib takes more time traversing directory recursively than os.walk() | <p>I'm experimenting to determine if the <code>pathlib</code> module is an improvement over the <code>os</code> for directory traversal. To my surprise, I am getting better readings from the <code>os</code> module when compared to <code>pathlib</code>. Which is something I was not expecting. Is it because the <code>os<... | <python><python-3.x><pathlib> | 2023-03-01 08:05:18 | 2 | 900 | Skegg |
75,600,944 | 14,715,170 | How to insert business logic in django template? | <p>I am working on review rating form, and I want to display the rating stars given by the user. I am getting an int value rating from the database out of 5 rating.</p>
<p>However I want to implement a logic in django template that would looks like the follow code,</p>
<pre><code>a = "THIS IS A STRING"
b = &q... | <python><python-3.x><django><django-templates><django-filter> | 2023-03-01 08:04:37 | 1 | 334 | sodmzs1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.