-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into dependabot/pip/Flask/flask-2.2.5
- Loading branch information
Showing
8 changed files
with
31 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
''' | ||
import matplotlib.pyplot as plt | ||
import numpy as np | ||
import random | ||
|
||
|
||
|
||
plt.plot([1,2,3,2]) | ||
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import json | ||
|
||
def csvtojson(csvstring): | ||
''' | ||
Input string is the form of k:v,k:v,... | ||
''' | ||
keyvaluepairs = csvstring.split(',') | ||
jsonOut = {} | ||
for pair in keyvaluepairs: | ||
key, value = pair.split(':') | ||
jsonOut[key] = value | ||
return jsonOut | ||
|
||
|
||
|
||
if __name__ == "__main__": | ||
testString1 = "a:b,c:d" | ||
testString2 = "a:b,c:d,e:f" | ||
jsonOut1 = csvtojson(testString1) | ||
print(jsonOut1["a"]) | ||
jsonOut2 = csvtojson(testString2) | ||
print(jsonOut2) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters