Rap star Beanie Sigel was back in federal court yesterday to answer questions about a positive drug test last December and about why he was hanging out with convicted felons in October.

Both the positive test and association with felons would violate the terms of probation for Sigel, who was sentenced to 12 months and a day plus two years of supervised release in October 2004 on gun and drug charges.

The U.S. Probation Office had asked for a hearing to modify Sigel's supervised release after he failed to notify his probation officer that he had been stopped and questioned by police last August at 20th and Carpenter streets.

At the time, Sigel was with several other individuals, at least one of whom was a convicted felon.

Sources said cops could not prove that Sigel had known that any of the individuals was a convicted felon.

Sigel also tested positive for codeine and morphine during a drug test last December.

After hearing from Sigel, his lawyer and the feds, U.S. District Court Judge R. Barclay Surrick extended Sigel's supervised release for an additional six months.

Sigel, whose real name is Dwight Grant, told Surrick that he had been given a prescription by his doctor three days before a scheduled drug test and that the script was legitimate.

Sigel's attorney, Fortunato Perri Jr., provided Surrick and Assistant U.S. Attorney Curtis Douglas with a copy of a prescription and a letter signed by Sigel's doctor that the script was to treat "flu-like" symptoms Sigel had been experiencing.

Both Surrick and Douglas seemed satisfied with that explanation.

But the judge was not as happy with Sigel's explanation for why he had been spotted in the company of a convicted felon.

"It's kind of hard for me to know who I'm associating with in the business I'm in," Sigel explained.

Surrick looked Sigel in the eye and then admonished him.

"You're going to get this situation straightened out, you're going to talk to probation, you're going to get under control or otherwise I'm going to have to take action you're not going to appreciate," Surrick said.

Sigel pleaded guilty in August 2004 to charges of being a felon in possession of a firearm and of controlled substances.

In September 2005, Sigel was acquitted of attempted-murder charges in connection with a 2003 West Philadelphia shooting.

Two months later, he was jailed for about an hour until he ponied up $27,000 in child-support payments and paid a $2,000 fine. *