I'd like to create class labels for a permutation of two columns using sklearn's LabelEncoder(). How do I achieve the following behavior? import pandas as pd im
I have a problem with the python requests library. I try to send a simple POST request to my Keycloak server, to introspect an access token. I tested in in Post
I have to write a code that makes use of recursion to sum numbers in a list up until the index is equal to a pre-determined integer value. i.e. list = [1,4,8,
(I recently asked this question on r/learnpython (here), but didn't get any feedback, so am re-posting it verbatim here. Hope that is okay!) Suppose I have a D
I have created a KSQL table with the following command: ksql> CREATE TABLE CUSTTABLE (id INT PRIMARY KEY, name VARCHAR, purchase VARCHAR) WITH (KAFKA_TOPIC =
I am writing data from a dash app to a SQL database setup by Django and then reading back the table in a callback. I have a column that the value should either
I have a basic set of data like: ID Value A 0.1 B 0.2 C -0.1 D -0.01 E 0.15 If we use data.rank() we get the result: ID Value A 3 B 5 C 1 D 2 E 4 Bu
Model.py class Order(models.Model): customerID = models.CharField(max_length=300, blank=True, null=True) osm_bol = models.CharField(max_length=300, bla
In Python, I have a dataset like this below, where column1 and column2 are objects and not strings: data = {'id': ['first_value', 'first_value', 'second_value'
Hi I'm trying to build a simple django app but I can't get index.html file to recognise the variables created in views.py. Nothing I do seems to work. Does it h
When I input this code print(cross_val_score(model, X, y, cv=3)) An error comes back that reads name 'model' is not defined: print(cross_val_score(model, X, y
I have the following network graph. # Create the graph with unique edges to check the algorithm correctness G = nx.MultiGraph() G.add_edge('A','B',route='56BM',
I have a backend,which receives codes and returns true or false. I send it codes using my python encryption,it returns true(the result varible): from Cryptodome
Here is the code from time import sleep import keyboard # Condição de partida da máquina while True: if keyboard.is_pressed('ENTER'):
I want to plot a 2d condition function, and the code as below: from numpy import exp,arange from pylab import meshgrid,cm,imshow,show def z_func(x,y): zPar
I have an input file where each line contains 99 lowercase letters, bccdddcdccddddddabcdabcabdbacbdcaaccbbcabacbccabcacbcdcccbdbacdcbbcbcbcccacadaaccababadbcbaa
In my django project i have many different models which i want to query using GraphQL. For instance: class Country(): name = CharField(max_length=255) clas
I am practicing on pygame and I was wondering how can we do so that the framerate does not affect the speed of execution of the game I would like FPS to not be
I have searched and searched and tried everything. I am creating a game where the user will input a pre-assigned pin and I want to validate that pin against a
In Pandas, it is simple to slice a series(/array) such as [1,1,1,1,2,2,1,1,1,1] to return groups of [1,1,1,1], [2,2,],[1,1,1,1]. To do this, I use the syntax: