I’m trying to use SQLAlchemy 1.4 to query an Oracle database: This should return some kind of datetime object. When I execute this code (roughly) using SQLAlchemy, it decides to return the value of the :created_date parameter instead. Why is the result (literally) “blah”? EDIT:: See snakecha…
Tag: python
Python PPTX workaround to add Transitions to slides
I successfully automated the creation of pptx presentations using python-pptx, customising background, inserting text, images, etc. How can I add custom Transitions to my slides? (E.g. “Transitions” > “Fade” from PowerPoint). As I could not find a function, my idea is to use workaro…
How to run server in development mode with flask?
I am learning to use flask and I want to run the server for an application in development mode, for this I do the following: When I run I get the following in the terminal: enter image description here Environment:development does not appear to me as I understand it should appear. In fact, before doing this I…
Pandas sum of count per percentile of rows
Here is a link to a working example on Google Colaboratory. I have a dataset that represents the reviews (between 0.0 to 10.0) that users have left on various books. It looks like this: The first rows have 1 review while the last ones have thousands. I want to see the distribution of the reviews across the us…
“Database ‘docker-db’ does not exist”
so I have this problem building django/postgre app with docker. it keeps saying “database does not exist” and quite few time googling doesnt bring any results. I already scrapped the volumes and rebuilt my app few times, followed different guides on how people do the postgres, still no luck making…
Error while updating Confluence page using Python
Using this code gives me the following error: Traceback (most recent call last): File “update2.py”, line 24, in status = confluence.update_page( File “/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/atlassian/confluence.py”, line 1513, in update_page if …
Compare two pandas series and remove duplicates
I have two series: I want to compare ser1 and ser2 and then remove the duplicates and put the result into ser1 to have something like this: I tried pd.concat but this gave me the combination of the two series without removing the duplicates. Answer
How to group by a dataframe and concatenate by a column
I have a df with the following structure: Store Sku Value 1 A 20 2 A 20 1 B 10 2 B 25 And I have to transform it, so that the stores with the same sku and same value, end up concatenated in a cell with a “-” separator like the following. Store Sku Value 1 – 2 A
How to get relative path given a parent of unknown location with Python’s pathlib?
with pathlib.Path.relative_to we can get relative paths with: But what if i don’t know the exact path of the parent directory (but i do know its name)? for example: Path(“/path/to/foo/bar/thing”) relative to “foo” => PosixPath(‘bar/thing’) Path(“/path/to/foo/…
Python: Using property get/set to run on sub-class function
I have a setup that looks something like this simplified setup: I understand the use of @property to do a get – set setup for an attribute. But in this case, I’m trying to figure out how I can directly call the WorkerBee methods (there are more than 1 in my case….) that would also trigger Ma…