What do you want to save?
Add Code snippet
New code examples
-
Python 2022-02-18 01:55:03
how to map longitude and latitude in python
from shapely.geometry import Point import geopandas as gpd from geopandas import GeoDataFrame df = pd.read_csv("Long_Lats.csv", delimiter=',', skiprows=0, low_memory=False) geometry = [Point(xy) for xy in zip(df['Longitude'], df['Latitude'])] ... Add solution -
Python 2022-01-30 18:45:17
pandas sort dataframe alphabetically by column
dict_ = { 'C':[1,2,3,4], 'B':[2,4,5,8], 'A':[7,5,7,8], 'D':[1,7,8,7] } from pandas import DataFrame df = DataFrame(dict_) #unorder columns df C B A D 0 1 2 7 1 1 2 4 5 7 2 3 5 7 8 3 4 8 8 7 #only follow from this line when have existing dataframe. col =... Add solution -
Python 2022-01-29 09:26:37
k-means
import tkinter as tk from tkinter import filedialog import pandas as pd from pandas import DataFrame import matplotlib.pyplot as plt from sklearn.cluster import KMeans from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg root= tk.Tk() canvas1... Add solution -
Other 2021-11-21 21:21:11
get data from elasticsearch to jupyter
from datetime import datetime from elasticsearch import Elasticsearch from pandas import DataFrame, Series import pandas as pd import matplotlib.pyplot as plt es = Elasticsearch(host="192.168.121.252") res = es.search(index="_all", doc... Add solution -
Python 2021-10-24 16:32:15
Concatenating two DataFrames, and then finding the Maximum value
from pandas import DataFrame Data1 = {'Set1': [55,22,11,77,33]} df1 = DataFrame(Data1, columns= ['Set1']) Data2 = {'Set2': [23,45,21,73,48]} df2 = DataFrame(Data2, columns= ['Set2']) Concatenated = df1['Set1'].map(str) + df2['Set2'].map(str) df_co... Add solution -
Python 2021-10-21 09:39:12
pca feature selection
# Feature Importance with Extra Trees Classifier from pandas import read_csv from sklearn.ensemble import ExtraTreesClassifier # load data url = "https://raw.githubusercontent.com/jbrownlee/Datasets/master/pima-indians-diabetes.csv" names = ['pr... Add solution -
Python 2021-10-20 13:27:06
qtradablestocksus
from quantopian.pipeline.data import Fundamentals from quantopian.pipeline.data import morningstar from quantopian.pipeline.factors import AverageDollarVolume from quantopian.pipeline.factors.morningstar import MarketCap from quantopian.pipeline.classifie... Add solution -
Python 2021-10-05 13:16:08
how to sort columns alphabetically in pandas
dict_ = { 'C':[1,2,3,4], 'B':[2,4,5,8], 'A':[7,5,7,8], 'D':[1,7,8,7] } from pandas import DataFrame df = DataFrame(dict_) #unorder columns df C B A D 0 1 2 7 1 1 2 4 5 7 2 3 5 7 8 3 4 8 8 7 #only follow from this line when have existing dataframe. col =... Add solution
Best helpers
+5
+5
+5
+5
+5
+5
+5
+5