This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cx_Oracle | |
import pandas as pd | |
import csv | |
ip = '**********' | |
port = **** | |
SID = '********' | |
dsn_tns = cx_Oracle.makedsn(ip, port, SID) | |
conn = cx_Oracle.connect('DB_USERNAME', 'DB_PASSWORD', dsn_tns) | |
c = conn.cursor() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rom pandas.io.json import json_normalize | |
import json | |
import psycopg2 | |
import pandas as pd | |
import requests | |
mm_get = requests.get('https://edume-api.herokuapp.com/stats/users',headers={"Authorization":'XXXXXXXXXXXXXXXXXXXXXXX'})mm_json=mm_get.json() | |
mm_json=mm_get.json() | |
data_1 = json_normalize(data = mm_json['data'], | |
record_path = ['courses','modules'], | |
record_prefix = 'courses.modules.', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
view: edume_lessons { | |
derived_table: { | |
sql: | |
SELECT | |
courses_modules_completiondate, | |
courses_modules_id, | |
courses_modules_status, | |
courses_modules_title, | |
courses_id, | |
courses_title, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#CAST | |
Visit....Google Cast (Beta) | |
https://chrome.google.com/webstore/detail/google-cast-beta/dliochdbjfkdbacpmhlcpmleaejidimm?hl=en | |
Add to chrome | |
#Stitch | |
https://blog.stitchdata.com/google-sheets-stitch-an-easy-way-sync-your-small-data-to-redshift-32a32ece8e0a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
output: word_document | |
--- | |
# Plantwise data analysis | |
Data from PlantWise Kenya | |
## Comments on data | |
+ ClinicFormID doesn't show in my file when opened in Excel (no text, just empty cells) - could there be more missing fields? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#EDA OFRA Spatial | |
#load neccessary packages | |
library(maptools) | |
library(sp) | |
library(rgdal) | |
#Importing data; | |
#maptools: Tools for Reading and Handling Spatial Objects | |
#rgdal has issues with IDs when importing spatial objects |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#lOGIT | |
setwd("c:/Users/machariam/Desktop/Logit") | |
list.files() | |
Dat=read.csv("Dat.csv") | |
names(Dat) | |
str(Dat) | |
hist(LandPercapita) | |
hist(MaizeLand) | |
hist(PPI) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Box plot | |
#Colour | |
setwd("c:/Users/machariam/Desktop/Rwanda PW Impact report/Logit") | |
list.files() | |
Dat.Yield=read.csv("Dat.Yield.csv") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data=read.csv(file.choose(), header=T) # Import data called data | |
View(data)# View data | |
duplicated(data$Dup) #Check for duplicates on column Dup, not a very efficient way for large dataset | |
data$Dup[duplicated(data1$Dup)] #Show duplicate entries, somewhat difficult to read results | |
unique(data1[duplicated(data1$Dup),])#Better way of showing unique repeat entries | |
#PSM with different matching criteria, select best based on visual inspection of common support graphics | |
setwd("C:/users/machariam/Desktop/Rwanda PW Impact report") | |
getwd() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data=read.csv(file.choose(), header=T) # Import data called data | |
View(data)# View data | |
duplicated(data$Dup) #Check for duplicates on column Dup, not a very efficient way for large dataset | |
data$Dup[duplicated(data1$Dup)] #Show duplicate entries, don't like how results are displayed | |
unique(data1[duplicated(data1$Dup),])#Better way of showing unique repeat entries | |
#PSM | |
setwd("C:/users/machariam/Desktop/Rwanda PW Impact report") | |
getwd() | |
RwandaData=read.csv("CleanV4.csv") |
NewerOlder