GithubHelp home page GithubHelp logo

anespy's Introduction

ANESPy

A package for easy import and cleaning of ANES data.

Installation

$ pip install -i https://test.pypi.org/simple/ anespy

Usage

ANESPy is intended to bypass the numerous headaches involved in research using ANES data. Though ANES data are used frequently in the social sciences (particularly political science), bringing ANES data into a project can be a difficult task requiring several recodes. The data are only available as CSVs for 2020 and cumulative data files, while the rest are made available as files for STATA and SPSS, or as an ASCII table. When these data are read in, the variables are not named and require that you reference a codebook to understand what they are. Some of the files are even incomplete, or presented with empty cells instead of any specific marker for missing data.

By using ANESPy, you can bring in data for a selected year (going back to 2000) and work with ANES data as its own class of DataFrame. Aside from speeding up the data acquisition process, this package provides the user with methods specific to the ANES class that expedite challenging transformations. Though there are aspects of this package still in development, its current functionality as a pseudo-API greatly improves the synergy between ANES research and Python-based statistical analysis.

Example

Say you wanted to get the 2012 version of the ANES Time Series, but you only wanted the Pre-Election variables. This can be done simply:

from anespy import *

data = anespy.load_ANES_data(2012)
data.conver_var_names()
data_pre, data_post = data.split_pre_post()

Using just three functions, you now have a DataFrame containing all the pre-election variables for 2012. It can also be exported using any of the available to_ methods from Pandas.

Contributing

Interested in contributing? Check out the contributing guidelines. Please note that this project is released with a Code of Conduct. By contributing to this project, you agree to abide by its terms.

License

anespy was created by Jackson Rudoff. It is licensed under the terms of the MIT license.

ANES Terms of Use

By using these data, you agree to the terms of use established by the ANES:

  • Use these datasets solely for research or statistical purposes and not for investigation of specific survey respondents.
  • Make no use of the identity of any survey respondent(s) discovered intentionally or inadvertently, and to advise ANES of any such discovery ([email protected])
  • Cite ANES data and documentation in your work that makes use of the data and documentation. Authors of publications based on ANES data should send citations of their published works to ANES for inclusion in our bibliography of related publications.
  • You acknowledge that the original collector of the data, ANES, and the relevant funding agency/agencies bear no responsibility for use of the data or for interpretations or inferences based upon such uses.

The ANES is not responsible for any mistakes I made with these datasets and the packaged functions.

Credits

anespy was created with cookiecutter and the py-pkgs-cookiecutter template.

anespy's People

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.