Use ChatGPT To Write Python Code

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

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

  • @TBjunk25
    @TBjunk25 9 месяцев назад +2

    I’ve just started using Chatgpt 4 to learn python and programming. Created a script allowing me to input a video, detect faces in the video, filter blurry + duplicate faces, output individual png frames for each individual. Thinking I could maybe sell this as a software to retail stores with high theft levels. Only took around 10 chats to get it to work as intended, starting with a simple (video2png script) it messed up a few times but after resubmitting the code and asking for it to fix it, it worked. It actually took longer just trying to figure out how to run a python script 😂
    Overall I’m very impressed, went from knowing literally nothing about coding / programming, to successfully running an optimized custom script within an hour. it’s not perfect but it’s definitely beyond game changing.

  • @ajn2747
    @ajn2747 11 месяцев назад

    Really interesting. I used ChatGPT to help me with a build project a few months ago. I was curious about your point at 4:45 about 'code style' and how you chain you code vs how ChatGPT formats it. Do you mind expanding on that?

    • @ChristopherBruehl
      @ChristopherBruehl 11 месяцев назад +1

      Hi there! ChatGPT seems to take the "average" code style from example it sees across the web. I prefer to chain my Pandas expressions, where a dataframe gets passed from one function to the next rather than create intermediate variables that store the dataframe at various points.
      So instead of:
      df = pd.read_csv("retail.csv")
      df["date"] = pd.to_datetime([df["date"])
      df.set_index("date", in_place=True)
      resampled_df = ...
      We could do:
      resampled_df = (
      pd.read_csv("retail.csv", parse_dates=["date"])
      .set_index("date)
      .groupby(["store_nbr", "family"])
      .resample("M")["Sales"].sum()
      .reset_index
      )
      .
      TL; DR: ChatGPT won't always align with your style/workflow preferences, so you may need to refactor code to get it into the shape you prefer.
      .

  • @arinoluwaolaniyi3868
    @arinoluwaolaniyi3868 Месяц назад

    Can these codes be detected?