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 ⌀ |
|---|---|---|---|---|---|---|---|---|
74,870,806 | 1,066,291 | Pickle custom collections.abc.Mapping as dict | <p>I have a custom facade that implements the collections.abc.Mapping mixin interface.</p>
<pre><code>from collections import abc
from typing import Mapping
class MyMapping(abc.Mapping):
def __init__(self, item:Mapping):
self._item = item
def __getitem__(self,key):
return self._item[key... | <python><pickle> | 2022-12-21 02:36:33 | 0 | 8,319 | Mark Rucker |
74,870,797 | 35,812 | Format braces within regex count specifier braces | <blockquote>
<p>I need to find from "aaaa" -> 'aa', 'aa', 'aa', 'aaa', 'aaa', 'aaaa'.</p>
<p>I tried <code>re.findall(r'(.)\1{1,}')</code>, but all I find is 'a'.</p>
</blockquote>
<p>From <a href="https://stackoverflow.com/questions/74870518/python-regex-get-all-possible-repeated-substrings">this question... | <python><python-3.x><regex> | 2022-12-21 02:34:12 | 1 | 6,671 | Chris Charley |
74,870,692 | 5,411,494 | How to check if an image is "JPEG 2000" in Python? | <p>How to check if an image file is <code>JPEG 2000</code> in Python?</p>
<p>If possible, without installing a heavy image library.</p>
| <python><image><jpeg><jpeg2000> | 2022-12-21 02:09:57 | 1 | 3,328 | Marcel |
74,870,540 | 9,092,563 | In Python scrapy, With Multiple projects, How Do You Import A Class Method From One project Into Another project? | <h1>PROBLEM</h1>
<p>I need to import a function/method located in scrapy project #1 into a spider in scrapy project # 2 <em>and use it in one of the spiders of project #2</em>.</p>
<h2>DIRECTORY STRUCTURE</h2>
<p>For starters, here's my directory structure (assume these are all under one root directory):</p>
<pre><code... | <python><web-scraping><import><module><scrapy> | 2022-12-21 01:32:56 | 1 | 692 | rom |
74,870,518 | 10,226,040 | Regex to get all possible repeated substrings | <p>I need to find from "aaaa" -> 'aa', 'aa', 'aa', 'aaa', 'aaa', 'aaaa'.</p>
<p>I tried <code>re.findall(r'(.)\1{1,}')</code>, but all I find is 'a'.</p>
| <python><regex> | 2022-12-21 01:27:37 | 1 | 311 | Chainsaw |
74,870,389 | 626,664 | How to assign multiple column in one go with dictionary values? | <p>I have a pandas dataframe and a function that returns a dictionary. I want to assign the result of the function to multiple columns. But the problem is, the function returns a dictionary that I want to save only the values to columns. I can do this by sending only the values from the function. However, I want to sol... | <python><pandas><multiple-columns><python-zip> | 2022-12-21 01:00:35 | 1 | 1,559 | Droid-Bird |
74,870,318 | 2,066,572 | Problems installing pytables on M1 Mac | <p>I'm trying to install pytables on an M1 Mac (MacOS 12.6.1, python 3.11 and hdf5 1.12.2 installed using homebrew). Following the advice in <a href="https://stackoverflow.com/a/74276925">https://stackoverflow.com/a/74276925</a> I did the following:</p>
<pre><code>pip install cython
brew install hdf5
brew install c-blo... | <python><macos><pip><homebrew><pytables> | 2022-12-21 00:44:07 | 2 | 438 | jhaiduce |
74,870,204 | 13,597,979 | Difficulty extending tuples in Python | <p>I'm using Python 3.9.6. Why do the classes <code>A</code> and <code>B</code> work with the <code>*args</code> as a parameter, but <code>C</code> does not? Python throws this error (before printing <code>args</code>):</p>
<p><code>TypeError: tuple expected at most 1 argument, got 3</code>.</p>
<p>Note the only differ... | <python><tuples> | 2022-12-21 00:22:07 | 1 | 550 | TimH |
74,870,085 | 9,403,538 | Cannot get celery to run task with Flask-SockeIO and eventlet monkey patching | <h1>Update 2:</h1>
<p>The solution is in how monkey patching actually gets done. See my answer below.</p>
<h1>Update 1:</h1>
<p>The issue is the monkey patching of eventlet. Monkey patching is pretty magic to me, so I don't fully understand why exactly. I can get the celery task to run if I don't monkey patch eventlet.... | <python><flask><celery><flask-socketio><eventlet> | 2022-12-20 23:58:16 | 1 | 1,107 | jacob |
74,870,051 | 17,620,776 | Recieving output text when a TensorFlow model name != x | <p>I have made a model which detects when a person has their face to the right, left, or in the middle. I am making a prediction using the following code:</p>
<pre><code>from keras.models import load_model
from PIL import Image, ImageOps
import numpy as np
# Disable scientific notation for clarity
np.set_printoptions(... | <python><tensorflow><keras> | 2022-12-20 23:52:46 | 1 | 357 | JoraSN |
74,869,964 | 10,181,236 | regex that match amazon link and replace it | <p>I'm trying to create a regex that matches amazon links on a string and replace it with another string. The code i wrote for the moment does not work since it just substitute a part of the url. I want to substitute all the url. this is the code</p>
<pre><code>import re
regex = r"https://amzn.to/[a-zA-Z0-9]+"... | <python><regex> | 2022-12-20 23:35:22 | 2 | 512 | JayJona |
74,869,890 | 4,507,231 | How to modify integer values in a Pandas DataFrame whilst avoiding SettingWithCopyWarning? | <p>I have a heterogenous Pandas DataFrame - columns are a mix of data types. I only want to subtract the values in one of the integer columns for all rows by a fixed constant. That's it, and it's that simple. But I keep running into <code>SettingWithCopyWarning</code>.</p>
<p>Take a DataFrame of two columns. The first ... | <python><pandas> | 2022-12-20 23:23:50 | 1 | 1,177 | Anthony Nash |
74,869,795 | 1,914,781 | add color to markers with plotly python | <p>How can I change marker's color based on the z array? The colors can be anything but need differ if value of z is differ! i understand that plotly express can do it, but i need to use plotly graph objects</p>
<p>I try to add a color=z entry but it report error!</p>
<pre><code>import numpy as np
import plotly.graph_o... | <python><plotly> | 2022-12-20 23:08:26 | 1 | 9,011 | lucky1928 |
74,869,781 | 2,386,605 | Overwrite environment variables with monkeypatch in pytest | <p>Currently, I have a file which contains</p>
<pre><code>DATABASE_URL = os.environ.get("DATABASE_URL")
engine = create_async_engine(DATABASE_URL, echo=False, future=True)
</code></pre>
<p>Now, I would like to overwrite DATABASE_URL with monkeypatch in pytest, but sadly whatever I tried it stocked to the &qu... | <python><environment-variables><pytest><monkeypatching> | 2022-12-20 23:06:01 | 1 | 879 | tobias |
74,869,773 | 11,628,437 | How do I get all 1000 results using the GitHub Search API? | <p>I understand that the GitHub Search API limits to 1000 results and 100 results per page. Therefore I wrote the following to view all 1000 results for a code search process that looks for a string <code>torch</code>-</p>
<pre><code>import requests
for i in range(1,11):
url = "https://api.github.com/search/co... | <python><github><github-api><github-search> | 2022-12-20 23:04:03 | 1 | 1,851 | desert_ranger |
74,869,745 | 6,724,526 | How to return a CSV from Pandas Dataframe using StreamingResponse in FastAPI? | <p>I'm trying to return a CSV response to a <code>GET</code> query (end library requirement..), and I am hoping to find a way to do this without writing the CSV to disk. A similar question has been answered <a href="https://stackoverflow.com/questions/61140398/fastapi-return-a-file-response-with-the-output-of-a-sql-que... | <python><pandas><dataframe><streaming><fastapi> | 2022-12-20 23:00:07 | 0 | 1,258 | anakaine |
74,869,685 | 10,146,441 | How to run external command in neovim on BufWritePre set in Lua | <p>I would like to format my code using <code>/bin/black</code> everytime I save a python file in <code>neovim</code>. So I have the following in my <code>~/.config/nvim/init.lua</code></p>
<pre><code>a.nvim_create_autocmd( { "BufWritePre" }, {
pattern = { "*.py" },
command = [[ /bin/black ]],
}... | <python><lua><neovim><python-black> | 2022-12-20 22:52:11 | 1 | 684 | DDStackoverflow |
74,869,684 | 3,482,266 | Concatenating a list of Multi-indices pandas dataframe | <p>I have a list whose elements are MultiIndex objects like:</p>
<pre><code>MultiIndex([(48, 39),
(48, 40),
(48, 41),
(48, 42),
(48, 43),
(49, 39),
(49, 40),
(49, 41),
(49, 42),
(49, 43)],
)
MultiIndex([(48, 48),
(48, 49),
... | <python><pandas><multi-index> | 2022-12-20 22:52:09 | 3 | 1,608 | An old man in the sea. |
74,869,677 | 3,361,462 | Create class from inherited class instance | <p>I have simple class:</p>
<pre><code>class Dog:
def __init__(self, size):
self.size = size
# there can be many fields
def bar(self):
print(f"WOOF {self.size}")
</code></pre>
<p>And two methods I cannot modify:</p>
<pre><code>def get_dog():
return Dog("big")
de... | <python><inheritance> | 2022-12-20 22:51:30 | 1 | 7,278 | kosciej16 |
74,869,658 | 10,443,817 | What is [AssertionCredentials] parameter in BigQuery library and how to get it? | <p><a href="https://github.com/tylertreat/BigQuery-Python" rel="nofollow noreferrer">BigQuery-Python</a> is a small python package that provides functions to interact with GCP's BigQuery. To use it one needs to first instantiate a client object. The documentation for the function <a href="https://github.com/tylertreat/... | <python><google-cloud-platform><google-bigquery><google-oauth> | 2022-12-20 22:49:31 | 1 | 4,125 | exan |
74,869,243 | 17,696,880 | Set up a search group with regular expressions that match one or two numeric values, but do not match any more immediately following numeric values | <pre class="lang-py prettyprint-override"><code>import re
input_text = "del 2065 de 42 52 de 200 de 2222 25 de 25 del 26. o del 8" #example input
num_pattern = r"(\d{1,2})"
identification_regex = r"(?:del|de[\s|]*el|de|)[\s|]*" + num_pattern
input_text = re.sub(identification_regex, &q... | <python><python-3.x><regex><replace><regex-group> | 2022-12-20 21:49:59 | 0 | 875 | Matt095 |
74,869,164 | 9,537,439 | Python - Enclosing time data from another table | <p>I have these two dataframes:</p>
<pre><code>import pandas as pd
from pandas import Timestamp
df_1 = pd.DataFrame({'id': {0: 'A',
1: 'A',
2: 'B',
3: 'C',
4: 'C'},
'IdOrder': {0: 1, 1: 2, 2: 1, 3: 1, 4: 2},
'TrackDateTime': {0: Timestamp('2020-01-21 23:28:35'),
1: Timestamp('2020-01-28 17:12:15'),
2: Tim... | <python><pandas><numpy> | 2022-12-20 21:37:21 | 1 | 2,081 | Chris |
74,869,070 | 2,653,179 | Python Jinja2: How to add an empty row in a table, which is created from a nested loop | <p>I create a table from 2 for loops, and I'd like to add an empty row when each inner loop is finished.</p>
<p>Do I need to keep track of both outer loop and inner loop for it, like this? Or is there a better way to do it?</p>
<pre><code><table border="1" style="border-collapse:collapse;">
... | <python><jinja2> | 2022-12-20 21:24:54 | 0 | 423 | user2653179 |
74,868,981 | 940,300 | Cannot connect to MongoDB replicaSet cluster | <p>I set up a MongoDB cluster with Docker which uses replicaSet <code>rs0</code>.</p>
<p>Checking the status of the cluster everything seems fine:</p>
<pre><code>{
set: 'rs0',
date: ISODate("2022-12-20T21:00:46.972Z"),
myState: 1,
term: Long("1"),
syncSourceHost: '',
syncSourceId: -1,
... | <python><mongodb><docker> | 2022-12-20 21:14:37 | 1 | 11,490 | Basic Coder |
74,868,876 | 5,212,614 | How can we plot City borders, or County borders, on a Folium Map? | <p>I have some code that generates a nice Heat Map for me. Here is my code.</p>
<pre><code>import folium
from folium.plugins import HeatMap
max_amount = float(df_top20['Total_Minutes'].max())
hmap = folium.Map(location=[35.5, -82.5], zoom_start=7, )
hm_wide = HeatMap(list(zip(df_top20.Latitude.values, df_top20.Longi... | <python><python-3.x><folium> | 2022-12-20 21:02:18 | 1 | 20,492 | ASH |
74,868,814 | 7,829,241 | Conda environment.yml - automatically add environment and extensions to Jupyter | <p>Whenever I install a sample <code>environment.yml</code>, say:</p>
<pre class="lang-yaml prettyprint-override"><code>name: my_env
dependencies:
- python
- numpy
- pip:
- scipy
- ipykernel
- ipywidgets
</code></pre>
<p>that I install by <code>conda env create -f environment.yml</code> I then always ... | <python><pip><jupyter-notebook><anaconda><conda> | 2022-12-20 20:57:26 | 0 | 474 | Zoom |
74,868,767 | 1,098,759 | Is there a way to disable positional arguments given that a flag is true with Python argparse? | <p>I am building a command line tool which should work as follows:</p>
<pre><code>mytool [-h] [-c|--config FILE] [-l|--list] ACTION
positional arguments:
ACTION the action to be performed
optional arguments:
-h, --help show this help message and exit
-v, --version show program'... | <python><argparse> | 2022-12-20 20:52:08 | 2 | 423 | Alexandru N. Onea |
74,868,696 | 10,576,322 | pytest coverage with conditional imports and optional requirements | <p>I got a hint to use optional requirements and conditional import to provide a function that can use pandas or not, depending whether it's available.
See here for reference:<br />
<a href="https://stackoverflow.com/a/74862141/10576322">https://stackoverflow.com/a/74862141/10576322</a></p>
<p>This solution works, but ... | <python><pytest><coverage.py><test-coverage><hatch> | 2022-12-20 20:44:14 | 1 | 426 | FordPrefect |
74,868,664 | 14,425,501 | ResourceExhaustedError only when fine-tuning a EfficientNetV2L in TensorFlow | <p>I am doing a multiclass image classification and this code is working fine, when I put <code>base_model.trainable = False</code>:</p>
<pre><code>file_paths = train['image'].values # train is a pd.DataFrame
labels = train['label'].values
valfile_paths = val['image'].values
vallabels = val['label'].values
ds_train ... | <python><tensorflow><machine-learning><deep-learning> | 2022-12-20 20:40:30 | 1 | 1,933 | Adarsh Wase |
74,868,633 | 1,866,833 | Python format date in jsonfiy output | <p>How to intercept datetime value and make custom format?</p>
<p>Here is how i fetch records and put them in json format:</p>
<pre><code>cursor.execute(sql)
row_headers = [x[0] for x in cursor.description]
json_data = []
for row in cursor.fetchall():
json_data.append(dict(zip(row_headers, row)))
return jsonify(... | <python><flask><jsonify> | 2022-12-20 20:37:06 | 1 | 2,714 | Josef |
74,868,580 | 8,262,535 | conda create environment ResolvePackageNotFound when pip is successful | <p>I am trying to create a conda environment using the following environment.yml file:</p>
<pre><code>conda env create -n med -f environment.yml
</code></pre>
<p>File contents:</p>
<pre><code>name: med
channels:
- defaults
- conda-forge
dependencies:
- python=3.8
- batchgenerators==0.23
- pandas==1.1.5
... | <python><pip><anaconda> | 2022-12-20 20:29:01 | 1 | 385 | illan |
74,868,489 | 14,584,978 | How to extract letters from a string (object) column in pandas dataframe | <p>I am trying to extract letters from a string column in pandas. This is used for identifying the type of data I am looking at.</p>
<p>I want to take a column of:</p>
<blockquote>
<p>GE5000341</p>
<p>R22256544443</p>
<p>PDalirnamm</p>
<p>AAddda</p>
</blockquote>
<p>and create a new column of:</p>
<blockquote>
<p>GE</p... | <python><pandas><string> | 2022-12-20 20:17:41 | 2 | 374 | Isaacnfairplay |
74,868,363 | 11,550,733 | Subclasses fail to instantiate base class variables with super().__init__() when base class inherits from Protocol | <p>Given the following code, I'd expect both <code>a.x</code> and <code>a.y</code> to be declared during instantiation. When class <code>P</code> doesn't inherit from <code>Protocol</code> both assertions pass. In the debugger, it doesn't seem that class <code>P</code>'s constructor is ever being ran. I suspect this ha... | <python><python-typing> | 2022-12-20 20:04:26 | 2 | 902 | Jamie.Sgro |
74,868,286 | 10,309,712 | How do I modify this function to return a 4d array instead of 3d? | <p>I created this function that takes in a <code>dataframe</code> to return an <code>ndarrays</code> of input and label.</p>
<pre class="lang-py prettyprint-override"><code>def transform_to_array(dataframe, chunk_size=100):
grouped = dataframe.groupby('id')
# initialize accumulators
X, y = np.zeros([0... | <python><pandas><dataframe><numpy><numpy-ndarray> | 2022-12-20 19:56:49 | 2 | 4,093 | arilwan |
74,868,270 | 19,797,660 | DataFrame How to vectorize this for loop? | <p>I need help vectorizing this <code>for</code> loop.
i couldn't come up with my own solution.
So the general idea is that I want to calculate the number of bars since the last time the condition was true.<br />
I have DataFrame with initial values <code>0</code> and <code>1</code> where <code>0</code> is the anchor p... | <python><pandas> | 2022-12-20 19:55:03 | 1 | 329 | Jakub Szurlej |
74,868,258 | 80,857 | Batch call to PlaylistItems: insert YouTube API v3 with Google API Python client library produces intermittent HttpError 500 | <p>I'm using the <a href="https://github.com/googleapis/google-api-python-client" rel="nofollow noreferrer">Google API Python client library</a> to run a batch of <a href="https://developers.google.com/youtube/v3/docs/playlistItems/insert" rel="nofollow noreferrer">PlaylistItems: insert</a> calls per the <code>batch</c... | <python><youtube-api><batch-processing> | 2022-12-20 19:53:45 | 0 | 5,324 | Keyslinger |
74,868,056 | 11,693,768 | Making a dataframe where new row is created after every nth column using only semi colons as delimiters | <p>I have the following string in a column within a row in a pandas dataframe. You could just treat it as a string.</p>
<pre><code>;2;613;12;1;Ajc hw EEE;13;.387639;1;EXP;13;2;128;12;1;NNN XX Ajc;13;.208966;1;SGX;13;..
</code></pre>
<p>It goes on like that.</p>
<p>I want to convert it into a table and use the semi colo... | <python><pandas><string><csv><delimiter> | 2022-12-20 19:33:01 | 1 | 5,234 | anarchy |
74,868,004 | 4,918,319 | How to find a complementary parallelogram | <p>On <a href="https://stackoverflow.com/a/8862483/4918319">https://stackoverflow.com/a/8862483/4918319</a>, an algorithm is put forward with which to determine whether a ray in 3-space goes through a given rectangle, if we specify the ray by two vectors (one specifying the origin of the ray and the other its direction... | <python><matlab><geometry><intersection><geometry-surface> | 2022-12-20 19:27:59 | 0 | 728 | Post169 |
74,867,992 | 18,758,062 | Missing Matplotlib Animated Figure in VSCode Jupyter Notebook | <p>I am trying to create a simple <code>matplotlib</code> animation in a Jupyter notebook running inside vscode.</p>
<pre class="lang-py prettyprint-override"><code>%matplotlib notebook
import matplotlib.pyplot as plt
from matplotlib.animation import FuncAnimation
fig, ax = plt.subplots()
line, = ax.plot([]) # A ... | <python><matplotlib><visual-studio-code><jupyter-notebook><matplotlib-animation> | 2022-12-20 19:25:40 | 1 | 1,623 | gameveloster |
74,867,754 | 11,397,243 | ModuleNotFoundError: No module named 'CGI.Util'; 'CGI' is not a package | <p>I am the author of <a href="https://github.com/snoopyjc/pythonizer/" rel="nofollow noreferrer">Pythonizer</a> - a Perl to Python translator and I'm currently trying to translate CGI.pm into Python. The output file is CGI.py. I am getting this error on this import:</p>
<pre><code>perllib.init_package("CGI"... | <python><python-3.x><import><module><package> | 2022-12-20 19:03:47 | 1 | 633 | snoopyjc |
74,867,671 | 1,245,262 | When is the watch() function required in Tensorflow to enable tracking of gradients? | <p>I'm puzzled by the fact that I've seen blocks of code that require tf.GradientTape().watch() to work and blocks that seem to work without it.</p>
<p>For example, this block of code requires the watch() function:</p>
<pre><code> x = tf.ones((2,2)) #Note: In original posting of question,
# I ... | <python><tensorflow> | 2022-12-20 18:54:32 | 2 | 7,555 | user1245262 |
74,867,657 | 12,436,050 | Generating new columns from row values in Python | <p>I have following pandas dataframe (HC_subset_umls)</p>
<pre><code> term code source term_normlz CUI CODE SAB TTY STR
0 B-cell lymphoma meddra:10003899 meddra b-cell lymphoma C0079731 MTHU019696 OMIM PTCS b-cell lymphoma
1 B-cell lymphoma meddra:1000... | <python><pandas> | 2022-12-20 18:53:23 | 1 | 1,495 | rshar |
74,867,493 | 1,928,054 | Setting values in subselection of MultiIndex pandas | <p>Consider the following DataFrame:</p>
<pre><code>import numpy as np
import pandas as pd
arrays1 = [
[
"A",
"A",
"A",
"B",
"B",
"B",
"C",
"C",
"C",
... | <python><pandas> | 2022-12-20 18:35:42 | 2 | 503 | BdB |
74,867,404 | 9,415,280 | How to clean nan in tf.data.Dataset in sequences multivariates inputs for LSTM | <p>I try to feed huge dataset (out of memory) to my lstm model.
I want to make some transformation on my data using the tf.data.Dataset.
I first turn my numpy data to dataset using tf.keras.utils.timeseries_dataset_from_array.
This is an exemple of my data:</p>
<p><a href="https://i.sstatic.net/uKp1K.png" rel="nofollow... | <python><tensorflow><lstm><tf.data.dataset><multivariate-time-series> | 2022-12-20 18:26:43 | 1 | 451 | Jonathan Roy |
74,867,309 | 12,149,817 | Save figure from a for loop in one pdf file in python | <p>I am trying to save scatter plots from a list of dataframes in one pdf file using this:</p>
<pre><code>pdf = matplotlib.backends.backend_pdf.PdfPages("./output.pdf")
for df in list_degs_dfs:
dfplt = df.plot.scatter("DEratio", "MI_scaled")
pdf.savefig(dfplt)
pdf.close()
</code></... | <python><matplotlib> | 2022-12-20 18:17:21 | 1 | 720 | Yulia Kentieva |
74,867,297 | 20,793,070 | Properly groupby and filter with Polars | <p>I have df for my work with 3 main columns: <code>cid1, cid2, cid3</code>, and more 7 columns <code>cid4, cid5, etc</code>.</p>
<p><code>cid1</code> and <code>cid2</code> is <code>int</code>, another columns is <code>float</code>.</p>
<p>Each combitations of <code>cid1</code> and <code>cid2</code> is a workset with s... | <python><dataframe><window-functions><python-polars> | 2022-12-20 18:16:24 | 1 | 433 | Jahspear |
74,867,266 | 12,415,855 | Upload file with ftplib not working and without any error message? | <p>i try to upload an image to my ftp-server using ftplib with the following code -</p>
<pre><code>import ftplib
import os
import sys
ADDR = "68.66.248.00"
USERNAME = "MyUser"
PW = "MyPw"
path = os.path.abspath(os.path.dirname(sys.argv[0]))
fn = os.path.join(path, "test.png")
... | <python><ftp><ftplib> | 2022-12-20 18:13:58 | 1 | 1,515 | Rapid1898 |
74,867,254 | 4,335,168 | How to round 6.25 to 6.3 and 6.24 to 6.2 in Python? | <p>How to round 6.25 to 6.3 and 6.24 to 6.2 in Python?</p>
<p>The 'round' function is rounding 6.25 to 6.2:</p>
<pre><code>mynum = 6.25
print(round(mynum, 1))
</code></pre>
<p>produces 6.2 and I really need it to produce 6.3
It seems to only round up with 6 like 6.26 produces 6.3</p>
<p>Just to be clear: I want 6.25 to... | <python><python-3.x> | 2022-12-20 18:12:34 | 0 | 2,120 | Mattman85208 |
74,867,071 | 10,976,885 | How to get execution date/logical date in PostgresOperator in Airflow? | <p>How do I get access to the execution date in the PostgresOperator in Apache Airflow?</p>
<p>With PythonOperator I get it as below</p>
<pre><code>def fun(context):
print(context["execution_date"])
print(context["logical_date"]) # also the same
task = PythonOperator(
task_id="pyth... | <python><postgresql><airflow><etl><pipeline> | 2022-12-20 17:56:30 | 1 | 851 | Dominik Sajovic |
74,867,013 | 8,260,088 | Getting a list of unique values within a pandas column | <p>Can you please help me with the following issue. Imagine, I have a following df:</p>
<pre><code>data = {
'A':['A1, B2, C', 'A2, A9, C', 'A3', 'A4, Z', 'A5, A1, Z'],
'B':['B1', 'B2', 'B3', 'B4', 'B4'],
}
df = pd.DataFrame(data)
</code></pre>
<p>How can I create a list with unique value that are stored in co... | <python><pandas> | 2022-12-20 17:51:55 | 3 | 875 | Alberto Alvarez |
74,866,946 | 1,524,501 | "ImportError: DLL load failed: %1 is not a valid Win32 application." but both Python and matplotlib are 64 bit | <p>I am trying to run the same code on my new PC (Windows 11). I installed Python 2.7 and matplotlib in both 64 bit but I still get "ImportError: DLL load failed: %1 is not a valid Win32 application."</p>
<p>I know this has been asked many times (e.g., <a href="https://stackoverflow.com/questions/35345434/mat... | <python><python-2.7><matplotlib><64-bit><pywin32> | 2022-12-20 17:46:00 | 0 | 2,111 | owl |
74,866,906 | 3,378,985 | Automatically detect unused code and exclude it from wheel build | <p>I have a large(ish) python library that does a lot of inter-related stuff (training some neural networks, setting up datasets, testing, evaluation, running inference on the networks, etc.). I want to build an extremely lightweight cut-down bare bones wheel package, which would only allow running of the inference and... | <python><dependency-management><python-wheel> | 2022-12-20 17:42:10 | 0 | 446 | BIOStheZerg |
74,866,858 | 3,052,832 | In Pyside6 (Or C++ Qt), how do I set a custom QML style at runtime? | <p>I want to use a custom style for my QML application. I have followed these instructions: <a href="https://doc.qt.io/qt-6/qtquickcontrols2-customize.html#creating-a-custom-style" rel="nofollow noreferrer">https://doc.qt.io/qt-6/qtquickcontrols2-customize.html#creating-a-custom-style</a></p>
<p>I have a directory stru... | <python><qt><qml><pyside><qtquick2> | 2022-12-20 17:37:56 | 2 | 2,054 | Blue7 |
74,866,798 | 4,391,249 | Does the Python built-in library have an incrementable counter? | <p>Is there anything like this in the Python built-in library:</p>
<pre class="lang-py prettyprint-override"><code>class Counter:
def __init__(self, start=0):
self.val = start
def consume(self):
val = self.val
self.val += 1
return val
</code></pre>
<p>I see this as much safer wa... | <python> | 2022-12-20 17:33:15 | 1 | 3,347 | Alexander Soare |
74,866,786 | 6,263,000 | python-oracledb thin client returns DPY-6005 | <p>I'm trying to connect to a 21c ATP and 19c ADP (free tier, ACL enabled/configured with "My Address", TLS enabled (mTLS set to "Not required"), connection string contains "ssl_server_dn_match=yes") using Python's <strong>thin client</strong> but at the point of making a connection or set... | <python><oracle-database><python-oracledb> | 2022-12-20 17:32:18 | 1 | 609 | Babak Tourani |
74,866,740 | 1,073,786 | Python lru_cache nested decorator | <p>I want to basically ignore a dict parameter in a method that want to decorate with <code>functools.lru_cache</code>.</p>
<p>This is the code I have written so far:</p>
<pre class="lang-py prettyprint-override"><code>import functools
class BlackBox:
"""All BlackBoxes are the same.""&quo... | <python><python-3.x><decorator><python-decorators><python-lru-cache> | 2022-12-20 17:28:32 | 1 | 2,184 | Sanandrea |
74,866,638 | 5,510,540 | Numpy array of strings into an array of integers | <p>I have the following array:</p>
<pre><code>pattern = array([['[0, 0, 1, 0, 0]'],
['[0, 1, 1, 1, 1]'],
['[0, 1, 1, 1, 0]'],
['[0, 0, 1, 1, 1]'],
['[0, 0, 0, 1, 1]'],
['[0, 0, 1, 0, 1]'],
['[0, 0, 0, 0, 1]'],
['[1, 0, 1, 0, 0]'],
['[0, 1, 0, 1, 1]'],
['[0,... | <python><arrays><string><numpy> | 2022-12-20 17:19:52 | 1 | 1,642 | Economist_Ayahuasca |
74,866,582 | 11,036,109 | Selenium, how to locate and click a particular button | <p>I'm using selenium to try and scrape a listing of products in this website:
<a href="https://www.zonacriativa.com.br/harry-potter" rel="nofollow noreferrer">https://www.zonacriativa.com.br/harry-potter</a></p>
<p>However, I'm having trouble getting the full listing of products. the page list 116 products, yet only a... | <python><selenium><selenium-webdriver><xpath><scroll> | 2022-12-20 17:14:39 | 2 | 411 | Alain |
74,866,244 | 9,770,831 | Try to return list of bills | <p>New to fast API, not able to find where I am doing wrong</p>
<p>Here is my router -</p>
<pre><code>@router.get('/{user_id}/salesbill', response_model=list[schemas.ShowSalesBill], status_code=status.HTTP_200_OK)
def get_all_salesbills(user_id: int, db: Session = Depends(get_db)):
objs = db.query(bill_model.SalesB... | <python><sqlalchemy><model><fastapi><pydantic> | 2022-12-20 16:44:10 | 1 | 657 | mdhv_kothari |
74,866,235 | 7,437,143 | Importing/re-using test files from another module in a pip package? | <h2>Context</h2>
<p>As part of a pip package, I wrote a test which I would like to partially re-use for different configurations. (A single configuration takes +- 15 minutes (on my device), so ideally I would like to be able to test them separately, instead of sequentially in a single test). However, for the pip packag... | <python><pip><init><directory-structure> | 2022-12-20 16:43:23 | 1 | 2,887 | a.t. |
74,866,193 | 730,285 | How do I keep scipy's loadmat() from implicitly converting complex data types into reals while keeping the original data types? | <p>Using SciPy 1.9.3 in Python 3.11.1, I am attempting to load data from a MATLAB <code>mat</code> file, which contains a couple matrices with complex doubles. When I execute <code>scipi.io.loadmat(filename, matlab_compatible=True)</code>, I get the following warning message:</p>
<pre><code>ComplexWarning: Casting com... | <python><scipy> | 2022-12-20 16:40:38 | 0 | 2,070 | seairth |
74,865,977 | 499,721 | Wrong result when comparing ref and WeakMethod in Python? | <p>I'm using a <code>set</code> to hold weak references to callables. These can be functions, callable instances (i.e. using the <code>__call__</code> method), and bound methods. Following the <a href="https://docs.python.org/3/library/weakref.html#module-weakref" rel="nofollow noreferrer">docs</a>, I'm using <code>wea... | <python><weak-references> | 2022-12-20 16:20:38 | 2 | 11,117 | bavaza |
74,865,894 | 7,581,507 | Pandas rolling average that takes missing points into account | <p>I would like to calculate a moving average on a dataframe that contains missing "points"</p>
<p>For the following example, we can see that the period of <code>09:00:02</code> has an average of <code>1.0</code>, where i would expect it to have the value of <code>0.5</code> because i would like to treat miss... | <python><pandas><moving-average> | 2022-12-20 16:13:24 | 0 | 1,686 | Alonme |
74,865,883 | 453,673 | How to use the settings package's `--settings` when using ArgParse? | <p><strong>Background:</strong><br />
Python has a <code>simple_settings</code> [package][1] which allows easy import of program settings from an external file. A program someone wrote, used to supply the settings to the program from the commandline as <code>python prog.py --settings=someFolder.settings</code>, and the... | <python><python-3.x><command-line-arguments><argparse> | 2022-12-20 16:12:34 | 2 | 20,826 | Nav |
74,865,755 | 4,019,495 | Why is the first expression interpreted as an int, and the second as a string? | <p>Using PyYaml</p>
<pre class="lang-py prettyprint-override"><code>import yaml
yaml.full_load(StringIO('a: 16:00:00'))
# {'a': 57600}
yaml.full_load(StringIO('a: 09:31:00'))
# {'a': '09:31:00'}
</code></pre>
<p>Why is there a difference in those behaviors?</p>
| <python><yaml><pyyaml> | 2022-12-20 16:00:56 | 2 | 835 | extremeaxe5 |
74,865,570 | 4,343,563 | Recombining chunked data in Python not working properly? | <p>I have a file that is 1.1GB. I need to transfer it to a s3 bucket in a different AWS environment. Due to permission restrictions that can't be changed, I can't use aws s3 cp to move the file or just upload it in s3. My only option is a code pipeline that can only upload files of 25MB or less. So, I split the file in... | <python><chunks> | 2022-12-20 15:45:00 | 1 | 700 | mjoy |
74,865,438 | 4,576,519 | How to get a flattened view of PyTorch model parameters? | <p>I want to have a flattened view of the parameters belonging to my Pytorch model. Note it should be a <strong>view</strong> and not a copy of the parameters. In other words, when I modify the parameters in the view it should also modify the model parameter. I can get the model parameters as follows:</p>
<pre class="l... | <python><memory><parameters><pytorch><neural-network> | 2022-12-20 15:33:44 | 1 | 6,829 | Thomas Wagenaar |
74,865,427 | 6,534,180 | Cannot import script functions from another script | <p>I've the following hierarchy:</p>
<pre><code>.root
/program/main.py
/functions/myfunctions.py
</code></pre>
<p>And using my main.py I want to use the functions present in myfunctions.py script. For that I've defined my <strong>PYTHONPATH</strong> AS ./root/functions and I have this as the import on my script:</p... | <python><python-import> | 2022-12-20 15:32:50 | 2 | 1,054 | Pedro Alves |
74,865,406 | 6,919,582 | Reading complete metadata from images in Python | <p>I want to read the full list of metadata from images (e.g. jpg) as it is provided for example by ExifTool by Phil Harvey. I cannot use this command line tool and its Python wrapper exiftool due to security restrictions. Unfortunately other Python packages such as PIL only provide a fraction of the available metadata... | <python><image><metadata> | 2022-12-20 15:31:30 | 2 | 675 | MikeHuber |
74,865,368 | 12,666,814 | KL Divergence loss Equation | <p>I had a quick question regarding the KL divergence loss as while I'm researching I have seen numerous different implementations. The two most commmon are these two. However, while look at the mathematical equation, I'm not sure if mean should be included.</p>
<pre><code>KL_loss = -0.5 * torch.sum(1 + torch.log(sigma... | <python><machine-learning><pytorch> | 2022-12-20 15:28:39 | 1 | 577 | AliY |
74,865,226 | 7,800,760 | networkX DiGraph: list all neighbouring nodes disregarding edge direction | <p>Is there a better way to obtain the list of nodes that connect to a given one in a directed graph via a single edge (whether inbound or outbound)?</p>
<p>Here is what I came up with. First I build and draw a demo DiGraph:</p>
<pre><code>import networkx as nx
G = nx.DiGraph()
G.add_edges_from([
('A','B'),
('B... | <python><networkx> | 2022-12-20 15:17:21 | 2 | 1,231 | Robert Alexander |
74,865,185 | 10,062,025 | Why Scraping a mobile url link using requests does not return all value? | <p>I am trying to scrape this mobile link <a href="https://www.tokopedia.com/now/sumo-beras-putih-kemasan-merah-5-kg" rel="nofollow noreferrer">https://www.tokopedia.com/now/sumo-beras-putih-kemasan-merah-5-kg</a> using a simple requests. That can only be open in app on mobile phone on tokopedia only.</p>
<p>It should ... | <python><python-requests> | 2022-12-20 15:13:43 | 1 | 333 | Hal |
74,865,101 | 9,274,940 | convert plotly figure to image and then use this image as normal PNG | <p>I'm trying to convert a plotly express figure to image, then use this image to save it on a power point slide. This is my code:</p>
<pre><code>import plotly.express as px
import plotly.io as pio
from pptx import Presentation
wide_df = px.data.medals_wide()
fig = px.bar(wide_df, x="nation", y=["gold... | <python><plotly><powerpoint> | 2022-12-20 15:07:31 | 1 | 551 | Tonino Fernandez |
74,865,069 | 10,557,442 | How to run in parallel several docker services on a docker-compose file and then check for the global status code? | <p>I need to test a python application on different environments (different python versions, different pip packages) with pytest. For that, I created a Dockerfile which accepts different build arguments, and fill those args from a docker compose template, like this:</p>
<pre><code>version: '3.9'
services:
python37:
... | <python><docker><docker-compose><continuous-integration><health-check> | 2022-12-20 15:04:56 | 0 | 544 | Dani |
74,864,992 | 14,729,820 | How to handle txt file using pandas and save it is results | <p>I have this input txt file that contains (image_name, other meta data not needed, and last column tokens separated by | character )
example of input: <strong>input.txt</strong></p>
<pre><code>a01-000u-00 ok 154 19 408 746 1661 89 A|MOVE|to|stop|Mr.|Gaitskell|from
a01-000u-01 ok 156 19 395 932 1850 105 nominating|any... | <python><pandas><dataframe><text><pytorch> | 2022-12-20 14:59:17 | 2 | 366 | Mohammed |
74,864,929 | 739,619 | Number of replacements performed by str.replace | <p>I'd have expected to find at least a question on this subject, instead... nothing.</p>
<p>I am writing a script for the smart patching of a project, so I have a dictionary where keys are file paths and values are lists of tuples, and each tuple is an original/replacement pair. I loop on files, slurp each file, apply... | <python><python-3.x> | 2022-12-20 14:53:37 | 0 | 533 | Francesco Marchetti-Stasi |
74,864,895 | 867,889 | A pythonic way to init inherited dataclass from an object of parent type | <p>Given a dataclass structure:</p>
<pre><code>@dataclass
class RichParent:
many_fields: int = 1
more_fields: bool = False
class Child(RichParent):
some_extra: bool = False
def __init__(seed: RichParent):
# how to init more_fields and more_fields fields here without referencing them directly?
... | <python><initialization><python-dataclasses> | 2022-12-20 14:51:22 | 1 | 10,083 | y.selivonchyk |
74,864,878 | 17,903,744 | Is there a way to make a "oscilloscope styled" double cursor delta while plotting in matplotlib? | <p>I was looking for more information about whether or not it was possible to make a "oscilloscope styled" double cursor delta (like the example below) while plotting with <code>matplotlib</code>?</p>
<p><a href="https://i.sstatic.net/A3IwM.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/A3IwM.... | <python><matplotlib> | 2022-12-20 14:50:14 | 1 | 345 | Guillaume G |
74,864,809 | 148,298 | Is it possible to debug python code running under an embedded interpreter without attaching it to its PID? | <p>I'm debugging a script running in embedded interpreter hosted in an application from VS Code using PDB. Constantly launching the host and selecting its process ID from a dialog is a bit cumbersome. Sometimes its windows hide behind the IDE, which upsets my window placements in order to bring it to the foreground. Th... | <python><vscode-debugger><pdb> | 2022-12-20 14:45:29 | 1 | 9,638 | ATL_DEV |
74,864,680 | 5,740,397 | Plotly: refresh data passed to px.line via dropdown from Database | <p>I want to use the plotly express lineplot to create a simple interactive plot that refreshes its data when choosing a new item in a dropdown box.</p>
<p>I have created a simple function <code>prepare_dashboard_data</code> which loads data from a database and does some filtering. The dashboard is showing the data fro... | <python><plotly><dashboard><reload><interactive> | 2022-12-20 14:34:58 | 1 | 565 | NorrinRadd |
74,864,621 | 7,791,963 | When writing in Python a dictionary to a YAML file, how to make sure the string in the YAML file is split based on '\n'? | <p>I have a long string in a dictionary which I will dump to a YAML file.</p>
<p>As an example</p>
<pre><code>d = {'test': {'long_string':'this is a long string that does not succesfully split when it sees the character '\n' which is an issue'}}
ff = open('./test.yaml', 'w+')
yaml.safe_dump(d, ff)
</code></pre>
<p>Whic... | <python><yaml> | 2022-12-20 14:30:53 | 1 | 697 | Kspr |
74,864,501 | 4,879,688 | How can I get PID(s) of a running Jupyter notebook? | <p>I have run several (<code>n</code>) Jupyter notebooks in parallel. As they use FEniCS, each has spawned a number (much more than <code>m - 1</code>) of threads (PIDs) which can occupy all available cores (<code>m</code>). Now I have much more than <code>m * n</code> threads (of at least <code>n</code> processes) w... | <python><linux><jupyter-notebook><process><fenics> | 2022-12-20 14:21:13 | 0 | 2,742 | abukaj |
74,864,419 | 11,687,381 | Failed building wheel for scikit-image | <p>I'm trying to install scikit-image library. As mentioned in official docs I'm running the command:</p>
<pre><code>python -m pip install -U scikit-image
</code></pre>
<p>What I have already:</p>
<ol>
<li>I have a virtual environment created for my project named env</li>
<li>I have numpy installed in my virtualenv</l... | <python><numpy><scikit-image> | 2022-12-20 14:15:31 | 1 | 609 | Apoorv pandey |
74,864,265 | 13,505,957 | Selenium can't detect text in html from Google Maps | <p>I am trying to scrape travel times between two points from Google Maps:
<a href="https://i.sstatic.net/Q8yt1.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/Q8yt1.png" alt="enter image description here" /></a></p>
<p>I have used inspect to find the XPath of the travel time in the HTML file:
<a href="h... | <python><selenium><web-scraping><xpath><webdriverwait> | 2022-12-20 14:03:43 | 1 | 1,107 | ali bakhtiari |
74,864,234 | 18,432,809 | how create a python service, executed when needed | <p>I want to create a notification service, that will be used in diferent applications. But I would run it only sometimes. How I achieve this? I will try to use webhooks, informing my service to notify something</p>
<p>basically, I don't keep my service running. I would deploy this in heroku, and heroku sleeps my app w... | <python><service><webhooks> | 2022-12-20 14:01:03 | 1 | 389 | vitxr |
74,864,198 | 10,748,412 | Django - Get all Columns from Both tables | <p>models.py</p>
<pre><code>from django.db import models
class DepartmentModel(models.Model):
DeptID = models.AutoField(primary_key=True)
DeptName = models.CharField(max_length=100)
def __str__(self):
return self.DeptName
class Meta:
verbose_name = 'Department Table'
class EmployeeMo... | <python><django><django-rest-framework><orm> | 2022-12-20 13:57:16 | 1 | 365 | ReaL_HyDRA |
74,864,195 | 3,214,538 | How do I create relationships across different schemas in SQLAlchemy ORM? | <p>I'm writing a Python application for an existing MySQL database ecosystem with tables spread across multiple schemas that I can't change without breaking a lot of legacy code (i.e. it's not an option). With my previous approach (see below) I was able to address all tables regardless of their schema so it didn't matt... | <python><sqlalchemy><orm> | 2022-12-20 13:57:02 | 1 | 443 | Midnight |
74,864,096 | 5,110,870 | Arcgis & Python: Azure YAML pipeline fails with "Command 'krb5-config --libs gssapi' returned non-zero exit status 127." | <p>I am deploying my Python code to an Azure Function with Python runtime 3.9, using the following yaml pipeline:</p>
<pre class="lang-yaml prettyprint-override"><code>trigger:
branches:
include:
- dev
- test
- uat
- prod
pool:
vmImage: ubuntu-latest
stages:
- stage: Build
displayN... | <python><azure><arcgis><azure-pipelines-yaml><gssapi> | 2022-12-20 13:49:21 | 1 | 7,979 | FaCoffee |
74,864,059 | 517,752 | Greengrass V2 generates extra `stdout` logs | <p>I deploy greengrass components into my EC2 instance. The deploy greengrass components have been generating logs which wraps around my python log.</p>
<p>what is causing the "wrapping" around it? how can I remove these wraps.</p>
<p>For example, the logs in <strong>bold</strong> are wraps the original pytho... | <python><amazon-web-services><logging><python-logging><aws-iot-greengrass> | 2022-12-20 13:46:50 | 1 | 1,342 | Pankesh Patel |
74,863,976 | 10,792,871 | Removing _x000D_ from Text Records in Pandas Dataframe | <p>I have a Pandas data frame that I imported from an Excel file. One of the columns looks like the following:</p>
<pre><code>Link
=========
A-324
A-76_x000D_\nA-676
A-95
A-95_x00D_n\nA-495
...
</code></pre>
<p>I was able to use regex to remove the <code>\n</code> characters, but I am unable to remove <code>_x000D_</co... | <python><python-3.x><excel><pandas><data-cleaning> | 2022-12-20 13:41:01 | 4 | 724 | 324 |
74,863,925 | 15,376,262 | Check if a value exists per group and remove groups without this value in a pandas df | <p>I have a pandas df that looks like this:</p>
<pre><code>import pandas as pd
d = {'value1': [1, 1, 1, 2, 3, 3, 4, 4, 4, 4], 'value2': ['A', 'B', 'C', 'C', 'A', 'B', 'B', 'A', 'A', 'B']}
df = pd.DataFrame(data=d)
df
</code></pre>
<p>Per group in column <code>value1</code> I would like to check if that group contains a... | <python><pandas><dataframe> | 2022-12-20 13:36:08 | 2 | 479 | sampeterson |
74,863,858 | 12,695,210 | pytest capture logging from function | <p>For some reason I am unable to obtain the logs genereated in a tested function when using pytest. I've had a read around for all the usual solutions but am stumped, feel like am missing something obvious. Any advice would be much appreciated:</p>
<p>minimum reproducable example:</p>
<pre><code>import logging
def fu... | <python><logging><pytest><python-logging> | 2022-12-20 13:29:29 | 0 | 695 | Joseph |
74,863,813 | 15,076,691 | Regex splitting with multiple end brackets | <p>I have an input of <code>10+sqrt(10+(100*20)+20)+sqrt(5)</code> which I need to be able to split up into <code>sqrt(...)</code> as many times as <code>sqrt</code> appears (in this instance, twice). The problem I am having is trying to split this up, I have tried on my own and come up with this <code>(sqrt\()(?<=s... | <python><list> | 2022-12-20 13:25:27 | 1 | 315 | Hunter |
74,863,748 | 16,389,095 | Kivy md tabs: how to add tooltips | <p>I'm trying to develop an interface in Python / Kivy Md. The container Box Layout should include three widgets: tabs, a label and a button. I would like to add a tooltip for each tab. The tooltip should be displayed when the mouse moves on the tab. I added the tooltip in my code, but this is displayed only when the m... | <python><kivy><kivy-language><kivymd> | 2022-12-20 13:20:20 | 1 | 421 | eljamba |
74,863,582 | 8,849,755 | Whittaker–Shannon (sinc) interpolation in Python | <p>I am using <a href="https://docs.scipy.org/doc/scipy/reference/generated/scipy.interpolate.interp1d.html#scipy.interpolate.interp1d" rel="nofollow noreferrer"><code>interp1d</code></a> from Scipy to interpolate a function with <code>linear</code> interpolation. Now I need to upgrade to <a href="https://en.wikipedia.... | <python><interpolation> | 2022-12-20 13:06:39 | 2 | 3,245 | user171780 |
74,863,409 | 10,024,802 | Pyqt5 window open in secondary display | <p>I have below code to open pyqt5 in secondary display although <code>print</code> gives secondary screen resolution, but opening in first display where is my fault?</p>
<pre><code>a = QApplication(sys.argv)
w = App()
# screen_count = a.desktop().screenCount()
screen_resolution = a.desktop().screenGeometry(1)
window_... | <python><python-3.x><pyqt5> | 2022-12-20 12:54:54 | 1 | 566 | CKocar |
74,863,300 | 20,051,041 | How to strip html elements from string in nested list, Python | <p>I decided to use BeautifulSoup for extracting string integers from Pandas column. BeautifulSoup works well applied on a simple example, however, does not work for a list column in Pandas. I cannot find any mistake. Can you help?</p>
<p>Input:</p>
<pre><code>df = pd.DataFrame({
"col1":[["<span s... | <python><html><pandas><beautifulsoup><xml-parsing> | 2022-12-20 12:44:57 | 2 | 580 | Mr.Slow |
74,863,090 | 5,449,789 | Should you normalizing a dataset per label, or across the range of entire dataset at once? | <p>So I'm looking to train a CNN model in Keras. The labels (Y) in my dataset are of shape (1080, 1920, 2). The values themselves however are quite large. Ranging from floating point numbers up to 80,000.</p>
<p>To smooth out the training process I want to normalize each label (array) using the following code where y i... | <python><numpy><dataset> | 2022-12-20 12:26:55 | 0 | 461 | junfanbl |
74,863,017 | 10,024,802 | How can I open virtual keyboard | <p>How can I open the virtual keyboard when I click spesific QlineEdit area ?</p>
<p>I am using below codes but I've error how can I do this correctly:</p>
<pre><code>self.phoneUi.phoneNumber.focusInEvent = self.show_keyboard
def show_keyboard(self, event):
input_method = QInputMethod.queryFocusObject()
input_m... | <python><pyqt5> | 2022-12-20 12:19:44 | 0 | 566 | CKocar |
74,862,986 | 4,869,005 | First and last element in numpy array comes as NaN while reading with genfromtxt | <p>My csv file looks like this <a href="https://extendsclass.com/csv-editor.html#ef4a190" rel="nofollow noreferrer">https://extendsclass.com/csv-editor.html#ef4a190</a></p>
<pre><code>from numpy import genfromtxt
my_data = genfromtxt('2857_54065_N.csv', encoding=None, delimiter=',')
my_data
</code></pre>
<p>Which gives... | <python><numpy> | 2022-12-20 12:17:47 | 1 | 2,257 | user2129623 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.