<jupyter_start><jupyter_text>Homework 3.1 3.1.aLoad the data from: http://opendata.dc.gov/datasets that I have include in this github   into a dataframe.  ( The file has been is available in directory ./data/ccp_current_csv.csv )<jupyter_code>import pandas as pd
Sample= pd.read_csv("data\ccp_current_csv.csv")
Sample.head()<jupyter_output><empty_output><jupyter_text>3.1.a  what is its shape and what does that mean?<jupyter_code>Sample.shape
Sample.mean()<jupyter_output><empty_output><jupyter_text>Homework 3.2 What are the number of rows in each 'QUADRANT' ? Procedure 1<jupyter_code>from scipy.stats import itemfreq
import numpy as np
A=np.array(Sample)
itemfreq(A[:,1])<jupyter_output>C:\Users\Sandeep\Anaconda2\lib\site-packages\ipykernel_launcher.py:4: DeprecationWarning: `itemfreq` is deprecated!
`itemfreq` is deprecated and will be removed in a future version. Use instead `np.unique(..., return_counts=True)`
  after removing the cwd from sys.path.<jupyter_text>Procedure 2<jupyter_code>Temp=np.unique(A[:,1])
BN=NE=NW=SE=SW = 0
print Temp
for x in range(len(A[:,1])):
    if A[x,1] == Temp[0]:
        BN = BN+1
    elif A[x,1] == Temp[1]:
        NE = NE+1
    elif A[x,1] == Temp[2]:
        NW = NW+1
    elif A[x,1] == Temp[3]:
        SE = SE+1
    else:
        SW=SW+1
print 'BN -->', BN  
print 'NE -->', NE
print 'NW -->', NW
print 'SE -->', SE
print 'SW -->', SW<jupyter_output>['BN' 'NE' 'NW' 'SE' 'SW']
BN --> 12
NE --> 163
NW --> 195
SE --> 84
SW --> 11<jupyter_text>Homework 3.3 - Array math demonstration For two arrarys  a= [1,2,3,4]  type=floatb= [5,6,7,8]  type=floatPeform the following array operations using numpy   ( show both operational use of numpy and functional (example addition operation => + vs addition function => numbpy.add() ) 3.3.1 addition a+b<jupyter_code>import numpy as np
a = np.asarray([1,2,3,4], dtype = float)
b=np.asarray([5,6,7,8], dtype = float)

np.add(a,b)
a+b<jupyter_output><empty_output><jupyter_text>3.3.2 subtraction a-b<jupyter_code>np.subtract(a,b)
a-b<jupyter_output><empty_output><jupyter_text>3.3.3 multiplication a*b<jupyter_code>np.multiply(a,b)
list1=a*b
print list1<jupyter_output>[ 5. 12. 21. 32.]<jupyter_text>3.3.4 divsion a/b<jupyter_code>np.divide(a,b)
a/b<jupyter_output><empty_output><jupyter_text>3.3.5 modulo  a%b<jupyter_code>np.mod(a,b)
a%b<jupyter_output><empty_output><jupyter_text>3.3.6 power  a^b<jupyter_code>np.power(a,b)
a**b<jupyter_output><empty_output><jupyter_text>Homework 3.4Find your own data and load it into a dataframe<jupyter_code>import numpy as np
import pandas as pd
Own_data=pd.read_csv("data/googleplaystore.csv")
print Own_data.head()
A=np.array(Own_data)
print(A)<jupyter_output>[['Photo Editor & Candy Camera & Grid & ScrapBook' 'ART_AND_DESIGN' 4.1
  ... '7-Jan-18' '1.0.0' '4.0.3 and up']
 ['Coloring book moana' 'ART_AND_DESIGN' 3.9 ... '15-Jan-18' '2.0.0'
  '4.0.3 and up']
 ['U Launcher Lite \xe2\x80\x93 FREE Live Cool Themes, Hide Apps'
  'ART_AND_DESIGN' 4.7 ... '1-Aug-18' '1.2.4' '4.0.3 and up']
 ...
 ['ClearCareGo Caregiver' 'MEDICAL' 4.2 ... '25-Jul-18' '2.1.3'
  '4.1 and up']
 ['Pregnancy Calculator and Tracker app' 'MEDICAL' 4.8 ... '1-Jun-18'
  '2.6.1' '4.1 and up']
 ['All Mental disorders' 'MEDICAL' 4.5 ... '7-Jul-17' '1.1'
  '4.0.3 and up']]<jupyter_text>Homework 3.5Provide an interesting analysis of the data columns ( frequency or averages )<jupyter_code>from scipy.stats import itemfreq
itemfreq(A[:,3])
itemfreq(Own_data)
np.unique(A[:,3])
np.unique(Own_data)<jupyter_output><empty_output><jupyter_text>Average<jupyter_code>np.average(np.float64(A[:,3]))
np.mean(A[:,3])
print np.array_split(A,10)
Own_data.mean()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1656258484930763, 'fraction_numerical': 0.0456149877816997, 'mean_word_length': 4.783359497645212, 'pattern_counts': {'":': 0, '<': 49, '<?xml version=': 0, '>': 61, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '13', 'dir': 'jupyter-structured-clean-dedup', 'id': '64925', 'license': 'MIT', 'n_tokens_mistral': 1618, 'n_tokens_neox': 1536, 'n_words': 333, 'path': 'Homeworks/Homework3/Rongali-HW3-pandas-numpy-Sept-2018.ipynb', 'repo_name': 'sandeepnaidurongali/big-data-python-class', 'size': '3683'}