I am following this guide: https://learn.microsoft.com/en-us/azure/app-service/tutorial-python-postgresql-app?tabs=bash%2Cclone&pivots=postgres-single-server After successfully completing Step 1 and Step 2, I get to Step 3: “Install the db-up extension for the Azure CLI: az extension add –name…
Tag: python
django custom function for filter query
I’ve a field in my model called, test_data = models.TextField(…), and the model is called MyOrm and this test_data contains data which is actually string, some holds JSON data, and some reference to blob-url. Now I’m trying to streamline my data. So I want to filter all the MyOrm object whos…
Convert tfrecords to image
I found a training dataset which is a set of tfrecords files,im trying to convert them into images but with no results,is it possible to convert them to images ? Answer To find out what is inside a tf.record use tf.data.TFRecordDataset and tf.train.Example: To parse the records, use tf.data.TFRecordDataset wi…
Dash Cytoscape from python networks graph not honouring the nodes coordinates
I am trying to learn Dash Cytoscape and wanted to perform the following: generate a graph with network, apply a fruchterman-reingold algorithm to position the nodes, convert the data to the cytoscape format and display it in a Dash app. Here is the code: I am not seeing the nodes appear where they should be. …
How do I order lines to be correct?
question is to arrange lines in order and with correct indent. I can’t write anything just need to arrange it. question is in the picture. what’s wrong with my answercapture Answer Try this:
Majority of my column headers are dates in my dataframe, not able to use the loc function – how do I fix this?
I have a dataframe that shows the number of downloads for each show, where every month is a column, with the actual start of each month being the data column name. df looks like this below: Show 2017-08-01 00:00:00 2017-09-01 00:00:00 2017-10-01 00:00:00 Show 1 23004 50320 450320 Show 2 30418 74021 92103 Howe…
python program to write a code that receives file route and return a tuple with things from the file
I need to write a program to receive a file. her content is something like that: this is my code: the program needs to return a tuple that contain the (name of the longest song, number of lines in the file, most appearing artist in the file) But it doesn’t work and return: Answer
Filtering dataclass instances by unique attribute value
I have a list of dataclass instances in the form of: Now I would like to filter that list and get only unique instances by a certain key (company in this case). The desired list: The original idea was to use a function in the fashion of python’s set() or filter() functions, but both is not possible here…
Permanent authentication from cloud function
I am trying to host some code inside a cloud function. This code tracks and parses new e-mails and write some information to a Realtime Database. It is almost 100% finished, but as I am very beginner, it’s been hard for me to deal with authentication. From my PC, it all worked when I authenticated just …
How to convert JSON data inside a spark dataframe into new columns
I have a spark dataframe like I want to convert the JSON (string) to new columns I don’t want to manually specify the keys from JSON as there are more than 100 keys Answer