In [1]:
from IPython.display import HTML
HTML('''<script>
code_show=true;
function code_toggle() {
if (code_show){
$('div.input').hide();
} else {
$('div.input').show();
}
code_show = !code_show
}
$( document ).ready(code_toggle);
</script>
<form action="javascript:code_toggle()"><input type="submit" value="Click here to toggle on/off the raw code."></form>''')
Out[1]:
In [2]:
import json
import pandas as pd
import matplotlib
from pandas import DataFrame as df
import numpy as np
%matplotlib inline
%pylab inline
pylab.rcParams['figure.figsize'] = (10, 8)
%matplotlib inline
import pandas as pd
from IPython.core.display import HTML
css = open('style-table.css').read() + open('style-notebook.css').read()
HTML('<style>{}</style>'.format(css))
Out[2]:
In [ ]:
In [3]:
path = 'RiskaOS.csv'
open(path).readline()
data = pd.read_csv(path)
data.head()
Out[3]:
In [4]:
path = 'RiskaOS.csv'
open(path).readline()
data = pd.read_csv(path)
data = data.replace({'RRO' : { 5 : '1', 4 : '2', 2 : '4', 1 : '5' }})
data = data.replace({'RRS' : { 5 : '1', 4 : '2', 2 : '4', 1 : '5' }})
data = data.replace({'TampilanO' : { 'SS' : 5, 'S' : 4, 'RG' : 3, 'TS' : 2, 'STS' : 1}})
data = data.replace({'TampilanS' : { 'SS' : 5, 'S' : 4, 'RG' : 3, 'TS' : 2, 'STS' : 1}})
data = data.replace({'MenuO' : { 'SS' : 5, 'S' : 4, 'RG' : 3, 'TS' : 2, 'STS' : 1}})
data = data.replace({'MenuS' : { 'SS' : 5, 'S' : 4, 'RG' : 3, 'TS' : 2, 'STS' : 1}})
data = data.replace({'PackagingO' : { 'SS' : 5, 'S' : 4, 'RG' : 3, 'TS' : 2, 'STS' : 1}})
data = data.replace({'PackagingS' : { 'SS' : 5, 'S' : 4, 'RG' : 3, 'TS' : 2, 'STS' : 1}})
data = data.replace({'WifiO' : { 'SS' : 5, 'S' : 4, 'RG' : 3, 'TS' : 2, 'STS' : 1}})
data = data.replace({'WifiS' : { 'SS' : 5, 'S' : 4, 'RG' : 3, 'TS' : 2, 'STS' : 1}})
data = data.replace({'PembayaranO' : { 'SS' : 5, 'S' : 4, 'RG' : 3, 'TS' : 2, 'STS' : 1}})
data = data.replace({'PembayaranS' : { 'SS' : 5, 'S' : 4, 'RG' : 3, 'TS' : 2, 'STS' : 1}})
data = data.replace({'PelayananO' : { 'SS' : 5, 'S' : 4, 'RG' : 3, 'TS' : 2, 'STS' : 1}})
data = data.replace({'PelayananS' : { 'SS' : 5, 'S' : 4, 'RG' : 3, 'TS' : 2, 'STS' : 1}})
data.head()
Out[4]:
In [5]:
import csv
data.to_csv('RiskaBersih.csv')
In [6]:
data1 = pd.read_csv('RiskaBersih.csv')
In [ ]: