牛逼!這個(gè)Python庫竟然可以偷懶,和import說再見!


pip install pyforestfrom pyforest import *active_imports()### Data Wranglingpd = LazyImport("import pandas as pd")np = LazyImport("import numpy as np")dd = LazyImport("from dask import dataframe as dd")SparkContext = LazyImport("from pyspark import SparkContext")load_workbook = LazyImport("from openpyxl import load_workbook")### Data Visualization and Plottingmpl = LazyImport("import matplotlib as mpl")plt = LazyImport("import matplotlib.pyplot as plt")sns = LazyImport("import seaborn as sns")py = LazyImport("import plotly as py")go = LazyImport("import plotly.graph_objs as go")px = LazyImport("import plotly.express as px")dash = LazyImport("import dash")bokeh = LazyImport("import bokeh")alt = LazyImport("import altair as alt")pydot = LazyImport("import pydot")# statisticsstatistics = LazyImport("import statistics")### Machine Learningsklearn = LazyImport("import sklearn")OneHotEncoder = LazyImport("from sklearn.preprocessing import OneHotEncoder")TSNE = LazyImport("from sklearn.manifold import TSNE")train_test_split = LazyImport("from sklearn.model_selection import train_test_split")svm = LazyImport("from sklearn import svm")GradientBoostingClassifier = LazyImport("from sklearn.ensemble import GradientBoostingClassifier")GradientBoostingRegressor = LazyImport("from sklearn.ensemble import GradientBoostingRegressor")RandomForestClassifier = LazyImport("from sklearn.ensemble import RandomForestClassifier")RandomForestRegressor = LazyImport("from sklearn.ensemble import RandomForestRegressor")TfidfVectorizer = LazyImport("from sklearn.feature_extraction.text import TfidfVectorizer")# TODO: add all the other most important sklearn objects# TODO: add separate sections within machine learning viz. Classification, Regression, Error Functions, Clustering# Deep Learningtf = LazyImport("import tensorflow as tf")keras = LazyImport("import keras")# NLPnltk = LazyImport("import nltk")gensim = LazyImport("import gensim")spacy = LazyImport("import spacy")re = LazyImport("import re")### Helpersys = LazyImport("import sys")os = LazyImport("import os")re = LazyImport("import re")glob = LazyImport("import glob")Path = LazyImport("from pathlib import Path")pickle = LazyImport("import pickle")dt = LazyImport("import datetime as dt")tqdm?=?LazyImport("import?tqdm")
############################## User-specific imports ###############################You can save your own imports in ~/.pyforest/user_imports.pyPlease note: imports in ~/.pyforest/user_imports.py take precedence over theimports above.
PS:公號內(nèi)回復(fù)「Python」即可進(jìn)入Python 新手學(xué)習(xí)交流群,一起?100 天計(jì)劃!
老規(guī)矩,兄弟們還記得么,右下角的 “在看” 點(diǎn)一下,如果感覺文章內(nèi)容不錯的話,記得分享朋友圈讓更多的人知道!


【神秘禮包獲取方式】
評論
圖片
表情
