canopy

Pickling a DataFrame

冷暖自知 提交于 2019-11-29 19:18:17
问题 I am trying to pickle a DataFrame with import pandas as pd from pandas import DataFrame data = pd.read_table('Purchases.tsv',index_col='coreuserid') data.to_pickle('Purchases.pkl') I have been running on "data" for a while and have had no issues so I know it is not a data corruption issue. I am thinking likely syntax but I have tried a number of variants. I hesitate to give the whole error message but it ends with: \pickle.pyc in to_pickle(obj, path) 13 """ 14 with open(path, 'wb') as f: 15

Enthought Canopy Mayavi font size bug

独自空忆成欢 提交于 2019-11-29 14:49:19
The font size setting in Enthough Canopy Mayavi mlab appears to be broken. Neither the command: mlab.axes.label_text_property.font_size = 12 (e.g.) nor the direct menu font size command (advanced settings) works. I have logged a bug report with Enthought, but it looks like a more general Mayavi bug, see Does Mayavi "Font Size" text property work? As you say this is a bug that has to do with the translation between the mayavi layer and the vtk layer. But for now you could use this attribute: >> ax=mlab.axes() >> ax.axes.font_factor 1.5 >> ax.axes.font_factor=2 It only produces a small increase

Enthought Canopy 1.1 giving error icui18n: cannot open shared object file: No such file or directory

感情迁移 提交于 2019-11-29 11:16:57
I have tried to get enthought canopy and follow the procedure. However, when I tried to run ./canopy , it gave this error: Unable to load library icui18n "Cannot load library icui18n: (icui18n: cannot open shared object file: No such file or directory)". I cannot sudo because I am using the university's supercomputing account, no permission to do so. Any advice? You just need a copy of ICU installed on the system you are trying to run canopy on. You can do this by either installing it via the OS's package manager, or by getting a copy in your home directory, and telling canopy where to find it

How we can use iter_rows() in Python openpyxl package?

百般思念 提交于 2019-11-29 09:24:59
问题 I'm using openpyxl package in Python(Canopy) to use excel files. We have this tutorial in this link : LINK you can also use the openpyxl.worksheet.Worksheet.iter_rows() method: >>> tuple(ws.iter_rows('A1:C2')) ((<Cell Sheet1.A1>, <Cell Sheet1.B1>, <Cell Sheet1.C1>), (<Cell Sheet1.A2>, <Cell Sheet1.B2>, <Cell Sheet1.C2>)) >>> for row in ws.iter_rows('A1:C2'): ... for cell in row: ... print cell <Cell Sheet1.A1> <Cell Sheet1.B1> <Cell Sheet1.C1> <Cell Sheet1.A2> <Cell Sheet1.B2> <Cell Sheet1.C2

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

霸气de小男生 提交于 2019-11-29 04:25:24
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' punchagan UPDATE: The following hack is not required in Canopy versions 1.0.3 and greater. Right click inside the Python pane, and select Keep Directory Synced to Editor .

Matplotlib fonts in Enthought Canopy

独自空忆成欢 提交于 2019-11-28 23:09:37
问题 I am using the matplotlib library inside Canopy, and the specific function is xkcd(). This function uses a specific font to plot charts. The font is Comic Sans MS, which if not present, should be downloaded. /home/luis/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/matplotlib/font_manager.py:1236: UserWarning: findfont: Font family ['Humor Sans', 'Comic Sans MS'] not found. Falling back to Bitstream Vera Sans (prop.get_family(), self.defaultFamily[fontext])) I use the small script

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

五迷三道 提交于 2019-11-28 10:49:04
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 implimentation would be similar to standard methods, such that it could be done like this: from matplotlib

Enthought Canopy doesn't print right away when statement occurs

纵然是瞬间 提交于 2019-11-28 05:14:51
问题 A while ago I switched from Enthought's old EPD to their newer Canopy system. For the most part it's nice, but one aspect has been particularly vexing. Whenever I run a python script, either from within the Canopy iPython environment or from the command line, none of my print statements actually get printed right away when that part of the script is hit. Instead, multiple print s seem to get executed all at once at a later time. As an example... import numpy as np print "About to start long

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

狂风中的少年 提交于 2019-11-28 00:17:27
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" --------------------------------------------------------------------------- AttributeError Traceback (most recent call last) c:\users\jay\appdata\local\temp\tmppvibq9.py in

Python 3 in Enthought Canopy

对着背影说爱祢 提交于 2019-11-27 21:30:22
How to use Python 3 in Canopy Enthought? It has the option on the bottom to select Python 3, but this does not change anything when we use: print(sys.version) 2.7.3 | 32-bit | (default, Mar 25 2013, 15:38:39) [MSC v.1500 32 bit (Intel)] An Enthought engineer answered that at present it is not possible to use Python 3 in or with Canopy . They are considering several ways to support it but none of them will arrive in the short term. Edit : Enthought just announced Python 3 support for Canopy 2.0 . as you can see on https://www.enthought.com/products/canopy/package-index/ most(or some) packages