<jupyter_start><jupyter_text>Highway Map Visualization  Read Data<jupyter_code>import pandas as pd 

highway_map_file = "data/highway_map.csv"

data = pd.read_csv(highway_map_file, sep=' ', header=None, names=('x', 'y', 's', 'dx', 'dy'))

print(data.head())<jupyter_output>x         y           s        dx        dy
0  784.6001  1135.571    0.000000 -0.023598 -0.999722
1  815.2679  1134.930   30.674479 -0.010995 -0.999940
2  844.6398  1134.911   60.046371 -0.002048 -0.999998
3  875.0436  1134.808   90.450415 -0.001848 -0.999998
4  905.2830  1134.799  120.689735  0.004131 -0.999992<jupyter_text>Visualize Data<jupyter_code>import matplotlib.pyplot as plt
%matplotlib inline

lane_width = 4

# values for 's' coordinates formatted to fit the graph
s_vals = ["{:.2f}".format(data['s'][i]) if i % 8 == 0 else '' for i in range(0,len(data))]

x_vals_lane_1 = [data['dx'][i] * lane_width * 0.5 + data['x'][i] for i in range(0, len(data))]
x_vals_lane_2 = [data['dx'][i] * lane_width * 1.5 + data['x'][i] for i in range(0, len(data))]
x_vals_lane_3 = [data['dx'][i] * lane_width * 2.5 + data['x'][i] for i in range(0, len(data))]

y_vals_lane_1 = [data['dy'][i] * lane_width * 0.5 + data['y'][i] for i in range(0, len(data))]
y_vals_lane_2 = [data['dy'][i] * lane_width * 1.5 + data['y'][i] for i in range(0, len(data))]
y_vals_lane_3 = [data['dy'][i] * lane_width * 2.5 + data['y'][i] for i in range(0, len(data))]

plt.figure(figsize=(20,20))
plt.xlabel('x', fontsize=32)
plt.ylabel('y', fontsize=32)
plt.plot(data['x'], data['y'])
plt.scatter(data['x'], data['y'])
for i in range(0, len(data)):
    plt.annotate(s_vals[i], (data['x'][i], data['y'][i]), color='red', fontsize=10)
    
plt.plot(x_vals_lane_1, y_vals_lane_1)
plt.plot(x_vals_lane_2, y_vals_lane_2)
plt.plot(x_vals_lane_3, y_vals_lane_3)
plt.show()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.19479110146500273, 'fraction_numerical': 0.12533912099837222, 'mean_word_length': 4.587878787878788, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '182520', 'license': 'MIT', 'n_tokens_mistral': 938, 'n_tokens_neox': 828, 'n_words': 168, 'path': 'Highway_Map_Visualization.ipynb', 'repo_name': 'RobertDae/Udacity_PathPlannerProject', 'size': '1843'}