code and a map visual of a demographic map of new york city

Introduction to Computer Programming:
Python Maps

We are looking at a society increasingly dependent on machines, yet decreasingly capable of making or even using them effectively.
― Douglas Rushkoff, Program or Be Programmed: Ten Commands for a Digital Age

Computer Science 0145-602-001, Fall 2024

Keywords: computer programming, CS1, python, computational thinking, critical computational literacy, maps, data visualization

Description: This course introduces students to programming and some core concepts of computer science, using a modern, object oriented programming language. Students learn concepts of variables, functions, selection, repetition/loops, basic data structures (arrays, lists, hashtables), and basic object oriented programming.

Class meetings: Online, asynchronous (coordinated through the course website)

Instructor

Dr. Curinga’s Office Hours by appointment

  • Monday, 4:30-5:30PM
  • Thursday, 4:30-5:30PM

Learning Goals

  • understand the types of problems that can be solved using computational techniques
  • understand the basic concepts of computation (CPU, RAM, permanent storage, GUIs, file systems, network connections)
  • learn core computer programming concepts (abstraction, variables, conditions, functions, repetition, recursion)
  • think algorithmically to design and test computer programs
  • master the basic syntax and idioms of the Python programming language
  • use technical documentation, APIs, and the internet to learn new technical concepts
  • develop step-by-step problem solving and debugging practices

Required Software/Online Accounts

  1. Google Colab. This is a free, online programming environment which you will access through your Adelphi email.
  2. Join our Slack with your mail.adelphi.edu email.
    • install the desktop client so that you can easily share code and screenshots
    • install the mobile client so that you can stay tuned for messages about the class
    • join the #code channel for discussions related to this class
    • DM the instructor at @mxc to get in touch
  3. Chat GPT. Since it’s release, I have used ChatGPT as a resource for my own software development projects. I think it will be very beneficial for you, too. Create an account at https://chat.openai.com/auth/login to get started. You can use your AU email, but that’s not required.
  4. Screenshot software. To get help, you might need to share a screenshot (more often you will copy-paste code or error messages). Don’t take pictures of your laptop with you phone. Take a screenshot. If you need help setting this up or getting recommendations, ask on #code on slack.

Required Books

None. All course readings, videos, etc will be provided online.

References

Programming references

  1. Python Documentation: official documentation for the Python programming language
  2. Pandas Documentation: the Pandas data analysis library
  3. Matplotlib Documentation: we’ll use Matplotlib for plots and graphs
  4. Seaborn Documentation: Seaborn gives us more control of the appearance of our charts
  5. GeoPandas Documentation: we’ll use GeoPandas to read geospatial data and make maps
  6. Plotly Documentation: we’ll use Plotly to make interactive charts and graphs
  7. Folium Documentation: Folium controls some of the map features in GeoPandas
  8. HTML reference: we’ll need a little bit of HTML for our legends and pop-ups
  9. Named HTML colors

Other documentation

  1. Slack Help Center
  2. Google Colab Help
  3. ChatGPT Documentation
  4. Jupyter Notebook Documentation
  5. Markdown in Jupyter Notebooks: learn how to use Markdown in Jupyter Notebooks

Tutorials for basic or advanced topics

  1. Python Essential Training
  2. Pandas Essential Training
  3. Khan Academy: descriptive statistics
  4. Python Statistics Basic Training

Generative AI / ChatGPT Policy

Since the introduction of GPT-3, programmers have been using generative AI as an integral part of their work. Some are predicting the end of programming, but I think it’s just another iteration in the tools that computer scientists and software engineers have at their disposal to create software more quickly and efficiently. In particular, it can help us learn new things and reduce the risk of trying something new.

The general rule for this course is that generative AI can be used for learning, but it is a violation of Adelphi’s academic honesty policy and considered cheating if you submit work that was generated by AI as your own. You must disable Gemini in your Google Colab environment. [Settings–>AI Assistance–> Hide generative AI features ]

Specifically:

Please note: it is not that hard for me to spot code you didn’t write (whether from a friend, AI, a “cheating” website, etc).

Assignments and Grading

Assignment Points
Labs (10 total) 30
Midterm project 25
Final project 30
Participation 15

Participation (15%)

You will complete three self-evaluations of your participation in the course by completing a Google Form. Your self-eval will be averaged with the instructor’s evaluation at the end of the semester.

