Skip to content

Instantly share code, notes, and snippets.

#https://stackoverflow.com/questions/10138085/python-pylab-plot-normal-distribution
import numpy as np
import matplotlib.pyplot as plt
mean = 0; variance = 1
x = np.arange(-5,5,.01)
y = np.exp(-np.square(x-mean)/2*variance)/(np.sqrt(2*np.pi*variance))
plt.plot(x,y)
plt.ylabel('gaussian distribution')
@prafuld3
prafuld3 / Keras Lenet on MNIST
Created December 1, 2019 08:44
Keras Lenet on MNIST
from keras.models import Sequential
from keras.layers.convolutional import Convolution2D
from keras.layers.convolutional import MaxPooling2D
from keras.layers.core import Activation
from keras.layers.core import Flatten
@prafuld3
prafuld3 / writing data from dataframe to google sheet
Last active November 26, 2022 11:14
writing data from dataframe to google sheet
df_gold=df[(df['Medal']=='Gold') & (df['Sport']=='Gymnastics')]
#change this by your sheet ID
SAMPLE_SPREADSHEET_ID_input = '1cvZswLiDo3LfhnA7RcS8vFqacx73RGor-OZ_FtvyLE8'
#change the range if needed
SAMPLE_RANGE_NAME = 'A1:AA1000'
def Create_Service(client_secret_file, api_service_name, api_version, *scopes):
global service
@prafuld3
prafuld3 / Reading google sheet using python
Last active November 6, 2023 15:32
Reading google sheet using python
import pandas as pd
from googleapiclient.discovery import build
from google_auth_oauthlib.flow import InstalledAppFlow,Flow
from google.auth.transport.requests import Request
import os
import pickle
SCOPES = ['https://www.googleapis.com/auth/spreadsheets']
# here enter the id of your google sheet