Quantcast
Browsing all 14097 articles
Browse latest View live

Python itertools.product challenge

Given a dictionary like this with some items being tuples...params = {'a': 'static','b': (1, 2),'c': ('X', 'Y')}I need the "product" of the tuples being expanded like this...[{'a': 'static','b': 1,...

View Article


I have problem i cannot solve the python grouping problem

How to write a code in Python language according to the following instructions:Int values will be received from the user. When the user enters the value 0, the value retrieval process will be...

View Article


Read analog Temperature raspberry python2.7

The conversion formula does not work as expected(21.6 Celsius degree in the room but will return another value of 34 or more depending on the formula used).I use a KY-013 temperature sensor and the...

View Article

execute Python script in SQL Server Machine Learning Services

I have a Python script which returns a SQL command. I want to execute the SQL command in sql transact, can you help me?Example of code:DECLARE @script NVARCHAR(MAX) = N'set @x1 = "SELECT * FROM...

View Article

Using python's subprocess to run shell commands on a remote system over ssh,...

I've got a somewhat unique situation that I cannot find a good answer for, but I do find ones that are very close.I've got password-less ssh access to remote hosts that I administer, when I need to run...

View Article


Assistance formatting and solving a very large system of equations problem

This is a real world problem that has been solved in the past via thousands of manual iterations.Please forgive my inexperience with stackoverflow and with how to format my question. Dave, I believe...

View Article

How to increase the width of hidden linear layers in Mistral 7B model?

After installing!pip install -U bitsandbytes!pip install -U transformers!pip install -U peft!pip install -U accelerate!pip install -U trlAnd then some boilerplates to load the Mistral model:from...

View Article

Batched tensor creation inside torch.vmap

I want to create a tensor with torch.zeros based on the shape of an input to the function. Then I want to vectorize the function with torch.vmap.Something like this:poly_batched = torch.tensor([[1, 2,...

View Article


Image may be NSFW.
Clik here to view.

Change linear dimension output using ezdxf from decimal inches to architectural

Currently all my dimensions output in decimal inches. I would like to change the output to architectural but have been unable to do so. I found in the documentation that there is a 'dimlunits' and...

View Article


Extracting comments/annotations from PDF sequentially - Python

I am trying to extract comments from a PDF using Python. These are the two pieces of code that I have tested:One using PyPDF2:import PyPDF2src = 'xxxx.pdf'input1 = PyPDF2.PdfFileReader(open(src,...

View Article

pylatex: how to apply {\centering } around graphics and or text?

I am trying to create the following (type of) code with PyLatex:{ \centering \includegraphics{image.png} \includegraphics{image.png}}I am not able to 'group' the \centering command with the curly...

View Article

What's the quickest way to perform convolution in multiple images stored in...

I would like to automate a process I usually do on videos, instead of following the steps on a video editor to do that every time. For example I would like to sharpen a video with my own custom...

View Article

QGIS Atlas Python script produces corrupt PDFs because it crashes mid export

My Python script freezes in the middle of execution when trying to export a QGIS layer as a PDF with a page per feature. It gets to the following line, and then the script simply crashes:result =...

View Article


404 Error with ui.tags.video in shiny for python

This is so simple, I can't figure what could be wrong. I have a python file and a file named test.mp4 in the same directory, and am running the script from the same directory. Never-the-less, the line...

View Article

Inserting pandas dataframe with float values into Oracle

I can insert normal values like integer, string into Oracle from pandas data frame but when I try float type values , sqlalchemy gives below errorssqlalchemy.exc.ArgumentError: Oracle FLOAT types use...

View Article


Usage of 'learning_phase' in keras for tensorflow backend?

I am trying to train a resnet network using keras backend in tensorflow. The feed dictionary for each batch update is written as: feed_dict= {x:X_train[indices[start:end]],...

View Article

Sending a video from the backend to the frontend then playing it with flask &...

After sending the video from the flask app to the front-end and trying to set the blob into a playable URL from the frontend it doesn't seem to accept the blob as a video...

View Article


Merge small parquet files into a single large parquet file

I have been trying to merge small parquet files each with 10 k rows and for each set the number of small files will be 60-100. So resulting into around 600k rows minimum in the merged parquet file.I...

View Article

pyenv appends .zshrc file with spam at every `source`

I am trying to setup python 3.7.3 to be my default python.I am following this guide https://opensource.com/article/19/5/python-3-default-mac undre the chapter What we should do at the bottom of the...

View Article

Python opentelemetry events in Application Insights

I'm following the guides below trying to setup logging in Azure Application Insights for my django...

View Article
Browsing all 14097 articles
Browse latest View live