Because this is a self-evaluation, you will have to set your own criteria for how you evaluate your participation. Here are some things that I will be looking for:

  • do you set aside time to work on the course each week?
  • do you complete labs on time?
  • do you ask for help when you are stuck?
  • do you help others on slack or over email?
  • do you share your work, relevant ideas, and resources?
  • do you find time to study or work with other students?
  • do you complete assignments on time?
  • do not abandon your teammates
  • do not turn in work written by AI or other students

Labs (30%)

There will be 10 programming “labs” during the course of the semester. Each lab will provide a few challenges based on the goals and examples of the week. You will

  • 0 points: for not turning in any work
  • 1-2 points: for a basic attempt, but code isn’t working or has fundamental flaws
  • 3 points: solution works and demonstrates mastery of relevant concepts

Some labs may have bonus problems. You should always try to do the bonus problems. They are focused more on problems solving and core “CS” concepts than the project-based exercises. If you submit a nice bonus solution, you may earn an extra point towards your lab score (but the total can’t exceed 30 points).

Labs are due by midnight on Tuesday of the week they are assigned. To turn in your lab:

  1. Save a copy of the weekly lab to your Colab.
  2. Rename it with your last name and the lab number, e.g. curinga-lab1.ipynb
  3. Share the document with the instructor mcuringa@adelphi.edu

Midterm: census data analysis (25%)

The midterm will be a pair project that you complete with your assigned partner (see the roster).

For this project you will choose an area of interest in the United States Census ACS data set. You will create a Jupyter Notebook in Colab that loads this data, cleans it, explores and describes the data, and demonstrates how it can be used.

Your Notebook must include:

  • the code to load and clean the data
  • better column names for the data, following our class conventions
  • a mardkown data dictionary describing each field
  • markdown analysis of interesting patterns and findings supported by the data and code
  • merging the census data with spatial data

Specifically, your Colab Notebook must have:

  • all of the code used to create your analysis
  • an introduction, headers, written discussion as markdown blocks
  • at least one interactive map with shapes, points, a color map, tool tips, and popups
  • at least two tables of data
    • tables must be well formatted/styled
    • at least one table must use grouped data and aggregate functions
  • markdown text blocks that provide a narrative analysis of the data and relevant descriptions of the methods

Project evaluation criteria

  1. Content/question: is the data set chosen interesting and relevant? does the code and written analysis present engaging, preliminary findings?
  2. Programming: is the code well written and efficient? Does it demonstrate mastery of the concepts covered in the course to this point? Specifically, you should use variable to make your program more flexible and easier to read. Variables should be well named. You shouldn’t have any unused code, commented out code, or redundant statements.
  3. Risk: does the project take a risk? Does it try to do something new or different? Low-risk projects very closely resemble the examples and labs; high-risk projects try to do something new or different, even if it doesn’t work exactly right.
  4. Visualization & presentation: is the map easy to read and easy to use? Can the user use the map to explore the data? Is the text edited (no typos, clear prose)? Is text formatted in HTML and markdown as needed? Are data tables well formatted and have appropriate column headers and output? Are the charts and graphs selected a good match for the data presented? Does the project make good use of color and size to convey quantitative information?

Both team members will receive the same grade for the project. This means that both members should be prepared to explain any aspect of the project during the instructor meeting and to demonstrate their ability to write new code.

Final project (30%)

The final project will follow the same format as the midterm project, except everyone will work alone and turn in their own work. The final can use either census data (from the first half of the term) or school data from the second half of the term. You must also integrate at least one data source that is not provided by the instructor.

The final project will be evaluated on the same criteria as the midterm.

Class Sessions

We’re going to operate this async course on a Wednesday to Wednesday schedule. That means that each Wednesday, will start a new module, and the lab for that week will be due by end of day on the following Tuesday. Modules will generally start with an audio introduction to the materials and a link to a Google Colab notebook. The notebook will contain all links to all other readings and videos, as well as sample code and lab exercises.

Week Date Topic Due (end of week)
1 08/28 - 09/03 Data(frames) & Variables Lab 1
2 09/04 - 09/10 Data and tables Lab 2
3 09/11 - 09/17 Mapping points Lab 3
4 09/18 - 09/24 Formatting map points Lab 4, Eval 1
5 09/25 - 10/01 Color maps Lab 5
6 10/02 - 10/08 Merging and grouping data Lab 6
7 10/09 - 10/15 Census Data project work
8 10/16 - 10/22 Census Geographies project work
9 10/23 - 10/29 Midterm meetings Project 1 Due
10 10/30 - 11/05 Charts & Graphs Lab 7, Eval 2
11 11/06 - 11/12 Mapping shapes & layers Lab 8
12 11/13 - 11/19 Open Lab 9
13 11/20 - 11/26 Open Lab 10
14 11/27 - 12/03 Final project studio project work
15 12/04 - 12/10 Beta testing project work
16 12/11 - 12/17 Final meetings Final Project, Eval 3

