Python – Panda Style: Conditionally changes the background color of the column to an absolute value

I had posted a question in about how I could apply a conditional change to the background color of the column in absolute value. But, I have not received an answer yet. Later, my friend helped me write a small code to replicate the case. He was inspired by this message in
But, for whatever reason, this code does not work. But, I can not understand where is a problem.

import pandas as pd
import matplotlib.pyplot as a plt
of matplotlib import colors
df = pd.DataFrame ([[3,2,10,4],[20,1,3,2],[5,4,6,1]])

def background_gradient (s, m = None, M = None, cmap = "PuBu", low = 0, high = 0):
s = s.applymap (lambda x: abs (x-6))
if m is None:
m = s.min (). min ()
if M is None:
M = s.max (). Max ()
rng = M-m
norm = color.Normalize (m- (rng * low), M + (rng * high))
normed = s.apply (standard)
cm = (cmap)
c = normed.applymap (lambda x: colors.rgb2hex (cm (x)))
ret = c.applymap (lambda x: "background color:% s"% x)
return back (background_gradient, axis = None)

sharepoint online – Content type and possibility of reusing the site column in the flat structure

About 6 months ago, I wrote this question about the possibility of reusing content types and site columns among site collections connected to a hub site in the world of flat structure. Migration of our local sub-sites to become collections of modern sites. how we are going to handle content types and site columns. I compared the horizontal structure with the subsites approach, where, in the subsites approach, we can manage the columns and types of site content on the root site and reuse all the columns and the content types of the site automatically within the subsites. So, after 6 months, improvements have been made or are there approaches in SharePoint Online that could allow us to facilitate the reuse of content types and site columns in the flat structure? or the same old case applies, should we use power-shell to handle the same types of content and the same site columns in the site collection of the flat structure?
Of course, I excluded the option of using content type hub sites to allow the reuse of content type in hub sites, because the content type site approach is a very classic / old approach that we should not use with the hub site. as if I had the decision to use sub-site approaches or to use hub-sites with content hubs, I will go with the subsites approach.
Thank you

magento2 – Extra column in commands

I want to add an extra column in the commands where all the commands are visible, called "company name". The information that will be displayed in this column will come from a drop-down menu in the shipment where the user will fill in the details. For example, the drop-down list will be as follows: State 1, State 2 …, State 10 – when the user selects States 1 to 5, the information in the new back-end column> Orders will be visible under the name "Company 1" or if the user's choice is set to state 6-10, there will be "company 2". I have read a lot, but until now, nothing has been accomplished, except for a few crashes. If anyone can tell me if it is possible and I should follow a path, it would be great.

views – Adds a link for each column

I work on tripal with drupal 7.x
I have created a new view. I had chosen the fields and I have this table.
enter the description of the image here

I want to add the link for each line of the map name. I put this tag
enter the description of the image herebut I want to change the ID (85) for each line that corresponds to the ID of the card. How can I do? Thank you

SQL Server 2012 – There is no column named id5093 in the body_record table. It is ignored for this operation

For more than 8 months, one of our databases contains spam and spam event logs with the following errors:

There is no column named id5093 in the body_record table. It is ignored for this operation.

The column has been removed and added, the database has also been refreshed / restarted, but the error continues to occur even if the column exists.

The code below has been used:

Use OM2;
alter table body_record add id5093 nvarchar (max);

Is there a way to solve this problem please?

Mysql: Insert in JSON column type with GROUP_CONCAT

I'm trying to insert a list of words in a column with the JSON type:

