Anderson is the first recruit brought in by new boss Justin Edinburgh, who took over on Monday with the club 16th in the League One table.
The 21-year-old joined Palace from non-league Barton Rovers in January 2015, but has yet to play a first-team game.
He had previous loan spells with Doncaster and Bolton and could make his Cobblers debut at MK Dons on Saturday.
"I felt we needed a striker who could stretch defences and worry them with speed and movement, and Keshi can do that," said Edinburgh.
Find all the latest football transfers on our dedicated page or visit our Premier League tracker here.

The National Housing Federation inquiry shows a worker paid the region's average wage - £23,405 - would need close to a £15,000 pay rise to qualify for an 80% mortgage.
The average home in the region costs almost £166,000, more than seven times the average salary.
In Harrogate, North Yorkshire, the average cost rises to 11 times salary.
The NHF report shows Harrogate has an average house cost of almost £277,000, where the average salary is still £24,731.
In comparison it found in Barnsley, Hull, North Lincolnshire and North East Lincolnshire the average house cost less than six times the average salary.
£277,000 Average house price in Harrogate
£166,000 Average house price in Yorkshire and the Humber
£38,000 The minimum salary needed for an 80% mortgage
£23,405 Average salary in Yorkshire and the Humber
The cost of renting or buying a home in the region was getting "further out of reach for many", according to the NHF.
Jo Allen, of the NHF, said: "In some places people are completely priced out of their local communities. In others we see areas which need employment opportunities and investment in empty homes."
The foundation represents independent non-profit housing associations in the United Kingdom.
It uses the mean average for house costs and wages and assumes an 80% mortgage based on a lending ratio of 3.5 times salary.
Salary data is based on the Annual Survey on Hours and Employment by the Office for National Statistics.
Yorkshire and the Humber is one of nine regions of England identified for statistical purposes.

The NSA was allowed to collect this information without a warrant thanks to a US law passed in 2008.
In a statement it said that an internal review had revealed several problems with the spying programme and its effect on US citizens' privacy.
Surveillance experts said the NSA's decision was "very significant".
The NSA is not allowed to conduct surveillance within the US but it managed to skirt this restriction thanks to one section of the 2008 Foreign Intelligence Surveillance Act (Fisa).
This let it grab the phone calls and messages of US citizens which mentioned or otherwise involved people outside the US it was keeping an eye on.
The NSA had been widely criticised because using Fisa had meant it had scooped up lots of messages, texts and other material sent by Americans without having to apply for a warrant.
In its statement, the NSA said technical limits, privacy problems and the difficulty of carrying out this type of surveillance had driven its decision. It also said it would delete the "vast majority" of data collected via this spying programme.
The powers to spy outlined in Fisa were due to be scrutinised this year by the US Congress and are set to be renewed by the end of 2017. Many members of Congress have been critical of the spying effort and politicians were expected to significantly limit its scope during the renewal and review process.
The Fisa spying programme has also been criticised by the US Federal Intelligence Surveillance Court, which oversees NSA requests for surveillance warrants.
The NSA had defended the Fisa-allowed spying, saying that it had helped it gather "critical" intelligence.
Julian Sanchez, a privacy and surveillance expert with the Cato Institute, said the broad reach of Fisa-sanctioned spying had made it a key target of civil liberties campaigners.
"Usually you identify a specific individual to scrutinise their content; this was scrutinizing everyone's content to find mentions of an individual," Mr Sanchez told Reuters.

The 23-year-old joined Livingston on a deal until the end of 2015-16 after leaving Dundee United in January.
He previously spent the first part of last season on loan at Almondvale Stadium, and made a total of 30 appearances for Livi last term.
McCallum, who has also played for Arbroath and Berwick, is the League Two side's 14th signing of the summer.
Find all the latest football transfers on our dedicated page.
Northampton Town have signed Crystal Palace striker Keshi Anderson on loan until the end of the season.
[NEXT_CONCEPT]
Workers need to earn about £38,000 a year to afford a mortgage in Yorkshire and the Humber region, a report said.
[NEXT_CONCEPT]
The US National Security Agency (NSA) is to end surveillance on messages sent by US citizens that mention foreign intelligence targets.
[NEXT_CONCEPT]
Plymouth Argyle have signed former Livingston goalkeeper Marc McCallum on an undisclosed-length contract.