Category "python"

Pandas datetime column to ordinal

I'm trying to create a new Pandas dataframe column with ordinal day from a datetime column: import pandas as pd from datetime import datetime print df.ix[0:5]

Get the XHR url of shopee.tw search result from DevTool

I would like to crawl the product name, price from the below link in shopee https://shopee.tw/search?filters=5&keyword=lego70689&noCorrection=true&o

"Reindex" only fills the first two rows with new values

I am new to stackoverflow. I hope I can formulate my question clearly. I am using reindex to fill out missing dates in a pandas dataframe: df = pd.read_csv('myf

Numpy sum of 2D array along axis=1, floating range

I would like to perform a sum of a 2D array over the second axis, but on a range which is variable. Not vectorised it is:` import numpy as np nx = 3 ny = 5 a =

python does not recognize R functions with ”.“ in the function name

When I call the contrasts.fit function in the R package, limma, I get an error, which I suspect is due to the "." reason, python may not recognize contrasts.fit

Is there a way make tests Flask and Firebase?

I have a Flask app. Authentication is provided by Google Firebase. I want to make url tests with any Python/Flask libraries? Is there a way? For example: /api/g

Is there a way to guarantee a certain number of lines detected with cv2.HoughLines()?

This question is an extension to my previous question asking about how to detect a pool table's corners. I have found the outline of a pool table, and I have ma

python generator function not yielding output [closed]

import itertools def password_generator(): with open("D:\Password Hacker\Password Hacker\\task\passwords.txt", "r") as passfile: f

How to get the previous rows close and apply it to the next row in a new column called previous close

I have a bunch of daily ohlc data like so: date,volume,open,close,high,low 2022-05-02,1756159.0,118.38,119.57,120.34,116.49 2022-05-03,3217838.0,119.72,122.4,12

Writing Python output as xlsx

I want to execute same function (gives output A, B, C, D) for all the files (library) available in the given path. I am trying write the output (A,B,C,D) in fou

Writing Python output as xlsx

I want to execute same function (gives output A, B, C, D) for all the files (library) available in the given path. I am trying write the output (A,B,C,D) in fou

How to draw on an image Tkinter canvas, PIL

I would want to be able to draw on an image being displayed by a tkinter canvas PIL. I tried google searching but all the results would be how to draw on an ima

Sending Cisco commands from a text file using Netmiko fails. send_config_set works but send_config_from_file doesn't

I have been using this link as guide. https://pyneng.readthedocs.io/en/latest/book/18_ssh_telnet/netmiko.html#:~:text=Netmiko%20is%20a%20module%20that,pip%20ins

Vectoring text data of dictionaries' values from pickle file

I'm new to NLP and trying to learn it by myself and I am doing classification. I have a pickle file with some data like this, {'food' : {'f1.txt', 'f2.txt', 'f

Azure Databricks - Python SSLCertVerificationError - unable to get local issuer certificate

I have an Azure Databricks notebook that gets a list of CSV files from a public government website and downloads them on a monthly basis or so. It's automating

Import a local module on <py-script> (Python for browsers)

I found a very useful application, that works like html tags for Python applications. Supposedly I could use all the features of Python between tags within a B

returning the highest value in the key : value pair in a dictionary [duplicate]

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

Question about selecting rows and columns from a DataFrame (Python) [duplicate]

I'm following this tutorial to select specific rows and columns from a DataFrame. The tutorial example shows that you can use: adult_names = t

Compare columns of different excel using python

I need to compare particular column between two excel sheet and if value matches then we need to replace the second column value of second excel sheet into the

Discord API. Bot don't see message from other users

I'm trying to make a selfbot for Discord and cant see message content from other users. async def on_message(message): print(f'USER - {message.author} texte