質問編集履歴

2

ホームディレクトリ名を「ユーザ名」に変更

2022/05/03 05:27

投稿

flexibler
flexibler

スコア36

test CHANGED
File without changes
test CHANGED
@@ -27,7 +27,7 @@
27
27
  ターミナルで「pip install pandas」を入力した結果、以下のように表示されました。
28
28
  私自身Anaconda-Navigator内にライブラリ「Pandas」が既に入っていたためインストール済みになってると考えていますが、どう解決したら良いでしょうか?
29
29
  ```ここに言語を入力
30
- (base) nukuikazuki@nukuikazukinoMacBook-Air ~ % pip install pandas
30
+ (base)ユーザ名@ユーザ名noMacBook-Air ~ % pip install pandas
31
31
  Requirement already satisfied: pandas in ./opt/anaconda3/lib/python3.9/site-packages (1.3.4)
32
32
  Requirement already satisfied: python-dateutil>=2.7.3 in ./opt/anaconda3/lib/python3.9/site-packages (from pandas) (2.8.2)
33
33
  Requirement already satisfied: pytz>=2017.3 in ./opt/anaconda3/lib/python3.9/site-packages (from pandas) (2021.3)

1

コードを画像表示からテキスト表示に変更

2022/05/03 03:57

投稿

flexibler
flexibler

スコア36

test CHANGED
File without changes
test CHANGED
@@ -1,6 +1,22 @@
1
1
  初歩的な質問ですみません。
2
- Jupyter Labでライブラリ「Pandas」を使用してファイル名「c01.csv」を読み込ませたいのですが、以下の通り「NameError: name ‘pd’ is not defined」と表示され
2
+ Jupyter Labでライブラリ「Pandas」を使用してファイル名「c01.csv」を読み込ませめに以下のコードを書きした
3
+
4
+ ```ここに言語を入力
5
+ import pandas as pd
6
+ pd.set_option('display.max_rows', 10)
7
+
3
- ![イメージ説明](https://ddjkaamml8q8x.cloudfront.net/questions/2022-05-03/fc6baa83-7b89-4536-8bd7-a250705b1395.png)
8
+ df_csv = pd.read_csv('c01.csv', encoding = 'shift-jis')
9
+ df_csv
10
+ ```
11
+ しかしこのようなエラー分が表示されました
12
+ ```ここに言語を入力
13
+ ---------------------------------------------------------------------------
14
+ NameError Traceback (most recent call last)
15
+ <ipython-input-2-e5274b09e40a> in <module>
16
+ ----> 1 pd.set_option('display.max_rows', 10)
17
+
18
+ NameError: name 'pd' is not defined
19
+ ```
4
20
 
5
21
 
6
22
  環境構築はこちらのYouTube動画(https://youtu.be/6b6uM7Fl8ck)