Categories
Mastering Development

Python matrix filling in values that shouldn’t be filled in

I’m trying to improve my python skills by making a rouge like game with pygame. I started by trying to make a simple level generator but I am running in to an issue where more values in my map matrix are bring filled in than should be. The following code is my attempt at adding […]

Categories
Mastering Development

Creating a new pandas dataframe by applying logic to already existing dataframes

I have two pandas dataframes as follows. data_1= {‘features_names’: [‘F1′,’F2′,’F3′,’F4’], ‘Sample_1’: [2260,25000,27000,35000], ‘Sample_2’: [22000,25,8,35000], ‘Sample_3’: [2350,25000,27000,3900], ‘Sample_4’: [25000,2570,250,3000] } df_1 = pd.DataFrame(data_1) and another data frame as follows. data_2={‘Sample_name’: [‘Sample_2′,’Sample_3′,’Sample_4′,’Sample_1’], ‘class’: [‘class_1′,’class_1′,’class_2′,’class_3’], ‘sex’: [‘m’,’m’,’f’,’m’], ‘age’: [23,25,21,35], ‘RIN’: [2.5,2.8,3.8,3.0] } df_2 = pd.DataFrame(data_2) Now using df_1 and df_2, I want to create df_3 which should be […]

Categories
Mastering Development

Backpropagation giving strange values in C++ neural network

I am trying to solve the iris data set with a neural network I wrote in C++ from scratch, which has 150 rows divided up into 3 different flowers with 4 columns and then a fifth for the flower type which I converted to a 0, 1 or 2. Problem: Whenever I run the network […]

Categories
Development

How to identify a range of data points between a minimum and a maximum in a dataframe in R?

My measured variable V1 follows cycles: it goes up to reach a maximum and down to reach a minimum. I call “cycle” the range of data points between 2 consecutive maxima (cycle 1 is maximum 1 – minimum 1 – maximum 2, cycle 2 is maximum 2 – minimum 2 – maximum 3). The minima […]

Categories
Artificial Intelligence (AI) Development

Binarize ConvNet Feature vector

Given a pre-trained CNN model, I extract feature vector of 3450 reference images FV_R as follows: FV_R = [ [-8.2, -52.2, 9.07, -1.1, -0.08, -9.1, …….., -4.11], [7.8, -3.8, 6.4, -4.27, -2.2, -5.0, …………., 3.6], [-1.2, -0.8, 49.3, 1.73, -1.74, -7.1, ……….., 2.41], [-1.2, -.8, 49.3, 0.6, -1.24, -1.04, ………., -2.06], . . . [-1.2, […]

Categories
Development Linux Ubuntu

Unable to start gnome-terminal via VNC:

I use Ubuntu 18.04.3 LTS (the machine is actually a VM that runs on VMware ESXi) and my VNC .xstartup file contains the following lines: #!/bin/sh gnome-panel & gnome-settings-daemon & metacity & nautilus & When I connect to my desktop over VNC with the following command, I cannot open a terminal session in my VNC […]

Categories
Development Linux Ubuntu

ubuntu 18.04 VNC Grey screen

I’m havinng problems getting my gnome desktop to load via vnc initially I followed this guide for xfce vnc https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-vnc-on-ubuntu-18-04 working Xfce config: #!/bin/sh unset SESSION_MANAGER unset DBUS_SESSION_BUS_ADDRESS startxfce4 & [ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup [ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources xsetroot -solid grey /usr/bin/autocutsel -s CLIPBOARD -fork vncconfig -iconic & x-terminal-emulator […]

Categories
Development

Merge/combine the array data based on the date without duplicating in angular

How to merge array data based on the date without duplicating? Here’s the code: [ { date: [ ‘2019-12-02 08:00:00’, ‘2019-12-03 08:00:00’ ], upload:[“47.93”, “47.46”, “47.40”, “47.29” ], download: [“43.90”, “41.12”, “46.80”, “47.86”, “47.69”, “47.74” ], ping: [“3.607”, “4.209”, “4.052”, “3.559”, “3.8”] } ],[ { date: [ ‘2019-12-02 08:00:00’, ‘2019-12-04 08:00:00’ ], upload: [ “47.93”, […]

Categories
Development

Redim Reserve fires ‘Out of Range’ error, but can’t understand why

I want to generate a 2-D array, with 2 fixed Columns and dynamic rows. The result should be (for example): (row number) , (row group level) 3 , 2 4 , 2 6 , 3 7 , 3 8 , 3 So far I have this code below, which seems to work for the first […]

Categories
Development

Add text to legend color square in ggplot2

I’m making a diverging bar plot for some Likert data (along these lines). The client has requested a “mean response” for each group, treating Likert responses as consecutive integers (“Strongly disagree” = 1, “Disagree” = 2, etc.); these means are displayed on top of the bars, in the “neutral” area. For transparency, I want to […]