Weekly Modules

Module 1: Data(frames) & Variables

This week we want to get up and running with the tools of the class and the basics of writing code in Python and Colab.

Listen to the Welcome Message:

Lab 1 (due Tuesday)

Goals:

  • install Slack
  • run code in Colab
  • review syllabus and course expectations
  • view results/output
  • use variables to store data
  • use basic operators to make calculations
  • explore data in a pandas DataFrame

Topics:

  • baic syntax
  • using Jupiter notebooks and Colab
  • introduction to DataFrames and pandas

Do:

  • Listen to the Welcome Message (above)
  • Join our Slack
  • Post on the #code channel in Slack:
    • your name
    • area of study
    • why you are taking this course and programming background (if any)
  • Watch the lab 1 video and review the4 code
  • Share your lab 1 with the instructor to submit it

Module 2: Data and tables

This week we’re going to look at how to manipulate data in a DataFrame and how to format it in tables. We will continue working with census data regarding populations in urban areas.

Lab 2

Goals:

  • use comparison operators to filter data
  • use math operators to calculate new columns
  • format data to make more readable tables
  • gain a deeper understanding of how variables and data work in Jupyter Notebook / Colab

Topics:

  • calculate new columns in a DataFrame with math operators
  • .copy() a DataFrame
  • display a sub-selection of columns in a table
  • filter/query a DataFrame to find specific rows
  • work with String data to improve table display
  • change column names
  • calculate basic statistics (sum, mean, etc) on columns

Do:

  • Post on the #code channel in Slack:
    • a screenshot of a table your created in Colab
    • an interesting “finding” from your analysis of the data
  • share lab 2 with the instructor

Module 3: Mapping points

We’re going to start working with geospatial data and maps this week. Specifically, we will look at how to create maps of our US City census data.

Lab 3

Goals:

  • understand core concepts of geospatial data
  • create a map of points
  • create mouse-over titles and pop-ups for points
  • create a map of points with different colors
  • create a map of points with different sizes

Topics:

Do:

  • choose a partner for the midterm project (aka project 1)

Module 4: Formatting map points

We’re going to continue mapping points, but this week we will focus on using color to visually communicate the meaning of our data.

Goals:

This week we will look at a more complex data set and investigate ways to tell stories or convey meaning with quantitative data through maps. Our goal is to learn to manipulate data using python and to write custom code that will help us display it effectively.

Topics:

  • use markdown to format text in Jupyter Notebooks
  • use the python if statement
  • use python dictionaries
  • use style functions with the DataFrame apply method
  • use color maps to create colors for map points based on data
    • understand different types of colors maps
    • effectively read and use the matplotlib color map documentation
    • create normalized values for color mapping from data

Do:

Module 5: Analyzing data

This week we will apply the things we have learned to look at a new data set. Our goal is to solidify our understanding of course concepts of the pandas and geopandas libraries.

Lab 5 (due Tuesday)

Goals:

  • apply skills to new data set
  • discover interesting patterns in data
  • decide how to analyze and display data

Topics:

  • sorting data
  • selecting columns
  • filtering data
  • creating new columns with vector operations
  • creating new columns using the apply() method
  • creating interactive maps with explore()
  • plot points on a map
  • formatting and customizing tooltip and popup options
  • changing base tile maps
  • using colormaps to display data

Do:

  • Watch the video explanation of the problems: Lab 5 Video
  • Do the problems

Module 6: Merging and grouping data

Goals:

  • load multiple data sets
  • understand how to merge data on shared keys
    • understand the difference between inner, outer, left, and right joins
  • group data to create new insights
    • use .groupby() and aggregate functions

Lab 6

Do:

  • watch the video
  • disable Gemini in your Google Colab environment
  • complete the lab exercises
  • begin looking at ACS Census data tables to get ready for your midterm project
    • register for a Census API key here
    • use this tool to get a sense for data variables
    • post on #code a census area you might be interested in for your midterm project
    • more to come next week

