This week's book giveaway is in the Python forum.
We're giving away four copies of High Performance Python for Data Analytics and have Tiago Rodrigues Antao on-line!
See this thread for details.
Win a copy of High Performance Python for Data Analytics this week in the Python forum!

Rish Dave

Greenhorn
+ Follow
since Mar 20, 2019
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Rish Dave

I need to load file data in arraylist which I have done by creating a method. How can I count number of students using streams by creating a separate method for counting names. I have a student class with constructor, getters and setters.

I have a file having data as
Name: a
Subjects : eng, phy, chem
Name: b
Subjects : math, bio

//name is variable in student class // getName is the getter

List<Student> stu = new ArrayList<>():


public static Map<String,Long> names(List<Student> name, Predicate <Student> getName) {      
   Map<String, Long> n  = stu.stream()
   .filter(getName)    
   .collect(Collectors.groupingBy(e -> e.getName(),Collectors.counting()));
   System.out.println(Collectors.counting());
   return n;
}

This method is not working. What changes should i make and how to call this method.
1 year ago
Hi. I have a file having data in the format below:
Name: a
year: 1997
subjects: Math, Phy, Chem
...
I dont understand how to read this file using scanners.
my constructor is:

I also have getters, setters and toString in my Info class but for my separate main class how do I create a method which reads this data as such (after subjects all three fields are repeated with different data values.. I am confused as subjects itself is a list.
1 year ago
How can i concatenate 3 already present vi files to new file using vi in unix?
Considering that I have one already made file open.
1 year ago
How do i display line numbers in vi in unix permanently for a particular file ?
Hoe do i concatenate files in vi itself with a blank line between each file's content?
1 year ago
How do i concatenate file1 and file2 in a new file called" result" with a blank line between the data of two files?
cat file1 file2 >> result
I dont know how ot get the blank line
1 year ago
is this a valid command?
cat filenum1 > cat filenum2. Supposing file1 and file2 are already there. What will this command do?
1 year ago
I need to merge both maps and if a key has different values in both maps, those values should be added for the particular key from different maps. The merged map should have unique keys and its values along with added values for same key.
1 year ago
I am unable to iterate and add up vales for same key for both maps. I need help.
1 year ago
Hey. I have two maps : Map<String, int> m1 = new HashMap<>() and Map<String, int> m2 = new HashMap<>();
and these have values respectively as m1 : { a=20, b=40, c=40} and m2: { a=19, x= 30, y=80}
And I want to go through each map and its values (they have "a" a common and I want both values of "a" summed up) and print both common and unique values  and store  to further use them. How do I do that?
1 year ago