Category "python-3.x"

Python- How to Combine 2 pandas.core.frame =.dataframe with the same column name together in python [duplicate]

So i got 2 pandas.core.frame.DataFrame like this: anomalies: Sales outlet Date 2006-07-01 700 2 a

Open3D scene renderer render_to_image returns black screen

I am trying to render a scene that simply contains a mesh of obj file and the material file. It looks okay when I try to view with o3d.visualization.draw([{

How to convert PPM image file to JPG or PNG using Python? [duplicate]

I have made a script which makes a valid ppm file which when opened using a ppm viewer is working properly. But I don't want my users to insta

I'm on a project trying to create a leap year generator. Every year works besides the years with the last two digits being 16 or 20

Any time I type the years that end with 16 or 20, example: 2016 or 3020, it just ends. The code I am using is below, any help would be much appreciated. Thank y

Google Colab: pip install and imports from a custom script

In MyDrive/colab a I have these files: 00-imports.py with content... !pip install boto3 classes.py with content... class Test def __init__(self): print(

Casting irresponsive

Tried to do casting on this little project I am working on can anyone tell me what I have done wrong? Calculation_to_units = 24 name_of_unit = "hours" def day

Can't understand how to store values for each step

I am a beginner, trying to learn recursion and solve some problems (trying the subsequences problem). But before I could even attempt to get the recursion logic

Nested Data inside output needing to be expanded

I have the following code import requests import json import pandas as pd import csv import numpy from pandas.io.json import json_normalize url = 'http://URL/a

Getting a map() to return a list in Python 3.x

I'm trying to map a list into hex, and then use the list elsewhere. In python 2.6, this was easy: A: Python 2.6: >>> map(chr, [66, 53, 0, 94]) ['B',

Unused import statement 'import config' Pycharm

class Bot: @staticmethod def token(): telegramtoken = '...' return telegramtoken @staticmethod def executar(): import

How to make the if condition contain more than one condition? i.e.: if (number % 3 == 0) & (number % 5 == 0): [duplicate]

Starting_Num = int(input('Please enter intial number: ')) Ending_Num = int(input('Please enter ending number: ')) for number in range(Starti

How can I add a conditional within my model that changes a model field based on a previous fields value?

Using Django/python. So I have a 'food' model that is taking multiple user inputs, one of which is 'type' and has the options of 'fresh' and 'pantry'. Another i

How to plot nodes of different shapes and facecolor of bbox in the same graph using networkx and matplotlib in Python?

I want to plot a simple graph using networkx. There are two nodes with labels Python and Programming in each. The code and graph are as follows: import networkx

Is it possible to let a sympy symbolic variable be element of a specific interval?

Im trying to solve some inequations containing absolute values and I want to use sympy to make my life a bit easier. There are some conditions for the given var

How to download pipeline code from Pycaret AutoML into .py files?

PyCaret seems like a great AutoML tool. It works, fast and simple and I would like to download the generated pipeline code into .py files to double check and i

How to use scipy's fminbound function when function returns a dictionary

I have simple function for which I want to calculate the minimum value from scipy import optimize def f(x): return x**2 optimize.fminbound(f, -1, 2) This

Running a Python Flask server in closed Terminal session

I've made an Flask API Server that i want to run on a Server and close the Terminal session and still keep it running. (SSH) The API's makes a lot of Requests t

Outputing single strings in python

I'm in need of some assistance in this code problem from a MOOC on python programming that I'm taking. This is just for self-learning, and not for any graded co

saving s2p format for vector network analyzer vna by jupyter notebook

I connected my laptop to a Vector Network Analyzer (VNA) by a GPIB cable. I identified the instrument to the laptop by the following code in Jupyter Notebook: f

Python 3.9 - Connect to memsql

I am trying to connect to memsql (running as docker container - cluster-in-a-box). I am using Python3.9. Tried with Python 3.8 as well. Here is the code snippet