Skip to content

Tag: python

Tkinter import filedialog error

I’m trying to use tkinter with python3 to open an image, see here a piece of code : I have installed python3-tk, and I have the demo window when I write in the terminal. I tried several combinations that did not work : gives , gives I tried with _tinker , FileDialog, file_dialog, but I always have &#822…

How can I draw lines into numpy arrays?

I would like to be able to draw lines into numpy arrays to get off-line features for on-line handwriting recognition. This means I don’t need the image at all, but I need for some positions in a numpy array who an image of a given size would look like. I would like to be able to specify an image size

Zsh: Conda/Pip installs command not found

So I installed Anaconda and everything is working. After I installed it I decided to switch to oh-my-zsh. I am now getting: when trying to use pip or conda installs 5.0.5 I have added to my zshenv.sh What is it that I’m missing? Answer It appears that my PATH is broken in my .zshrc file. Open it and add…

Print ‘std err’ value from statsmodels OLS results

(Sorry to ask but http://statsmodels.sourceforge.net/ is currently down and I can’t access the docs) I’m doing a linear regression using statsmodels, basically: I know that I can print out the full set of results with: which outputs something like: I need a way to print out only the values of coef…

Scikit-learn train_test_split with indices

How do I get the original indices of the data when using train_test_split()? What I have is the following But this does not give the indices of the original data. One workaround is to add the indices to data (e.g. data = [(i, d) for i, d in enumerate(data)]) and then pass them inside train_test_split and then…