def test_unjson_dataframe(self): '''Test unjson dataframe with `nan` values''' csv_utils.unjson_dataframe(json_data) assert_frame_equal(json_data, unjson_data, check_like=True)
figsize = width / float(dpi), height / float(dpi) # Create a figure of the right size with one axes that takes up the full figure fig = plt.figure(figsize=figsize) ax = fig.add_axes([0, 0, 1, 1]) # Hide spines, ticks, etc. ax.axis('off') # Display the image. ax.imshow(im_data) return fig, ax subjects = pandas.read_csv(subjects_with_marks_path) reductions_all = pandas.read_csv(reducer_export_path) reductions = reductions_all[reductions_all.reducer_key == 'points'] reductions = reductions.dropna(axis=1, how='all') unjson_dataframe(reductions) reductions_counts = reductions_all[reductions_all.reducer_key == 'counts'] reductions_counts = reductions_counts.dropna(axis=1, how='all') bbox_props = { 'boxstyle': 'round', 'fc': 'w', 'ec': '0.5', 'alpha': 1 } text_props = { 'bbox': bbox_props, 'ha': 'left', 'va': 'top', 'size': 18 }
from panoptes_aggregation.csv_utils import unjson_dataframe from astropy.wcs import WCS import numpy as np from gz3d_fits import cov_to_ellipse from plot_fits_files import set_up_axes from make_subject_fits import define_wcs import matplotlib.pyplot as plt import mpl_style import progressbar as pb plt.style.use(mpl_style.style1) path = '/Volumes/Work/GZ3D' data = pandas.read_csv(path + '/point_reducer_galaxy_and_star_mpl6.csv') unjson_dataframe(data) widgets = [ 'Plot: ', pb.Percentage(), ' ', pb.Bar(marker='0', left='[', right=']'), ' ', pb.ETA() ] pbar = pb.ProgressBar(widgets=widgets, max_value=len(data)) subjects = pandas.read_csv(path + '/galaxy-zoo-3d-subjects-mpl5-mpl6.csv') subjects.columns = [ 'subject_id', 'project_id', 'workflow_id', 'subject_set_id', 'data.metadata', 'data.locations', 'classifications_count', 'retired_at', 'retirement_reason' ]