.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "_examples/pandas/plot_format03.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note Click :ref:`here ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr__examples_pandas_plot_format03.py: 03. Empty ================== Example .. GENERATED FROM PYTHON SOURCE LINES 7-37 .. rst-class:: sphx-glr-script-out Out: .. code-block:: none '\n# Load data\ndf = pd.read_csv(\'./datasets/format03_data_300.csv\')\n\n# Show\nprint(df)\nprint(df.columns)\nprint(df.dtypes)\nprint(df[\'0\'].isna().sum())\n\n# Convert string to numpy\nprint(df[\'0\'])\n#df[\'0\'] = df[\'0\'].map(np.fromstring)\n\n#print(df[\'0\'])\n\naux = df.loc[0, \'0\']\nprint("aaa")\nprint(aux)\nprint(type(aux))\n\na = np.frombuffer(aux, dtype=np.complex_)\nprint(a)\na = np.fromstring(aux, dtype=np.complex_)\nprint(a)\n' | .. code-block:: default :lineno-start: 7 # Libraries import numpy as np import pandas as pd """ # Load data df = pd.read_csv('./datasets/format03_data_300.csv') # Show print(df) print(df.columns) print(df.dtypes) print(df['0'].isna().sum()) # Convert string to numpy print(df['0']) #df['0'] = df['0'].map(np.fromstring) #print(df['0']) aux = df.loc[0, '0'] print("aaa") print(aux) print(type(aux)) a = np.frombuffer(aux, dtype=np.complex_) print(a) a = np.fromstring(aux, dtype=np.complex_) print(a) """ .. rst-class:: sphx-glr-timing **Total running time of the script:** ( 0 minutes 0.001 seconds) .. _sphx_glr_download__examples_pandas_plot_format03.py: .. only :: html .. container:: sphx-glr-footer :class: sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_format03.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_format03.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_