The new anaconda spyder has an integrated iPython console. I really dislike the way dataframes are displayed in this console. There are some border graphics around the dataframe and resizing that occurs with window resizing that make it difficult to examine the contents. In addition, often for large dataframes if one just types the variable name, we can only see a XX rows x YY columns display, not a display of the top corner of the dataframe.
How can I reset the dataframe display so that it displays the way a standard iPython (or iPython QT) console would display a dataframe, i.e. with no graphics?
Thanks.
The development version of Spyder has a Pandas Dataframe editor (and an numpy array editor, up to 3d). You can run this from source or wait for the next release, 2.3.1.
This is probably more adequate to edit or visualize dataframe than using the embedded qtconsole.
Related
I use jupyter notebook with octave kernel and it runs quite fine.
After a while I wondered why highlighting looks so strange.
Then I realized that part of the notebook is detected as python although an octave kernel is running.
Part of the code cells, in fact most are plain text.
Now I found out in the bottom left corner, one can choose.
The language for octave is in fact MATLAB.
This improves appearance very much.
But now I wonder whether I really must switch each cell individually.
I also found autodetect but this never finds MATLAB.
I've got a network with undirected, weighted edges. I'm interested in whether nodes A and B are in the same community. When I run "modularity" in Gephi, the modularity class for node A is usually, though not always, distinct from that of B. However, when I switch over to Python and run, on the exact same underlying data, either louvain_communities() (from the networkx.algorithms.community module) or community_louvain.best_partition() (from the community module), A is always in the same community as B. I've tried this at various resolutions, but keep getting similar results: the Python modules are grouping A and B significantly more often than Gephi.
My question is: What is the Gephi method doing differently? My understanding is that Gephi uses the Louvain method; the variables I can see (resolution, using weights, etc.) seem to be the same. Why the disparity?
Edit:
I was asked to provide some code for this.
Basically I have edge tuples with weights like so:
edge_tuples = [(A,B,5),(A,C,11),(B,C,41),…]
I have nodes as a list:
nodes = [A,B,C,…]
I use networkx to make a graph:
G = nx.Graph()
G.add_nodes_from(nodes)
G.add_weighted_edges_from(edge_tuples)
If I’m using community, I get the partition like so:
partition = community.community_louvain.best_partition(G,resolution=.7)
The resolution could be whatever, but .7 is in line with what I've tried before.
In Gephi, I'm just using ordinary node and edge tables. These are generated and exported as csv's in the process of creating the edge_tuples described above (i.e. I make them both out of the same data and just export a csv before making the networkx graph), so I don't see where the underlying data would be differing, although I'm certainly open to correction.
I would like to implement Siril's Midtones Function Transfer algorithm in a GIMP plugin. Ideally, it would get 2 sliders (black level, midtones value) and a preview.
But I can't find a non-obsolete tutorial/example to implement a pixel operation with minimum GUI (sliders, preview...). Do you have an idea where to start ? Maybe a up-to-date example of plugin with pixel by pixel operation ? or with widget like sliders ?
# Siril's algortihm :
MTF(x;m) = ((m-1)x)/((2m-1)x-m)
# x : pixel value (float)
# m : midtones values float[0, 1]
https://free-astro.org/siril_doc-en/#Histograms
https://free-astro.org/index.php?title=Siril:Processing_tutorial
Siril is a great free software to process astrophotography, but it lacks some tools like layers, selection...
For a full-capability plugin written in C the best place is Gimp's own source. Some filters are still defined as plugins in Gimp. See here.
Otherwise you can do a quick proof-of-concept in Python, with an auto-generated dialog for the two sliders (but no preview). The python interface defines "pixel regions" that map a python list directly over the Gimp data.
You can even use Numpy.
For a Python POC:
Official Gimp-python doc is here.
Numpy link has an example script.
Large set of example scripts here.
An example of all the UI widgets here
Some hints about debugging your stuff here
just for curiosity sake - is there a way to find how many lines of code you've written in your ipython notebook? I have multiple lines per box, so I can't just count the number of boxes I have...
I want to run a cell using vim. however, using what I see here:
How to implement MATLAB-like cell mode in Vim
I get a matlab instance starting, running and then closing. Is it possible to to this like it would be on a real matlab? ie I have a vim on one side and matlab on the other (open all the time), and by a vim command I get the cell to run on the matlab?
Not sure whether this is exactly what you want, but you might want to browse through these answers