Quantcast
Channel: Active questions tagged excel - Stack Overflow
Viewing all articles
Browse latest Browse all 88054

Python function to import filename and city name

$
0
0

Very new to python and trying my best to learn. I understand the concept of functions and they don;t seem complicated but for some reason I have the worst time with them.

I have an excel spreadsheet I need to open the file and read data in from a specific sheet w/in the file.

I setup the function like so:

def process_data(file, city):
    file_name =  "../data/" + file # path to file + file name
    sheet = city # sheet name 


process_data("Jan 10.xlsx", "Seattle")

but it doesn't work. I ultimately want to read this into a panda dataframe so I can manipulate the data. Can someone give a newbie a little guidance?

All help is greatly appreciated....


Viewing all articles
Browse latest Browse all 88054

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>