canopy

Python file open() in Enthought Canopy fails with: “IOError No such file or directory”

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-27 18:26:23
问题 I'm running code under Enthought Canopy to open and read a file. It keeps telling me IOError. But I am pretty sure the text file name is right and it is in the same directory with the Python file, and the code works well in other IDEs like Python IDLE. Don't know what's wrong. Any suggestions? inFile = open('words.txt', 'r') words = inFile.read().split() fails with IOError: [Errno 2] No such file or directory: 'words.txt' 回答1: UPDATE: The following hack is not required in Canopy versions 1.0

Save the “Out[]” table of a pandas dataframe as a figure

笑着哭i 提交于 2019-11-27 03:55:45
问题 This may seem to be a useless feature but it would be very helpful for me. I would like to save the output I get inside Canopy IDE. I would not think this is specific to Canopy but for the sake of clarity that is what I use. For example, my console Out[2] is what I would want from this: I think that the formatting is quite nice and to reproduce this each time instead of just saving the output would be a waste of time. So my question is, how can I get a handle on this figure? Ideally the

AttributeError: 'module' object has no attribute 'cbook'

房东的猫 提交于 2019-11-26 21:42:19
问题 I am trying to run a simple code and I have all the dependencies for matplotlib and numpy installed in my Canopy. Still I am getting error. import cv2 import numpy as np import matplotlib.pyplot as plt x = cv2.imread('jay.jpg') plt.imshow(x, cmap = 'gray', interpolation = 'bicubic') plt.xticks([]), plt.yticks([]) # to hide tick values on X and Y axis plt.show() Error: %run "c:\users\jay\appdata\local\temp\tmppvibq9.py" --------------------------------------------------------------------------

Folium map not displaying

偶尔善良 提交于 2019-11-26 21:34:46
问题 Running on canopy version 1.5.5.3123 With; Folium Version: 0.1.2, Build: 1 The following code; import folium import pandas as pd LDN_COORDINATES = (51.5074, 0.1278) from IPython.display import HTML import shapefile #create empty map zoomed in on London LDN_COORDINATES = (51.5074, 0.1278) map = folium.Map(location=LDN_COORDINATES, zoom_start=12) display(map) Returns <folium.folium.Map at 0x10c01ae10> But nothing else. How do i get to display a map within an ipython notebook? 回答1: I've found