Skip to content

Instantly share code, notes, and snippets.

Avatar

Gyan Prakash Tripathi prakashthegyan

View GitHub Profile
@prakashthegyan
prakashthegyan / capstoneNotebook-Copy1.ipynb
Created Apr 24, 2019
Created on Cognitive Class Labs
View capstoneNotebook-Copy1.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View gist:36bbded6a42d8725f68eb1df3f128323
marks10th.head()
marks12th.head()
IDandName.head()
@prakashthegyan
prakashthegyan / MergeFunction
Last active Feb 4, 2020
Merge Function Introduction
View MergeFunction
allMarks=marks10th.append(marks12th)
marks10th.shape, marks12th.shape, allMarks.shape
View Mean of a column
allMarks['Exam Points'].mean() #Average Marks
View Maximum Marks Scored
allMarks['Exam Points'].max() # Maximum Marks
View Merged Data
mergedData=allMarks.merge(IDandName, on='student id')
mergedData.head()
View Names of Toppers
mergedData.loc[mergedData['Exam Points']==100]
View Reading Files
import pandas as pd
marks10th=pd.read_csv('10thClassMarks.csv')
marks12th=pd.read_csv('12thClassMarks.csv')
IDandName=pd.read_csv('StudentIDandName.csv')
View connect to mongodb
import pymongo
import pprint
mongo_uri = "mongodb://localhost:27017/"
client = pymongo.MongoClient(mongo_uri)