Forum Discussion

thiamhuat2026's avatar
thiamhuat2026
Icon for Helper III rankHelper III
4 months ago
Solved

Number of Rows do not tally ...why?

I have a dataframe merged_df which shows the number of rows here to be 1648323.

Which I wrote it to be output under Files/exports directory.

After which I open the file using Modern CSV which shows different number of rows.

Now, the number of rows shown here is 1662414. Why are those two number of rows different?

 

 

  • v-dineshya's avatar
    v-dineshya
    4 months ago

    Hi thiamhuat2026 ,

    Thank you for reaching out to the Microsoft Community Forum. Could you please confirm whether your issue is resolved?

     

    Regards,

    Dinesh

6 Replies

  • krajanimm's avatar
    krajanimm
    Regular Visitor

    Are there any line breaks with \r or \r\n in any columns in your CSV? Try checking for new lines in your notebook. also, what is the count of lines in the output if you check using the same code you used before the conversion? Do they tally?

    • thiamhuat2026's avatar
      thiamhuat2026
      Icon for Helper III rankHelper III

      quite difficult to check ... even if there are any breaks in any columns, shouldn't they still considered in the same row?

      • thiamhuat2026's avatar
        thiamhuat2026
        Icon for Helper III rankHelper III
         .option("multiLine", "true") \  solved it.
    • thiamhuat2026's avatar
      thiamhuat2026
      Icon for Helper III rankHelper III

      Each row is represented by the unique CaseID. I am puzzled why there is an increase when I wrote to an CSV file to view.