Skip to content
Advertisement

Category: Questions

How can I write to specific Excel columns using openpyxl?

I’m writing a Python script that needs to write collections of data down specific columns in an Excel document. More specifically, I’m calling an API that returns a list of items. Each item in the list contains multiple fields of data (item name, item version, etc). I would like to iterate through each item in the list, then write selected

python to get substring of an excel cell with a condition

I’m trying to concatenate several csv files and create a ‘DATE_TIME’ column based on the specific column ‘NAME’. I apply an IF condition for extract the substring of DATE_TIME from NAME based on the appearance of a string ‘RE’. Here’s my code: My question is at the IF-ELSE statement. They return the same position of the substring, so that I

Installing scipy and scikit-learn on apple m1

The installation on the m1 chip for the following packages: Numpy 1.21.1, pandas 1.3.0, torch 1.9.0 and a few other ones works fine for me. They also seem to work properly while testing them. However when I try to install scipy or scikit-learn via pip this error appears: ERROR: Failed building wheel for numpy Failed to build numpy ERROR: Could

cannot import name ‘stop_words’ from ‘sklearn.feature_extraction’

I’ve been trying to follow an NLP notebook, and they use: However, this is throwing the following error: My guess is that stop_words is not (or maybe no longer) part of the ‘feature_extraction’ part of sklearn, but I might be wrong. I have seen some articles that used sklearn.feature_extraction.stop_words, but at the same time I see places which have used

How to solve the ‘mul objective has no attribute ‘cos’ ‘

How to solve the multi object problem? If I input 2, the expected result should be 2*cos(2*x). Answer Your code contains a few misconceptions. One problem is an important general programming rule: try to use different variable names for variables with different meanings. So, x shouldn’t be assigned a float, as it was a symbolic variable before. And derivative_f being

Advertisement