How can I display an image from a file in Jupyter Notebook?

前端 未结 11 1179
被撕碎了的回忆
被撕碎了的回忆 2020-11-28 01:03

I would like to use an IPython notebook as a way to interactively analyze some genome charts I am making with Biopython\'s GenomeDiagram module. While there is extensive doc

11条回答
  •  野性不改
    2020-11-28 01:46

    from IPython.display import Image
    
    Image(filename =r'C:\user\path')
    

    I've seen some solutions and some wont work because of the raw directory, when adding codes like the one above, just remember to add 'r' before the directory. this should avoid this kind of error: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape

提交回复
热议问题