CSV Column to Python Dictionary

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

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

  • @Bob47lordofthedance
    @Bob47lordofthedance 2 месяца назад

    this helped me solve a problem i was stuck on for weeks. Thanks

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

    Nice, clear, and straight to it. Liked!

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

    how can we do it for n number of columns any generalized process?

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

      Hi krushnakant, this video focused on only 1 column. You can add other column names into a fieldnames parameter to get them in a python dictionary.

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

    I need help i have csv sheet in the " requirement was there are 30 columns and I need to split one CSV file to 2 based on 1 condition if any data is present in that column that row needs to store in one CSV and of blank in that column cell that all row record into another CSV file like that splitting should be done for more than 10,000 records can you help me

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

      Hi Vegineti, this seems like a question more suitable for stack exchange.

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

    How can you put it in a column when print

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

      Hi Max, sorry I think I need more of an explanation of what you are trying to do. I don't understand the question

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

    What if there is no header on the csv file just starts the first row with 8 column and goes on?

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

      Hi there, there is a parameter I believe that will allow you to specify there is no header you can use.

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

      @@DataEngUncomplicated I know. What I mean is when you set the column to animal, to find one of the names of the animals. how would I go about setting up the python dictionary to select the 3rd column in my CSV when I don’t have a header to reference like you did.

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

    could you do this without importing the csv module

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

      HI Marko, I'm sure it's possible but will probably be a couple more steps to do this. There are other libraries that will handle reading a CSV file into python for example pandas.