-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Export CSV file with google link based on Beam Travel times #2438
Export CSV file with google link based on Beam Travel times #2438
Conversation
test! |
…nd departureTimeRange
__author__ = "Carlos Caldas" | ||
|
||
|
||
def main(args): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the verison of Python? Is it 2 or 3? Anyway, can you use https://docs.python.org/2/library/argparse.html to parse arguments instead of doing a lot of manual work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is Python 3. It is using getOpt
. There is no lot of manual work, only default values definitions, so the arguments must be tested.
|
||
def convert_file(input_file_location, output_file_path, program_arguments): | ||
df = read_csv_as_dataframe(input_file_location, program_arguments) | ||
urls_list = generate_urls_as_list( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess you could do it in-place, e.g:
def google_link(start_x, start_y, end_x, end_y):
return f"https://www.google.com/maps/dir/{start_y}%09{start_x}/{end_y}%09{end_x}"
df['google_link'] = df.apply(lambda x: google_link(x.start_x, x.start_y, x.end_x, x.end_y), axis=1)
Issue: #2426
Running the script (python v3):
will generate the file
/path-to-the-file/0.personal.CarRideStats.output.csv
will generate the file
/path-to-the-python_script/output/sf-light/austin-light-100k__2020-03-02_20-06-35_cnx/ITERS/it.9/9.CarRideStats.output.csv
This change is