Call a class from another file

1

In a class in a file querySQLPredictions.py we have:

class QuerySQLPredictions:
    """"""
    def __init__(self,dataFrame_subscriber_content):
        """"""
        self.dataFrame_subscriber_content = dataFrame_subscriber_content

and in another file, Main.py another function call it:

ratings_full = df.fillna(0).astype(int)

import querySQLPredictions

querySQLPred = querySQLPredictions(ratings_full)

But when I call the second file it says

  File "Main.py", line 66, in <module>
    import querySQLPredictions
  File "/home/antoine/Swiper/Recommender/FactorizationRecommender/FactorizationRecommenderGraphlab/querySQLPredictions.py", line 12, in <module>
    class QuerySQLPredictions:
  File "/home/antoine/Swiper/Recommender/FactorizationRecommender/FactorizationRecommenderGraphlab/querySQLPredictions.py", line 16, in QuerySQLPredictions
    self.dataFrame_subscriber_content = dataFrame_subscriber_content
NameError: name 'dataFrame_subscriber_content' is not defined
    
asked by ThePassenger 11.07.2017 в 17:46
source

0 answers