Skip to content

Tag: python

I can’t switch screen in kivy

I followed a tutorial on youtube so I could learn how to use kivy, but when I try to switch screen it doesn’t work, I write my code the exact same way the guy does it, but for some reason nothing happens when I click the button “Se dine produkter”. I have written where I need help in the .kv

How do I compare two letters or values in two different lists?

I am making a program that has two lists (in Python), and each list contains 5 different letters. How do I make it so that any index number I choose for both lists gets compared and uppercase a letter if the condition is true? If the first two values in the list are the same (in my case a lowercase

Does collection’s Counter keeps data sorted?

I was reading python collections’s Counter. It says following: Somehow these printed values are printed in descending order (9 > 8 > 4 > 2). Why is it so? Does Counter store values sorted? PS: Am on python 3.7.7 Answer In terms of the data stored in a Counter object: The data is insertion-order…

SHAP import local_accuracy

I’m trying to test metrics from the shap library https://github.com/slundberg/shap/blob/master/shap/benchmark/metrics.py I tried calling metrics like this : But am always getting the error : Answer Try instead: Why? Inspecting package’s top level __init__.py you’ll find out the following com…