I am trying to read B.txt
using pandas
. It prints the value of B
but not as a list. I present the current and expected outputs.
import pandas as pd
df = pd.read_csv("B.txt", header=None)
B = df. to_numpy()
B=B.tolist()
print("B =",B)
The current output is
B = [['B=3']]
The expected output is
B=[3]