Skip to Content
Practical Data Analysis Cookbook
book

Practical Data Analysis Cookbook

by Tomasz Drabas
April 2016
Beginner to intermediate content levelBeginner to intermediate
384 pages
8h 36m
English
Packt Publishing
Content preview from Practical Data Analysis Cookbook

Identifying those responsible for stealing the credit cards

Having identified the affected parties and seeing how much they lost, let's now find out who is responsible for this.

Getting ready

To execute this recipe, you will need NetworkX, collections, and NumPy. No other prerequisites are required.

How to do it…

In this recipe, we will attempt to find the merchant that all the affected parties shopped at before the first fraudulent transaction occurred (the graph_fraudOrigin.py file):

import networkx as nx import numpy as np import collections as c # import the graph graph_file = '../../Data/Chapter08/fraud.gz' fraud = nx.read_graphml(graph_file) # identify customers with stolen credit cards people_scammed = c.defaultdict(list) for (person, merchant, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Python Data Analysis Cookbook

Python Data Analysis Cookbook

Ivan Idris
Practical Simulations for Machine Learning

Practical Simulations for Machine Learning

Paris Buttfield-Addison, Mars Buttfield-Addison, Tim Nugent, Jon Manning

Publisher Resources

ISBN: 9781783551668Supplemental Content