Data Visualization with Python and JavaScript. 2nd Edition Chorzów

How do you turn raw, unprocessed, or malformed data into dynamic, interactive web visualizations? In this practical book, author Kyran Dale shows data scientists and analysts--as well as Python and JavaScript developers--how to create the ideal toolchain for the job. By providing engaging examples …

od 186,15 Najbliżej: 21 km

Liczba ofert: 1

Oferta sklepu

Opis

How do you turn raw, unprocessed, or malformed data into dynamic, interactive web visualizations? In this practical book, author Kyran Dale shows data scientists and analysts--as well as Python and JavaScript developers--how to create the ideal toolchain for the job. By providing engaging examples and stressing hard-earned best practices, this guide teaches you how to leverage the power of best-of-breed Python and JavaScript libraries.Python provides accessible, powerful, and mature libraries for scraping, cleaning, and processing data. And while JavaScript is the best language when it comes to programming web visualizations, its data processing abilities can't compare with Python's. Together, these two languages are a perfect complement for creating a modern web-visualization toolchain. This book gets you started.You'll learn how to:Obtain data you need programmatically, using scraping tools or web APIs: Requests, Scrapy, Beautiful SoupClean and process data using Python's heavyweight data processing libraries within the NumPy ecosystem: Jupyter notebooks with pandas+Matplotlib+SeabornDeliver the data to a browser with static files or by using Flask, the lightweight Python server, and a RESTful APIPick up enough web development skills (HTML, CSS, JS) to get your visualized data on the webUse the data you've mined and refined to create web charts and visualizations with Plotly, D3, Leaflet, and other libraries Spis treści: PrefacePart I: Basic ToolkitPart II: Getting Your DataPart III: Cleaning and Exploring Data with pandasPart IV: Delivering the DataPart V: Visualizing Your Data with D3 and PlotlyThe Second EditionConventions Used in This BookUsing Code ExamplesOReilly Online LearningHow to Contact UsAcknowledgmentsSecond EditionIntroductionWho This Book Is ForMinimal Requirements to Use This BookWhy Python and JavaScript?Why Not Python in the Browser?Why Python for Data ProcessingJavaROthersPythons Getting Better All the TimeWhat Youll LearnThe Choice of LibrariesPreliminariesThe Dataviz Toolchain1. Scraping Data with Scrapy2. Cleaning Data with pandas3. Exploring Data with pandas and Matplotlib4. Delivering Your Data with Flask5. Transforming Data into Interactive Visualizations with Plotly and D3Smaller LibrariesUsing the BookA Little Bit of ContextSummaryRecommended BooksI. Basic Toolkit1. Development SetupThe Accompanying CodePythonAnacondaInstalling Extra LibrariesVirtual EnvironmentsJavaScriptContent Delivery NetworksInstalling Libraries LocallyDatabasesGetting MongoDB Up and RunningEasy MongoDB with DockerIntegrated Development EnvironmentsSummary2. A Language-Learning Bridge Between Python and JavaScriptSimilarities and DifferencesInteracting with the CodePythonJavaScriptBasic Bridge WorkStyle Guidelines, PEP 8, and use strictCamelCase Versus UnderscoreImporting Modules, Including ScriptsJavaScript ModulesKeeping Your Namespaces CleanOutputting Hello World!Simple Data ProcessingString ConstructionSignificant Whitespace Versus Curly BracketsComments and Doc-StringsDeclaring Variables Using let or varStrings and NumbersBooleansData Containers: dicts, objects, lists, ArraysFunctionsIterating: for Loops and Functional AlternativesConditionals: if, else, elif, switchFile Input and OutputClasses and PrototypesDifferences in PracticeMethod ChainingEnumerating a ListTuple UnpackingCollectionsUnderscoreFunctional Array Methods and List ComprehensionsMap, Reduce, and Filter with Pythons LambdasJavaScript Closures and the Module PatternA Cheat SheetSummary3. Reading and Writing Data with PythonEasy Does ItPassing Data AroundWorking with System FilesCSV, TSV, and Row-Column Data FormatsJSONDealing with Dates and TimesSQLCreating the Database EngineDefining the Database TablesAdding Instances with a SessionQuerying the DatabaseEasier SQL with DatasetMongoDBDealing with Dates, Times, and Complex DataSummary4. Webdev 101The Big PictureSingle-Page AppsTooling UpThe Myth of IDEs, Frameworks, and ToolsA Text-Editing WorkhorseBrowser with Development ToolsTerminal or Command PromptBuilding a Web PageServing Pages with HTTPThe DOMThe HTML SkeletonMarking Up ContentCSSJavaScriptDataChrome DevToolsThe Elements TabThe Sources TabOther ToolsA Basic Page with PlaceholdersPositioning and Sizing Containers with FlexFilling the Placeholders with ContentScalable Vector GraphicsThe ElementCirclesApplying CSS StylesLines, Rectangles, and PolygonsTextPathsScaling and RotatingWorking with GroupsLayering and TransparencyJavaScripted SVGSummaryII. Getting Your Data5. Getting Data Off the Web with PythonGetting Web Data with the Requests LibraryGetting Data Files with RequestsUsing Python to Consume Data from a Web APIConsuming a RESTful Web API with RequestsGetting Country Data for the Nobel DatavizUsing Libraries to Access Web APIsUsing Google SpreadsheetsUsing the Twitter API with TweepyScraping DataWhy We Need to ScrapeBeautiful Soup and lxmlA First Scraping ForayGetting the SoupSelecting TagsCrafting Selection PatternsCaching the Web PagesScraping the Winners NationalitiesSummary6. Heavyweight Scraping with ScrapySetting Up ScrapyEstablishing the TargetsTargeting HTML with XpathsTesting Xpaths with the Scrapy ShellSelecting with Relative XpathsA First Scrapy SpiderScraping the Individual Biography PagesChaining Requests and Yielding DataCaching PagesYielding RequestsScrapy PipelinesScraping Text and Images with a PipelineSpecifying Pipelines with Multiple SpidersSummaryIII. Cleaning and Exploring Data with pandas7. Introduction to NumPyThe NumPy ArrayCreating ArraysArray Indexing and SlicingA Few Basic OperationsCreating Array FunctionsCalculating a Moving AverageSummary8. Introduction to pandasWhy pandas Is Tailor-Made for DatavizWhy pandas Was DevelopedCategorizing Data and MeasurementsThe DataFrameIndicesRows and ColumnsSelecting GroupsCreating and Saving DataFramesJSONCSVExcel FilesSQLMongoDBSeries into DataFramesSummary9. Cleaning Data with pandasComing Clean About Dirty DataInspecting the DataIndices and pandas Data SelectionSelecting Multiple RowsCleaning the DataFinding Mixed TypesReplacing StringsRemoving RowsFinding DuplicatesSorting DataRemoving DuplicatesDealing with Missing FieldsDealing with Times and DatesThe Full clean_data FunctionAdding the born_in columnMerging DataFramesSaving the Cleaned DatasetsSummary10. Visualizing Data with Matplotlibpyplot and Object-Oriented MatplotlibStarting an Interactive SessionInteractive Plotting with pyplots Global StateConfiguring MatplotlibSetting the Figures SizePoints, Not PixelsLabels and LegendsTitles and Axes LabelsSaving Your ChartsFigures and Object-Oriented MatplotlibAxes and SubplotsPlot TypesBar ChartsScatter PlotsAdding a regression lineseabornFacetGridsPairGridsSummary11. Exploring Data with pandasStarting to ExplorePlotting with pandasGender DisparitiesUnstacking GroupsHistorical TrendsNational TrendsPrize Winners Per CapitaPrizes by CategoryHistorical Trends in Prize DistributionAge and Life Expectancy of WinnersAge at Time of AwardLife Expectancy of WinnersIncreasing Life Expectancies over TimeThe Nobel DiasporaSummaryIV. Delivering the Data12. Delivering the DataServing the DataOrganizing Your Flask FilesServing Data with FlaskDelivering Data FilesDynamic Data with Flask APIsA Simple Data API with FlaskUsing Static or Dynamic DeliverySummary13. RESTful Data with FlaskThe Tools for a RESTful JobCreating the DatabaseA Flask RESTful Data ServerSerializing with marshmallowAdding our RESTful API RoutesPosting Data to the APIExtending the API with MethodViewsPaginating the Data ReturnsDeploying the API Remotely with HerokuCORSConsuming the API Using JavaScriptSummaryV. Visualizing Your Data with D3 and Plotly14. Bringing Your Charts to the Web with Matplotlib and PlotlyStatic Charts with MatplotlibAdapting to Screen SizesUsing Remote Images or AssetsCharting with PlotlyBasic ChartsPlotly ExpressPlotly Graph-ObjectsMapping with PlotlyAdding Custom Controls with PlotlyFrom Notebook to Web with PlotlyNative JavaScript Charts with PlotlyFetching JSON FilesUser-Driven Plotly with JavaScript and HTMLSummary15. Imagining a Nobel VisualizationWho Is It For?Choosing Visual ElementsMenu BarPrizes by YearA Map Showing Selected Nobel CountriesA Bar Chart Showing Number of Winners by CountryA List of the Selected WinnersA Mini-Biography Box with PictureThe Complete VisualizationSummary16. Building a VisualizationPreliminariesCore ComponentsOrganizing Your FilesServing the DataThe HTML SkeletonCSS StylingThe JavaScript EngineImporting the ScriptsModular JS with ImportsBasic Data FlowThe Core CodeInitializing the Nobel Prize VisualizationReady to GoData-Driven UpdatesFiltering Data with CrossfilterCreating the filterRunning the Nobel Prize Visualization AppSummary17. Introducing D3The Story of a Bar ChartFraming the ProblemWorking with SelectionsAdding DOM ElementsLeveraging D3Measuring Up with D3s ScalesQuantitative ScalesOrdinal ScalesUnleashing the Power of D3 with Data Binding/JoiningUpdating the DOM with DataPutting the Bar Chart TogetherAxes and LabelsTransitionsUpdating the Bar ChartSummary18. Visualizing Individual PrizesBuilding the FrameworkScalesAxesCategory LabelsNesting the DataAdding the Winners with a Nested Data-JoinA Little Transitional SparkleUpdating the Bar ChartSummary19. Mapping with D3Available MapsD3s Mapping Data FormatsGeoJSONTopoJSONConverting Maps to TopoJSOND3 Geo, Projections, and PathsProjectionsPathsgraticulesPutting the Elements TogetherUpdating the MapAdding Value IndicatorsOur Completed MapBuilding a Simple TooltipUpdating the MapSummary20. Visualizing Individual WinnersBuilding the ListBuilding the Bio-BoxUpdating the Winners ListSummary21. The Menu BarCreating HTML Elements with D3Building the Menu BarBuilding the Category SelectorAdding the Gender SelectorAdding the Country SelectorWiring Up the Metric Radio ButtonSummary22. ConclusionRecapPart I: Basic ToolkitPart II: Getting Your DataPart III: Cleaning and Exploring Data with pandasPart IV: Delivering the DataPart V: Visualizing Your Data with D3 and PlotlyFuture ProgressVisualizing Social Media NetworksMachine-Learning VisualizationsFinal ThoughtsA. D3s enter/exit PatternThe enter MethodAccessing the Bound DataIndex

Specyfikacja

Podstawowe informacje

Autor
  • Kyran Dale
Rok wydania
  • 2022
Format
  • MOBI
  • EPUB
Ilość stron
  • 568
Kategorie
  • Programowanie