Categories
Development

How to extract the correlation matrix features to a list if their values is beyond a certain threshold

After a read the first chapter in the book “Hands-On Machine Learning with Sci-kit Learn and Tensorflow” I wanted to do my own little project and learn a bit. So I wanted to make it simple and only use simple linear regression with features that correlate with Sale Price above abs(0.1). corr_matrix = raw_train_data.corr() corr_matrix[‘SalePrice’].sort_values(ascending […]

Categories
Development HTTP

Unresolved constraint in bundles-osgi.wiring.package=com.mashape.unirest.http (version>=2.0.0)(!(version>=3.0.0))

I am trying to deploy a bundle on fuse server after making few changes in it. I have added unirest dependency to perform REST calls. The build is working fine on local machine and on Jenkins, but the bundle is throwing error and not getting deployed on fuse server. It is throwing below error: Unable […]

Categories
Development XML

Can we avoid putting ad unit id in xml layout and rather put in activity class

I want put all my ad unit ids at one place and use from that place in all the activities. I don’t want to put unit ids in xml layout.

Categories
Development

Matplotlib: How to draw y = -x in a log-log plot?

I’m drawing with Matplotlib a log-log plot to exploit the correlation between some nodes using their assortativity. I successfully drawn the y = x line but now I’m struggling with the y = -x. Here is the code I’m using: plt.xscale(“log”) plt.yscale(“log”) plt.grid() x = np.arange(0, 1500) plt.plot(x, 0.35*x, “:”, color=”r”) plt.title(“Assortativity”) plt.show() This is […]

Categories
Development

Make div visible when hover

so I’m trying to make an X button appear and disapear when mouse over on it. Iv’e tried alot of threads over stackoverflow and did not get an answer. here is my JS code: let closeX = document.createElement(“button”); closeX.className = “xBtn”; CSS: .xBtn{ display: none; width: 23px; height: 23px; background-image: url(img/xIcon.png); background-size: 100%; position: relative; […]

Categories
Development

Dask: why did parallel computing take longer than a serial one?

Dask is a flexible library for parallel computing in Python. Dask is composed of two parts: Dynamic task scheduling optimized for computation. This is similar to Airflow, Luigi, Celery, or Make, but optimized for interactive computational workloads. “Big Data” collections like parallel arrays, dataframes, and lists that extend common interfaces like NumPy, Pandas, or Python […]

Categories
Development

Converting a float to string using locale settings and forced fixed decimals

in Python3, I need to convert a float to string using the current locale but keeping the zeros after the delimiter, which may be a comma. The code import locale amt = 83.00 locale.setlocale(locale.LC_ALL, ‘DE’) print(locale.str(amt)) prints 83 the required output is 83,00 How can I do this the right way using locale?

Categories
Development

allowing one one dash(-) between numbers using regex

I need a regex pattern where first 3 numbers should be 750 and after 3 digits user is allowed to type only hyphen(-) and then numbers . Below is the regex pattern I used. /^(?:7|71|(?:711-?[0-9]*))$/ The problem here is ,it is allowing both number and Hyphen(-) in the fourth place. Actual Result : 711000990 or […]

Categories
Development

Azure Data Factory Copy Activity Rest API JSON response date format incorrect

I am trying to copy data from rest api source using the azure copy activity. I have used Rest Api as source and csv as target. But the json response I am receiving is having the date as below format: {Createddate: /date(345667999)/} But when I hit preview data its giving the correct date format.(yyyy-mm-dd). Can […]

Categories
CSV Development

AttributeError: ‘NoneType’ object has no attribute ‘string’. I did the same for an empty csv file and there it worked

import requests from bs4 import BeautifulSoup import pandas import os import csv class NamenCollector: def NamenHolen(self, url, pfad): bool1 = False bool2 = False self.page = requests.get(url) self.soup = BeautifulSoup(self.page.content, ‘lxml’) Namen1 = self.soup.find_all(‘div’, class_=’live_group1′) Namen2 = self.soup.find_all(‘div’, class_=’live_group2′) if os.stat(pfad).st_size == 0: nam = self.soup.find(‘div’, class_=’live_group1′).string.strip().encode(“utf-8”) with open(pfad, ‘a’) as csvFile: writer = csv.writer(csvFile) […]