This is my first question on StackOverflow. I am very nervous. I am new to programming, and doing my best to learn and improve.
I am currently working on a project using Beautiful Table. However, when I run my code, I keep getting this deprecation warning:
C:\Users\Piko...\venv\Lib\site-packages\beautifultable\utils.py:125: FutureWarning: 'BeautifulTable.getitem' has been deprecated in 'v1.0.0' and will be removed in 'v1.2.0'. Use 'BeautifulTable.{columns|rows}[key]' instead.
from beautifultable import BeautifulTable
table = BeautifulTable()
table.rows.append([" ", " ", " "])
table.rows.append([" ", " ", " "])
table.rows.append([" ", " ", " "])
table.columns.header = ["A", "B", "C"]
table.rows.header = ["1", "2", "3"]
#below is an example of code that triggers the warning:
table.rows[0]['A'] = "Oops"
I have gone through the BeautifulTable docs and I can't seem to figure out the proper syntax of 'BeautifulTable.{columns|rows}[key]'.
Could you help me rewrite this code so I no longer get this warning message?
Also, I have used the following code as a temporary fix because the warning's red font makes me nervous:
import warnings
warnings.simplefilter(action='ignore', category=FutureWarning)