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
//Explicitly declared | |
var someVariableName: String = "Explicitly declared variable of type String" | |
val someIntValue: Int = 343 | |
val someDoubleValue: Double = 343.24 | |
//Implicitly declared | |
var someVariableName = "Implicitly declared variable of type String" | |
val someIntValue = 343 |
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
val someVariableName = "Kotin is fun and you can't re-assign me!" |
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
var someVariableName = "Kotlin is fun!" |
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
fig = plt.figure(figsize = (12,9)) | |
m = Basemap(projection='mill', | |
llcrnrlat = -90, | |
urcrnrlat = 90, | |
llcrnrlon = -180, | |
urcrnrlon = 180, | |
resolution = 'c') | |
lon_x = users_dataFrame['Longitude'].tolist() | |
lat_y = users_dataFrame['Latitude'].tolist() |
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
users_dataFrame = pd.read_csv('users.csv') | |
users_dataFrame |
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
tocsv(users_table, 'users.csv') |
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
users_table = unpackdict(users_table, 'address') | |
users_table = unpackdict(users_table, 'geo') | |
#select a few columns | |
users_table = cut(users_table, 'id', 'name','username','email','phone','city','street','suite','lat','lng') | |
#rename column headers | |
users_table = rename(users_table, {'name':'Name','username':'Username','email':'Email','phone':'Phone','city':'City','street':'Street','suite':'Suite','lat':'Latitude', 'lng':'Longitude'}) | |
users_table |
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
#Extract | |
users_table = fromdicts(data) | |
users_table |
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
jsonurl = urllib.request.urlopen("https://jsonplaceholder.typicode.com/users") | |
data = json.loads(jsonurl.read()) | |
data |
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
from petl import look, fromdb,fromjson,fromdicts,unpackdict,cut, todb, rename, tocsv | |
from matplotlib.pyplot import figure | |
from sklearn.linear_model import LinearRegression | |
from sklearn.model_selection import train_test_split | |
from pandas import DataFrame | |
from plotly.subplots import make_subplots | |
from shapely.geometry import Point | |
from geopandas import GeoDataFrame | |
from mpl_toolkits.basemap import Basemap | |
import pandas as pd |