Category : jupyter-notebook

import ipywidgets as widgets from IPython.display import display w = widgets.Dropdown( options={‘Pen’: 7732, ‘Pencil’: 102, ‘Pad’: 33331}, description=’Item:’, ) display(w) #w.value results: Dropdown(description=’Item:’, options={‘Pen’: 7732, ‘Pencil’: 102, ‘Pad’: 33331}, value=7732) which is not a Drop Down HI i was working in linux jupyter notebook in Virtual enviroment i have try solution from here Jupyter widget ..

Read more

I have recently started using matplotlib and I tried to plot a graph with population(float) , total travel time(float) and location_id(string), with 800 rows. here is my code plt.figure(figsize=(20,8)) x = county_query_df[‘geo_id’] y1 = county_query_df[‘total_pop’] y2 = county_query_df[‘Total_time_travel’] plt.plot(x, y1, label="Total Population", linewidth = 3) plt.plot(x, y2, label="Aggregate Time Travel",linewidth = 3) plt.plot() plt.grid(True) #set ..

Read more

I currently have this piece of code: import pandas as pd import re import nltk from nltk.tokenize import word_tokenize from nltk.corpus import stopwords from nltk.stem.porter import PorterStemmer from sklearn.feature_extraction.text import CountVectorizer from sklearn.model_selection import train_test_split from sklearn.naive_bayes import MultinomialNB from sklearn.metrics import confusion_matrix, classification_report, accuracy_score #################################################################################### nltk.download(‘punkt’) nltk.download(‘stopwords’) dataset = pd.read_csv(‘car_reviews.csv’) ps = PorterStemmer() #################################################################################### ..

Read more

I’m iterating through an index and printing out some values with this: fl = gis.content.get(fl_item_id).layers[fl_item_idx].query(where="City = ‘Round Rock’", order_by_fields=’Date_Confirmed DESC’ ).sdf for index, total in fl.iterrows(): print(total[‘Cumulative_Totals’]) which results in: 4020 3965 3937 3880 3832 3775 3714 3699 3670 3615 3533 3502 3475 3441 3371 3338 3314 3275 3258 3256 3221 3198 3178 3162 I’d ..

Read more