Category "python"

why this line of my code crash the archive?

This part of the code for some reason doesn't allow me to read anything from the file correctly. It's like I delete everything and leave white spaces or somethi

Splitting a record into 12 months based on the date in pandas dataframe

I have the data in the below format stored in a pandas dataframe PolicyNumber InceptionDate 1 2017-12-28 00:00:00.0 https://i.stack.imgur.com/pE

How to get correct date format from JSON string in Python?

I am trying to get some data from a JSON url using Python and convert in Pandas PD. Everything is working OK. Only there is a column for date. It is coming weir

How to remove space from number followed by unit or dimensions?

Here is the input string string1 = 0.9% SODIUM CHLORIDE 8290306544 FLUSH 0.9 % SYRINGE 10 ML string2 = 0.9% SODIUM CHLORIDE 8290-3071-44 FLUSH 0.9 % SYRINGE 10

Exception has occurred: NoSuchElementException - iframe will not work

from discord_webhook import DiscordEmbed, DiscordWebhook from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.comm

creating a fuzzer for ftp [duplicate]

I keep getting the error when I try to connect to the ftp server: a bytes like object is required not str #!/usr/bin/python import socket s

Finding the minimum result of a list of results

Is there a code to define / sort through lists?

Apache beam: Reading and transforming multiple data types from single file

Is there a way to read each data type as it is by a PCollection from a CSV file? By default, all the values in a row read by a PCollection are converted into a

Print out a list of prime numbers in python

The question is: print out all numbers from 1 to 1000 that satisfy the two conditions: Those are prime numbers The numbers after being reversed are also prime n

Get the mtime of a symlink and not its target in Python

In Python (and Python2) on macOS, when I use os.path.getmtime('/path/to/a/symlink') I get the modification time of the symlink's target. - How do I get instead

Lib Spotipy no responde

i'm trying to use the lib Spotipy for Spotify. When i execute the code below, nothing happen. I have a springboot app who receives the token generated, when i t

Mac - include Python.h framework when compiling a cpp file

I'm currently building a cpp project which contains python code. To use embed python code in c++ the Python.h file from the Python.framework is required. Before

Merge two dfs with multiple entries of same value in joining column

I have two data frames. The first is input which looks like the following: Merchant SKU Quantity Per Box NOB Shipment Status id_using_regex prepped_by_in

Pymongo: update document only if value of a field matches a provided value

Is it possible to update a document based on the condition that the value of a field in that document matches a value that I provide? I can easily do this in tw

What exactly is current working directory?

My book states: Every program that runs on your computer has a current working directory, or cwd. Any filenames or paths that do not begin with the root folder

Adding non-integer member values to IntEnum in Python3

I have roughly the following: class Foo(IntEnum): a = 0 b = auto() c = auto() strings = ["Alpha", "Beta", "Charlie"] def __str__(self): return Foo

Pymongo: update document only if value of a field matches a provided value

Is it possible to update a document based on the condition that the value of a field in that document matches a value that I provide? I can easily do this in tw

Every file added to .gitignore was deleted by Git during a Pull

I recently wanted to start tracking some project files for a certificate course I'm taking, so I got the Git Desktop app and linked my main project folder to my

How do you... Define a Graphing Function

For Data Analytics & using Python. I came across this code(below) and my question is... did the user copy and paste this from somewhere or do I define a gra

How to insert nulls into a SQL Server table

I have the following dataframe: data = [['Alex', 182.2],['Bob', 183.2],['Clarke', 188.4], ['Kelly', NA]] df = pd.DataFrame(data, columns = ['Name', 'Height'])