^M Character when uploading Python

What is this symbol (^M) that appears when I upload some Python code to GitHub? I’ve uploaded similar files (all coded in Spyder) but the symbol only appears in one file. The raw code is fine it just appears in Normal View

Windows uses two characters to define a newline: CR+LF.
Unix uses one character: LF.
Old Macintosh OS used the other: CR.

The ^M is the CR.

https://peterbenjamin.com/seminars/crossplatform/texteol.html