Let me start by saying that the example floor you are about to see is not in the best condition. I decided a year or two ago to remove the hideous blue stained wall-to-wall carpet from the house, and I love the results. Under the blue crusty monstrosity, there were lovely honey-colored wood floors. The wood was infinitely better than the carpet. But—the floor itself was fairly scratched and stained. This walnut trick works better with new scratches; not so much with scratches that have existed underneath wall-to-wall carpeting for 30 or 40 years.
So, keeping all that in mind, please ignore the dark scratches you see—those are going to take some serious work, beyond the capacity of a walnut.
Look for the white scratch, shaped like a ^ little tent that ends near the word "see—" in the previous paragraph. That's the scratch we're going to tackle.
Prepare to be astonished.
It's so easy, it's kind of ridiculous.
Take a walnut, without the shell (available in the baking aisle of your local grocery store), and rub it with vigor on the scratch.
Working from right to left in these photos, the scratch is (mostly) obliterated.
You'll be getting a little bit of nut oil on your floor as you do this. Don't worry, you can just wipe it up with a soft cloth.
Apparently, almonds, pecans, and brazil nuts also work. Any oily nut probably will do.
Now if I can only find a way to eradicate those dark scratches as easily...
In case you forgot what the original scratch looked like, here are the first and last pictures, side by side.