CHANGE COLUMN DTYPE | How to change the datatype of a column in Pandas (2020)

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

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

  • @bryanparis7779
    @bryanparis7779 2 года назад

    The best video...i was searching in so many videos here and thanks to you I'm done:) MANY WISHESSSSS

  • @michaelmiachel1832
    @michaelmiachel1832 2 года назад +1

    Thank you! I've watched a lot of videos, but it was yours that helped me at a certain point👍

  • @amaanraza2704
    @amaanraza2704 2 года назад

    Explanation with rationale as to why we do it a certain way is exemplary

  • @mahboobalam5689
    @mahboobalam5689 2 года назад +1

    It's a nicely explained tutorial. 👍

  • @mrmuranga
    @mrmuranga 4 года назад +2

    nice and short..thanks

  • @7Dikano
    @7Dikano 2 года назад +1

    Hi, thank you! I have a problem while trying to convert 'missing' to int I have this error (IntCastingNaNError: Cannot convert non-finite values (NA or inf) to integer). Also my vs Code ipynb file won't recognise Int64: ..errors='coerce').astype(Int64)

  • @mr.sakshamjolly8972
    @mr.sakshamjolly8972 2 года назад

    really helpful bro... thanks for creating this video

  • @sergio_bandera
    @sergio_bandera 2 года назад +1

    Thank youuuuuuuuuuuuuuuuuuuu!!!!!!!!!!!!!!!!!!!!

  • @experiencewithgeoffrey
    @experiencewithgeoffrey 3 года назад +2

    Thank you so much for this! :)

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

    Thanks so much it is very informative.

  • @unknown7261
    @unknown7261 2 года назад +1

    Hello, I just want to ask what to do if a dataframe is displaying 1,500 even if the value on the excel is 1,500.00

    • @ChartExplorers
      @ChartExplorers  2 года назад

      When you read in the excel file you can specify the data type (dtype) of the column
      df = pd.read_excel('excel_file.xlsx', dtype={'col_a': float, 'col_d':float})
      If your column of numbers has commas in (1,500.00) it you will have to read in the file, remove the commas and any other symbols and then convert to float.
      If you want two decimal places you can change it for the entire dataframe with the following
      pd.options.display.float_format = "{:,.2f}".format

  • @darksider8207
    @darksider8207 5 месяцев назад

    can anyone explain at money col he replaces everything with empty string but i have loss which is indicated by - how can i keep the - sign for indicatiing loss and change its type to nu[meric ??

  • @miketruong0808
    @miketruong0808 3 года назад +1

    Can you share the link to the video for converting column to datetime? It's not in your descriptions

    • @ChartExplorers
      @ChartExplorers  3 года назад +1

      Hi Mike, thanks for letting me know! I had forgotten to add the link ruclips.net/video/f7LODKIjtaA/видео.html

    • @miketruong0808
      @miketruong0808 3 года назад

      @@ChartExplorers thank you. Your video was very helpful by the way

    • @ChartExplorers
      @ChartExplorers  3 года назад

      Thanks! I'm glad it helped (it makes it feel worth it when I know it actually helps out).

  • @brandonjones5326
    @brandonjones5326 3 года назад +1

    Thanks for this!

  • @arunimav6592
    @arunimav6592 2 года назад

    How to find out which of the columns are having a datatype object and convert them to string type ...i mean not specifically mentioning the column name..but by iterating and taking them automatically...PLS REPLY

  • @ridoychandraray2413
    @ridoychandraray2413 2 года назад

    Very helpful

  • @honest_review2492
    @honest_review2492 2 года назад

    How to convert high and low in float

  • @honest_review2492
    @honest_review2492 2 года назад

    It is not working with any of your suggestions please help

  • @artibhardwaj5035
    @artibhardwaj5035 3 года назад

    Thanks alot u save my life

  • @shubhamjami5341
    @shubhamjami5341 4 года назад +1

    Thank you so much bro

  • @robiatuladawiyahal-qosh2916
    @robiatuladawiyahal-qosh2916 2 года назад

    Thank you!

  • @ameysonawane
    @ameysonawane 3 года назад

    thank you so much..!!

  • @QuietPenguinGaming
    @QuietPenguinGaming 3 года назад

    You completely skipped over the only column I cared about (missing) by saying "now we should be fully equipped to deal with this on our own".
    Abysmal tutorial and teacher.

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

    Thank you!