Categories
Linux Mastering Development

Editing a file based on a pattern appearance

I have a file that contains text and numbers like this: state(1, s(1,a), [s(1,b)]). state(1, s(1,b), [s(1,a)]). state(1, s(2,a), [s(2,b)]). state(1, s(2,b), [s(2,a)]). state(1, s(3,a), [s(3,b)]). state(1, s(3,b), [s(3,a)]). state(1, s(4,a), [t(1), t(2)]). state(1, s(5,a), [t(1), t(3)]). state(1, s(6,a), [s(6,b)]). state(1, s(6,b), [s(6,a)]). …so on I want the numbering with in s(x,y) to change as […]

Categories
Ask Geographic Information System (GIS)

Raster file not found (R)

I am using raster() inside an if statement and I get the following error: Error in .rasterObjectFromFile(x, band = band, objecttype = "RasterLayer", : Cannot create a RasterLayer object from this file. (file does not exist) I am cheching all the paths and are correct. Perhaps the function file.path() is not correct to get the […]

Categories
Ask Geographic Information System (GIS)

What more I should include in the code to generate the figure. I am following someone’s readymade code and novice in the field

import hypy as hp import scipy as sp import numpy as np import math import matplotlib.pyplot as plt fontsize_labels = 10 fontsize_tick_labels = 8 fontsize_legend = 8 fig, ax1 = plt.subplots(1,1) fig.set_size_inches(4.2,3.5) ###function dls ### def dls(x,t): s = [] for i in range(0, len(t)): s.append(hp.stefhest(‘pcw.lap’,x,t[i])) ds = [] for i in range(0, len(t)): ds.append(hp.stefhest(‘pcw.der’,x,t[i])) […]

Categories
Mastering Development

Ordered set of Dataframe values in Pandas

Question: a series named heights_A with values 176.2, 158.4, 167.6, 156.2, and 161.4. These values represent heights of 5 students of class A. Label each student as s1, s2, s3, s4, and s5. another series named weights_A with values 85.1, 90.2, 76.8, 80.4, and 78.9. These values represent weights of 5 students of class A. […]

Categories
Mastering Development

How to limit number of permutations

I have like 20 short strings that I want to permutate, but I just want the permutations that have len=8. I could do something like that, but it calculates aaalll possible permutations and then print. import itertools p = itertools.permutations([s1, s2, s3, s4, s5, s6,…]) for i in p: s = ”.join(j for j in […]

Categories
User Help

Trying to add up hours in excel

I have an IF formula adding up the hours in my rota: =IF(AC5>AB5, AC5-AB5,AC5+1-AB5), but in the total hours column, the addition isn’t working. A different site said to multiple it by 24. Neither has worked: =(SUM(G5,K5,O5,S5,W5,AA5,AE5))x24 or =(AE6+AA6+W6+S6+O6+K6+G6) I have tried editing the custom formula to be either h:mm or [h]:mm which also isn’t […]

Categories
User Help

Trying to add up hours in excel

I have an IF formula adding up the hours in my rota: =IF(AC5>AB5, AC5-AB5,AC5+1-AB5), but in the total hours column, the addition isn’t working. A different site said to multiple it by 24. Neither has worked: =(SUM(G5,K5,O5,S5,W5,AA5,AE5))x24 or =(AE6+AA6+W6+S6+O6+K6+G6) I have tried editing the custom formula to be either h:mm or [h]:mm which also isn’t […]

Categories
User Help

Trying to add up hours in excel

I have an IF formula adding up the hours in my rota =IF(AC5>AB5, AC5-AB5,AC5+1-AB5), but in the total hours column, the addition isn’t working. A different site said to times it by 24. Neither has worked =(SUM(G5,K5,O5,S5,W5,AA5,AE5))x24 or =(AE6+AA6+W6+S6+O6+K6+G6) I have tried editing the custom formula to be either h:mm or [h]:mm which also isn’t […]

Categories
Mastering Development

How to fully delete plots from subplot and properly resize?

I am trying to create a corner plot for an upcoming paper, but I’m running into difficulty. I am creating an N x N array of subplots (currently, N = 6) and then deleting a bit over half of them. The issue is that the figure doesn’t seem to resize itself after I delete the […]

Categories
Mastering Development

Tidying up the ggplot pie chart

After looking at various post and asking questions here i have been able to make a multi faceted pie chart. But i am facing a problem in tidying up the pie chart. Here are the things i am having troubles with: How do i remove the facet labels from each row and only have one […]