show table items as interactive sliders on jupyter notebook - dataframe

I am using qgrid to show pandas dataframe as a table in jupyter notebook. The code I'm using now is very simple, like:
qgrid_widget = qgrid.show_grid(some_df, show_toolbar=True)
qgrid_widget
Now the table is shown like the following (The table is big, I just show part of it):
For the rest of the work, I need to adjust many values in the table. And, as an experimental work, I don't know yet how the values should be adjusted, so I need to try. Now, to adjust the values, I double-click on the entry and enter the new value. I think a more efficient way is the following: each value in the table is represented on a slider, and I can drag the slider in the table to change the value.
I have tried the following but they don't work:
use ipywidgets.FloatSlider() as the entry of the table. This way, qgrid shows table entries just in plain text, "FloatSlider(value=xx, min=xx, max=xx, step=xxx)".
use ipysheet with FloatSlider(). However, even by following the examples here, the sheet just doesn't display on my jupyter notebook.
Does anyone have an idea for this question? How to use an interactive slider for each value in a table? Thanks!

Related

Not existing column in the current network's table but still visible in the column selection

I have imported data table to my cytoscape map for the following continuous mapping accorging to values. After some time, I have imported another data table and then deleted the previous one. The original data are not present in either the node or edge table but I still can see the names of the original columns when selecting column for continuous mapping i. g. for size or colour. Moreover, this warning appears: "The current table does not have the selected column. Please select another column." Do you know how to solve this so that I no longer see the names when these columns are not even in the table?
I would be grateful for any ideas.
I have tried to delete the data table and import the data again but it didn't help. I have also tried to clone current network and import data to the new map, but the old names are still present in the column selection.
Do you know how to solve this so that I no longer see the names when these columns are not even in the table?
I would be grateful for any ideas.
A couple points and then a couple suggestions:
The style is going to "remember" the selected column name, even if you delete it since it doesn't know what to change it to. It will add a warning icon mentioning that the column is missing. You have to choose a new column (or reload the missing column) to address that issue. [I think you know this already, but just stating for completeness :)]
The pulldown list of column names should be updated when you delete table columns. This does indeed sound like a bug.
Are you running the latest Cytoscape 3.9.1?
Have you tried selecting another style and then returning back to this style? That might "refresh" the column name list.
Have you tried saving/restoring the session?

how to make vscode dataframe column name small?

i am trying to use jupyter notebook in vscode.
However, when i run dataframe.
As shown in below, column names are shown bigger so that it's difficult to read.
How i can adjust column names smaller and more readable?

Order of the columns in Apache Zeppelin when selecting the data from the temprorary table is wrong, how to put specific column first?

Currently we have the scala DataFrame output with id value shown first (but it is chronologically added to the DataFrame last). Other columns appears dynamically based on .pivot() function and the data.
When I call for the data in %sql interpreter, the order is changing, thus making CSV file that I download also have id column as the last one, that doesn't work for me. I can't just write the selection script at once with putting the id column at the first point manually, as I can't control other columns because of pivot. Is there any other way to make specific column go first?
The Scala paragraph is:
resultMean.registerTempTable("mean")
The sql paragraph is:
%sql
select *
from mean
For someone who will read this in future, the reason of such a behavior is in misusing the DataFrame. In Scala .show() was applied to one DataFrame, while the export to the temp table to another one. If you face the same, please double check you apply your methods to the same objects.

How to find table region for camelot

As mentioned in camelot, we can extract table from particular region like:
tables = camelot.read_pdf('table_regions.pdf', table_regions=['170,370,560,270'])
But how can I find these regions for my pdf.
You can detect this regions, by some visual debugging.
https://camelot-py.readthedocs.io/en/master/user/advanced.html#visual-debugging
I know it's a late reply - but I just came across a possible solution.
If you're looking for a automated extraction method, you could use lattice in a first step, retrieve the table boundaries with tables[0]._bbox and use these numbers in a second call to camelot.read_pdf() into the argument table_areas.
Be aware that they are in a weirdly sorted format for a bbox.
If you just want to detect the table region you are reading, try to do this using Jupyter Notebook:
Define the table region inside .read_pdf method: tables = camelot.read_pdf('table_regions.pdf', table_regions=['170,370,560,270'], flavor='lattice'); pay attention on the flavor, because it defines whether the table have borderlines or not(it can be lattice for borders or stream for space).
Use camelot-py with plot from matplotlib: camelot.plot(tables[index], kind='contour') (You may know about how many index your object have by simply executing the name of the object. e.g.: tables runnign inside .ipynb cell)(contour is a visual debugging).
The plot will show an image of your table with a red rectangle contour. Just repeats step 2 until you achieve the table region you want to extract.
To test if the data is correct just use tables[index].df.

Is there a way to single out data within an SQL column?

So I'm working with an old joomla site and trying to export only useful data, and I found a pretty hacky way of accomplishing what I wanted to do.
So for the column I want to get to, images, even though there's been no useful information input into it, joomla automatically populates it with the following:
{"image_intro":"","float_intro":"","image_intro_alt":"","image_intro_caption":"","image_fulltext":"","float_fulltext":"","image_fulltext_alt":"","image_fulltext_caption":""}
I Ideally only want to search for fields where the value for image_fulltext is not empty, and only get the value of the field.
My original idea was this hacky snippet just to find the relevant rows at least.
SELECT id, images FROM `JOOMLAPREFIX_content` WHERE images !='{"image_intro":"","float_intro":"","image_intro_alt":"","image_intro_caption":"","image_fulltext":"","float_fulltext":"","image_fulltext_alt":"","image_fulltext_caption":""}'
This gets the me the relevant rows, but it also gets me more information than I want. (The first suggested solution, while a much less "hackey" query, gets me the same result, as you can see in the SQL snippet.)
Id Images
7 {"image_intro":"","float_intro":"","image_intro_alt":"","image_intro_caption":"","image_fulltext":"images\/featuredimage1832014.jpg","float_fulltext":"","image_fulltext_alt":"","image_fulltext_caption":""}
Is there a way to target only the value of image_fulltext, in the case of this row: "images/featuredimage1832014.jpg"?
SQL Fiddle
Try this:
SELECT id, images FROM `JOOMLAPREFIX_content` WHERE images NOT LIKE '%"image_fulltext":""%'