Category "python"

Flask CSS Error after pressing submit button

I have a flask web that makes prediction and returns it. The index page is rendered, the model receives data and makes a prediction and shows it correctly. But

SAM-local fails to start API with multiple stacks

I want to add resources to my root stack and somehow found a function where I can first get stack first like this my_api = RestApi.from_rest_api_attributes(

How to import a .sql file into DuckDB database?

I'm exploring DuckDB for one of my project. Here I have a sample Database file downloaded from https://www.wiley.com/en-us/SQL+for+Data+Scientists%3A+A+Beginner

Pre-release version number in mixed python/rust project with maturin

I am working on a mixed Rust/Python project being build with maturin. I am having trouble figuring out how I can specify a pre-release version that can than be

columnwise extended attributes in python for use in SAS

I have a requirement to create extended attributes (XATTR) on columns in the python data frame. Reason: I need to import this dataset from python into SAS where

Pandas - Key Exception - Length mismatch: Some times Expected axis has 3 elements, Some times has 2 elemnts

I have built a script to update stock values from yahoo finance with pandas. Sometimes the script works fine, but at some point it gets an error: Key Exception

How to get VScode Integrated Terminal Virtual Environment working?

I have completed a few courses online in Python and recently started a new course in Django. Previously I always used a virtual environment but would activate t

how to fix anaconda driver issue?

libGL error: MESA-LOADER: failed to open radeonsi: /home/moritz/anaconda3/lib/python3.9/site-packages/matplotlib/../../../libstdc++.so.6: version `GLIBCXX_3

Reading HDF files and Converting them into Binary in Bash/Mac command line [closed]

I am having trouble downloading hdf files from a directory in an ssh server and opening with HDFView 3.0 on Mac. I used the sftp to connect to

PyCups Failed building wheel for pycups on Raspberry Pi

I'm trying to install pycups on my raspberry pi running Python 2.7.16 and pip version 18.1. I'm trying to install with the following command: sudo pip install p

Polynomial Expansion without sklearn

I want to try and recreate this functions from scratch (without using sklearn): # The matrix is M which is 1000x10 matrix. from sklearn.preprocessing import Po

How to use memray with Gunicorn and Django?

I have a project with Django and I did a multiread with Gunicorn. but my project has a memory leak. I want to monitor memory with "memray" but I don't know how

how to create a list of pdf page numbers if pdf page contains specific text strings using python

I am trying to extract PDF page numbers if the page contains certain strings, and then append the selected page numbers to a list. For example, page 2, 254, 439

How to use custom function with tensorflow dataset API?

I am new to TensorFlow's tf.data.Dataset and I am trying to use it on my data that I loaded with pandas dataframe as follows: Load the input date (df_input):

Unable to Request from Twitter Ads Api using OAuth in Python

I am stuck on a issue with Twitter-ads-api. I have completed the authorization and got the oauth-verifier token, but after this I am stuck on how to request for

Looking a pythonic way to add many formulas that change coordinates in a spreadsheet

I am creating a spreadsheet with python I want to add the following formula in the cells from D6 to P6. For example for D6, the formula should be =AVERAGE(D3:D5

Python subprocess line 1420 FileNotFoundError: [WinError 2] The system cannot find the file specified. Jupyter-Matlab notebook

I want to use Jupyter-matlab notebooks. I've downloaded Anaconda navigator and followed the steps from this web: http://jmlilly.net/jupyter-matlab Unfortunately

Filtering out rows in multidimensional numpy arrays

Let's say that I have an array like this: array([[ 1, 2], [-1, -2], [ 0, 0], [-1, 2], [ 2, -1]]) I want to filter out all rows t

Looping problem Elden ring runes per level calculation

This code is currently showing the total amount needed to reach the next level, but what I would like it to do is show the complete total amount so for example

How can I get the current text size in graphics.py

In Python graphics.py you can use the function setSize() to set the font size. How can you read the current font size of an object? What is the default font si