-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Spyder not counting lines in datafile correctly #22961
Comments
Hey @rkiko, thanks for reporting. You said:
I think the problem could be that the file is saved by Spyder with a different line ending than the one with which it was originally created (each operating system has different characters to represent the end of a line). And that's what's causing the problem your students are seeing. What Spyder version are you and your students using? |
When I open the file on Windows with Spyder 6.0.2 from the Windows installer I see the file line numbers as shown in the macOS screenshot (so the data is after the line 57): Checking the screenshot with the file that works with 114 as That operation I guess could be though as mixing CRLF with LF line endings? Is there any Spyder Editor option/preference that could do such a change/replace @ccordoba12 ? |
No, there is not way to do that from Spyder. @rkiko, did your students only open the file you posted and see it as in the first screenshot you posted? Or did they make some changes to it? |
@ccordoba12, according to my knowledge, the students did not change the file. I however asked them again and also asked for info about operating system and spyder version. Will get back to you asap. |
Thanks @rkiko! I think we should be able to get to the bottom of this with that info. |
I conducted a coding class and use code to open a txt file with pandas. I need to skip parts of the header, using skiprows = 57. Some of the students reported that the code works with skiprows = 114 and when one checks the datafile in the spyder window, one sees that the file is shown to have 114 rows. Other students reported that even 114 did not work. So, spyder in some cases did corrupt the line number of the file on read in...
Data file shown on computer of a student:
Code working with skiprows set to 114:
The data file that needs to be read in:
Station_1_Schwentine.txt
File as shown on my Mac, with correct line number (also e.g. as shown in BBedit).
The text was updated successfully, but these errors were encountered: