Skip to content
Snippets Groups Projects
Commit 8c396102 authored by Loicia Robart's avatar Loicia Robart
Browse files

hop

parent db77be96
No related branches found
No related tags found
No related merge requests found
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js ie6 oldie" lang="en-US"> <![endif]-->
<!--[if IE 7]> <html class="no-js ie7 oldie" lang="en-US"> <![endif]-->
<!--[if IE 8]> <html class="no-js ie8 oldie" lang="en-US"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en-US"> <!--<![endif]-->
<head>
<title>Attention Required! | Cloudflare</title>
<meta charset="UTF-8" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
<meta name="robots" content="noindex, nofollow" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<link rel="stylesheet" id="cf_styles-css" href="/cdn-cgi/styles/cf.errors.css" />
<!--[if lt IE 9]><link rel="stylesheet" id='cf_styles-ie-css' href="/cdn-cgi/styles/cf.errors.ie.css" /><![endif]-->
<style>body{margin:0;padding:0}</style>
<!--[if gte IE 10]><!-->
<script>
if (!navigator.cookieEnabled) {
window.addEventListener('DOMContentLoaded', function () {
var cookieEl = document.getElementById('cookie-alert');
cookieEl.style.display = 'block';
})
}
</script>
<!--<![endif]-->
</head>
<body>
<div id="cf-wrapper">
<div class="cf-alert cf-alert-error cf-cookie-error" id="cookie-alert" data-translate="enable_cookies">Please enable cookies.</div>
<div id="cf-error-details" class="cf-error-details-wrapper">
<div class="cf-wrapper cf-header cf-error-overview">
<h1 data-translate="block_headline">Sorry, you have been blocked</h1>
<h2 class="cf-subheadline"><span data-translate="unable_to_access">You are unable to access</span> www2.census.gov</h2>
</div><!-- /.header -->
<div class="cf-section cf-highlight">
<div class="cf-wrapper">
<div class="cf-screenshot-container cf-screenshot-full">
<span class="cf-no-screenshot error"></span>
</div>
</div>
</div><!-- /.captcha-container -->
<div class="cf-section cf-wrapper">
<div class="cf-columns two">
<div class="cf-column">
<h2 data-translate="blocked_why_headline">Why have I been blocked?</h2>
<p data-translate="blocked_why_detail">This website is using a security service to protect itself from online attacks. The action you just performed triggered the security solution. There are several actions that could trigger this block including submitting a certain word or phrase, a SQL command or malformed data.</p>
</div>
<div class="cf-column">
<h2 data-translate="blocked_resolve_headline">What can I do to resolve this?</h2>
<p data-translate="blocked_resolve_detail">You can email the site owner to let them know you were blocked. Please include what you were doing when this page came up and the Cloudflare Ray ID found at the bottom of this page.</p>
</div>
</div>
</div><!-- /.section -->
<div class="cf-error-footer cf-wrapper w-240 lg:w-full py-10 sm:py-4 sm:px-8 mx-auto text-center sm:text-left border-solid border-0 border-t border-gray-300">
<p class="text-13">
<span class="cf-footer-item sm:block sm:mb-1">Cloudflare Ray ID: <strong class="font-semibold">92b82d6ccaf9207b</strong></span>
<span class="cf-footer-separator sm:hidden">&bull;</span>
<span id="cf-footer-item-ip" class="cf-footer-item hidden sm:block sm:mb-1">
Your IP:
<button type="button" id="cf-footer-ip-reveal" class="cf-footer-ip-reveal-btn">Click to reveal</button>
<span class="hidden" id="cf-footer-ip">2a04:cec0:10f8:3e40:aa8b:e06b:1a05:f021</span>
<span class="cf-footer-separator sm:hidden">&bull;</span>
</span>
<span class="cf-footer-item sm:block sm:mb-1"><span>Performance &amp; security by</span> <a rel="noopener noreferrer" href="https://www.cloudflare.com/5xx-error-landing" id="brand_link" target="_blank">Cloudflare</a></span>
</p>
<script>(function(){function d(){var b=a.getElementById("cf-footer-item-ip"),c=a.getElementById("cf-footer-ip-reveal");b&&"classList"in b&&(b.classList.remove("hidden"),c.addEventListener("click",function(){c.classList.add("hidden");a.getElementById("cf-footer-ip").classList.remove("hidden")}))}var a=document;document.addEventListener&&a.addEventListener("DOMContentLoaded",d)})();</script>
</div><!-- /.error-footer -->
</div><!-- /#cf-error-details -->
</div><!-- /#cf-wrapper -->
<script>
window._cf_translation = {};
</script>
</body>
</html>
%% Cell type:markdown id:31b7b99b-60d6-4ae9-b340-f09ef9bf2ef0 tags:
# Dataset FolkTables
- ROBART Loïcia
- HENNIAUX Gaspar
%% Cell type:markdown id:d70abd61-f4bd-41b3-97cf-e06311de84fa tags:
## Préparation des données
%% Cell type:code id:12d09989-4639-4185-bda3-b13da9b1b31f tags:
``` python
## pip install folktables
```
%% Cell type:code id:25f15ce7-0ea0-4828-965e-862733daec4b tags:
``` python
from folktables import ACSDataSource, ACSIncome
import pandas as pd
# liste des états sélectionnées pour notre expérimentation
states = ['CA', # Californie - Ouest
'TX', # Texas - Sud
'IL', # Chicago
'NY', # New York - Nord-Est
'FL', # Floride - Sud-Est
'GA', # Géorgie - Sud
'MI'] # Michigan - Midwest
# On charge les données
source = ACSDataSource(survey_year='2018', horizon='1-Year', survey='person')
all_states_data = []
for state in states:
by_state_data = source.get_data(states=[state], download=True)
features, labels, _ = ACSIncome.df_to_pandas(by_state_data)
# Ajouter une colonne "state"
features['state'] = state
all_states_data.append(features)
# Fusionner tous les États dans un seul DataFrame
df = pd.concat(all_states_data, ignore_index=True)
df
```
%% Output
Downloading data for 2018 1-Year person survey for CA...
data/2018/1-Year/csv_pca.zip may be corrupted. Please try deleting it and rerunning this command.
Exception: File is not a zip file
---------------------------------------------------------------------------
FileNotFoundError Traceback (most recent call last)
Cell In[6], line 18
14 all_states_data = []
16 for state in states:
---> 18 by_state_data = source.get_data(states=[state], download=True)
19 features, labels, _ = ACSIncome.df_to_pandas(by_state_data)
21 # Ajouter une colonne "state"
File ~/.local/lib/python3.10/site-packages/folktables/acs.py:32, in ACSDataSource.get_data(self, states, density, random_seed, join_household, download)
30 def get_data(self, states=None, density=1.0, random_seed=0, join_household=False, download=False):
31 """Get data from given list of states, density, and random seed. Optionally add household features."""
---> 32 data = load_acs(root_dir=self._root_dir,
33 year=self._survey_year,
34 states=states,
35 horizon=self._horizon,
36 survey=self._survey,
37 density=density,
38 random_seed=random_seed,
39 download=download)
40 if join_household:
41 orig_len = len(data)
File ~/.local/lib/python3.10/site-packages/folktables/load_acs.py:120, in load_acs(root_dir, states, year, horizon, survey, density, random_seed, serial_filter_list, download)
116 first = True
118 for file_name in file_names:
--> 120 with open(file_name, 'r') as f:
122 if first:
123 sample.write(next(f))
FileNotFoundError: [Errno 2] No such file or directory: 'data/2018/1-Year/psam_p06.csv'
%% Cell type:code id:28433677-9584-4b52-87f3-313cab8d8bcd tags:
``` python
```
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment