How can I make a U.S. map with cities represented as dots? - maps

I have a list of 50 cities that I want to plot on a map in Stata. The data is in csv format and looks like this:
New York city New York
Los Angeles city California
Chicago city Illinois
Houston city Texas
Phoenix city Arizona
Philadelphia city Pennsylvania
San Antonio city Texas
San Diego city California
Dallas city Texas
How can I get a U.S. map with a dot for each city? I have looked into spmap but not been able to find a solution.

Related

Matching employees from different school and hometown

I am new to coding. Now I have a employee table looked like below:
Name
Hometown
School
Jeff
Illinois
Loyola University Chicago
Alice
California
New York University
William
Michigan
University of Illinois at Chicago
Fiona
California
Loyola University Chicago
Charles
Michigan
New York University
Linda
Indiana
Loyola University Chicago
I am trying to get those employees in pairs where two employees come from different state and different university. Each person can only be in one pair. The expected table should look like
employee1
employee2
Jeff
Alice
William
Fiona
Charles
Linda
The real table is over 3,000 rows. I am trying to do it with SQL or Python, but I don't know where to start.
A straightforward approach is to pick employees one by one and search the table after the one for an appropriate peer; found peers are flagged in order to not be paired repeatedly. Since in your case a peer should be found after a few steps, this iteration will likely be faster than operations which construct whole data sets at once.
from io import StringIO
import pandas as pd
# read example employee table
df = pd.read_table(StringIO("""Name Hometown School
Jeff Illinois Loyola University Chicago
Alice California New York University
William Michigan University of Illinois at Chicago
Fiona California Loyola University Chicago
Charles Michigan New York University
Linda Indiana Loyola University Chicago
"""))
# create expected table; its length is half that of the above
ef = pd.DataFrame(index=pd.RangeIndex(len(df)/2), columns=['employee1', 'employee2'])
k = 0 # number of found pairs, index into expected table
# array of flags for already paired employees
paired = pd.Series(False, pd.RangeIndex(len(df)))
# go through the employee table and collect pairs
for i in range(len(df)):
if paired[i]: continue
for j in range(i+1, len(df)):
if not paired[j] \
and df.iloc[j]['Hometown'] != df.iloc[i]['Hometown'] \
and df.iloc[j]['School'] != df.iloc[i]['School']:
# we found a pair - store it, mark employee j paired
ef.iloc[k] = df.iloc[[i, j]]['Name']
k += 1
paired[j] = True
break
else:
print("no peer for", df.iloc[i]['Name'])
print(ef)
output:
employee1 employee2
0 Jeff Alice
1 William Fiona
2 Charles Linda

How can I make a Geo Chart display one specific country and its regions in Google Data Studio?

A Geo Chart usually shows entire world.
How to show one country's region and color them according to my data?
Also how can I group my data in a table so Data Studio can actually represent regions of my country?
e.g. I have 3 countries and number of accounts in each country, in what column can I put regional data for my country?
country
account_number
region
russia
324
??
kazakhstan
5785
??
america
2342
??
I have added a report, Data Studio recognizes the country by country code, but from there it's not clear how to highlight regions by numbers:
Google Data Studio Report
One way it can be achieved is by using:
Chart Type: Google Maps
Bubble Location: region
Bubble Colour: country
Metric: metric
Created an Editable Google Sheet with the sample data below with some random values for the metric field as well as adding a few values for the region field:
country
account_number
region
metric
Russia
324
Moscow
54
Russia
325
Saint Petersburg
36
Russia
326
Krasnodar Krai
14
Kazakhstan
5785
Almaty
31
Kazakhstan
5786
Astana
57
Kazakhstan
5787
Kyzylorda
58
United States
2342
New York
28
United States
2343
California
99
United States
2344
Texas
30
Editable Google Data Studio Report as well as a GIF to elaborate:

International equivalents of the SEC's EDGAR (SEDAR in Canada) database?

Are there equivalents of the SEC's EDGAR (filing database) for European companies? Or any other region for that matter? For the UK I've found the "Companies House".
http://www.sedar.com/homepage_en.htm
https://www.sec.gov/edgar/searchedgar/accessing-edgar-data.htm
http://download.companieshouse.gov.uk/en_monthlyaccountsdata.html
I'm searching for (XBRL) filings outside the US, preferably for European entities.
United Kingdom: https://beta.companieshouse.gov.uk/search/companies
Ireland: www.cro.ie
France: www.infogreffe.fr
Germany: https://www.unternehmensregister.de/ureg
Italy: www.registroimprese.it
Switzerland: https://www.zefix.ch/
European Business Register (EBR): http://www.ebr.org/
GLO Filings: www.glofilings.com
So far there is no one single aggregator for EU business data.
But you can get data on the country basis.
In the UK that's Companies House - https://www.gov.uk/government/organisations/companies-house
In France, it's the Registre du commerce et des sociétés https://www.infogreffe.fr/societes/
In Germany, it's the Unternehmensregister https://www.unternehmensregister.de/ureg/?language=de&submitaction=language
For other countries there is a list on the Companies House website: https://www.gov.uk/government/pu...

salesforce rule to display selected values in picklist on selection of another picklist

I am new in salesforce and learning it.
There is a task which i want to perform, Description is as follows:
I've created a custom object Property and few fields for this object.
There are two picklist type of fields for this object Country and City.
Country field contains following values: United States, United Kingdom, India, China, Japan and etc.
City field contains following values: New York, Los Angeles, Glasgow, London, Tokyo, Beijing, New Delhi, Dehradun etc.
What i want to do is when user selects a specific value in Country field only related City should display for selection in City field.
For example: If user selects United States in Country field then only New York and Los Angeles should be displayed for selection in City field or If user selects United Kingdom in Country field then only Glasgow, Manchester and London should be displayed for selection in City field and then user will select one value from available City value.
Thanks in advance, Any help is appreciated.
Field dependices will do this for you

How to deal with State, County, City relations? (for US 50 states)

From the 50 states of US, most of them have counties except Louisiana and Alaska.
My tables would look like this
**State_tbl**
State_id
State_name
**County_tbl**
County_id
State_id ->state_tbl
County_name
**City_tbl**
City_id
County_id ->county_tbl
City_name
However, since the two states Alaska and Louisiana don't have counties, I would have problems implementing them. And I also read that there may be cities within a state that don't have a county, or that belong to two counties (don't know if that is true).
What would be the best approach to design the database?
UPDATE More info:
I have an user which would register to serve into specific cities (within a state). When I retrieve data I want to be able to display both the cities that are served, as well as the counties. There would be a Many-to-Many relationship between the user and the cities served, and a one-many relationship between cities and counties.
i.e:
John K - serving in state_A (all counties and cities below belong to state_A)
-cities served: City_A (county_x), City_B (County_Y), City_C (County_Y)
-counties served: County_X, County_Y
Also, would I be able to retrieve a user's info and all the cities and counties served within one query?
Just treat the boroughs and parishes and counties (or any other naming conventions) as the same thing. The USPS treats them the same and the Census Bureau also treats them the same. Most of the government (and nongovernment organizations) in the US that need to generate any kind of report on counties or statistical areas rely on the MSA or CBSA codes which are based on these units, all of which are referred to as counties - even though they may have other local names.
For Alaska, here are all the boroughs:
ANCHORAGE
BETHEL
ALEUTIANS WEST
LAKE AND PENINSULA
KODIAK ISLAND
ALEUTIANS EAST
WADE HAMPTON
DILLINGHAM
KENAI PENINSULA
YUKON KOYUKUK
VALDEZ CORDOVA
BRISTOL BAY
MATANUSKA SUSITNA
NOME
YAKUTAT
FAIRBANKS NORTH STAR
DENALI
NORTH SLOPE
NORTHWEST ARCTIC
SOUTHEAST FAIRBANKS
JUNEAU
HOONAH ANGOON
HAINES
PETERSBURG
SITKA
SKAGWAY
KETCHIKAN GATEWAY
PRINCE OF WALES HYDER
WRANGELL
For Lousiana, here are all the parishes:
JEFFERSON
SAINT CHARLES
SAINT BERNARD
PLAQUEMINES
ST JOHN THE BAPTIST
SAINT JAMES
ORLEANS
LAFOURCHE
ASSUMPTION
SAINT MARY
TERREBONNE
ASCENSION
TANGIPAHOA
SAINT TAMMANY
WASHINGTON
SAINT HELENA
LIVINGSTON
LAFAYETTE
VERMILION
SAINT LANDRY
IBERIA
EVANGELINE
ACADIA
SAINT MARTIN
JEFFERSON DAVIS
CALCASIEU
CAMERON
BEAUREGARD
ALLEN
VERNON
EAST BATON ROUGE
WEST BATON ROUGE
WEST FELICIANA
POINTE COUPEE
IBERVILLE
EAST FELICIANA
BIENVILLE
NATCHITOCHES
CLAIBORNE
CADDO
BOSSIER
WEBSTER
RED RIVER
DE SOTO
SABINE
OUACHITA
RICHLAND
FRANKLIN
MOREHOUSE
UNION
JACKSON
LINCOLN
MADISON
WEST CARROLL
EAST CARROLL
RAPIDES
CONCORDIA
AVOYELLES
CATAHOULA
LA SALLE
TENSAS
WINN
GRANT
CALDWELL

Resources