Q:

How to make a graphing code graph with csv instead of txt

I have a code that lets me graph stacked bar charts, and it imports data from a .txt file. 
df = pd.read_table("tiempo.txt",header =None, names = ['Tiempos no Contributivos','Tiempos Contributivos', 'Tiempos Productivos'])
df['bar'] = 1 
dfgroup = df.groupby('bar').sum()
ax = dfgroup [['Tiempos no Contributivos','Tiempos Contributivos', 'Tiempos Productivos']].plot(kind='bar', title ="Tiempos de obra",
         figsize=(15, 10), legend=True, fontsize=12)
ax.set_xlabel(" ", fontsize=12)
ax.set_ylabel("Tiempo(segundos)", fontsize=12)
plt.show()

The graph this code throws, looks like this. 
Graph Image
What i need is for this code to work like its been working, but instead of reading a .txt file, i need it to read a .csv file. 
When i tried to switch the .txt file for the .csv one in the reading part, this happened. 
Error
The data used in this code looks like this (Wont post the entirety of it because there are like 500 rows)
Example of the data used

A:

So I fixed that and changed the function to read_csv.   Then I noticed that your csv wasn't comma delimited, and was, instead, tab delimited.   So, I added delimiter='\t' the read.  Next, I went ahead adn updated the functions you were calling to set the ylabel and xlabel to their modern names.   Then, I took your current column names and fed them into the plot, that way we have a properly labeled graph. 
import pandas as pd
import matplotlib.pyplot as plt; plt.rcdefaults()
import numpy as np

df = pd.read_csv("tiempo.txt",header=None,delimiter='\t',names = ['Tiempos no Contributivos','Tiempos Contributivos', 'Tiempos Productivos'])
y_pos = np.arange(len(df.columns))
bars = df.sum(axis=0)

plt.bar(y_pos, bars, align='center', alpha=0.5)
plt.xticks(y_pos, df.columns)
plt.ylabel("Tiempo(segundos)", fontsize=12)
plt.xlabel(" ", fontsize=12)
plt.title('Tiempo')

plt.show()

Output:

