לדלג לתוכן

קובץ:US Labor Participation Rate by gender.svg

תוכן הדף אינו נתמך בשפות אחרות.
מתוך ויקיפדיה, האנציקלופדיה החופשית

לקובץ המקורי(קובץ SVG, הגודל המקורי: 720 × 540 פיקסלים, גודל הקובץ: 81 ק"ב)

ויקישיתוף זהו קובץ שמקורו במיזם ויקישיתוף. תיאורו בדף תיאור הקובץ המקורי (בעברית) מוצג למטה.
 
W3C-validity not checked.

תקציר

תיאור
English: Graph of US Civilian Labor Participation Rate from 1948 to 2011 by gender. Men are represented in light blue, women in pink, and the total in black.
תאריך יצירה
מקור Bureau of Labor Statistics within the United States Department of Labor
יוצר User:Int21h
אישורים והיתרים
(שימוש חוזר בקובץ זה)
Creative Commons CC-Zero קובץ זה זמין לפי תנאי הקדשה עולמית לנחלת הכלל CC0 1.0 של Creative Commons.
האדם ששייך יצירה להיתר הזה הקדיש את היצירה לנחלת הכלל על־ידי ויתור על כל הזכויות שלו או שלה על היצירה בכל העולם לפי חוק זכויות יוצרים, לרבות כל הזכויות הקשורות או הסמוכות כקבוע בחוק. באפשרותך להעתיק, לשנות, להפיץ, או להציג את היצירה, אפילו למטרות מסחריות, וכל זה אפילו מבלי לבקש רשות.

גרסאות אחרות

Source code

#!/usr/bin/env python

##
# Create an SVG graph of BLS timeseries data using matplotlib and 
# BeautifulSoup.
#

import matplotlib.figure
import datetime
import bs4
import matplotlib.backends.backend_cairo
import string
import urllib2

def main():
	url = 'http://data.bls.gov/timeseries/%s?years_option=specific_years&include_graphs=true&to_year=2011&from_year=1948'
	total_series = 'LNS11300000'
	men_series = 'LNS11300001'
	women_series = 'LNS11300002'
	
	fig,ax = init_figure()
	add_plot(ax, scrape_bls(bs4.BeautifulSoup(urllib2.urlopen(url % total_series))), 'black')
	add_plot(ax, scrape_bls(bs4.BeautifulSoup(urllib2.urlopen(url % men_series))), 'lightblue')
	add_plot(ax, scrape_bls(bs4.BeautifulSoup(urllib2.urlopen(url % women_series))), 'pink')
	save_figure(fig, 'US Labor Participation Rate 1948-2011 by gender.svg')

##
# Scrape the BLS soup for the data.
#
def scrape_bls(soup):
	table = soup.find_all('table', attrs={'class': 'regular-data'})
	assert len(table) == 1
	table = table[0]
	data = []
	years_lc = [[t for t in r if type(t) is bs4.element.Tag] for r in table.contents[4] if type(r) is bs4.element.Tag]
	for row in years_lc:
		year = int(row[0].text)
		months = [float(t.text) for t in row[1:] if any(c in string.printable and c != ' ' for c in t.text)]
		data.append((year,months))
	return data

##
# Add plot to figure. Extra parameters are passed to 
# matplotlib.axes.Axes.plot().
#
def add_plot(axis, data, *args):
	x=[]
	y=[]
	for year,months in data:
		for month,n in enumerate(months):
			x.append(datetime.date(year, month+1, 1))
			y.append(n)
	axis.plot(x, y, *args)

##
# Initialize figure.
#
def init_figure():
	figure = matplotlib.figure.Figure()
	axis = figure.add_subplot(111)
	
	axis.xaxis.set_major_locator(matplotlib.dates.YearLocator(6))
	axis.xaxis.set_major_formatter(matplotlib.dates.DateFormatter('%Y'))
	
	axis.grid(True)
	
	return figure,axis

##
# Save figure
#
def save_figure(figure, filename):
	figure.canvas = matplotlib.backends.backend_cairo.FigureCanvasCairo(figure)
	figure.savefig(filename, transparent=True)

if __name__ == "__main__":
	main()

כיתובים

נא להוסיף משפט שמסביר מה הקובץ מייצג

פריטים שמוצגים בקובץ הזה

מוצג

היסטוריית הקובץ

ניתן ללחוץ על תאריך/שעה כדי לראות את הקובץ כפי שנראה באותו זמן.

תאריך/שעהתמונה ממוזערתממדיםמשתמשהערה
נוכחית14:47, 9 בנובמבר 2016תמונה ממוזערת לגרסה מ־14:47, 9 בנובמבר 2016‪540 × 720‬ (81 ק"ב)Kopiersperreupdated to 2016
06:52, 9 באוקטובר 2011תמונה ממוזערת לגרסה מ־06:52, 9 באוקטובר 2011‪540 × 720‬ (76 ק"ב)Int21hcleanup, standardization.
12:59, 8 באוקטובר 2011תמונה ממוזערת לגרסה מ־12:59, 8 באוקטובר 2011‪540 × 720‬ (83 ק"ב)Int21h{{Information |Description={{en|1=Graph of US Civilian Labor Participaton Rate from 1948 to 2010 by gender}} |Source=Bureau of Labor Statistics within the [[:wikipedia:United States Department of Labor|United Stat

אין בוויקיפדיה דפים המשתמשים בקובץ זה.

שימוש גלובלי בקובץ

אתרי הוויקי השונים הבאים משתמשים בקובץ זה:

מטא־נתונים