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

.T syntax not working #25

Open
lig2017 opened this issue Jul 11, 2024 · 0 comments
Open

.T syntax not working #25

lig2017 opened this issue Jul 11, 2024 · 0 comments

Comments

@lig2017
Copy link

lig2017 commented Jul 11, 2024

Thank you very much for your scripts :)

This line uses .T, which does not work

https://github.com/PeyracheLab/pynacollada/blame/dc18e7781cbf86549014c46dafd5483ceb02ee4c/pynacollada/Pynapple%20Paper%20Figures/Peyrache%202015/Peyrache_dataset.ipynb#L1894

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
Cell In[43], [line 12](vscode-notebook-cell:?execution_count=43&line=12)
      [9](vscode-notebook-cell:?execution_count=43&line=9) plt.plot(decoded.restrict(ep),'--', color = 'grey', linewidth = 2, label = 'decoded HD', zorder = 1) #Decoded HD, in grey
     [11](vscode-notebook-cell:?execution_count=43&line=11) #Plot the smoothed probability distribution
---> [12](vscode-notebook-cell:?execution_count=43&line=12) plt.imshow(p_feature.restrict(ep).T, aspect = 'auto',interpolation = 'bilinear', extent = [ep['start'].values[0],ep['end'].values[0],0,2*np.pi], origin = 'lower', cmap = 'viridis')
     [13](vscode-notebook-cell:?execution_count=43&line=13) # plt.imshow(
     [14](vscode-notebook-cell:?execution_count=43&line=14) #     np.transpose(p_feature.restrict(ep).values),
     [15](vscode-notebook-cell:?execution_count=43&line=15) #     aspect="auto",
   (...)
     [19](vscode-notebook-cell:?execution_count=43&line=19) #     cmap="viridis",
     [20](vscode-notebook-cell:?execution_count=43&line=20) # )
     [21](vscode-notebook-cell:?execution_count=43&line=21) plt.xlabel('Time (s)') #X-axis is time in seconds


```pytb
File c:\Users\lucia\anaconda3\Lib\site-packages\pynapple\core\time_series.py:122, in BaseTsd.__getattr__(self, name)
    [118](file:///C:/Users/lucia/anaconda3/Lib/site-packages/pynapple/core/time_series.py:118)         return np_func(self, *args, **kwargs)
    [120](file:///C:/Users/lucia/anaconda3/Lib/site-packages/pynapple/core/time_series.py:120)     return method
--> [122](file:///C:/Users/lucia/anaconda3/Lib/site-packages/pynapple/core/time_series.py:122) raise AttributeError(
    [123](file:///C:/Users/lucia/anaconda3/Lib/site-packages/pynapple/core/time_series.py:123)     "Time series object does not have the attribute {}".format(name)
    [124](file:///C:/Users/lucia/anaconda3/Lib/site-packages/pynapple/core/time_series.py:124) )

AttributeError: Time series object does not have the attribute T

Here there is another example of your code that does work beautifully
https://pynapple-org.github.io/pynapple/generated/examples/tutorial_HD_dataset/

thank you! :)

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