Module 7: Census Data

This week we will work directly with the Census API, gathering “raw” data directly from the source. We look at how to query for census variables/fields, how to specify the year, and how to find data for specific geographic regions.

Goals:

  • configure and use your own Census API key
  • use the python census library to send valid queries
  • understand the structure of the Census API
  • clean and format data for further analysis
  • use the census for and in parameters to specify the geographic region of interest

Do:

Module 8: Project 1 studio

This week you will work with your partner to complete the midterm project. There will be no new labs this week, but we will hold our weekly online session to work on projects.

Module 9: Midterm meetings

This week, you and your partner will schedule a 30 minute meeting with the instructor. In this meeting, you will have 15 minutes to explain and demonstrate the key aspects of your code, followed by a 5 minute discussion.

The instructor will ask you to write some new code for your project, which you will have 10 minutes to work on, individually, and then present.

Goals:

  • demonstrate mastery of topics and concepts covered in the first half of the course
  • identify areas of weakness and strength
  • offer feedback to the instructor

Do:

  • share your project code with the instructor
  • schedule a zoom meeting with the instructor link TBD

Module 10: Mapping shapes & layers

So far, we have mostly placed points on our maps. This week we will plot polygons (shapes) from geospatial data files. We will learn how to draw boundaries from data, add labels, control the styles, and use color maps to create data-driven choropleth maps.

We will combine points and shapes, and create multiple layers and legends on our maps.

Lab 8 (due Tuesday)

Goals:

  • experience working with new data and discovering features of that data
  • choose your own analysis and visualizations

Topics:

Do:

Module 11, 12, 13: Stats, data cleaning, spatial queries?

These three weeks are left intentionally blank. It’s tough to have a student-directed learning experience if everything is planned before we have met. There are many topics to cover, so we will choose which ones to focus on based on interest and the types of projects students are pursuing.

We may want to take a deeper dive into statistical analysis. We might want to add multiple layers and controls to the maps. Maybe we want to collect data from more sources, including live data streams, “scraped” data that isn’t ready immediately ready for analysis (and must be cleaned), or text data that requires some natural language processing. We might also want to focus on making highly polished visuals, making interactive graphs or integrating more advanced HTML/CSS into our work. Almost certainly we will do further spatial analysis, learning how to find where shapes overlap and border, which points are contained within which shapes, etc.

In short, there are many possibilities and studying any of them will help us gain a deeper understanding of computer science, software engineering, and computer programming.

Goals:

Topics:

Do:

Module 14: Final studio

This week will focus on getting your final project in shape for the beta test in week 15.

Module 15: Beta testing

This week you will share your progress with the class in order to receive feedback, ask for help, and learn from each other.

Goals:

  • get feedback on project
  • find bugs and areas of confusion

Do:

Module 16: Final meetings

You will schedule your final one-on-one meeting with the instructor to demo your final project and solve some computing problems to show what you learned during the semester.


Adelphi University Services, Policies, and Regulations

Student Access Office and Disability Accommodation

If you have a disability that may significantly impact your ability to carry out assigned coursework, please contact the Student Access Office (SAO) at (516) 877-3806 or send an email to sao@adelphi.edu. The staff will review your concerns and determine, with you, appropriate and necessary accommodations. Please allow for a reasonable time frame for requesting ASL interpreters or transcription services.

Reasonable accommodations are available in online classes for students with a documented disability. Please note that due to the nature of online courses, some accommodations approved for on campus classes may not apply. If you have a disability that may significantly impact your ability to carry out assigned coursework, please contact the SAO at (516) 877-3806 or send an email to sao@adelphi.edu. We will review your request and determine with you appropriate and necessary accommodations.

University Libraries

The Adelphi University Libraries provides education, information resources, services and spaces that advance teaching, learning, research and creative activity. The Libraries provide semester-long support to assist with research assignment development, skills assessment, research readiness and more. Our goal is to equip learners with the information literacy skills necessary to become effective lifelong consumers of information. For more information visit the Libraries homepage or contact us for help.

Student Counseling Center

The Student Counseling Center (SCC) provides confidential and professional virtual mental health counseling services, resources, and referrals to support the academic and personal success, health, and well-being of Adelphi students without additional charge. Counselors are available to help students cope with a variety of stressors and personal issues that may interfere with their academic and personal experiences. The SCC also supports students who may be feeling suicidal or in crisis. To schedule an appointment, call (516) 877-3646 or email scc@adelphi.edu. If you need immediate assistance, walk-in services are available during the fall and spring semesters Monday-Friday, 9:00 a. m.–5:00 p.m. Additional information can also be found at .

