Category "python"

Pandas combine two columns with delimiters

I have two columns which have delimiters: column1 column2 a,b,c,d e,f,g,h h,i j,k l,m,n o,p,q ... ... I am trying to group them as ae

Assertion error during deep neural network image classification

# GRADED FUNCTION: two_layer_model def two_layer_model(X, Y, layers_dims, learning_rate = 0.0075, num_iterations = 3000, print_cost=False): """ Impleme

No error logs in /var/log/nginx/error.log [nginx]

The nginx on my Google Linux server is not printing error logs in the file /var/log/nginx/error.log. The content of my /etc/nginx/sites-available/app file is: s

Deep neural network gives a constant value as output

I have implemented a neural network from scratch. I have taken random values as both input and output. When I use a single layer( with sigmoid activation) the n

Input 0 of layer sequential_2 is incompatible with the layer: expected ndim=3, found ndim=2. Full shape received: (None, 1)

model = Sequential() model.add(LSTM(100, input_shape = [X_sequence.shape[1], X_sequence.shape[2]])) model.add(Dropout(0.5)) model.add(Dense(1, activation="sigmo

TKInter Option list to run a command to move to next level

I have attempted to create a function that will look at the current value in the OptionList and run the assigned code depending on its value. Here I have set-up

Trying to make images as sprites in pygame

Why isn't this code working? I'm trying to create a class to quickly create players for my game in pygame. I was trying to create a sprite based on what he did

Random Lottery Number Generator without repeat sets?

Random gen() picks a repeated number, the same number as 33, 33, in a list. I want to get a different list from numbers [0.99]. What method should be used to fi

Unit testing for python function-using post requests and get requests

I am trying to test the below function using unit test mocks but i am not able to do it since the return type from request get/post is of type <class 'reques

How to count word occurrences in a text column against values in another column?

I have a data frame with a column of text and another column (score) that describes a score for the text and a column (score_label) that provides a label 'b' or

Tkinter Button That Stops Thread

I'm trying to make a discord bot that I can start and stop using tkinter. I have a tkinter button that runs a thread which turns on the bot and since I have a s

How to see what can be set/updated on an issue?

I'm trying to use the JIRA Python API to create and update issues on different projects. Currently I'm after timetracking but I've seen other fields that cannot

How to decrease the space between grouped bar-subplots in matplotlib?

import matplotlib import matplotlib.pyplot as plt import numpy as np a_means, a_CI = (70, 60), (2.7, 1.9) b_means, b_CI = (85, 83), (2.6, 1.2) c_means, c_CI =

ResourceExhaustedError: Exception encountered when calling layer "batch_normalization_10" (type BatchNormalization)

When I run a transformer code for video prediction, the code itself should be correct but an error occured: ResourceExhaustedError: Exception encountered when c

Import a python property in other file python

py like this class MyStack(core.Stack): def __init__(self, scope: cdk.Construct, construct_id: str, **kwargs) -> None: super().__init__(scope, c

How can I dynamically split the text based on multiple sub-titles in a given text for every new text?

I have an original text that looks like this: We are AMS. We are a global total workforce solutions firm; we enable organisations to thrive in an age of constan

pywinauto not see some button in dialog

Its can't find button Setup -> Load Option My apps screen I has that code import time from pywinauto import application app = application.Appl

Pandas internals - "Index labels must be unique"

The Pandas Internals documentation (v1.2.4) states In pandas there are a few objects implemented which can serve as valid containers for the axis labels: Index

Iterate Naive Bayes classifier over a list of strings

This is an NLP question that hopefully someone can help me with. Specifically trying to do sentiment analysis. I have a Naive Bayes classifier that has been tra

How to retrieve the first added node when a LinkedList is created?

I have created a linkedlist in Python using below classes: class: Node class Node: def __init__(self, data): self.data = data self.next = No