- I have a bank data having dates and amount,
and a holiday csv file given separately
which has dates of holiday and I have to add the amount values from date of holiday to the next working day and make the amount of the day having holiday '0'

- 1
- 3
-
What have you tried so far? – Daweo Sep 28 '21 at 08:50
-
I tried converting the holiday file into a dictionary but apart from that I have no idea – firestorm Sep 28 '21 at 09:03
-
1@firestorm well, that's at least something! So... why not adding it to the question? If you at least show what you've tried, it's a completely different case than just slightly reworded homework text. Then, if you have no clue how to do it from the programming side, try at least to split the problem into small parts in bullet-point list. Either you'll get an idea what to do, or you'll prove that you actually know what's necessary, but have no clue how to *code it*. – Peter Badida Sep 28 '21 at 09:07
-
@PeterBadida Actually I am new to this platform , I will keep that in mind form next time – firestorm Sep 28 '21 at 09:11
-
@firestorm This argument unfortunately doesn't really fly this time. You're 2 months (2nd July 2021) on this platform which is quite a long time to go through the [tour](https://stackoverflow.com/tour) and [mcve](https://stackoverflow.com/help/minimal-reproducible-example) pages. – Peter Badida Sep 28 '21 at 09:12
-
1@PeterBadida this Is my first question man, and still if you have any problem than flag this question . I am not here for any arguments I just wanted to clear my doubt. – firestorm Sep 28 '21 at 09:16
-
@firestorm The tour page is displayed right after the registration and guides a new user on how to create questions. I'm actually trying to help and pry off some info relevant to the question from you because since you've posted the question you've only removed the second part of it and haven't provided code or anything else thus it looks like a "do homework for me" which is *really* frown upon in here. Where is the actual question or "doubt" you want to clear? – Peter Badida Sep 28 '21 at 09:22
1 Answers
I'll try to answer generically as there's no other info provided.
As the question is "How to Exclude Holidays and Weekends from a Bank data in python" there are multiple ways how to achieve it:
- create a new list, iterate through old list's elements and add to the new one only those that match a certain condition
- filter already existing list with a code that will be executed for each element
- etc
As you have the bank data in CSV, you need to convert it to a format Python can understand directly - that is the dict
you've mentioned in the comments, or any other Python structure as CSV is basically text and worse to manipulate directly. Thus bank data would be one dict
and the holiday data would be another dict
.
Then you apply the logic via programming so that the holidays and weekends aren't present in those items.
Also, I recommend you to start splitting problems into smaller parts until you can address at least one of the parts, then incrementally move forward with resolving it until eventually you solve the whole problem.
Some tutorials worth checking:

- 11,310
- 10
- 44
- 90