Need support when the SCC is not available? For 24/7 emergency counseling, referral, or assistance, please contact:

Center for Academic Support and Enrichment (formerly the Learning and Writing Centers)

Website: http://adelphi.edu/case Email: CASE@adelphi.edu
Phone: (516) 877-3200 Location: Nexus 132

The Center for Academic Support and Enrichment (CASE) offers programs and services—like individual tutoring in writing and subjects across the curriculum, small group study sessions, academic coaching and targeted workshops—that help students explore, deepen and extend their classroom learning. Support programming focuses on establishing foundational skills and techniques of studentship, like time management and note-taking. Enrichment services develop higher-order critical thinking skills and problem solving skills inherent in both abstractions and applications of curricular study. Contact us via email, phone or via eCampus to review our full slate of real-time (in person and remote) and asynchronous services. These are included in your tuition, so you’ve already bought them! Don’t miss out on the opportunity to supercharge your college experience. Many services require reservations, especially late in the semester. Reserve a spot on our scheduling portal and/or join the self-directed virtual CASE LAB. Get on the CASE, and take your Adelphi experience to the next level.

The Adelphi Honor Code

“The University is an academic community devoted to the pursuit of knowledge. Fundamental to this pursuit is academic integrity. In joining the Adelphi community I accept the University’s Statement of Academic Integrity and pledge to uphold the principles of honesty and civility embodied in it. I will conduct myself in accordance with ideals of truth and honesty and I will forthrightly oppose actions which would violate these ideals.”

Code of Academic Integrity

The Code of Academic Integrity prohibits behavior that can broadly be described as lying, cheating, or stealing. Academic dishonesty or violations of the Code of Academic Integrity include, but are not limited to, the following:

  1. Fabricating data or citations
  2. Collaborating in areas not approved by the professor
  3. Unauthorized multiple submission of one’s own work
  4. Sabotage of others’ work, including library vandalism or manipulation
  5. Plagiarism
  6. The creation of unfair advantage
  7. The facilitation of dishonesty
  8. Tampering with or falsifying records
  9. Cheating
  10. Other forms of academic dishonesty

Copying and pasting from any source into your assignments or exams without quotation marks, citations and references, constitutes plagiarism. Students are expected to produce and submit original work and to cite all sources appropriately. Unauthorized collaboration on any work, or the presentation of someone else’s work as your own, is plagiarism. Content generated by an Artificial Intelligence third-party service or site (AI-generated content, e.g. ChatGPT) without attribution or authorization is also a form of plagiarism. Unless explicitly stated, artificial intelligence-based technologies, such as ChatGPT or word mixing software, cannot be used to generate responses (partial or otherwise) for student assignments or exams.

If you are unsure about what plagiarism or another form of academic dishonesty are, please reach out to me to discuss it as soon as possible. An allegation of an academic integrity violation of this section may be referred for further review and could result in disciplinary action.

Student Course Evaluations

During the last two weeks of the class, you will receive notification, via email and eCampus, that the course evaluation is available for your input electronically. Your feedback is valuable and students are strongly encouraged to respond. Please be assured that your responses are anonymous and the results will not be available to the instructor until after course grades have been submitted after the semester ends.

Religious Observance Policy

Adelphi University welcomes diversity in its community and respects various religious observances. Students who anticipate being absent due to their religious observance are required by Adelphi University to notify their professors at the start of the semester. This will allow faculty to take these observances into consideration in light of their course exam and assignment schedules. Students absent from class, clinical experiences, practice, labs, etc. on those days, after prior notice to the professor, will not be penalized for any exam or assignment deadline missed because of those absences. Students must contact the instructor to work out suitable arrangements for make-ups or other satisfaction of academic requirements. Adelphi’s Exam/Assignment Absence Policy can be viewed here.

Attendance Policy

Only students who are registered for courses, and whose name appears on the Official Class Roster may attend courses at the University. Adelphi students make a commitment to be active participants in their educational program; class attendance is an integral part of this commitment. Students are expected to be present promptly at the beginning of each class period, unless prevented by illness or by other compelling cause. In the event of such absence, students may request that faculty members be notified by the Office of Academic Services and Retention. Students are responsible for learning course content and completing coursework missed through absences.