creates the table my_table (
JSON synonyms

My query looks like this:

INSERT in my_table (id, synonyms)
SELECT id, GROUP_CONCAT (synonyms DISTINCT) as synonyms of (
SELECT id, name1, name2, GROUP_CONCAT (name DISTINCT1) as synonyms


SELECT id, name1, name2, GROUP_CONCAT (name DISTINCT2) as synonyms
group by identifier;

If executed without the INSERT of the first line, the synonyms The column returns a list of words separated by commas:

id name1 noun2 synonyms
1 a a, b a, a, b
2 two by two, c

I want to insert these synonyms as JSON_ARRAY. However, the INSERT command fails when the individual words are not quoted twice. If I add JSON_ARRAY in my selection:

SELECT name1, name2, id, JSON_ARRAY (GROUP_CONCAT (synonyms DISTINCT)) ...

I get the following result:

name1 noun2 synonyms
a a, b      ["one,a,b"]
two c        ["two,c"]

When what I want is that (to be able to insert it directly into the synonyms column):

name1 noun2 synonyms
a a, b      ["one","a","b"]
two c        ["two","c"]

Is there a way to do this with SQL or is it better to handle it in the application code?

postgresql – How can I group the name of the json_agg column?


id json_agg
-------------------------------------------------- -
33  ["Running", "NotRunning", "NotRunning", "Running", "Running", "Running", "Running", "Running", "Running", "Running", "Running", "Running", "Running", "Running", "Running", "Running", "NotRunning", "Running", "Running", "NotRunning"]

desired result

id json_agg
-------------------------------------------------- -
33  ["Running":15, "NotRunning":20]

sharepoint enterprise – Column calculated to produce a Julian date

In Coraswork, there is a calculation that produces a Julian date such as: 19140UA. 19 = year, 140 is the Julian date, UA = 1st calculated number of that day, if there is more than one calculated number, it will be replaced by UB, UC, etc. What is the formula for producing this alphanumeric?

2013 – Loading files in the SharePoint library and reference to an Excel file to populate the column values

I am brand new in SharePoint. I've been tasked with developing a SharePoint site that will make it easier to find documents and organize them better than they currently are on our network drives. I'm now trying to set up a library of specifications.

there is:

  • Characteristics
  • Standard Specifications Exceptions
  • Exceptions of non-standard specification

Non-standard specification exceptions are also divided into 4 regions where the same exemption file name may have different content.

Initially, I had the intention of downloading everything in a library and using different views to display the information. But after reading another question, it seems like a better library is for each other.

In the end, I'll probably have about 3,000 +/- documents to download. They will be a mix of PDF, XML, DOC and DWG. Each file will have a unique name. Some of the file formats will be:

DK 001A820.XML
DK 100F08M.xml
OPSS 0202.pdf
OPSS 0304.pdf
SSP 101F23.xml
SSP 102S05.xml
MTOD 0101.0700.dwg
MTOD 0202.0400.dwg
OPSD 0100.0100.dwg
OPSD 0100.0110.dwg
SSD 0002.0001.dwg
SSD 0005.0002.dwg

Currently, each of the types defined by the first 3-4 characters is in its own directory. In addition, each directory has an Excel file that contains an index. All of which are similar, but the column names, number, and position may vary slightly from one index to another.

An example of an index would look like this:

enter the description of the image here

On the basis of this table, I know that SSD 0002.0001.dwg is titled:

Structural structure of layering of standard drawings

And that his status is:


Although I can drag 100 files at a time and manually go into the library and fill in the column information for each file, it is time consuming.

Is there a way to download the files and get the correct column information from the index file?

As a follow-up question, is there a better way to proceed? Previously, I had just created a hyperlink formula in each index linked to the file on the network drive.

No idea what to label this as being either a help with that would be appreciated.

How to encrypt a column using aes-256-gcm encryption in PostgreSQL?

As a database person, I need to encrypt the SSN numbers wherever they are in a table. We use PostgreSQL.
My application counterparts require the use of the AES-256-GCM encryption algorithm. However, I'm not sure how to apply this in postgresql.

After searching Google, I can encrypt using one of the following AES methods:

  1. UPDATE ssnTable
    SET encrypted_ssn = encrypt (encrypted_ssn :: bytea, & # 39; mykey, & # 39;)

  2. UPDATE ssnTable
    SET encrypted_ssn = pgp_sym_encrypt (encrypted_ssn, & # 39; mykey & # 39 ;, compress-algo = 1, cipher-algo = aes256 & # 39;)

None of these answers specifically uses the algorithm 'aes-256-gcm', that's what I'm asked to use.
An idea on how to use this algorithm on the column, in PostgreSQL?