Categories
Mastering Development

For loop with if else skipping last item Python

I am trying to create a list with only the numbers of initial list. I created a code to retrieve the numbers but it skips the last item. I can´t figure out why it does it. Thanks 🙂 list1=[‘a13′,’b23′,’c33′,’d43’] #a13=item a,1,3 = subitems list2=[] list3=[] for item in list1: for subitem in item: if subitem.isdigit()==True: […]

Categories
Mastering Development

ValueError: invalid literal for int() with base 10: ‘[[4, 4, 4, 4], [2, 2, 2, 2], [6, 6, 6, 6], [8, 8, 8, 8], [8, 8, 8, 8]]’

I want to convert this whole string into a 2d list of integer type. b="[[31, 91, 80, 11], [50, 11, 20, 10], [22, 33, 11, 11], [10, 12, 33, 23], [8, 8, 8, 8]]" I tried with the isdigit() function but it wouldn’t work for the double digit strings as it was also splitting it […]

Categories
Mastering Development

Is it possible in Java to implement interfaces and their methods without using the keyword “implements”?

I have homework to do (actually my girlfriend :-D) and there are some restrictions on what I can and can’t do. In my NetBeans project folder there are two folders named "interfaces" and "homework". The folder "interfaces" contains interfaces and classes that are NOT allowed to edit, because said that to us xD. I am […]

Categories
Mastering Development

update whole json by remove all elements from array except the one at given array index

Whole json structure to be kept, but in one array I’d like to remove all values but one on given index. Input: { "a": { "b": [11,22,33,44] } } Desired output: { "a": { "b": [22] } } All I have on input to identify item to be deleted is its index in array. I […]

Categories
Mastering Development

R grouping data by numeric numbers in a column

I am trying to group data by numbers in a column, I have tried different versions of group_by, cut, group etc but I have not been able to get it. I have a lot of data that looks like this: position variants 3 snv 5 snv 12 snv 17 mnv 22 deletion 27 snv 33 […]

Categories
Linux Mastering Development

awk match last record and print

I got this record as fileinp: 1 ABCDEFGHILM 12345678901234567 ABCD X 1 CDEFGHILMNO 34567890123456789 BCDE Y 1 EFGHILMNOPQ 56789012345678901 CDEF Z 1 GHILMNOPQRS 78901234567890123 DEFG W When last character is Y or Z, I want to print from char 14 to char 47, appended by the last character matched. Results expected as fileout: 34567890123456789Y 56789012345678901Z […]

Categories
Mastering Development

Counting how many times a digit occurs in a number C++

So im having trouble figuring out how to count how many times a digit occurs in a number. The gist of the entire hw problem is that the user will give me a range of numbers( a to b) and my code has to be able to see how many numbers within that range have […]

Categories
Linux Mastering Development

How to extract specific data (using string and delimiter) from multiple text file to a excel sheet?

I have thousands of files like (e.g. EOG090W06LO_M0_mlc) like below and I want to extract specific data from those files like lnL kappa (ts/tv) omega (dN/dS) tree length for dN tree length for dS EOG090W06LO -5160.995083 1.50195 0.05318 0.6637 12.4810 EOG090W05ZG …… ……. …… ……. …….. EOG090W06CS …… ……. …… ……. …….. Kindly guide me […]

Categories
Linux Mastering Development

How to extract specific data (using string and delimiter) from multiple text file to a excel sheet?

I have thousands of files like (e.g. EOG090W06LO_M0_mlc) like below and I want to extract specific data from those files like lnL kappa (ts/tv) omega (dN/dS) tree length for dN tree length for dS EOG090W06LO -5160.995083 1.50195 0.05318 0.6637 12.4810 EOG090W05ZG …… ……. …… ……. …….. EOG090W06CS …… ……. …… ……. …….. Kindly guide me […]

Categories
Linux Mastering Development

How to extract specific data (using string and delimiter) from multiple text file to a excel sheet?

I have thousands of files like (e.g. EOG090W06LO_M0_mlc) like below and I want to extract specific data from those files like lnL kappa (ts/tv) omega (dN/dS) tree length for dN tree length for dS EOG090W06LO -5160.995083 1.50195 0.05318 0.6637 12.4810 EOG090W05ZG …… ……. …… ……. …….. EOG090W06CS …… ……. …… ……. …….. Kindly guide me […]