# -*- coding: utf-8 -*-
"""DASK IPYNB.ipynb

Automatically generated by Colaboratory.

Original file is located at
    https://colab.research.google.com/drive/1jXYsd7wHBNPbhEfUWF8hyfrrBnQMwJdM

Installing of dask
"""

#Installing of Dask
!pip install "dask[complete]"

#Module to ignore the warnings
import warnings
warnings.filterwarnings('ignore')

"""Reading of Data"""

import dask.dataframe as dd
import pandas as pd

# Commented out IPython magic to ensure Python compatibility.
# %%time
# DF_PANDAS=pd.read_csv("/content/faceexp-comparison-data-train-public.csv",error_bad_lines=False,header=None,engine='python',warn_bad_lines=False)

"""Here to include multiple files we must fetch the csv files into a pandas data frame and merge them to get the final colloborated data frame"""

DF_PANDAS.shape

DF_PANDAS.head()

dtypes=dtype={16: 'float64',
       17: 'float64',
       18: 'float64',
       19: 'float64',
       20: 'float64',
       21: 'float64',
       22: 'float64',
       23: 'float64',
       24: 'float64',
       25: 'float64',
       26: 'float64',
       27: 'float64'}

# Commented out IPython magic to ensure Python compatibility.
# %%time
# DF_DASK=dd.read_csv("/content/faceexp-comparison-data*.csv",error_bad_lines=False,header=None,dtype=dtypes,warn_bad_lines=False).set_index(0)

DF_DASK.shape

DF_DASK.npartitions #To know how many pandas data frames are present in dask

DF_PANDAS.head(5)

DF_DASK.known_divisions

DF_DASK.head()

DF_DASK.info()

DF_DASK.divisions

"""Accessing subsets of data frame using loc and iloc"""

DF_DASK.loc['http://0.blog.xuite.net/0/2/1/b/13368594/blog_747921/txt/15838650/5.jpg'].compute()
#It provides the rows which has same index..which has been divided.

len(DF_DASK) #It Reads all the files in the data frame and gives the rows count

"""Additionally Dask will also provides following APIs
```
*   DataFrame.categorize
*   DataFrame.map_partitions
*   DataFrame.repartition
*   DataFrame.visualize



```


"""
ad46397ca155bf365aa93279308f7d23ddef4bd3
# -*- coding: utf-8 -*-
"""DASK IPYNB.ipynb

Automatically generated by Colaboratory.

Original file is located at
    https://colab.research.google.com/drive/1jXYsd7wHBNPbhEfUWF8hyfrrBnQMwJdM

Installing of dask
"""

#Installing of Dask
!pip install "dask[complete]"

#Module to ignore the warnings
import warnings
warnings.filterwarnings('ignore')

"""Reading of Data"""

import dask.dataframe as dd
import pandas as pd

# Commented out IPython magic to ensure Python compatibility.
# %%time
# DF_PANDAS=pd.read_csv("/content/faceexp-comparison-data-train-public.csv",error_bad_lines=False,header=None,engine='python',warn_bad_lines=False)

"""Here to include multiple files we must fetch the csv files into a pandas data frame and merge them to get the final colloborated data frame"""

DF_PANDAS.shape

DF_PANDAS.head()

dtypes=dtype={16: 'float64',
       17: 'float64',
       18: 'float64',
       19: 'float64',
       20: 'float64',
       21: 'float64',
       22: 'float64',
       23: 'float64',
       24: 'float64',
       25: 'float64',
       26: 'float64',
       27: 'float64'}

# Commented out IPython magic to ensure Python compatibility.
# %%time
# DF_DASK=dd.read_csv("/content/faceexp-comparison-data*.csv",error_bad_lines=False,header=None,dtype=dtypes,warn_bad_lines=False).set_index(0)

DF_DASK.shape

DF_DASK.npartitions #To know how many pandas data frames are present in dask

DF_PANDAS.head(5)

DF_DASK.known_divisions

DF_DASK.head()

DF_DASK.info()

DF_DASK.divisions

"""Accessing subsets of data frame using loc and iloc"""

DF_DASK.loc['http://0.blog.xuite.net/0/2/1/b/13368594/blog_747921/txt/15838650/5.jpg'].compute()
#It provides the rows which has same index..which has been divided.

len(DF_DASK) #It Reads all the files in the data frame and gives the rows count

"""Additionally Dask will also provides following APIs
```
*   DataFrame.categorize
*   DataFrame.map_partitions
*   DataFrame.repartition
*   DataFrame.visualize



```


"""