The much-anticipated jump in inflation is here. Here's how investors can play it

The current price of gasoline is shown at a gas station in Carlsbad, California, U.S., September 16, 2019.
Mike Blake | Reuters

The much-anticipated rise in inflation is beginning to show up in the data, with April's Consumer Price Index showing the biggest annual gain in more than a decade. Here's a playbook on how investors can navigate the rising inflation.

Wednesday's consumer price index report showed a year-over-year rise of 4.2% and 0.8% since March. While officials from the Federal Reserve and the Biden administration have said the inflation could prove to be temporary, pointing to effects from the pandemic on last year's data and pent-up demand, the data is still moving markets.

Rising inflation has already lead to warnings about margins and prices from CEOs, but it isn't necessarily bad for stocks. Credit Suisse's head of global equity strategy Andrew Garthwaite said in a recent note that inflation should be positive for equities overall until it hits 3%. Historically, the S&P 500 has performed better when inflation is between 2% and 3% than when it is lower, according to Bank of America.