Had a question regarding the python code in Section 3 Unit 1

Course Name: [Getting Market Data: Stocks, Crypto, News

The following code was provided in the Section 3 Unit 1- Forex price data.

Did not understand the purpose of the code in the section
#ignore warnings

Import Libraries

For data manipulation

import numpy as np
import pandas as pd

To fetch financial data

import yfinance as yf

For visualisation

import matplotlib.pyplot as plt
%matplotlib inline
plt.style.use(‘seaborn-v0_8-darkgrid’)

Ignore warnings

import warnings
warnings.filterwarnings(‘ignore’)

Hi,

We use the code for ignore warnings because there are times when Python libraries give warnings that certain code will be depreciated in the future. These warnings are simply a notification and in no way mean the code is wrong. But there can be times when we misinterpret them and think that my code is an error. To avoid this, we use the ignore warnings code.

You can remove the two lines and try to see the difference yourself.

Thanks.