Pylint complains "no value for argument 'cls'"

Python
I have defined the following class-method to define my object from a pandas.DataFrame instead of from a list like so: class Container(object): @c...
2 years ago

How to plot a density map in python?

Python
I have a .txt file containing the x,y values of regularly spaced points in a 2D map, the 3rd coordinate being the density at that point. 4.8828125000...
2 years ago

Python Unicode Error With % Operator

Python
Not sure what I'm doing wrong here, but with this: # -*- coding: utf-8 -*- class Foo(object): CURRENCY_SYMBOL_MAP = {"CAD":'$', "USD":'$', "GBP"...
2 years ago

adjacent letters in strings

Python
Trying to write a program that will calculate the number of matching letter pairs adjacent to one another ("mississippi" contains 3) and output that n...
2 years ago

Decrypting a string into a number

Python
Last week, I was assigned to encrypt numeric PINs into pronounceable strings (made up of vowel-consonant pairs). This went well. This week, I've been...
2 years ago

Capture screen and find reference image

Python
I'm trying to do the following in python: Capture the screen If the screenshot contains a given reference image (can be jpg or pgn), get the coordin...
2 years ago

[Python]Conversion issue: Float --> Bytes and viceversa

Python
i'm struggling with something i cannot solve. I'm developing a Client - Server app, in python ofc, i need to send some "float type" data but sock.send...
2 years ago

KeyError at /add_post/

Python
I'm trying to add a feature restricting users to post more than one in one minuate. Then I have met this error, not sure why this isn't working. Can y...
2 years ago

Use capture group in re.sub

Python
I have the following code: >>> s = 'https://www.microsoft.com/ja-jp/store/tv/%E7%BE%8E%E7%94%B7-%E3%82%A4%E3%82%B1%E3%83%A1%E3%83%B3-%E3%82%...
2 years ago

Implementing NSApplication delegate protocol for openFile in PyObjC

Python
I want to do this in Python (pyobjc) -(BOOL) application: (NSApplication*)sharedApplication openFile:(NSString*) fileName { ... } My delegate is a ...
2 years ago

How to extract link from <a> inside the <h2 class=section-heading>:BeautifulSoup

Python
I am trying to extract a link which is written like this: &lt;h2 class="section-heading"&gt; &lt;a href="http://www.nytimes.com/pages/arts/index....
2 years ago

Can I write intentionally "mis-indented" Python code?

Python
In free-form languages, sometimes I use indentation to represent some implicit structure in my statements. In the following example, I'm just doing a ...
2 years ago

Python: How to call method in separate process

Python
I want to start the ActorCore method in a seperte process and then process messages that come to that ActorCore. For some reason this code is not work...
2 years ago

Selenium get textarea error

Python
I'm trying to scrap in a website using Selenium and Python, I got stucked in a field called 'textarea' by the website. This is how the website HTML ca...
2 years ago

While condition and rate equation

Python
This is the code I have so far: def convertWeight(): (totalWeight * 0.45359237) def getRate(): if totalWeight &lt;= 2: rate = totalWeig...
2 years ago

subprocess.run: Is it safe to combine check=True with stdout=PIPE?

Python
Python 3.5 introduced the run() function in the subprocess module as the new recommended high-level means of subprocess invocation. Amongst the three...
2 years ago

Python & tkinter: canvas.lift and canvas.lower on overlapping buttons does not work

Python
I created two overlapping buttons on a canvas, using tkinter and python 3.4: Now I would like to bring button1 to the front (the button you cannot ...
2 years ago

What's the difference between list and tuples?

Python
What's the difference? What are the advantages / disadvantages of tuples / lists?
2 years ago

pandas - change df.index from float64 to unicode or string

Python
I want to change a dataframes' index (rows) from float64 to string or unicode. I thought this would work apparently not: #check type type(df.index)...
2 years ago

R function rep() in Python (replicates elements of a list/vector)

Python
The R function rep() replicates each element of a vector: &gt; rep(c("A","B"), times=2) [1] "A" "B" "A" "B" This is like the list multiplication in...
2 years ago