python-3.x

How to print all thumbnail_url from the data

How to print all thumbnail_url from the data Question: I am new in Python and trying to print all thumbnail_url from the data? in Python? The data is medias the issue is its logging only one thumbnail_url but in the data their are multiple thumbnail_urls – But i want to print al thumbnail_url from that …

Total answers: 1

Swapping values in list with computed target indices

Swapping values in list with computed target indices Question: I have the following code for swapping 0 and 1 in the list: b["".join(b).rfind("0")],b["".join(b).find("1")] = b["".join(b).find("1")],b["".join(b).rfind("0")] If the value of b is ["1","0","1","1","1","1"] it becomes ["0","1","1","1","1","1"], swapping 0 and 1 as expected. However, if instead b starts as the previous result ["0","1","1","1","1","1"] the list remains unchanged …

Total answers: 3

TypeError: invalid rect assignment with vectors

TypeError: invalid rect assignment with vectors Question: I am a novice to programming and wanted to make pong as one of my first projects. I am now trying to get the pong ball to bounce to a random location but i got a TypeError: invalid rect assignement. Here is my code: import pygame import os …

Total answers: 1

How can we plot a network graph, using pyvis, in a browser?

How can we plot a network graph, using pyvis, in a browser? Question: When I run the code below, I get this message but no network graph is displayed. Warning: When cdn_resources is ‘local’ jupyter notebook has issues displaying graphics on chrome/safari. Use cdn_resources=’in_line’ or cdn_resources=’remote’ if you have issues viewing graphics in a notebook. …

Total answers: 2

Gunicorn3 goes to the development server

Gunicorn3 goes to the development server Question: When I open a server with gunicorn for my flask app, it automatically opens the development server of flask, without giving me any errors: $ gunicorn3 –workers=1 main:app [2023-10-16 19:46:13 +0000] [1061] [INFO] Starting gunicorn 20.1.0 [2023-10-16 19:46:13 +0000] [1061] [INFO] Listening at: http://127.0.0.1:8000 (1061) [2023-10-16 19:46:13 +0000] …

Total answers: 1

List of lists of mixed types to numpy array

List of lists of mixed types to numpy array Question: I have data imported from csv and they are stored in list of lists as: data=[[‘1’, ‘ 1.013831’, ‘ 1.713332’, ‘ 1.327002’, ‘ 3.674446’, ‘ 19.995361’, ‘ 09:44:24’, ‘ 2.659884’], [‘2’, ‘ 1.013862’, ‘ 1.713164’, ‘ 1.326761’, ‘ 3.662183’, ‘ 19.996973’, ‘ 09:49:27’, ‘ 2.668791’], …

Total answers: 1

task from eolymp with bad condition

task from eolymp with bad condition Question: I have a task to solve a rather interesting problem from the eolymp site, here is the link: https://www.eolymp.com/en/problems/7342, please solve the problem 100% in Python and drop the code in your answer. I have gone through many options to solve this problem but it is too confusing …

Total answers: 1

Why are few Testcases of finding Valid BST are failing here in python?

Why are few Testcases of finding Valid BST are failing here in python? Question: So, I am trying to find ,Given the root of a binary tree, determine if it is a valid binary search tree (BST). A valid BST is defined as follows: The left subtree of a node contains only nodes with keys …

Total answers: 1

ImportError: cannot import name 'deprecated' from 'typing_extensions'

ImportError: cannot import name 'deprecated' from 'typing_extensions' Question: I want to download spacy, but the version of typing-extensions is lowered in the terminal: ERROR: pydantic 2.3.0 has requirement typing-extensions>=4.6.1, but you’ll have typing-extensions 4.4.0 which is incompatible. ERROR: pydantic-core 2.6.3 has requirement typing-extensions!=4.7.0,>=4.6.0, but you’ll have typing-extensions 4.4.0 which is incompatible. Installing collected packages: typing-extensions …

Total answers: 1