0

Hi, Guys.
I'm calculating the correlation coefficient between two HashMaps of Stock Prices keyed on Dates. However, the Dates do not always line up perfectly. So, I need to line-up the two HashMaps by their Keys.

Thus far, I'm creating two ArrayLists of the Dates, doing retainAll between them and then copying over the HashMaps using only the matching Dates.
This probably less than ideal.
If someone has a more efficient way, please let me know.
Help me out, Daniweb.

2
Contributors
2
Replies
13
Views
2 Years
Discussion Span
Last Post by DeanMSands3
1

Maybe just loop through the keys of one of the Maps, deleting all the entries that don't have a corresponding key in the second Map?

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.