New answers tagged


I copied the user, rafaelvalle's code: # Find Elbow Point, Trade off Point def elbow_point(data): curve = data nPoints = len(curve) allCoord = np.vstack((range(nPoints), curve)).T np.array([range(nPoints), curve]) firstPoint = allCoord[0] lineVec = allCoord[-1] - allCoord[0] lineVecNorm = lineVec / np.sqrt(np.sum(lineVec**2)) ...


Your current solution is fine, but it computes the counts multiple times. It's more efficient to compute once and store the result: # compute once complaints = npy_dataframe["Complaint Type"].value_counts().head() # reuse result, height=complaints) ax.axhline(y=complaints.mean(), linestyle="--") Or use the data ...


Only this line is solved the error["Complaint Type"].value_counts().head().keys(),npy_dataframe["Complaint Type"].value_counts().head())

Top 50 recent answers are included