<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 The Hacker Within Spring 2017 survey
by R. Stuart Geiger, freely licensed CC-BY 4.0, MIT license
Importing and processing data
Importing libraries
Step1:  Importing data and previewing
Step2:  Creating two dataframes
Step3:  Topic interest
Each topic (e.g. Python, R, GitHub) has one cell, with a list based on the items checked. 
If someone clicked "I want this at THW", there will be a 1. 
If someone clicked "I really want this at THW," there will be a 2. 
If someone clicked "I know something about this..." there will be a 3. 
These are mutually independent -- if someone clicked all of them, the value would be "1, 2, 3" and so on.
Assumptions for calculating interest
Step4:  Results
Step5:  Topic expertise
Step6:  Meta questions about THW
Step7:  Personal experience with scientific computing
Step8:  What skill level should we aim for?
Step9:  What should our sessions look like?
<ASSISTANT_TASK:>
Python Code:
import pandas as pd
import matplotlib.pyplot as plt
%matplotlib inline
Explanation: The Hacker Within Spring 2017 survey
by R. Stuart Geiger, freely licensed CC-BY 4.0, MIT license
Importing and processing data
Importing libraries
End of explanation
df = pd.read_csv("survey.tsv",sep="\t")
df[0:4]
Explanation: Importing data and previewing
End of explanation
df_topics = df
df_topics = df_topics.drop(['opt_out', 'Skill level', 'Personal experience', 'Presentation style'], axis=1)
df_meta = df
df_meta = df[['Skill level', 'Personal experience', 'Presentation style']]
Explanation: Creating two dataframes: df_topics for interest/experience about topics and df_meta for questions about THW
End of explanation
topic_interest = {}
topic_teaching = {}
for topic in df_topics:
    
    topic_interest[topic] = 0
    topic_teaching[topic] = 0
    for row in df_topics[topic]:
        
        # if row contains only value 1, increment interest dict by 1
        if str(row).find('1')>=0 and str(row).find('2')==-1:
            topic_interest[topic] += 1
        
        # if row contains value 2, increment interest dict by 3
        if str(row).find('2')>=0:
            topic_interest[topic] += 3
            
        if str(row).find('3')>=0:
            topic_teaching[topic] += 1       
Explanation: Topic interest
Each topic (e.g. Python, R, GitHub) has one cell, with a list based on the items checked. 
If someone clicked "I want this at THW", there will be a 1. 
If someone clicked "I really want this at THW," there will be a 2. 
If someone clicked "I know something about this..." there will be a 3. 
These are mutually independent -- if someone clicked all of them, the value would be "1, 2, 3" and so on.
Assumptions for calculating interest: If someone clicked that they just wanted a topic, add 1 to the topic's score. If someone clicked that they really wanted it, add 3 to the topic's score. If they clicked both, just add 3, not 4.
End of explanation
topic_interest_df = pd.DataFrame.from_dict(topic_interest, orient="index")
topic_interest_df.sort_values([0], ascending=False)
topic_interest_df = topic_interest_df.sort_values([0], ascending=True)
topic_interest_df.plot(figsize=[8,14], kind='barh', fontsize=20)
Explanation: Results
End of explanation
topic_teaching_df = pd.DataFrame.from_dict(topic_teaching, orient="index")
topic_teaching_df = topic_teaching_df[topic_teaching_df[0] != 0]
topic_teaching_df.sort_values([0], ascending=False)
topic_teaching_df = topic_teaching_df.sort_values([0], ascending=True)
topic_teaching_df.plot(figsize=[8,10], kind='barh', fontsize=20)
Explanation: Topic expertise
End of explanation
df_meta['Personal experience'].replace([1, 2, 3], ['1: Beginner', '2: Intermediate', '3: Advanced'], inplace=True)
df_meta['Skill level'].replace([1, 2, 3], ['1: Beginner', '2: Intermediate', '3: Advanced'], inplace=True)
df_meta['Presentation style'].replace([1,2,3,4,5], ["1: 100% presentation / 0% hackathon", "2: 75% presentation / 25% hackathon", "3: 50% presentation / 50% hackathon", "4: 25% presentation / 75% hackathon", "5: 100% hackathon"], inplace = True)
df_meta = df_meta.dropna()
df_meta[0:4]
Explanation: Meta questions about THW
End of explanation
pe_df = df_meta['Personal experience'].value_counts(sort=False).sort_index(ascending=False)
pe_plot = pe_df.plot(kind='barh', fontsize=20, figsize=[8,4])
plt.title("What is your personal experience with scientific computing?", size=20)
Explanation: Personal experience with scientific computing
End of explanation
skill_df = df_meta['Skill level'].value_counts(sort=False).sort_values(ascending=False)
skill_plot = skill_df.plot(kind='barh', fontsize=20, figsize=[8,4])
plt.title("What skill level should we aim for?", size=20)
Explanation: What skill level should we aim for?
End of explanation
style_df = df_meta['Presentation style'].value_counts(sort=False).sort_index(ascending=False)
style_plot = style_df.plot(kind='barh', fontsize=20, figsize=[8,4])
plt.title("Session format", size=20)
Explanation: What should our sessions look like?
End of explanation
<END_TASK>