Unable to import cufflinks
See also questions close to this topic
Draw line between two given points (OpenCV, Python)
I am struggling with this problem for an hour by now...
I have an image with a rectangle inside:
This is the code I wrote to find the points for the corners:
import cv2 import numpy as np img = cv2.imread('rect.png') gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) gray = np.float32(gray) points = cv2.goodFeaturesToTrack(gray, 100, 0.01, 10) points = np.int0(points) for point in points: x, y = point.ravel() cv2.circle(img, (x, y), 3, (0, 255, 0), -1) print(points) print(points) print(points) print(points) cv2.imshow('img', img) cv2.waitKey(0) cv2.imwrite('rect.png', img)
This is the result:
As you can see, it works perfect. What I want is to draw a line along the upper/lower points (x1,x2 - x3,x4).
What I produced since now is this...
cv2.line(img, (points), (points), (0, 255, 0), thickness=3, lineType=8) cv2.imshow('img', img) cv2.waitKey(0)
But it doesn't work.
Any idea ?
The result should be like this:
The two lines must pass along the coordinates of the points.
print(points)above give the next output, as example:
[[561 168]] [[155 168]] [[561 53]] [[155 53]]
Performance difference between python libraries networkx, networkit and c++ boost
I am currently using
networkxwhich I guess is the slowest of the three. I am considering rewriting some parts for
networkitor the whole thing in c++ to use the
boostnetwork library. Does anybody have experience or even benchmarks comparing the three?
Accessing remote Oracle database via Squish(python)
I need to access a remote Oracle database during an automation process I am doing using Squish(Python). As a standalone python uses cx_oracle to access Oracle database.
Using Plotly subplots in R shifts grouped boxplot
I am trying to plot multiple grouped box plots using subplots in Plotly.
When I tried to do this, each plotly object that is passed to subplot function will display the plots shifted to the side.
p <- plot_ly(ggplot2::diamonds, x = ~cut, y = ~price, color = ~clarity, type = "box") %>% layout(boxmode = "group") q <- plot_ly(ggplot2::diamonds, x = ~cut, y = ~price, color = ~clarity, type = "box") %>% layout(boxmode = "group") s1 <- subplot(p, q, nrows = 2) s1
The plot s1 will look like, s1(subplot output)
All the plots at top row is shifted to left and the plots at the bottom is shifted to the right from the center of axis tick.
Is there a way to prevent this shift and center all the plots?
Modifying hoverformat in plotly
How would I make it so that when hovering over a plotly graph, the displayed value in the hoverbox can be divided by 1000 and have a "K" appended to it?
For instance, when hovering over "$10,000,000" in a plotly graph, what could be done so that "$10,000K" is displayed in the box?
Specifically, can anything be done with the "hoverformat" property? It currently looks like this:
I'm aware that this prints a float with 0 decimal places...but how would I specify the displayed value to be divided by 1000 and then have a "K" appended?
Where to create Online SQL Database
I am wanting to create my own online SQL database for a website that is going to feature some interactive r shiny/plotly apps. I see that there a appear to be a few options through things like amazon web services and microsoft. Does anyone have any recommendations for something that would be free and minimal work?