Process finished with exit code 0 but doesn't show expected result

The code is given below:

import semopy
import pandas as pd


df = pd.read_spss(r"C:\Users\Irfan\Downloads\218.R1.sav")

replacer = {'SD': 1, 'D': 2, 'N': 3, 'A': 4, 'SA': 5}


cols = ['CBI_1', 'CBI_2', 'CBI_3', 'TRUST_1', 'TRUST_2', 'TRUST_3', 'TRUST_4', 'eWOM_1', 'eWOM_2', 'eWOM_3', 'eWOM_4',
'eWOM_5']
df[cols] = df[cols].replace(replacer)


model_spec = """
CBI =~ CBI_1 + CBI_2 + CBI_3
TRUST =~ TRUST_1 + TRUST_2 + TRUST_3 + TRUST_4
eWOM =~ eWOM_1 + eWOM_2 + eWOM_3 + eWOM_4 + eWOM_5
CBI ~ TRUST + eWOM
"""


model = semopy.Model(model_spec)

model.fit(df)

model.inspect()
0
3 comments

Hi, 

Could you please check if the issue is IDE-related by running your code from the terminal outside of IDE?

0

My code is perfectly fine as it ran successfully in jupyter lab.Andrey Resler

 

0

Ah, I see. 

If you run the code from .py file, please try running it in a Python console and let me know if you see the output.

0

Please sign in to leave a comment.