Home > Mobile >  How to print the output of variables in a dataframe
How to print the output of variables in a dataframe

Time:12-24

This might be a very basic question but I am stuck with it for quite some time now. I have four variables with some values and I want to put it into a data frame. I am using the below code but not getting any results. Please help

code details

CodePudding user response:

Create new dataframe with columns A, B, C, D:

import pandas as pd

A=5*5
B=6*6
C=7*7
D=8*8

data = pd.DataFrame({'A': [5*5], 'B': [6*6], 'C': [7*7], 'D': [8*8]})
data
print(data)

CodePudding user response:

import pandas as pd

A=5*5
B=6*6
C=7*7
D=8*8

data = pd.DataFrame({'A': [5*5], 'B': [6*6], 'C': [7*7], 'D': [8*8]})

print(data)
  • Related