Skip to content
Advertisement

Tag: python

Importing .bak MySQL database with Python using pymssql

The title is pretty self explanotory. I’ve tried the following code : But I get the following error : No module named ‘_mssql’. I have the version 2.2.2 of pymssql and I use Python 3.9. I’m just trying to write and read from this database, and I only have the .bak file. I’m quite new to SQL, so I might

Problem in a function that extracts and saves fields from a database table to another

If in the combo_Nations combobox I select a specific Country (the country name is extracted from the “All_Nations” table in the “Nations_name” column), I would like to get the corresponding ID_Nations of the respective selected country (ID_Nations is found in the same table “All_Nations”). The ID will be automatically inserted in another table of the database together with other fields,

How to display and link two sql tables?

I’m trying to display genres from a “Genre” Table in SQL to my main table I found a way to do it with one item but I cannot find a way to do it with multiple genres I got an error from this and I don’t know how to fix it. My SQL database: Answer Do a LEFT JOIN for

how to insert pandas dataframe into IN operator of SQL

I have pandas dataframe with unique number of user: I want to pass this column to sql query where I use IN operator: I have tried doing this which would retrun whith this ‘1qw3,2wed,3das,4frr,533ew,612w’ and then something like WHERE users in STRING_SPLIT(data_frame, ‘,’) but this one is obviousely doesnt work… Answer You can convert the list into a tuple, this

As a result of the Euclidean distance many images are mistakenly identified as identical

Sorry for my bad english, i have a small database that contains hashes of photos, when I try to find similar photos to the one below: for which the following hash was calculated: “0f3f2764ecc482c2” using the method average_hash() The system finds a very large number of collisions, below is an example of photos that were identified as completely identical: The

Spark: How to transpose and explode columns with dynamic nested arrays

I applied an algorithm from the question Spark: How to transpose and explode columns with nested arrays to transpose and explode nested spark dataframe with dynamic arrays. I have added to the dataframe “””{“id”:3,”c”:[{“date”:3,”val”:3, “val_dynamic”:3}]}}””” , with new column c, where array has new val_dynamic field which can appear on random basis. I’m looking for required output 2 (Transpose and

constructing a message format from the fetchall result in python

*New to Programming Question: I need to use the below “Data” (two rows as arrays) queried from sql and use it to create the message structure below. data from sql using fetchall() ##expected message structure I tried to create below method to iterate over the rows and then input the values, this is was just a starting, but this was

Advertisement