XML to CSV

With my Ph.D. program starting this fall, I expect I’ll be doing a lot more programming. I used to program a lot as an undergraduate, but, well, that was a long time ago.

I’ve been teaching myself Python, so I was excited when I learned a colleague was looking for a way to convert an .xml file to a .csv file. There was just one specific variable they were looking to export into .csv format, so the code is specific to that.

Since I’ll probably be coding a lot more, I figured I’d post this bit of code here.

_____

import csv
from xml.etree import ElementTree

infile = raw_input(“Name of xml file:  “) # ask user for file to convert

# create name output file, same as input file replacing .xml with .csv
out = ” ”
for letter in infile:
if letter != “.”:
out += letter
else:
break

out += “.csv”

# parse input file
with open(infile, ‘rt’) as f:
tree = ElementTree.parse(f)

#identify data to export to .csv
out_data = []
out_data.append(‘beta’)  # header column: variable we’re interested in
out_data.append(‘source’) # header column: name of file being converted

for node in tree.iter(): #iterate through .xml file
if node.tag == “{http://www.dmg.org/PMML-4_1}PCell”: #look for the tag holding the variable we’re interested in
beta = node.attrib.get(‘beta’) #grab data from variable we’re interested in
out_data.append(beta) # add data to output
out_data.append(infile) # add name of converted file to output

# write .csv file
out_file  = open(out, “wb”)
csv_writer = csv.writer(out_file, quoting=csv.QUOTE_NONE)

count = 0

for row in out_data: #iterate through output data putting commas and line breaks in correct places
count += 1
out_file.write(row) # write data to .csv file
if count%2 == 0:
csv_writer.writerow(” “) # we’re outputing two columns of data, so add a line break if two columns have been added
else:
out_file.write(“,”) #else, add a “,” to seperate data elements on the same row

out_file.close() # close file

print “wrote %s” % out

facebooktwittergoogle_plusredditlinkedintumblrmail

media literacy education article

This is just out today: Levine, P. (2014). Media Literacy for the 21st Century. A Response to “The Need for Media Education in Democratic Education.” Democracy and Education, 23 (1), Article 15. It’s an invited response to Jeremy Stoddard’s fine piece “The Need for Media Education in Democratic Education.” My response is not a critique but just a complementary perspective. The abstract:

We cannot pretend to educate young people for citizenship and political participation without teaching them to understand and use the new media, which are essential means of expressing ideas, forming public opinions, and building institutions and movements. But the challenge of media literacy education is serious. Students need advanced and constantly changing skills to be effective online. They must understand the relationship between the new media and social and political institutions, a topic that is little understood by even the most advanced social theorists. And they must develop motivations to use digital media for civic purposes, when no major institutions have incentives to motivate them. Until we address those challenges, students will struggle to make sense of the new media environment, let alone take constructive action.

 

The post media literacy education article appeared first on Peter Levine.

Don’t Miss Our Tech Tuesday Call with Consider.it on 5/5

As we recently announced, NCDD is hosting another one of our Tech Tuesday events next Tuesday, May 5th from 2-3pm EST. We have had many folks already register to join us, but there is still room, so make sure to sign up today!

Tech_Tuesday_BadgeDuring the call, we will hear from Kevin Miniter, the co-founder of Consider.it – an innovative dialogue software that helps regular people participate in a facilitated conversation where they identify their common ground, sticking points, and misconceptions as they build toward consensus on a topic. Consider.it also powers the Living Voter’s Guide that informs tens of thousands of Washington voters every year.

This talk with Kevin promises to be a very informative, especially for those of us who have been looking for or are interested in ways to integrate more technology our dialogue work.

Don’t miss this great opportunity! Register today by clicking here!

The Past is Public

Earlier this week, I attended the final “Tisch Talk in the Humanities” of the semester. This new series was launched by Tisch College to explore the intersections of humanities and civic work.

The final talk was on “neighboring,” a concept that was here taken to mean – essentially the opposite of “othering.”

When we “other” somebody we set them apart from ourselves. We emphasize difference and reinforce an “us” versus “them” dynamic.

Neighboring doesn’t mean abolishing differences, but rather embracing the broader commonalities of proximity.

We are all people. We are all in the same boat.

These are the declarations of neighboring.

An interesting point emerged from this conversation. Peter Probst, a professor of Art & Art History at Tufts, started discussing neighboring not only in the present tense, but in the context of history – in the context of preservation.

The past is public, he argued.

What we think of as history is actually a collection of individual stories brought into a collective whole.

That collective whole is jointly owned as “history,” but individual stories still have the right to resist the dominant narrative.

Thus preservation can be an act of neighboring, as historians seek to honor individual stories and include diverse narrative as part of the public whole.

If the past is public, then we all must be good stewards – not only of history but of our neighbor’s truths.

facebooktwittergoogle_plusredditlinkedintumblrmail

The Los Angeles Citywide Neighborhood Council System

In order to unite disenfranchised parts of the City, the citizens of Los Angeles voted the Neighborhood Council system into the City Charter in 1999. The Neighborhood Councils have created a citywide community of volunteers, increasing civic participation and making government more responsive to local needs.

A Resounding “Thank You” to Andy Fluke

NCDD Co-Founder Andy Fluke’s role as Creative Director is coming to a close in July. While many of you know Andy, you might not realize the scale of the contribution he has made over the years. It’s a story well worth telling.

Andy-pumpkin-borderAs creative director, Andy has been the graphic design force behind our website and publications, quietly anchoring NCDD’s infrastructure and fostering its growth for the past 12 years.  He may be best known for developing the website from a handful of pages to what it is today: a 6,000-page compendium widely regarded as the leading source for news and resources in the field. In NCDD’s first 12 years, Andy redesigned and expanded the website four times, in response to the needs of our community and the growth of the organization.

His first love has always been graphic design, a skill he learned in his father’s printing business and wielded to create the conference guidebooks, reports, signage, infographics, and other NCDD materials that have drawn praise from professionals throughout the dialogue and deliberation community.

To focus only on Andy’s creative skills, however, would be to miss the myriad other ways he has helped to shape NCDD since its founding in 2002. As co-founder, he played a critical role as sounding board and thinking partner for Sandy over the years. His contributions to NCDD’s day-to-day operations have also been significant: he has assisted with office tasks, written and edited content for the website, helped behind the scenes at NCDD’s events, maintained the staff’s computers, and much more.

AndyOnRock-borderAbove all, Andy has been essential as a problem solver, stepping into new responsibilities and mastering new skills on the fly. “There is no accomplishment that I’m more proud of than my overall ability to solve problems and create opportunities with little or no financial investment,” he said. “In every task, I’ve dedicated myself to seeking the most cost-efficient and productive ways to make things happen for NCDD.”

This ability has been indispensable to NCDD’s success. When Sandy and Andy co-founded NCDD in 2002 after running the first National Conference on Dialogue and Deliberation, planning conferences and running organizations were new territory for them. NCDD has always been a lean operation, and the desire to do as much as possible for NCDD members required them to be thoughtful, frugal, and clever when attempting anything new, especially online.

As Andy moves into the next phase of his career, we know that his resourcefulness and “keep it simple” approach will serve organizations well for years to come. At the same time, as Andy says, “I look forward to acting as an ambassador for the fantastic work that NCDD continues to do and continuing to support the dialogue and deliberation community.”

Andy will continue offering his skill and experience to the dialogue and deliberation community and is available to consult on or engage in any publication or internet design projects. His personal email address is afluke@gmail.com and you can also learn more about him at andyfluke.com.

The Care-Centered Economy: A New Theory of Value

I recently encountered a brilliant new essay by German writer Ina Praetorius that revisits the feminist theme of “care work,” re-casting it onto a much larger philosophical canvas. “The Care-Centered Economy:  Rediscovering what has been taken for granted” suggests how the idea of “care” could be used to imagine new structural terms for the entire economy. 

By identifying “care” as an essential category of value-creation, Praetorius opens up a fresh, wider frame for how we should talk about a new economic order.  We can begin to see how care work is linked to other non-market realms that create value -- such as commons, gifts of nature and colonized peoples --all of which are vulnerable to market enclosure.

The basic problem today is that capitalist markets and economics routinely ignore the “care economy” -- the world of household life and social conviviality may be essential for a stable, sane, rewarding life.  Economics regards these things as essentially free, self-replenishing resources that exist outside of the market realm.  It sees them as “pre-economic” or “non-economic” resources, which therefore don’t have any standing at all.  They can be ignored or exploited at will.

In this sense, the victimization of women in doing care work is remarkably akin to the victimization suffered by commoners, colonized persons and nature.  They all generate important non-market value that capitalists depend on – yet market economics refuses to recognize this value.  It is no surprise that market enclosures of care work and commons proliferate.

A 1980 report by the UN stated the situation with savage clarity:  “Women represent 50 percent of the world adult population and one third of the official labor force, they perform nearly two thirds of all working hours, receive only one tenth of the world income and own less than 1 percent of world property.”

read more

CIRCLE’s release on today’s Civics results

23% of 8th-Graders “Proficient” in Civics According to Nation’s Report Card Released Today
Today’s Release Shows Inequality in Civics Education, Serious Gaps by Racial and Economic Backgrounds Reflecting Unequal Education

Medford/Somerville, MA – Today, the Federal Government released the Nation’s Report Card: 2014 U.S. in Civics. Experts on civic education from the Center for Information and Research on Civic Learning & Engagement (CIRCLE) based at Tufts University’s Tisch College – the preeminent, non-partisan research center on youth engagement – have been involved in both designing and analyzing the National Assessment of Educational Progress (NAEP) Civics Assessment and can provide informed commentary.

“The quality and equality of civic education is a reflection of our investment in a healthy democracy,” said Dr. Kei Kawashima-Ginsberg, director of CIRCLE. “The National Assessment of Education Progress, or the Nation’s Report Card, as it’s also known, is a difficult and complex test that successfully measures some key areas of civic learning and how well civics is taught. However, as the new Nation’s Report Card: 2014 shows, we are far from achieving an acceptable quality or equality of civics education.”

The 2014 NAEP Civics, released today, finds that 23% of America’s 8th graders are “proficient.” Although higher scores would certainly be desirable, many adults might be surprised by how difficult the NAEP Civics questions are. For instance, in 2014, 8th graders were asked to identify a power of the modern President not described in the Constitution and to understand that growth in the elderly population would affect Social Security spending.

NAEP assessments in all other subjects yield roughly comparable proficiency levels to those found in civics. For instance, on the 2013 Mathematics NAEP, 27% of 8th graders scored proficient and 9% scored advanced.

More significant than the overall proficiency levels are gaps by student groups. For instance, only 9% of African American students reached at least the “proficient” level in the 2014 NAEP Civics, compared to 40% of Asian/Pacific Islander students. Students from urban areas, students whose parents didn’t attend college, students eligible for free and reduced-price lunch, and students with disabilities all scored lower than average.

“The NAEP Civics measures education for citizenship, which is an essential purpose of schools,” said Peter Levine, Associate Dean for Research at Tufts University’s Jonathan M. Tisch College of Citizenship and Public Service and a member of the NAEP Civics Committee. “In 2014, due to budget cuts, the NAEP Civics was fielded only at the 8th grade level. It is important for the NAEP Civics to be administered regularly and at the 4th grade, 8th grade, and 12th grade levels so that we can assess our progress in educating America’s kids for citizenship.”

Previous research by CIRCLE has shown that what students know about civics is related to how much and how well they are taught civics. The gaps in NAEP scores reflect inequality in civic education.

Dr. Kei Kawashima-Ginsberg closely studied previous NAEP Civics results for a fact sheet entitled, “Do Discussion, Debate, and Simulations Boost NAEP Civics Performance?” In that work, Kawashima-Ginsberg explored the relationship between three promising teaching practices and NAEP scores for various demographic groups.

Dr. Peter Levine, Associate Dean for Research at Tisch College, has written a fact sheet entitled, “What the NAEP Civics Assessment Measures and How Students Perform.” The fact sheet looks closely at what the NAEP Civics test measures, the skills and values that it doesn’t capture, and in general how to interpret the results. Levine was a member of the committee that helped design the 2014 civics test.

###

The post CIRCLE’s release on today’s Civics results appeared first on Peter Levine.

Recap of the NCDD Confab Call with Pete Peterson

We had another great Confab Call event last week with NCDD member Pete Peterson of the Davenport Institute. Pete shared some very interesting insights and lessons that he learned from his recent run for Confab bubble imageCalifornia Secretary of State last year in a bid to become, as he calls it, the state’s “Chief Engagement Officer.”

It was an inspiring conversation in many ways, and after listening to Pete, there very well may be a few more NCDD members thinking about using their public engagement backgrounds to run for office!

In case you missed it, you can watch the recording of the call by clicking here (we used join.me, so there is screensharing plus audio). We also encourage you to check out some of our past Confab Calls for more great conversations and ideas.