Skip to main content
The 2024 Developer Survey results are live! See the results

Questions tagged [python]

Python is a dynamically typed, multi-purpose programming language. It is designed to be quick to learn, understand, and use, and enforces a clean and uniform syntax. Note that Python 2 reached end-of-life on January 1st, 2020. For version-specific Python questions, add the version tag (e.g. [python-3.x] or [python-3.9]). When using a Python variant (e.g. Jython, PyPy) or library (e.g. Pandas, NumPy), please include it in the tags.

641,783 questions with no upvoted or accepted answers
29 votes
2 answers
2k views

Graph optimizations on a tensorflow serveable created using tf.Estimator

Context: I have a simple classifier based on tf.estimator.DNNClassifier that takes text and output probabilities over an intent tags. I am able to train an export the model to a serveable as well as ...
o-90's user avatar
  • 17.5k
23 votes
1 answer
2k views

xgboost.plot_tree: binary feature interpretation

I've built an XGBoost model and seek to examine the individual estimators. For reference, this was a binary classification task with discrete and continuous input features. The input feature matrix is ...
boot-scootin's user avatar
  • 12.4k
21 votes
6 answers
2k views

How to configure VS Code's Integrated Terminal to use the correct Python Interpreter

TL;DR This question is NOT asking how to select a Python Interpreter to run, or debug, code with, furthermore; this question is NOT asking anything in regard to Virtual Environment, or how to activate ...
Mark Kortink's user avatar
  • 2,030
20 votes
0 answers
3k views

Resolving differences between Keras and scikit-learn for simple fully-connected neural network

I have built a fully-connected neural network in both scikit-learn (v 0.20.0) and Keras (v 2.2.4) with TensorFlow backend (v 1.12.0). There are 10 units in the single hidden layer. In both cases I ...
Finncent Price's user avatar
20 votes
2 answers
3k views

FastCGI, Lighttpd, and Flask

I'm setting up a simple web server on my Raspberry Pi and I can't seem to set up lighttpd, fastcgi, and flask correctly. By now, I've gone through a few iterations of /etc/lighttpd/lighttpd.conf, the ...
user1610406's user avatar
20 votes
3 answers
10k views

Nested cross-validation example on Scikit-learn

I'm trying to work my head around the example of Nested vs. Non-Nested CV in Sklearn. I checked multiple answers but I am still confused on the example. To my knowledge, a nested CV aims to use a ...
NCL's user avatar
  • 415
19 votes
0 answers
2k views

Create a QEMU Bridge Using the Socket Networking Backend

I am trying to create a bridge to an interface in my host, much like the Virtualbox's and VMWare's bridge adapters, in QEMU, using a combination of socket networking and a Python library called Scapy (...
falhumai96's user avatar
19 votes
1 answer
1k views

Mutation for nested object

I'm trying to implement GraphQL mutation for a "complex" object. Let's say we have a Contact with three fields: firstName, lastName and address, which is object with one field street: Here ...
Pavel Reznikov's user avatar
18 votes
1 answer
16k views

Connect to sql server from linux environment using putty private key, sqlalchemy and pyodbc

Hi I am trying to read a dataframe from sql server from a linux(ubuntu server). The file(gscm.ppk) has the admin keys in it I have used the following format to connect to sql server: import urllib....
nsk's user avatar
  • 191
18 votes
6 answers
16k views

Install from pipfile using pipenv install gives error

I have a project where I'm trying to install from the pipfile using pipenv install. I get som error when installing. Before i describe the error, this is what I did: Reinstall pipenv Reinstall Python ...
BluePrint's user avatar
  • 2,088
18 votes
0 answers
1k views

robobrowser won't change cookies

I have a POST request sent to server from robobrowser, and the server responds with no data. The response headers are as follows (this is the response from Chrome browser and it's the way it supposed ...
ikel's user avatar
  • 1,918
18 votes
1 answer
2k views

Saving multiple images in MayaVi

I want to render around 500 images and save them to different png files, therefore I wrote a small class which contains my dataset and a renderfunction from mayavi import mlab mlab.options.offscreen=...
jrsm's user avatar
  • 1,685
18 votes
5 answers
10k views

How to print value of tensorflow.python.framework.ops.Tensor in Tensorflow 2.0?

I have a few tensors in my code and and need to get the values of those tensors. This is one them. How to print the values of tensor OA? Input:OA Output: <tf.Tensor 'Sum_1:0' shape=(1, 600) dtype=...
Raghu's user avatar
  • 457
17 votes
0 answers
6k views

Reprojecting .tiff file with rasterio: CRSError: The WKT could not be parsed. OGR Error code 6

I am trying to re-projected a .tiff file to EPSG:32638 with the following code. Versions I have installed: Rasterio version 1.1.5 Numpy version 1.18.1 This is the code I am using:https://rasterio....
ecd's user avatar
  • 305
17 votes
0 answers
2k views

How to test rollbacks in SQLAlchemy

I have a problem with test isolation when testing a logic, that involves a transaction rollback in SQLAlchemy. Model: class Product(db.Model): id = db.Column(db.Integer, primary_key=True) ...
Stranger6667's user avatar

15 30 50 per page
1
2 3 4 5
42786