Advent of Code 2023 Day 2 - Python walkthrough

Поделиться
HTML-код
  • Опубликовано: 14 янв 2025

Комментарии • 6

  • @markus5775
    @markus5775 Год назад +3

    Very nice video! Hope you keep them going! I agree i would also like a overview of your envoriment

    • @anshumandash1304
      @anshumandash1304  Год назад

      Thank you for the comment! I went ahead and made a video briefly talking about it, I also made a playlist and it's now the first video in there. Let me know if you want me to go more into detail on the environment!

  • @michaelschnicke7322
    @michaelschnicke7322 Год назад +2

    Can you make a video of your environment?
    How does it work with "python3 main.py 2 -t"? And all the other features: day selection, switch between test and real, output with the required time and so on ...

    • @anshumandash1304
      @anshumandash1304  Год назад +1

      Hey! Thanks for the comment, I went ahead and recorded a small video talking about this stuff, along with a link to the code in the repo in case you want it for yourself. I made a playlist, it's the first video there. let me know if you want any other information about it!

  • @murphygreen8484
    @murphygreen8484 Год назад +1

    My approach was to just chunk through each line, splitting each section and then appending to a game list, a color list and a count list. Then I zipped the three lists together and made them into a DataFrame. From there the rest was easy. This way if there were extra colors it would still work and I didn't have to care the order of the colors. Also if the same color was pulled twice or a color was missing it wouldn't matter and I didn't have to initiate the counts with zeros. Having the data unpivoted made it easier to summarize as well.

    • @anshumandash1304
      @anshumandash1304  Год назад

      If I'm going to be honest data frames scare me lol 😅 but that definitely does sound like a clean solution.
      My justification for not doing something like that is I want to avoid external libraries as much as possible, and also I think this is much faster because of the overhead that comes with pandas