<jupyter_start><jupyter_text>Daksh Domain and Data Introdcution**Social Sector Area**: JudicialA domain here is defined by the related domain knowledge captured in the dataset provided. In the following blocks of information we will be going throw some of the data that is provided and talking about the context that might help understand the data better.**As understanding of the domain is a very subjective matter we encourage/expect you to raise any questions around it, on github/slack or just talk to the facilitators**<jupyter_code>import pandas as pd
import seaborn as sns

%matplotlib inline<jupyter_output><empty_output><jupyter_text>Data: What we are working with?we are dealing with two tables of data 1. Cases, each row in the cases table refers to a unique case and its information.2. Hearing, each row in the hearing table refers to a single hearing held for a given case.The cases and hearings are recorded by people sitting in different courts and uploaded to government websites as pdfs or data entries. So, courts at different level of **judicial hierarchy** namely, senior civil judge, civil judge, CJM etc in different **districts** are capturing the data.To make the data consumable in the amount of time we have and to make it manageable we are dealing with a few districts only.    - Chamrajnagar    - Kollegal    - Gundlupet How is the data captured?The data is scraped at regular intervals by Daksh and stored.<jupyter_code>!ls data/<jupyter_output>case_level.csv
 case_level.xlsx
 hearing_level.xlsx
'Population Status Final.xlsx'
 raw
 senior_civil_judge_and_cjm_court,_chamarajanagar_cases.csv
 senior_civil_judge_and_cjm_court,_chamarajanagar_cases_processed.csv
 senior_civil_judge_and_cjm_court,_chamarajanagar_hearings.csv
 senior_civil_judge_and_cjm_court,_chamarajanagar_hearings_processed.csv<jupyter_text>**Note**:For ease of consumption we will be talking about Chamrajnagar data, that is already processed such that all columns that are mostly empty are removed.<jupyter_code>cases = pd.read_csv('data/senior_civil_judge_and_cjm_court,_chamarajanagar_cases_processed.csv')
hearings = pd.read_csv('data/senior_civil_judge_and_cjm_court,_chamarajanagar_hearings_processed.csv')
cases.shape<jupyter_output><empty_output><jupyter_text>There are 34 columns that tells us some information in the cases table and for Chamarajanagar we have 4907 cases in our dataset from 2 days worth of scraping data<jupyter_code>cases.columns
# we can get rid off 'Unnamed: 0' column
cases.drop(['Unnamed: 0'], axis=1, inplace=True)<jupyter_output><empty_output><jupyter_text>Columns that don't add Contextual Information1. Id 2. CombinedCaseNumber3. CaseNumber4. Year5. LastSyncTime6. Full identifier<jupyter_code>non_contextual_cols = ['Id','CombinedCaseNumber', 'CaseNumber', 'Year', 'LastSyncTime', 'Full_Identifier']
cases[non_contextual_cols].head()
cases.Year.value_counts().sort_values().plot('barh', title='Number of cases by year')<jupyter_output><empty_output><jupyter_text>Columns that add Contextual Information1. CaseType, Case type describes some of the meta information on what kind of case it is. Some case type definitions given here http://www.lawyersclubindia.com/forum/Court-Abbreviations-For-Law-Students-33260.asp2. CourtHallNumber, Halls are generally managed by a Judge and can be a representation for a judge3. DateFiled, tells us when the case was filed.4. Petitioner, PetitionerAdvocate & PetitionerType are descriptors around who the petitioner is and who is fighting their case5. Respondent, RespondentType gives information on whom the case is filed.6. BeforeHonarbleJudges contains information on the judges position who are hearing the case<jupyter_code>cases.CaseType.value_counts().plot('barh', title='Number of cases by CaseType')<jupyter_output><empty_output><jupyter_text>**2 CourtHallNumber, Halls are generally managed by a Judge and can be a representation for a judge**<jupyter_code>cases.CourtHallNumber.value_counts().plot('barh', title='Number of cases by CourtHallNumber')
cases.DateFiled.apply(lambda x: str(x).split('-')[0]).value_counts().plot('barh', title='Number of cases by Filling date')
cases[['Petitioner', 'PetitionerAdvocate', 'PetitionerType']].head()
cases[['Respondent', 'RespondentType']].head()
cases[['BeforeHonarbleJudges']].head()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.07540229885057471, 'fraction_numerical': 0.007126436781609196, 'mean_word_length': 6.673721340388007, 'pattern_counts': {'":': 0, '<': 28, '<?xml version=': 0, '>': 28, 'https://': 0, 'lorem ipsum': 0, 'www.': 1, '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': '7', 'dir': 'jupyter-structured-clean-dedup', 'id': '356638', 'license': 'MIT', 'n_tokens_mistral': 1341, 'n_tokens_neox': 1227, 'n_words': 453, 'path': 'exploration/Domain.ipynb', 'repo_name': 'DataKind-BLR/Daksh-Sprint-2018', 'size': '4350'}