Category "python"

Sympy Inverse a function: y = ax+b into x = (y-b)/a

This should be easy, and hopefully doable in Sympy. I have a function: Y = 0.05*X + 0.15, which I define using Sympy: from sympy import * Y = 0.05*X + 0.15 How

Does Plotly similar function like matplotlib fill_between

I am converting some matplotlib code to Plotly. Does Plotly have something similar to matplotlib fill_between Code to convert # ax.fill_between(fcst_t, fc

Apply Swap Operation at Most Once to get a Strictly Increasing Sequence

I am doing some of these DS&A questions on various sites online for practice and I ran into this one: Given an array of non-negative integers numbers,

pymsteams. I need to mention a person in message sent by pymsteams. How to do it?

I have installed and connected pymsteams to a channel and able to send messages. I read documentation but didn't find anything related to how to send message wi

Matplotlib quiver: axis lim, legend and color

I'm trying to represent a reference system (triad) or simply three unitary vectors in a matplotib-generated figure in Python. I'm using the following code based

How to attach or get filenames from MapDataset from image_dataset_from_directory() in Keras?

I am training convolutional autoencoder and I have this code for loading data (images): train_ds = tf.keras.preprocessing.image_dataset_from_directory( 'pat

Get previous package versions with conda

Given a specific package name when I run conda list my-package-name I get its current version. What's a simple way / command to get instead the history of the p

Will y_train change during training in keras?

I am trying to write a custom metric in keras like this: def C_index1(E,T): T = T.reshape(len(T),1) T_ind = T > T.T E_ind = E.reshape(len(E),1) E_ind

Could not find a working python interpreter. Unity, Firebase

Could not find a working python interpreter. Please make sure one of the following is in your PATH: python python3 python3.8 python3.7 python2.7 python2 I insta

How to plot Dataframe for many rows?

I have a dataset where each row plots an ECG, with 50k rows, 181 columns and has 4 classes, represented in the last column (0, 1, 2, 3). So, I need to "convert"

hello.py: error: the following arguments are required: -i/--image

I have taken a piece of code from the web which uses OpenCV to find circles in an image. # import the necessary packages import numpy as np import argparse impo

How to get Slider in Plotly to show each value of r instead of the steps?

fig = go.Figure() for r in np.arange(0.05, 0.56, 0.005): #want the steps to show each value in r xth_r,yth_r,zth_r = coords_theta(r) fig.add_trace(

Django constraints when removing columns in manual migrations

Django silently removes constraints when removing columns, then arbitrarily chooses to include them in migrations. I've encountered an odd bug(?) in Django in o

from multithreading.decorators import measure_time - Why thet dont works?

import time Pycharm for some reason highlights the .decorators, but I install all from multithreading.decorators import measure_time # <-- Problem with thet

How do I (efficiently) update the text of a tkinter label that was procedurally generated?

I am making a restaurant menu program that pulls items and their attributes from a .json file, and then allows users to add them to a cart and export an order (

how to activate virtualenv created by pyenv in bash script?

I need to write a script to start gunicorn + django site which developed with pyenv the script is something like #!/bin/bash

Fastest and most efficient way to save and load a large dict

I have a problem. I have a huge dict. I want to save and load this huge dict. But unfortunately I got an MemoryError. The dict should not be too big. What is r

Can't get matching in an "if" statement

This is my first time posting a question on stackoverflow and I'm new to programming in general. Any guidance on the below matter will be appreciated. I have a

remove commas , and [ ] from a list python 3

I have a this funtion n=5 nums=5 1 4 2 3 def LIS(nums, n): dp = [] dp_list = [] for i in range(n): dp.append(1) dp_list.append([n

GCP-Cloud Composer: Secret Manager access variable.json

I try to configure Secret Manager for my Composer (ver 1.16, airflow 1.10) but I have a weird situation like below. In my Composer, I've used a variable.json fi