Categories
Linux Mastering Development Ubuntu

I can not connect to the Internet with cable and login window

I am having huge problems with connecting my Ubuntu 20.04 to the Internet. I live in a student village and to access the Internet you need to log in with your academic email and password. This is the trouble I find. I plug an Ethernet cable into my laptop. Ubuntu recognizes the ethernet cable and […]

Categories
Mastering Development

How to Un-Sort The legends in the graph in R?

I am not an expert in R. I am having an issue, the legends are sorted alphabetically. I cannot arrange them manually because I have 87 patients and each patient has 300 days and the status (category) changes every day so i want to plot the graph exactly like it has in the source. ggplot(data […]

Categories
Mastering Development

cannot arrange numbers into shape (n,n) matrix

I have the following code that generates a fractal image, the problem is how to reconstruct numbers to be a matrix. from PIL import Image from pylab import * from numpy import NaN import numpy as np import matplotlib.pyplot as plt def julia(C): X = arange(-1.5, 1.5, 0.05) Y = arange(-1.5, 1.5, 0.05) pixel = […]

Categories
Mastering Development

What is the second number in the MFCCs array?

When I extract MFCCs from an audio the ouput is (13, 22). What does the number represent? Is it time frames ? I use librosa. The code is use is: mfccs = librosa.feature.mfcc(y=X, sr=sample_rate, n_mfcc=13, hop_length=256) mfccs print(mfccs.shape) And the ouput is (13,22).

Categories
Mastering Development

Search and process data from multi-index DataFrames

I have two dataframes df2, with the payment statistics (that have the probability of the client pay a certain debt) and df3 with new clients data. import pandas as pd d = {‘City’: [‘Tokyo’,’Tokyo’,’Lisbon’,’Tokyo’,’Tokyo’,’Lisbon’,’Lisbon’,’Lisbon’,’Tokyo’,’Lisbon’,’Tokyo’,’Tokyo’,’Tokyo’,’Lisbon’,’Tokyo’,’Tokyo’,’Lisbon’,’Lisbon’,’Lisbon’,’Tokyo’,’Lisbon’,’Tokyo’], ‘Card’: [‘Visa’,’Visa’,’Master Card’,’Master Card’,’Visa’,’Master Card’,’Visa’,’Visa’,’Master Card’,’Visa’,’Master Card’,’Visa’,’Visa’,’Master Card’,’Master Card’,’Visa’,’Master Card’,’Visa’,’Visa’,’Master Card’,’Visa’,’Master Card’], ‘Colateral’:[‘Yes’,’No’,’Yes’,’No’,’No’,’No’,’No’,’Yes’,’Yes’,’No’,’Yes’,’Yes’,’No’,’Yes’,’No’,’No’,’No’,’Yes’,’Yes’,’No’,’No’,’No’], ‘Client Number’:[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22], ‘DebtPaid’:[0.8,0.1,0.5,0.30,0,0.2,0.4,1,0.60,1,0.5,0.2,0,0.3,0,0,0.2,0,0.1,0.70,0.5,0.1]} df = pd.DataFrame(data=d) df2=df.groupby([‘City’,’Card’,’Colateral’])[‘DebtPaid’].\ value_counts(bins=[-0.001,0,0.25,0.5,0.75,1,1.001,2],normalize=True) […]

Categories
Mastering Development

How to organize 2 level array to a custom dictionary format?

I’m trying to convert this array a = [ [‘A’,’B’,’C’], [1,33,45], [721,22,9] ] to a dictionary in order to have this output: b = { ‘A’:[1,721], ‘B’:[33,22], ‘C’:[45,9] } My current code is like this, getting this error: b = {} for i in range(1,len(a)): for j in range(len(a[i])): b[a[0][j]].append(a[i][j]) Traceback (most recent call last): […]

Categories
Mastering Development

Notice: Array to string conversion in PHP Json problems

I’m very new to php I have been watching some youtube videos I have a json file [{"name":"hally","ip":{"ip":[1,2,3,4]}},{"name":"Olojak","ip":{"ip":[11,22,33,44]}},{"name":"Andy","ip":{"ip":[111,222,333,444]}},{"name":"NoMad","ip":{"ip":[1111,2222,3333,4444]}},{"name":"ni","ip":{"ip":[11111,22222,33333,44444]}},{"name":"Nish","ip":{"ip":[111111,222222,333333,444444]}},{"name":"hs","ip":{"ip":[1111111,2222222,333333,4444444]}},{"name":"Kif","ip":{"ip":[11111111,22222222,33333333,44444444]}},{"name":"Kip","ip":{"ip":[111111111,111111111,111111111,11111111]}}] and i want to display each name and ip address this is my php file <?php $jsondata = file_get_contents("info.json"); $names = json_decode($jsondata, true); foreach ($names as $user){ echo $user[‘name’]."<br/>"; echo "IP:".$user[‘ip’]; echo "<br/>"; }; //echo "<br/>"; echo […]

Categories
Mastering Development

how to calculate the scatter within classes for a 50×20 matrix

I am trying to reduce a largely dimentional matrix to only 2D, i was using an example for 2D arrays,which works, but i would need to do the same for a higher dimentional scatter. I have two classes and each classes have matrices of 50×20 dimensional feature spaces. For my example i have these 2D […]

Categories
Database Development

Primary Key and Unique Constraints in Partitioned Table

I am currently creating a project that applies to a table that contains about 40 columns (including varchar (max)) and will be partitioned. About 200-250 records per second will be inserted into the table, which gives a daily volume of around 21 600 000 records. The last 14 days should be kept in the table, […]

Categories
Mastering Development

function(return array of “column” in a Javascript/Json Object)

I’ve got this object var list = {"selection1": [ {"answers": [1, 4, 5, 7]}, {"answers": [4, 3, 2, 1]}, {"answers": [10, 22, 12, 34]}, ], "selection2": [ {"answers": [31, 34, 35, 37]}, {"answers": [44, 43, 42, 41]}, {"answers": [20, 42, 22, 54]}, ]}; and I want to return a desired column by calling function(1, list, […]