Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

X should be a numpy array #2

Open
mlhossen opened this issue Apr 22, 2021 · 0 comments
Open

X should be a numpy array #2

mlhossen opened this issue Apr 22, 2021 · 0 comments

Comments

@mlhossen
Copy link

Hi, I am trying to calculate the TE where my data is a matrix obtained from a molecular dynamics simulation. I tried following:

import pandas as pd
import seaborn
import matplotlib.pyplot as plt
from PyIF import te_compute as te
import numpy as np
X_1000 = pd.read_csv("1.csv")(6, 1).flatten() # 1.csv is my data
Y_1000 = pd.read_csv("1.csv")(6, 1).flatten()

And I got the following error message:


TypeError Traceback (most recent call last)
in
----> 1 X_1000 = pd.read_csv("1.csv")(6, 1).flatten()
2 Y_1000 = pd.read_csv("1.csv")(6, 1).flatten()

TypeError: 'DataFrame' object is not callable

Further, when I typed
TE = te.te_compute(X_1000, Y_1000, k=1, embedding=1, safetyCheck=True, GPU=False)
I got following message:


AssertionError Traceback (most recent call last)
in
----> 1 TE = te.te_compute(X_1000, Y_1000, k=1, embedding=1, safetyCheck=True, GPU=False)

~/opt/anaconda3/lib/python3.8/site-packages/PyIF/te_compute.py in te_compute(X, Y, k, embedding, safetyCheck, GPU)
27 assert_true(k>=1, msg="K should be greater than or equal to 1")
28 assert_true(embedding >= 1, msg='The embedding must be greater than or equal to 1')
---> 29 assert_true(type(X) == np.ndarray, msg='X should be a numpy array')
30 assert_true(type(Y) == np.ndarray, msg='Y should be a numpy array')
31 assert_true(len(X) == len(Y), msg='The length of X & Y are not equal')

~/opt/anaconda3/lib/python3.8/unittest/case.py in assertTrue(self, expr, msg)
763 if not expr:
764 msg = self._formatMessage(msg, "%s is not true" % safe_repr(expr))
--> 765 raise self.failureException(msg)
766
767 def _formatMessage(self, msg, standardMsg):

AssertionError: False is not true : X should be a numpy array
What am I missing here? What could be possible action overcoming the issues?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant